@tocca-systems/twp-cli 0.136.0 → 0.138.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.public.md +10 -0
- package/README.md +10 -7
- package/dist/{api-command-7OCXXISL.js → api-command-YT33DV4C.js} +1 -1
- package/dist/{app-VJSPABPJ.js → app-OAWMTXZ3.js} +1 -1
- package/dist/{brief-ISRPL272.js → brief-CG74AOQD.js} +1 -1
- package/dist/{chunk-DILKXZRD.js → chunk-DWZC3652.js} +1 -1
- package/dist/{chunk-UHNQHCPW.js → chunk-EAIDN2BE.js} +1 -1
- package/dist/{chunk-MNPGGAKL.js → chunk-EHHY34NR.js} +20 -18
- package/dist/{chunk-MY5QCWCS.js → chunk-K54OB2BX.js} +8 -8
- package/dist/{chunk-7CVIIHMY.js → chunk-LGRZABOT.js} +1 -1
- package/dist/chunk-LJWU23D2.js +66 -0
- package/dist/{chunk-R76JZIZ5.js → chunk-ROAZEXMJ.js} +1 -1
- package/dist/{chunk-G6QQFB2J.js → chunk-VLTRRD4T.js} +1 -1
- package/dist/cli.js +11 -10
- package/dist/{commands-N2MWYHCZ.js → commands-VAXOJGSE.js} +1 -1
- package/dist/{github-git-F6EOFNQ7.js → github-git-ATC7VIW6.js} +1 -1
- package/dist/{holiday-D2ZM5PCX.js → holiday-RF4VPQX3.js} +1 -1
- package/dist/{license-NEEKNJBY.js → license-WD2VND3X.js} +1 -1
- package/dist/{login-history-NVMX2UAZ.js → login-history-3ZLCYSBI.js} +1 -1
- package/dist/{media-NRLQ7C4C.js → media-2COUCISC.js} +1 -1
- package/dist/{outlook-OE7CUTAJ.js → outlook-IKZR2BEU.js} +1 -1
- package/dist/{registry-JEOUYMGG.js → registry-MDZXZUVK.js} +1 -1
- package/dist/{run-LEJKFFSA.js → run-5VFEV3BR.js} +1 -1
- package/dist/{skill-PQBRALUW.js → skill-MOMCYET5.js} +1 -1
- package/dist/{sns-2YRL6A6J.js → sns-ING5W2OI.js} +58 -52
- package/dist/{teams-WMKWQCLH.js → teams-5FS7HVDE.js} +1 -1
- package/dist/{user-77JTTQWR.js → user-DVI5ELJJ.js} +60 -48
- package/package.json +1 -1
- package/dist/chunk-43RLWH2F.js +0 -64
|
@@ -304,7 +304,7 @@ flags}}function numberFlag(p,name){const v=p.flags.get(name);if(v===void 0)retur
|
|
|
304
304
|
\u3066\u304F\u3060\u3055\u3044"}return n}async function buildPublicOptions(p,env){const str=n=>{const v=p.flags.get(n);return typeof v==="string"?v:void 0};const publicUrl=str("--public-url");if(publicUrl===void 0)return"\u516C\u958B\u30E2\u30FC\u30C9\u306B\u306F --public-url\uFF08\u5916\u304B\u3089\u958B\u304F https:// \u306E URL\uFF09\u304C\u5FC5\u8981\u3067\u3059";const certPath=str("--tls-cert");const keyPath=str("--tls-key");if(certPath===void 0!==(keyPath===void 0))return"--tls-cert \u3068 --tl\
|
|
305
305
|
s-key \u306F\u4E21\u65B9\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044";let tls;if(certPath!==void 0&&keyPath!==void 0){try{tls={cert:fs5.readFileSync(certPath,"utf8"),key:fs5.readFileSync(keyPath,"utf8")}}catch(e){return`\u8A3C\u660E\u66F8\u30FB\u9375\u3092\u8AAD\u3081\u307E\u305B\u3093\uFF08${e.message}\uFF09`}}const reauthRaw=str("--reauth-minutes");const reauth=reauthRaw===void 0?null:Number(reauthRaw);if(reauth!==null&&(!/^\d+$/.test(reauthRaw??"")||reauth<1||reauth>720))return"--reauth-m\
|
|
306
306
|
inutes \u306F 1\u301C720 \u306E\u6574\u6570\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044";const allow=str("--allow-ip");const profile=str("--profile");const bind=str("--bind");const allowIps=allow!==void 0?allow.split(",").map(x=>x.trim()).filter(x=>x!==""):void 0;if(allowIps!==void 0&&allowIps.length===0)return"--allow-ip \u306B IP \u30A2\u30C9\u30EC\u30B9\u304C1\u3064\u3082\u3042\u308A\u307E\u305B\u3093";const opts={publicUrl,...tls?{tls}:{},behindTlsProxy:p.flags.get("--behind-tls-pr\
|
|
307
|
-
oxy")===true,trustedProxy:p.flags.get("--trusted-proxy")===true,...allowIps!==void 0?{allowIps}:{},...bind!==void 0?{bindHost:bind}:{},...profile!==void 0?{profile}:{},...reauth!==null?{reauthWindowMs:reauth*6e4}:{},env,cliVersion:true?"0.
|
|
307
|
+
oxy")===true,trustedProxy:p.flags.get("--trusted-proxy")===true,...allowIps!==void 0?{allowIps}:{},...bind!==void 0?{bindHost:bind}:{},...profile!==void 0?{profile}:{},...reauth!==null?{reauthWindowMs:reauth*6e4}:{},env,cliVersion:true?"0.138.0":"0.0.0-dev"};const{validatePublicOptions}=await import("./console-public-K5CP7KZJ.js");return validatePublicOptions(opts)??opts}function waitForSignal(){return new Promise(resolve=>{const done=()=>{process.removeListener("SIGINT",done);process.removeListener(
|
|
308
308
|
"SIGTERM",done);resolve()};process.once("SIGINT",done);process.once("SIGTERM",done)})}function lockDirOf(dir){return path5.join(dir,"lock")}function runningPid2(dir,isLoop){let pid;try{pid=Number.parseInt(fs5.readFileSync(path5.join(lockDirOf(dir),"pid"),"utf8").trim(),10)}catch{return null}if(!Number.isInteger(pid)||pid<=0)return null;return isLoop(pid)?pid:null}function protectedDeny(twpHome,cwd,home=os.homedir(),claudeConfigDir){const readWrite=[absPathRule(twpHome),absPathRule(path5.join(home,
|
|
309
309
|
".ssh")),absPathRule(path5.join(home,".claude")),absPathRule(path5.join(home,".claude.json"),""),...claudeConfigDir!==void 0&&claudeConfigDir.trim()!==""?[absPathRule(claudeConfigDir)]:[]];const writeOnly=[...cwd!==void 0?[absPathRule(path5.join(cwd,".claude")),absPathRule(path5.join(cwd,".git")),absPathRule(path5.join(cwd,".git"),""),absPathRule(path5.join(cwd,".mcp.json"),"")]:[],...SHELL_RC_FILES.map(f=>absPathRule(path5.join(home,f),""))];return[...readWrite.flatMap(p=>[`Read(${p})`,`Edit(${p}\
|
|
310
310
|
)`]),...writeOnly.map(p=>`Edit(${p})`)]}var SHELL_RC_FILES=[".bashrc",".bash_profile",".bash_login",".bash_logout",".profile",".zshrc",".zprofile",".zshenv",".zlogin",".zlogout"];function unscopedWriteRules(allow){return allow.filter(r=>r==="Edit"||r==="Write"||r==="MultiEdit"||r==="Edit(*)"||r==="Edit(**)")}var STRIPPED_ENV_KEYS=["TWP_TOKEN","TWP_API_KEY","TWP_API_KEY_VALUE","TWP_LOOP_PLAN_TOKEN"];function aiEnv(env){const out={...env};for(const k of STRIPPED_ENV_KEYS)delete out[k];return out}async function defaultEngine(config,log,env){
|
|
@@ -37,4 +37,4 @@ REMOTE_USAGE)}const account=args.account!==void 0?await resolver.githubAccount(a
|
|
|
37
37
|
`);if(deps.hint??process.stderr.isTTY===true){const origin=new URL(ctx.apiUrl).origin;err(`\u8A8D\u8A3C\u306F credential helper \u3067\u6E21\u3057\u307E\u3059\uFF08\u672A\u8A2D\u5B9A\u306A\u30891\u56DE\u3060\u3051\u30021\u884C\u76EE\u306F\u65E2\u5B58\u306E\u6C4E\u7528 helper \u3092\u5916\u3059\uFF09:
|
|
38
38
|
git config --global credential.${origin}.helper ''
|
|
39
39
|
git config --global --add credential.${origin}.helper '!twp github git-credential${args.profile!==void 0?` --profile ${args.profile}`:""}'
|
|
40
|
-
`)}return EXIT_OK}async function runGithubGit(sub,argv,deps={}){try{return sub==="git-remote"?await runRemote(argv,deps):await runCredential(argv,deps)}catch(e){const{exitCodeFor,reportError}=await import("./run-
|
|
40
|
+
`)}return EXIT_OK}async function runGithubGit(sub,argv,deps={}){try{return sub==="git-remote"?await runRemote(argv,deps):await runCredential(argv,deps)}catch(e){const{exitCodeFor,reportError}=await import("./run-5VFEV3BR.js");const code=exitCodeFor(e);reportError(e,null,code,deps.err??writeStderr);return code}}export{GIT_TOKEN_MARGIN_MS,GIT_USERNAME,isRelayTarget,parseCredentialInput,runGithubGit};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{parseCsvRecords}from"./chunk-
|
|
3
|
+
import{parseCsvRecords}from"./chunk-EHHY34NR.js";import{importRejection}from"./chunk-ERLQA262.js";import{decodeCsvText}from"./chunk-OMW6BBAY.js";import"./chunk-KMZCAOSR.js";import"./chunk-YFRU7RQJ.js";import"./chunk-O756DX6D.js";import"./chunk-PXSZZRPJ.js";import"./chunk-YLF4S4MC.js";import"./chunk-CHT6EP5C.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";
|
|
4
4
|
import"./chunk-UZVBQV4W.js";import{ApiError,MultipartBody}from"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{nonEmpty}from"./chunk-DYT22FTA.js";import{requireResolved,singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";
|
|
5
5
|
import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import fs from"fs";import path from"path";var NAME="holiday";var LABEL="\u795D\u65E5";var READ_PATH="/api/v2/holidays";var ADMIN_PATH="/api/v2/admin/tenant/holidays";var DATE_RE=/^\d{4}-\d{2}-\d{2}$/;var YEAR_RE=/^\d{4}$/;var NAME_MAX=100;var IMPORT_MAX_BYTES=1024*1024;var SHOWN_DIFF=30;var COLUMNS=["date","name"];var IMPACT="\u795D\u65E5\u306F\u52E4\u6020\u306E\u96C6\u8A08\uFF08\u4F11\u65E5\u52B4\u50CD\u30FB\u6240\u5B9A\u65E5\u6570\uFF09\u3068\u55B6\u696D\u65E5\u6570\u306E\u8A08\u7B97\u306B\u52B9\u304D\u307E\u3059\u3002\u7DE0\u3081\u6E08\u307F\u306E\u6708\u306E\u795D\u65E5\u3092\u5909\u3048\u3066\u3082\u3001\u7DE0\u3081\u305F\u96C6\u8A08\u306F\u81EA\u52D5\u3067\u306F\u76F4\u308A\u307E\u305B\u3093\u3002";
|
|
6
6
|
var FORBIDDEN=`\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002${LABEL}\u306E\u4F5C\u6210\u30FB\u66F4\u65B0\u30FB\u524A\u9664\u30FBCSV \u306E\u51FA\u3057\u5165\u308C\u306F\u7BA1\u7406\u8005\u3060\u3051\u304C\u884C\u3048\u307E\u3059`;var DATE_FLAG={name:"--date",summary:"\u5BFE\u8C61\u306E\u65E5\u4ED8\uFF08\u4F4D\u7F6E\u5F15\u6570\u306E\u4EE3\u308F\u308A\u306B\u4F7F\u3048\u308B\uFF09",takesValue:true,placeholder:"<YYYY-MM-DD>"};var NAME_FLAG={name:"--name",summary:`\u795D\u65E5\u540D\uFF08${NAME_MAX}\
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{LICENSE_FEATURE_NAMES,judge,licenseDomain,readLicenses,releaseCommand,resolveFeature}from"./chunk-
|
|
3
|
+
import{LICENSE_FEATURE_NAMES,judge,licenseDomain,readLicenses,releaseCommand,resolveFeature}from"./chunk-EAIDN2BE.js";import"./chunk-EHHY34NR.js";import"./chunk-OMW6BBAY.js";import"./chunk-UZVBQV4W.js";import"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-DYT22FTA.js";import"./chunk-7DCWZ2NF.js";import"./chunk-HCTPCUST.js";import"./chunk-STILP3Z6.js";
|
|
4
4
|
import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";export{LICENSE_FEATURE_NAMES,judge,licenseDomain,readLicenses,releaseCommand,resolveFeature};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{LOGIN_HISTORY_RETENTION_DAYS}from"./chunk-
|
|
3
|
+
import{LOGIN_HISTORY_RETENTION_DAYS}from"./chunk-EHHY34NR.js";import"./chunk-OMW6BBAY.js";import"./chunk-UZVBQV4W.js";import"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger}from"./chunk-DYT22FTA.js";import{requireResolved,withResolved}from"./chunk-7DCWZ2NF.js";import{isRecord,pick}from"./chunk-HCTPCUST.js";
|
|
4
4
|
import{ApiResponseError,UsageError}from"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";var LABEL="\u30ED\u30B0\u30A4\u30F3\u5C65\u6B74";var PATH="/api/v2/admin/tenant/login-history";var FORBIDDEN=`\u7D44\u7E54\u7BA1\u7406\u8005\u306E\u6A29\u9650\u304C\u5FC5\u8981\u3067\u3059\u3002${LABEL}\u306F\u7D44\u7E54\u7BA1\u7406\u8005\u3060\u3051\u304C\u898B\u3089\u308C\u307E\u3059`;var RESULTS=["success","failure","locked","ip_blocked"];var MAX_LIMIT=500;var DEFAULT_LIMIT=100;var STATS_SCAN_LIMIT=1e3;var MAX_STATS_DAYS=90;var LIST_COLUMNS=["timestamp","result","email","ip_address","failure_\
|
|
5
5
|
reason"];var RECORDING_HELP=`\u8A18\u9332\u306B\u3064\u3044\u3066:
|
|
6
6
|
- \u5C65\u6B74\u306F${LOGIN_HISTORY_RETENTION_DAYS}\u65E5\u3067\u6D88\u3048\u307E\u3059\u3002\u305D\u308C\u3088\u308A\u524D\u306F\u51FA\u307E\u305B\u3093\uFF08\u300C\u30ED\u30B0\u30A4\u30F3\u3057\u3066\u3044\u306A\u3044\u300D\u3068\u306F\u9650\u308A\u307E\u305B\u3093\uFF09\u3002
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{checkOutTarget}from"./chunk-
|
|
3
|
+
import{checkOutTarget}from"./chunk-VLTRRD4T.js";import"./chunk-K54OB2BX.js";import"./chunk-LXFLA3PZ.js";import"./chunk-P4QSPSOQ.js";import{contentTypeFor,inspectLocalFile}from"./chunk-D3RGSH6B.js";import{checkUploadQuota}from"./chunk-GNSZOYBQ.js";import"./chunk-Q3B65OFC.js";import{parseWaitOptions,waitUntilTerminal}from"./chunk-3EFJQDC4.js";import"./chunk-RMFLTSOV.js";import{readBody}from"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";
|
|
4
4
|
import"./chunk-BD7O73GK.js";import{repeatedValues}from"./chunk-6NHLWYI2.js";import"./chunk-UZVBQV4W.js";import{ApiError}from"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import{collapsesInUrlPath,isSafePathSegment}from"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import{LIST_FLAGS,LIST_PAGING_HELP,envelopePaging,nonEmpty,positiveInteger,readEnvelopeCursor,shellQuote}from"./chunk-DYT22FTA.js";import{requireResolved,
|
|
5
5
|
singleRef,withResolved}from"./chunk-7DCWZ2NF.js";import{acknowledgement,isRecord,pick}from"./chunk-HCTPCUST.js";import{ApiRejectedError,ApiResponseError,NetworkError,UsageError,WaitTimeoutError}from"./chunk-STILP3Z6.js";import"./chunk-TZL2342W.js";import"./chunk-ITFO5GPX.js";import"./chunk-GWVREACM.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-ZN7AEXEI.js";import"./chunk-OKATZ4SN.js";
|
|
6
6
|
import"./chunk-RKBUJKI5.js";import"./chunk-UREA4ZIG.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";import crypto2 from"crypto";import fs2 from"fs";import path from"path";var SCOPE_PERSONAL="personal";var SCOPE_PROJECT="project";var UUID=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;var FORBIDDEN_NAME=/[/\\:*?"<>|]/;var NAME_MAX=255;var ROW_COLUMNS=["id","path","name","file_count","subfolder_count","parent_id","updated_at"];var TRASH_COLUMNS=["id","path","name","file_count","subfolder_count","parent_id","deleted_at"];function folderRows(raw){return raw.map(row=>{const id=row["id"];const name=row["name"];const parentId=row["parent_id"];if(typeof id!==
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{outlookDomain}from"./chunk-
|
|
3
|
+
import{outlookDomain}from"./chunk-LGRZABOT.js";import"./chunk-LJWU23D2.js";import"./chunk-K2TO4DFJ.js";import"./chunk-Q3B65OFC.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-YJP4FUY4.js";import"./chunk-DYT22FTA.js";import"./chunk-7DCWZ2NF.js";import"./chunk-HCTPCUST.js";import"./chunk-STILP3Z6.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";
|
|
4
4
|
import"./chunk-VSJBJXZO.js";export{outlookDomain};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{loadDomain}from"./chunk-
|
|
3
|
+
import{loadDomain}from"./chunk-K54OB2BX.js";import"./chunk-VSJBJXZO.js";export{loadDomain};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-
|
|
3
|
+
import{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain}from"./chunk-VLTRRD4T.js";import"./chunk-K54OB2BX.js";import"./chunk-LXFLA3PZ.js";import"./chunk-P4QSPSOQ.js";import"./chunk-Q3B65OFC.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-UZVBQV4W.js";import"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";
|
|
4
4
|
import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-DYT22FTA.js";import"./chunk-HCTPCUST.js";import"./chunk-STILP3Z6.js";import"./chunk-TZL2342W.js";import"./chunk-ITFO5GPX.js";import"./chunk-GWVREACM.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-ZN7AEXEI.js";import"./chunk-OKATZ4SN.js";import"./chunk-RKBUJKI5.js";
|
|
5
5
|
import"./chunk-UREA4ZIG.js";import"./chunk-NHYMHCAT.js";import"./chunk-VSJBJXZO.js";export{CURATED_PAGING_VOCABULARY,buildPrepareContext,checkOutTarget,exitCodeFor,fetchAllPages,outputValue,reportError,requiresYes,resolvePaging,runDomain};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{FISCAL_YEAR_FLAG,fiscalYear,groupedSkillRows,matchSkill,parseReorderFile,parseSelfEvaluation,qualificationDomain,qualificationImportPreview,qualificationImportRows,reorderPreview,skillDomain,skillMatrix,skillNames}from"./chunk-
|
|
3
|
+
import{FISCAL_YEAR_FLAG,fiscalYear,groupedSkillRows,matchSkill,parseReorderFile,parseSelfEvaluation,qualificationDomain,qualificationImportPreview,qualificationImportRows,reorderPreview,skillDomain,skillMatrix,skillNames}from"./chunk-DWZC3652.js";import"./chunk-EHHY34NR.js";import"./chunk-OMW6BBAY.js";import"./chunk-PXSZZRPJ.js";import"./chunk-CHT6EP5C.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";
|
|
4
4
|
import"./chunk-UZVBQV4W.js";import"./chunk-SH2YLLVL.js";import"./chunk-CJFIIGSH.js";import"./chunk-HVZUXLQ4.js";import"./chunk-YJP4FUY4.js";import"./chunk-SBRTBKEZ.js";import"./chunk-DYT22FTA.js";import"./chunk-7DCWZ2NF.js";import"./chunk-HCTPCUST.js";import"./chunk-STILP3Z6.js";import"./chunk-J7QYPKVK.js";import"./chunk-EDF4U5BT.js";import"./chunk-RZVI6PMW.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";
|
|
5
5
|
import"./chunk-VSJBJXZO.js";export{FISCAL_YEAR_FLAG,fiscalYear,groupedSkillRows,matchSkill,parseReorderFile,parseSelfEvaluation,qualificationDomain,qualificationImportPreview,qualificationImportRows,reorderPreview,skillDomain,skillMatrix,skillNames};
|
|
@@ -14,13 +14,14 @@ return`\u30B9\u30EC\u30C3\u30C9\u306F${X_MAX_THREAD_PARTS}\u4EF6\u307E\u3067\u30
|
|
|
14
14
|
--channel",summary:"\u30C1\u30E3\u30CD\u30EB\uFF08x / linkedin / facebook / instagram\uFF09",takesValue:true,placeholder:"<\u30C1\u30E3\u30CD\u30EB>"};var X_CHANNEL_FLAG={...CHANNEL_FLAG,summary:"\u30C1\u30E3\u30CD\u30EB\uFF08x\uFF09"};var CHANNELS_FLAG={name:"--channel",summary:"\u30C1\u30E3\u30CD\u30EB\uFF08\u7E70\u308A\u8FD4\u3057\u3067\u8907\u6570\uFF09",takesValue:true,placeholder:"<\u30C1\u30E3\u30CD\u30EB>",repeatable:true};var ACCOUNT_FLAG={name:"--account",summary:"\u6295\u7A3F\u5148\u30A2\u30AB\u30A6\u30F3\u30C8\uFF08\u9023\u643AID \u304B @\u30E6\u30FC\u30B6\u30FC\
|
|
15
15
|
\u540D\u3002\u9023\u643A\u304C1\u4EF6\u306A\u3089\u7701\u7565\u53EF\uFF09",takesValue:true,placeholder:"<ID|@\u540D\u524D>"};var TEXT_FLAG={name:"--text",summary:"\u672C\u6587\u3092\u76F4\u63A5\u6307\u5B9A\u3059\u308B\uFF08\u4E00\u884C\u5411\u3051\uFF09",takesValue:true,placeholder:"<\u6587\u5B57\u5217>"};var TEXT_FILE_FLAG={name:"--text-file",summary:"\u672C\u6587\u3092\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u3080\uFF08- \u3067\u6A19\u6E96\u5165\u529B\uFF09",takesValue:true,placeholder:"<\u30D1\u30B9|\
|
|
16
16
|
->"};var THREAD_FLAG={name:"--thread",summary:"X \u306E\u30B9\u30EC\u30C3\u30C9\u306E\u7D9A\u304D\uFF082\u4EF6\u76EE\u4EE5\u964D\uFF09\u3092\u76F4\u63A5\u6307\u5B9A\u3059\u308B\uFF08\u7E70\u308A\u8FD4\u3057\u3067\u9806\u306B\u30FB--thread-file \u3068\u4F75\u7528\u4E0D\u53EF\uFF09",takesValue:true,placeholder:"<\u6587\u5B57\u5217>",repeatable:true};var THREAD_FILE_FLAG={name:"--thread-file",summary:"X \u306E\u30B9\u30EC\u30C3\u30C9\u306E\u7D9A\u304D\uFF082\u4EF6\u76EE\u4EE5\u964D\uFF09\u3092\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u3080\uFF08\u7E70\u308A\u8FD4\u3057\u3067\u9806\u306B\uFF09",
|
|
17
|
-
takesValue:true,placeholder:"<\u30D1\u30B9>",repeatable:true};function str(value){return typeof value==="string"&&value!==""?value:null}function oneLine(value,max=40){const text=value.replace(/[\r\n\t]+/g,
|
|
18
|
-
function channelName(channel){return CHANNEL_LABELS[channel]??channel}function checkChannel(raw,allowed,usage){const channel=raw.trim().toLowerCase();if(CHANNEL_LABELS[channel]===void 0){throw new UsageError(
|
|
19
|
-
|
|
20
|
-
--channel \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4F8B: --channel x\uFF09",usage);
|
|
21
|
-
throw new
|
|
22
|
-
return
|
|
23
|
-
channel);if(rows.length===0){if(ORGANIZATION_CHANNELS.includes(channel)){throw new UsageError(`${label} \u306E\u9023\u643A\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\uFF08\u7D44\u7E54\u3067\u5171\u6709\u3059\u308B\u9023\u643A\u3067\u3059\uFF09
|
|
17
|
+
takesValue:true,placeholder:"<\u30D1\u30B9>",repeatable:true};var QUOTE_FLAG={name:"--quote",summary:"X \u3067\u5F15\u7528\u3059\u308B\u6295\u7A3F\uFF08\u6570\u5B57\u306E ID \u304B\u6295\u7A3F URL\u3002\u30B9\u30EC\u30C3\u30C9\u3067\u306F1\u4EF6\u76EE\u304C\u5F15\u7528\u306B\u306A\u308B\uFF09",takesValue:true,placeholder:"<\u6295\u7A3FID|\u6295\u7A3FURL>"};function str(value){return typeof value==="string"&&value!==""?value:null}function oneLine(value,max=40){const text=value.replace(/[\r\n\t]+/g,
|
|
18
|
+
" ").replace(/[\p{Cc}\p{Cf}]/gu,"").trim();const chars=[...text];return chars.length>max?`${chars.slice(0,max).join("")}\u2026`:text}function accountHandle(row){const username=oneLine(String(row["account_username"]??""));return username!==""?`@${username}`:oneLine(String(row["account_name"]??""))}function channelName(channel){return CHANNEL_LABELS[channel]??channel}function checkChannel(raw,allowed,usage){const channel=raw.trim().toLowerCase();if(CHANNEL_LABELS[channel]===void 0){throw new UsageError(
|
|
19
|
+
`--channel ${raw} \u306F\u77E5\u3089\u306A\u3044\u30C1\u30E3\u30CD\u30EB\u3067\u3059\uFF08x / linkedin / facebook / instagram\uFF09`,usage)}if(!allowed.includes(channel)){throw new UsageError(`${channelName(channel)} \u3067\u306F\u3053\u306E\u64CD\u4F5C\u3092\u4F7F\u3048\u307E\u305B\u3093\uFF08\u4F7F\u3048\u308B\u306E\u306F ${allowed.map(channelName).join("\u30FB")} \u3067\u3059\uFF09`,usage)}return channel}function oneChannel(input,usage,allowed=POSTABLE_CHANNELS){const raw=input.flags.get("--c\
|
|
20
|
+
hannel");if(raw===void 0||raw.trim()==="")throw new UsageError("--channel \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4F8B: --channel x\uFF09",usage);return checkChannel(raw,allowed,usage)}function manyChannels(input,allowed,usage){const raws=repeatedValues(input,"--channel");if(raws.length===0)throw new UsageError("--channel \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u4F8B: --channel x\uFF09",usage);const channels=raws.map(raw=>checkChannel(raw,allowed,usage));
|
|
21
|
+
const dup=channels.find((c,i)=>channels.indexOf(c)!==i);if(dup!==void 0)throw new UsageError(`--channel ${dup} \u304C2\u56DE\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059`,usage);return channels}function dataRecord(body,label){const data=isRecord(body)?body["data"]:void 0;if(!isRecord(body)||body["result"]!==true||!isRecord(data)){throw new ApiResponseError(`${label}\u306E\u5FDC\u7B54\u306B data \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}
|
|
22
|
+
return data}function items(body,label){const list=isRecord(body)?body["items"]:void 0;if(!Array.isArray(list))throw new ApiResponseError(`${label}\u306E\u5FDC\u7B54\u306B items \u914D\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return list.filter(isRecord)}function segment(value,label){if(!isSafePathSegment(value))throw new ApiResponseError(`${label}\u3092\u30D1\u30B9\u306B\u4F7F\u3048\u307E\u305B\u3093: ${value}\
|
|
23
|
+
\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002`);return encodeURIComponent(value)}async function resolveAccount(input,ctx,channel,usage,options={}){const rows=options.rows??(await ctx.resolver.snsConnections()).filter(row2=>row2["provider"]===channel);const label=channelName(channel);if(rows.length===0){if(ORGANIZATION_CHANNELS.includes(channel)){throw new UsageError(`${label} \u306E\u9023\u643A\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\uFF08\u7D44\u7E54\u3067\u5171\u6709\u3059\u308B\u9023\u643A\u3067\u3059\uFF09`,
|
|
24
|
+
`${label} \u306F\u5E83\u5831\u306E\u7BA1\u7406\u8005\u304C\u7D44\u7E54\u3068\u3057\u3066\u9023\u643A\u3057\u3001\u5E83\u5831\u306E\u30E1\u30F3\u30D0\u30FC\u4EE5\u4E0A\u306E\u6A29\u9650\u3092\u6301\u3064\u4EBA\u304C\u4F7F\u3048\u307E\u3059\u3002\u9023\u643A\u6E08\u307F\u306E\u306F\u305A\u306A\u3089\u3001\u5E83\u5831\u306E\u6A29\u9650\u3092\u30C6\u30CA\u30F3\u30C8\u306E\u7BA1\u7406\u8005\u306B\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002\u672A\u9023\u643A\u306A\u3089\u3001\u5E83\u5831\u306E\u7BA1\u7406\u8005\u304C${connectScreen(
|
|
24
25
|
channel)}\u3067\u9023\u643A\u3057\u307E\u3059\uFF08\u30D6\u30E9\u30A6\u30B6\u3067\u884C\u3044\u307E\u3059\uFF09\u3002`+(channel==="facebook"?"Facebook\u30DA\u30FC\u30B8\u306F\u3001\u63D0\u4F9B\u3092\u59CB\u3081\u3066\u3044\u306A\u3044\u30C6\u30CA\u30F3\u30C8\u3067\u306F\u307E\u3060\u4F7F\u3048\u307E\u305B\u3093\uFF08twp sns accounts \u306B Facebook\u30DA\u30FC\u30B8\u306E\u6848\u5185\u304C\u51FA\u306A\u3044\u3068\u304D\u306F\u3053\u308C\u306B\u5F53\u305F\u308A\u307E\u3059\uFF09\u3002":""))}throw new UsageError(
|
|
25
26
|
`${label} \u306E\u30A2\u30AB\u30A6\u30F3\u30C8\u304C\u9023\u643A\u3055\u308C\u3066\u3044\u307E\u305B\u3093`,`${connectScreen(channel)}\u3092\u958B\u304D\u300C\u9023\u643A\u3059\u308B\u300D\u304B\u3089\u9023\u643A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u9023\u643A\u306F\u30D6\u30E9\u30A6\u30B6\u3067\u884C\u3044\u307E\u3059\uFF09\u3002twp sns accounts \u3067\u9023\u643A\u306E\u72B6\u614B\u3092\u78BA\u8A8D\u3067\u304D\u307E\u3059\u3002`)}const ref=input.flags.get("--account")?.trim();let row;if(ref===
|
|
26
27
|
void 0||ref===""){if(rows.length>1){const names=rows.map(r=>`${String(r["id"])}\uFF08${accountHandle(r)}\uFF09`).join("\u3001");throw new UsageError(`${label} \u306E\u9023\u643A\u304C ${rows.length} \u4EF6\u3042\u308A\u307E\u3059\u3002--account \u3067\u9078\u3093\u3067\u304F\u3060\u3055\u3044: ${names}`,usage)}row=rows[0]}else{const name=ref.replace(/^@/,"").toLowerCase();const hits=rows.filter(r=>r["id"]===ref||String(r["account_username"]??"").toLowerCase()===name||String(r["account_name"]??"").
|
|
@@ -63,52 +64,57 @@ connection_id"]!==wanted)){throw new ApiResponseError("\u63A5\u7D9A\u5148\u304C\
|
|
|
63
64
|
body))return facebookData(body)["posts"].filter(isRecord).map(facebookRow);if(listModeOf(body)==="instagram")return items(body,"Instagram \u306E\u30E1\u30C7\u30A3\u30A2\u4E00\u89A7").map(instagramRow);const names=isRecord(body)&&isRecord(body[ACCOUNT_NAMES_KEY])?body[ACCOUNT_NAMES_KEY]:{};return items(body,"SNS\u6295\u7A3F\u306E\u4E00\u89A7").map(row=>postRow(row,names))},raw:body=>isTimeline(body)?timelineData(body):isFacebookFeed(body)?facebookData(body):items(body,"SNS\u6295\u7A3F\u306E\u4E00\u89A7"),
|
|
64
65
|
notes(body,input){if(isFacebookFeed(body)){const page=facebookData(body)["page"];const name=isRecord(page)?str(page["name"]):null;return name===null?[]:[`Facebook\u30DA\u30FC\u30B8: ${oneLine(name)}`]}if(!isTimeline(body))return[];const data=timelineData(body);const notes=[];const fetchedAt=Date.parse(String(data["fetched_at"]??""));if(input.resolved?.["mode"]==="timeline"&&Number.isFinite(fetchedAt)&&Date.now()-fetchedAt<2*60*1e3){notes.push("\u26A0 \u30AD\u30E3\u30C3\u30B7\u30E5\u304C\u53E4\u304B\u3063\u305F\u305F\u3081\u3001\u30B5\u30FC\u30D0\u304C X \u304B\u3089\u65B0\u7740\u3092\u8AAD\u307F\u53D6\u308A\u307E\u3057\u305F\uFF08\u8AAD\u307F\u53D6\u3063\u305F\u4EF6\u6570\u3076\u3093\u306E\u30AF\u30EC\u30B8\u30C3\u30C8\u3092\u6D88\
|
|
65
66
|
\u8CBB\u3057\u3066\u3044\u307E\u3059\uFF09\u3002")}if(data["cached"]!==true){notes.push("\u3053\u306E\u9023\u643A\u306E\u6295\u7A3F\u306F\u307E\u3060\u4E00\u5EA6\u3082\u53D6\u5F97\u3057\u3066\u3044\u307E\u305B\u3093\u3002--fetch --yes \u3067\u53D6\u5F97\u3057\u307E\u3059\uFF08\u30AF\u30EC\u30B8\u30C3\u30C8\u3092\u6D88\u8CBB\u3057\u307E\u3059\uFF09\u3002")}else{notes.push(`\u53D6\u5F97: ${String(data["fetched_at"]??"\u4E0D\u660E")} / \u6307\u6A19\u306E\u66F4\u65B0: ${String(data["metrics_refreshe\
|
|
66
|
-
d_at"]??"\u306A\u3057")}`)}const error=str(data["refresh_error"]);if(error!==null)notes.push(`\u26A0 X \u304B\u3089\u306E\u65B0\u7740\u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08\u4E00\u89A7\u306F\u624B\u5143\u306E\u30AD\u30E3\u30C3\u30B7\u30E5\u3067\u3059\uFF09: ${error}`);return notes}};var POST_USAGE="twp sns post --channel <\u30C1\u30E3\u30CD\u30EB> [--channel \u2026] [--account <ID|@\u540D\u524D>] (--text <\u6587\u5B57\u5217> | --text-file <\u30D1\u30B9>) [--thread <\u6587\u5B57\u5217> \u2026 | --thread-file <\u30D1\u30B9> \u2026] [--
|
|
67
|
-
--yes";function parseAt(raw,now=new Date){const m=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2}))?(Z|[+-]\d{2}:\d{2})?$/.exec(raw.trim());const bad=()=>{throw new UsageError(`--at \u306F YYYY-MM-DDTHH:MM\uFF08\u65E5\u672C\u6642\u9593\uFF09\u304B\u3001\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u4ED8\u304D\u306E\u65E5\u6642\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${raw}\uFF09`,"\u4F8B:
|
|
68
|
-
if(m===null)return bad();const[,y,mo,d,h,mi,s="00",zone]=m;const parts=[Number(y),Number(mo),Number(d),Number(h),Number(mi),Number(s)];const check=new Date(Date.UTC(parts[0],parts[1]-1,parts[2],parts[3],parts[4],parts[5]));if(check.getUTCFullYear()!==parts[0]||check.getUTCMonth()!==parts[1]-1||check.getUTCDate()!==parts[2]||check.getUTCHours()!==parts[3]||check.getUTCMinutes()!==parts[4]||check.getUTCSeconds()!==parts[5]){return bad()}const offset=zone??
|
|
69
|
-
:${s}${offset==="Z"?"Z":offset}`;const at=new Date(iso);if(Number.isNaN(at.getTime()))return bad();if(at.getTime()<=now.getTime()){throw new UsageError(`--at \u306E\u65E5\u6642\uFF08${iso}\uFF09\u304C\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u4E88\u7D04\u306F\u73FE\u5728\u3088\u308A\u5F8C\u306E\u65E5\u6642\u306B\u3057\u3066\u304F\u3060\u3055\u3044`,POST_USAGE)}return{iso,assumedJst:zone===void 0}}function mediaFiles(input,channels,usage=POST_USAGE){
|
|
70
|
-
map(raw=>{const{file,size}=inspectLocalFile(raw,"--media",usage);const name=path.basename(file);return{file,name,size,contentType:snsContentType(name)}});for(const channel of channels){const violation=mediaViolation(channel,files);if(violation!==null)throw new UsageError(violation,usage)}return files}var VIDEO_EXTENSIONS={".mp4":"video/mp4",".mov":"video/quicktime"};function snsContentType(name){return VIDEO_EXTENSIONS[path.extname(name).
|
|
71
|
-
const rule=MEDIA_RULES[channel];if(rule===void 0)return null;const label=channelName(channel);if(files.length===0){return rule.required?`${label} \u306B\u306F\u753B\u50CF\u304B\u52D5\u753B\u304C1\u4EF6\u4EE5\u4E0A\u5FC5\u8981\u3067\u3059\uFF08--media \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`:null}if(files.length>rule.maxItems)return`${label} \u306B\u4ED8\u3051\u3089\u308C\u308B\u30E1\u30C7\u30A3\u30A2\u306F ${rule.
|
|
72
|
-
\u4EF6\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\uFF09`;const videos=files.filter(f=>rule.videoTypes.includes(f.contentType)).length;if(!rule.mixed&&videos>0&&videos<files.length)return`${label} \u306E\u6295\u7A3F\u306B\u306F\u753B\u50CF\u3068\u52D5\u753B\u3092\u540C\u6642\u306B\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093`;if(videos>rule.maxVideos&&rule.maxVideos>0)return`${label} \u306E\u6295\u7A3F\u306B\u4ED8\u3051\u3089\u308C\u308B\u52D5\u753B\u306F ${rule.
|
|
73
|
-
for(const f of files){if(rule.imageTypes.includes(f.contentType)){const max=channel==="x"&&f.contentType==="image/gif"?X_MAX_GIF_BYTES:rule.maxImageBytes;if(f.size>max)return`${label} \u306B\u4ED8\u3051\u3089\u308C\u308B\u753B\u50CF\u306F ${max/MB}MB \u307E\u3067\u3067\u3059: ${f.file}`}else if(rule.videoTypes.includes(f.contentType)){const max=rule.maxVideoBytes(files.length);if(f.size>max)return`${label} \u306B\u4ED8\u3051\u3089\u308C\u308B\u52D5\u753B\u306F ${max/
|
|
74
|
-
"instagram"?files.length>=2?"\uFF08\u30AB\u30EB\u30FC\u30BB\u30EB\uFF09":"\uFF08\u30EA\u30FC\u30EB\uFF09":""}: ${f.file}`}else{return`${label} \u306B\u306F${rule.typesText}\u3060\u3051\u3092\u4ED8\u3051\u3089\u308C\u307E\u3059: ${f.file}`}}return null}function textViolation(channel,text){const limit=TEXT_LIMITS[channel];if(limit===void 0)return null;const count=charCount(text);if(count>limit)return`${channelName(channel)} \u306E\u672C\u6587\u306F ${limit}
|
|
75
|
-
\u6587\u5B57\uFF09`;if(channel==="instagram"){const tags=(text.replace(URL_PATTERN_ALL," ").match(/[##][^\s##。、,.!?「」()()]+/gu)??[]).length;if(tags>INSTAGRAM_MAX_HASHTAGS)return`Instagram \u306E\u30CF\u30C3\u30B7\u30E5\u30BF\u30B0\u306F ${INSTAGRAM_MAX_HASHTAGS} \u500B\u307E\u3067\u3067\u3059\uFF08${tags} \u500B\uFF09`}return null}async function readText(input,usage,required){const text=await readBody(input,{flag:"--text",
|
|
76
|
-
usage});if(required&&(text===void 0||text.trim()===""))throw new UsageError("\u672C\u6587\uFF08--text \u304B --text-file\uFF09\u304B\u753B\u50CF\uFF08--media\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",usage);return text}async function readThread(input){const inline=repeatedValues(input,THREAD_FLAG.name);const files=repeatedValues(input,THREAD_FILE_FLAG.name);if(inline.length>0&&files.length>0){throw new UsageError(
|
|
77
|
-
POST_USAGE)}const[flag,values]=inline.length>0?[THREAD_FLAG.name,inline]:[THREAD_FILE_FLAG.name,files];const parts=[];for(const[i,value]of values.entries()){if(flag===THREAD_FILE_FLAG.name&&value==="-"){throw new UsageError("--thread-file \u306B\u6A19\u6E96\u5165\u529B\uFF08-\uFF09\u306F\u4F7F\u3048\u307E\u305B\u3093\u3002\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
78
|
-
"--text-file"));flags.set(flag,value);const text=await readBody({args:[],flags},{flag:THREAD_FLAG.name,fileFlag:THREAD_FILE_FLAG.name,label:`\u30B9\u30EC\u30C3\u30C9\u306E${i+2}\u4EF6\u76EE`,maxChars:BODY_MAX_CHARS,usage:POST_USAGE});parts.push(text??"")}return parts}function postThread(input){const raw=input.resolved?.["thread"];return raw===void 0?[]:JSON.parse(raw)}function
|
|
79
|
-
parse(requireResolved(input,"targets"))}function postText(input){return JSON.parse(requireResolved(input,"text"))}function draftPlan(input){const thread=postThread(input);return{method:"POST",path:POSTS_PATH,body:{body:postText(input),targets:postTargets(input).map(t=>({channel:t.channel,connection_id:t.
|
|
80
|
-
\u3055\u3044\u3002");return id}async function discardDraft(ctx,row){const channel=str(row["channel"])??"x";try{await ctx.send({method:"DELETE",path:`${POSTS_PATH}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
67
|
+
d_at"]??"\u306A\u3057")}`)}const error=str(data["refresh_error"]);if(error!==null)notes.push(`\u26A0 X \u304B\u3089\u306E\u65B0\u7740\u306E\u53D6\u5F97\u306B\u5931\u6557\u3057\u307E\u3057\u305F\uFF08\u4E00\u89A7\u306F\u624B\u5143\u306E\u30AD\u30E3\u30C3\u30B7\u30E5\u3067\u3059\uFF09: ${error}`);return notes}};var POST_USAGE="twp sns post --channel <\u30C1\u30E3\u30CD\u30EB> [--channel \u2026] [--account <ID|@\u540D\u524D>] (--text <\u6587\u5B57\u5217> | --text-file <\u30D1\u30B9>) [--thread <\u6587\u5B57\u5217> \u2026 | --thread-file <\u30D1\u30B9> \u2026] [--quote <\u6295\u7A3FID|\u6295\u7A3FURL>] [--media \
|
|
68
|
+
<\u753B\u50CF|\u52D5\u753B> \u2026] [--at <\u65E5\u6642>] --yes";function parseAt(raw,now=new Date){const m=/^(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2})(?::(\d{2}))?(Z|[+-]\d{2}:\d{2})?$/.exec(raw.trim());const bad=()=>{throw new UsageError(`--at \u306F YYYY-MM-DDTHH:MM\uFF08\u65E5\u672C\u6642\u9593\uFF09\u304B\u3001\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u4ED8\u304D\u306E\u65E5\u6642\u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${raw}\uFF09`,"\u4F8B: \
|
|
69
|
+
--at 2026-11-04T09:30 \uFF0F --at 2026-11-04T00:30Z")};if(m===null)return bad();const[,y,mo,d,h,mi,s="00",zone]=m;const parts=[Number(y),Number(mo),Number(d),Number(h),Number(mi),Number(s)];const check=new Date(Date.UTC(parts[0],parts[1]-1,parts[2],parts[3],parts[4],parts[5]));if(check.getUTCFullYear()!==parts[0]||check.getUTCMonth()!==parts[1]-1||check.getUTCDate()!==parts[2]||check.getUTCHours()!==parts[3]||check.getUTCMinutes()!==parts[4]||check.getUTCSeconds()!==parts[5]){return bad()}const offset=zone??
|
|
70
|
+
"+09:00";const iso=`${y}-${mo}-${d}T${h}:${mi}:${s}${offset==="Z"?"Z":offset}`;const at=new Date(iso);if(Number.isNaN(at.getTime()))return bad();if(at.getTime()<=now.getTime()){throw new UsageError(`--at \u306E\u65E5\u6642\uFF08${iso}\uFF09\u304C\u904E\u304E\u3066\u3044\u307E\u3059\u3002\u4E88\u7D04\u306F\u73FE\u5728\u3088\u308A\u5F8C\u306E\u65E5\u6642\u306B\u3057\u3066\u304F\u3060\u3055\u3044`,POST_USAGE)}return{iso,assumedJst:zone===void 0}}function mediaFiles(input,channels,usage=POST_USAGE){
|
|
71
|
+
const raws=repeatedValues(input,"--media");const files=raws.map(raw=>{const{file,size}=inspectLocalFile(raw,"--media",usage);const name=path.basename(file);return{file,name,size,contentType:snsContentType(name)}});for(const channel of channels){const violation=mediaViolation(channel,files);if(violation!==null)throw new UsageError(violation,usage)}return files}var VIDEO_EXTENSIONS={".mp4":"video/mp4",".mov":"video/quicktime"};function snsContentType(name){return VIDEO_EXTENSIONS[path.extname(name).
|
|
72
|
+
toLowerCase()]??contentTypeFor(name)}function mediaViolation(channel,files){const rule=MEDIA_RULES[channel];if(rule===void 0)return null;const label=channelName(channel);if(files.length===0){return rule.required?`${label} \u306B\u306F\u753B\u50CF\u304B\u52D5\u753B\u304C1\u4EF6\u4EE5\u4E0A\u5FC5\u8981\u3067\u3059\uFF08--media \u3067\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\uFF09`:null}if(files.length>rule.maxItems)return`${label} \u306B\u4ED8\u3051\u3089\u308C\u308B\u30E1\u30C7\u30A3\u30A2\u306F ${rule.
|
|
73
|
+
maxItems} \u4EF6\u307E\u3067\u3067\u3059\uFF08${files.length} \u4EF6\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u3059\uFF09`;const videos=files.filter(f=>rule.videoTypes.includes(f.contentType)).length;if(!rule.mixed&&videos>0&&videos<files.length)return`${label} \u306E\u6295\u7A3F\u306B\u306F\u753B\u50CF\u3068\u52D5\u753B\u3092\u540C\u6642\u306B\u4ED8\u3051\u3089\u308C\u307E\u305B\u3093`;if(videos>rule.maxVideos&&rule.maxVideos>0)return`${label} \u306E\u6295\u7A3F\u306B\u4ED8\u3051\u3089\u308C\u308B\u52D5\u753B\u306F ${rule.
|
|
74
|
+
maxVideos} \u672C\u307E\u3067\u3067\u3059`;for(const f of files){if(rule.imageTypes.includes(f.contentType)){const max=channel==="x"&&f.contentType==="image/gif"?X_MAX_GIF_BYTES:rule.maxImageBytes;if(f.size>max)return`${label} \u306B\u4ED8\u3051\u3089\u308C\u308B\u753B\u50CF\u306F ${max/MB}MB \u307E\u3067\u3067\u3059: ${f.file}`}else if(rule.videoTypes.includes(f.contentType)){const max=rule.maxVideoBytes(files.length);if(f.size>max)return`${label} \u306B\u4ED8\u3051\u3089\u308C\u308B\u52D5\u753B\u306F ${max/
|
|
75
|
+
MB}MB \u307E\u3067\u3067\u3059${channel==="instagram"?files.length>=2?"\uFF08\u30AB\u30EB\u30FC\u30BB\u30EB\uFF09":"\uFF08\u30EA\u30FC\u30EB\uFF09":""}: ${f.file}`}else{return`${label} \u306B\u306F${rule.typesText}\u3060\u3051\u3092\u4ED8\u3051\u3089\u308C\u307E\u3059: ${f.file}`}}return null}function textViolation(channel,text){const limit=TEXT_LIMITS[channel];if(limit===void 0)return null;const count=charCount(text);if(count>limit)return`${channelName(channel)} \u306E\u672C\u6587\u306F ${limit}\
|
|
76
|
+
\u6587\u5B57\u307E\u3067\u3067\u3059\uFF08${count} \u6587\u5B57\uFF09`;if(channel==="instagram"){const tags=(text.replace(URL_PATTERN_ALL," ").match(/[##][^\s##。、,.!?「」()()]+/gu)??[]).length;if(tags>INSTAGRAM_MAX_HASHTAGS)return`Instagram \u306E\u30CF\u30C3\u30B7\u30E5\u30BF\u30B0\u306F ${INSTAGRAM_MAX_HASHTAGS} \u500B\u307E\u3067\u3067\u3059\uFF08${tags} \u500B\uFF09`}return null}async function readText(input,usage,required){const text=await readBody(input,{flag:"--text",
|
|
77
|
+
fileFlag:"--text-file",label:"\u672C\u6587",maxChars:BODY_MAX_CHARS,usage});if(required&&(text===void 0||text.trim()===""))throw new UsageError("\u672C\u6587\uFF08--text \u304B --text-file\uFF09\u304B\u753B\u50CF\uFF08--media\uFF09\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044",usage);return text}async function readThread(input){const inline=repeatedValues(input,THREAD_FLAG.name);const files=repeatedValues(input,THREAD_FILE_FLAG.name);if(inline.length>0&&files.length>0){throw new UsageError(
|
|
78
|
+
"--thread \u3068 --thread-file \u306F\u540C\u6642\u306B\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093\uFF08\u4EF6\u306E\u9806\u5E8F\u304C\u6C7A\u307E\u3089\u306A\u3044\u305F\u3081\uFF09",POST_USAGE)}const[flag,values]=inline.length>0?[THREAD_FLAG.name,inline]:[THREAD_FILE_FLAG.name,files];const parts=[];for(const[i,value]of values.entries()){if(flag===THREAD_FILE_FLAG.name&&value==="-"){throw new UsageError("--thread-file \u306B\u6A19\u6E96\u5165\u529B\uFF08-\uFF09\u306F\u4F7F\u3048\u307E\u305B\u3093\u3002\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9\u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044",
|
|
79
|
+
POST_USAGE)}const flags=new Map([...input.flags].filter(([name])=>name!=="--text"&&name!=="--text-file"));flags.set(flag,value);const text=await readBody({args:[],flags},{flag:THREAD_FLAG.name,fileFlag:THREAD_FILE_FLAG.name,label:`\u30B9\u30EC\u30C3\u30C9\u306E${i+2}\u4EF6\u76EE`,maxChars:BODY_MAX_CHARS,usage:POST_USAGE});parts.push(text??"")}return parts}function postThread(input){const raw=input.resolved?.["thread"];return raw===void 0?[]:JSON.parse(raw)}function postQuote(input){return input.
|
|
80
|
+
resolved?.["quote"]??null}function partCredits(price,text,quoted=false){return quoted||URL_PATTERN.test(text)?price.postWithLink:price.post}function postTargets(input){return JSON.parse(requireResolved(input,"targets"))}function postText(input){return JSON.parse(requireResolved(input,"text"))}function draftPlan(input){const thread=postThread(input);const quote=postQuote(input);return{method:"POST",path:POSTS_PATH,body:{body:postText(input),targets:postTargets(input).map(t=>({channel:t.channel,connection_id:t.
|
|
81
|
+
connectionId,...thread.length>0?{thread_bodies:thread}:{},...quote!==null?{quote_tweet_id:quote}:{}}))}}}function postId(row){const id=str(row["id"]);if(id===null||!UUID.test(id))throw new ApiResponseError("SNS\u6295\u7A3F\u306E\u5FDC\u7B54\u306B id \u304C\u3042\u308A\u307E\u305B\u3093\u3002\u63A5\u7D9A\u5148\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002");return id}async function discardDraft(ctx,row){const channel=str(row["channel"])??"x";try{await ctx.send({method:"DELETE",path:`${POSTS_PATH}\
|
|
82
|
+
/${postId(row)}`,body:{expected_updated_at:row["updated_at"]??null}});ctx.warn(`\u4F5C\u6210\u9014\u4E2D\u306E\u4E0B\u66F8\u304D\uFF08${String(row["id"])}\uFF09\u3092\u524A\u9664\u3057\u307E\u3057\u305F\u3002`)}catch(error){ctx.warn(`\u4F5C\u6210\u9014\u4E2D\u306E\u4E0B\u66F8\u304D\uFF08${String(row["id"])}\uFF09\u3092\u524A\u9664\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\uFF08${error.message}\uFF09\u3002twp sns list --channel ${channel} --status draft \u3067\u78BA\u304B\u3081\u3001twp sns delete --channel ${channel}\
|
|
83
|
+
${String(row["id"])} --yes \u3067\u6D88\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}}var postOperation={name:"post",summary:"SNS \u3078\u6295\u7A3F\u3059\u308B\u30FB\u4E88\u7D04\u3059\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",usage:POST_USAGE,description:"\u26A0 \u5916\u90E8\u3078\u516C\u958B\u3059\u308B\u64CD\u4F5C\u3067\u3059\u3002--yes \u304C\u7121\u3051\u308C\u3070\u5B9F\u884C\u3057\u307E\u305B\u3093\u3002--dry-run \u3067\u6295\u7A3F\u5148\u30FB\u8CBB\u7528\u30FB\u672C\u6587\u3092\u78BA\u304B\u3081\u3066\u304B\u3089\n --yes \u3092\u4ED8\u3051\u3066\u304F\u3060\u3055\u3044\uFF08--dry-run \u3067\u3082\u6599\u91D1\u306E\u78BA\u8A8D\u306E\u305F\u3081 GET \u30921\u672C\u9001\u308A\u307E\u3059\uFF09\u3002\n\u26A0 X \u3078\u306E\u6295\u7A3F\u306F\u30AF\u30EC\u30B8\u30C3\u30C8\u3092\u6D88\u8CBB\u3057\u307E\u3059\u3002\u672C\u6587\u306B URL \u3092\u542B\u3080\u300C\u30EA\u30F3\u30AF\u4ED8\u304D\u6295\u7A3F\u300D\u306F\u5358\u4FA1\u304C\u5927\u304D\u304F\u4E0A\u304C\u308A\u307E\u3059\n \uFF08\u9001\u308B\u524D\u306B\u5358\u4FA1\u3092\u8868\u793A\u3057\u307E\u3059\uFF09\u3002LinkedIn\u30FBFacebook\u30DA\u30FC\u30B8\u30FBInstagram \u3078\u306E\u6295\u7A3F\u306F\u30AF\u30EC\u30B8\u30C3\u30C8\u3092\u6D88\u8CBB\u3057\u307E\u305B\u3093\u3002\n\n--at \u3092\u4ED8\u3051\
|
|
84
|
+
\u308B\u3068\u4E88\u7D04\u3057\u307E\u3059\uFF08\u6307\u5B9A\u306E\u6642\u523B\u306B TWP \u304C\u6295\u7A3F\u3057\u307E\u3059\uFF09\u3002\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u3092\u4ED8\u3051\u306A\u3044\u65E5\u6642\u306F\u65E5\u672C\u6642\u9593\u3067\u3059\u3002\n\u4E88\u7D04\u306E\u53D6\u308A\u6D88\u3057\u306F twp sns list --channel <\u30C1\u30E3\u30CD\u30EB> --status scheduled \u306E id \u3092 twp sns delete \u306B\u6E21\u3057\u307E\u3059\u3002\n--channel \u306F\u7E70\u308A\u8FD4\u3057\u3066\u8907\u6570\u306E\u30C1\u30E3\u30CD\u30EB\u3078\u540C\u3058\u672C\u6587\u30FB\u540C\u3058\u30E1\u30C7\u30A3\u30A2\u3092\u51FA\u305B\u307E\u3059\u3002\u7D50\u679C\u306F\u30C1\u30E3\u30CD\u30EB\u3054\u3068\u306B\u51FA\u3057\u307E\u3059\n\uFF081\u3064\u304C\u5931\u6557\u3057\u3066\u3082\u3001\u4ED6\u306E\u30C1\u30E3\u30CD\u30EB\u306E\u6295\u7A3F\u306F\u53D6\u308A\u6D88\u3057\u307E\u305B\u3093\uFF09\u3002\n--media\uFF08\u7E70\u308A\u8FD4\u3057\u6307\u5B9A\uFF09\u3067\u4ED8\u3051\u3089\u308C\u308B\u3082\u306E\uFF08\u6307\u5B9A\u3057\u305F\u5168\u30C1\u30E3\u30CD\u30EB\u306E\u6761\u4EF6\u3067\u9001\u308B\u524D\u306B\u78BA\u304B\u3081\u307E\u3059\uFF09:\n x \u2026 \u753B\u50CF\uFF08JPEG\u30FBPNG\u30FBWEBP\u30FBGIF\uFF094\u679A\u307E\u3067\u3002\u52D5\u753B\u306F\u4E0D\u53EF\n linkedin \u2026 \u753B\u50CF\uFF08JPEG\u30FBPNG\u30FBGIF\uFF0910\u679A\u307E\u3067\u3002\u52D5\u753B\u306F\u4E0D\u53EF\n facebook \u2026 \u753B\u50CF\uFF08JPEG\u30FBPNG\u30FBGIF\uFF0910\u679A\u307E\u3067 \u304B \u52D5\u753B\uFF08MP4\u30FBMOV\uFF091\u672C\u3002\u753B\u50CF\u3068\u52D5\u753B\u306F\u6DF7\u305C\u3089\u308C\u306A\u3044\n instagram \u2026 \u5FC5\u9808\u3002JPEG \u306E\u753B\u50CF\u30FBMP4/MOV \u306E\u52D5\u753B\u3092\u5408\u308F\u305B\u306610\u4EF6\u307E\u3067\uFF081\u4EF6\u306E\u52D5\u753B\u306F\u30EA\u30FC\u30EB\u30012\u4EF6\u4EE5\u4E0A\u306F\u30AB\u30EB\u30FC\u30BB\u30EB\uFF09\n\u672C\u6587\u306E\u4E0A\u9650\u306F\
|
|
85
|
+
X \u304C\u9023\u643A\u306E\u30D7\u30E9\u30F3\u3067 280 \u304B 25,000\uFF08\u65E5\u672C\u8A9E\u306F1\u5B572\uFF09\u3001LinkedIn 3,000\u3001Facebook\u30DA\u30FC\u30B8 63,206\u3001\nInstagram 2,200 \u6587\u5B57\uFF08\u30CF\u30C3\u30B7\u30E5\u30BF\u30B030\u500B\u307E\u3067\uFF09\u3067\u3059\u3002\nFacebook\u30DA\u30FC\u30B8\u30FBInstagram \u306F\u7D44\u7E54\u3067\u5171\u6709\u3059\u308B\u9023\u643A\u3067\u3001\u5E83\u5831\u306E\u30E1\u30F3\u30D0\u30FC\u4EE5\u4E0A\u306E\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\u3002\n\n--thread / --thread-file \u3092\u4ED8\u3051\u308B\u3068 X \u306E\u30B9\u30EC\u30C3\u30C9\u306B\u3057\u307E\u3059\uFF08--text \u304C1\u4EF6\u76EE\u3001\u7D9A\u304D\u3092\u6307\u5B9A\u3057\u305F\u9806\u306B\u8FD4\u4FE1\u3068\u3057\u3066\u3064\u306A\u3052\u308B\uFF09\u3002\n 1\u4EF6\u76EE\u3092\u542B\u3081\u306625\u4EF6\u307E\u3067\u30FB\u5404\u4EF6 X \u306E\u4E0A\u9650\uFF08\u9023\u643A\u306E\u30D7\u30E9\u30F3\u3067 280 \u304B 25,000\u3002\u65E5\u672C\u8A9E\u306F1\u5B572\u3002\u7D9A\u304D\u306F2000\u5B57\u307E\u3067\uFF09\u307E\u3067\u30FB\u7D9A\u304D\u306E\u7A7A\u306F\u4E0D\u53EF\uFF08\u9001\u308B\u524D\u306B\u6B62\u3081\u307E\u3059\uFF09\u3002\n \u8CBB\u7528\u306F\u4EF6\u3054\u3068\u3067\u3001URL \u3092\u542B\u3080\u4EF6\u3060\u3051\u304C\u30EA\u30F3\u30AF\u4ED8\u304D\u306E\u5358\u4FA1\u3067\u3059\u3002URL \u30922\u4EF6\u76EE\u4EE5\u964D\u3078\u7F6E\u304F\u30681\u4EF6\u76EE\u306E\u5358\u4FA1\u306F\u901A\u5E38\u306E\u307E\u307E\u3067\u3059\u3002\n \u753B\u50CF\uFF08--media\uFF09\u306F1\u4EF6\u76EE\u306B\u3060\u3051\u4ED8\u304D\u307E\u3059\u3002\u30B9\u30EC\u30C3\u30C9\u306F X \u3060\u3051\u3067\u4F7F\u3048\u307E\u3059\u3002\n \u9014\u4E2D\u3067\u5931\u6557\u3059\u308B\u3068\u305D\u308C\u307E\u3067\u306E\u4EF6\u306F X \u306B\u51FA\u305F\u307E\u307E\u6B8B\u308A\u307E\u3059\uFF08\u518D\u9001\u306F\u3057\u307E\u305B\u3093\uFF09\u3002\u4F55\u4EF6\u76EE\u307E\u3067\u51FA\u305F\u304B\u3092\n twp sns list --channel x \
|
|
86
|
+
--status all \u3067\u78BA\u304B\u3081\u3066\u304B\u3089\u6253\u3061\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\u3002\n\n--quote \u3092\u4ED8\u3051\u308B\u3068 X \u306E\u5F15\u7528\u6295\u7A3F\u306B\u3057\u307E\u3059\uFF08\u6570\u5B57\u306E\u6295\u7A3F ID \u304B https://x.com/<\u30E6\u30FC\u30B6\u30FC\u540D>/status/<ID>\uFF09\u3002\n \u5F15\u7528\u6295\u7A3F\u306F\u30EA\u30F3\u30AF\u4ED8\u304D\u6295\u7A3F\u306E\u5358\u4FA1\u3067\u3059\uFF08\u30B9\u30EC\u30C3\u30C9\u3067\u306F\u5F15\u7528\u306B\u306A\u308B1\u4EF6\u76EE\u3060\u3051\uFF09\u3002\u4E88\u7D04\u3067\u3082\u5F15\u7528\u5148\u3092\u4FDD\u3061\u307E\u3059\u3002\n \u5F15\u7528\u306F X \u3060\u3051\u3067\u4F7F\u3048\u307E\u3059\u3002X \u306E\u5951\u7D04\u306B\u3088\u3063\u3066\u306F\u5F15\u7528\u3092\u62D2\u5426\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u3001\u305D\u306E\u3068\u304D\u306F X \u306E\u7406\u7531\u3092\u8868\u793A\u3057\u3066\u6B62\u3081\u307E\u3059\u3002\n\n\u9806\u306B\u3001\u4E0B\u66F8\u304D\u306E\u4F5C\u6210 \u2192 \u753B\u50CF\u306E\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3068\u7D10\u3065\u3051 \u2192 \u6295\u7A3F\uFF08--at \u306A\u3089\u4E88\u7D04\uFF09\u3092\u9001\u308A\u307E\u3059\u3002\u9014\u4E2D\u3067\u6B62\u307E\u3063\u305F\u3089\n\u4F5C\u3063\u305F\u4E0B\u66F8\u304D\u3092\u6D88\u3057\u307E\u3059\u3002\u7D42\u4E86\u30B3\u30FC\u30C9 4\uFF08\u901A\u4FE1\u306E\u5931\u6557\uFF09\u3067\u3082 SNS \u5074\u3067\u306F\u6295\u7A3F\u6E08\u307F\u306E\u3053\u3068\u304C\u3042\u308B\u306E\u3067\u3001\u6253\u3061\u76F4\u3059\u524D\u306B\ntwp sns list --channel <\u30C1\u30E3\u30CD\u30EB> --status all \u3067\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
87
|
+
destructive:true,confirmation:"\u5916\u90E8\u306E SNS \u3078\u516C\u958B\u6295\u7A3F\u3059\u308B\u64CD\u4F5C\uFF08X \u306F\u30AF\u30EC\u30B8\u30C3\u30C8\u3092\u6D88\u8CBB\u3057\u307E\u3059\uFF09",flags:[CHANNELS_FLAG,ACCOUNT_FLAG,TEXT_FLAG,TEXT_FILE_FLAG,THREAD_FLAG,THREAD_FILE_FLAG,QUOTE_FLAG,{name:"--media",summary:"\u4ED8\u3051\u308B\u753B\u50CF\u30FB\u52D5\u753B\u306E\u30D1\u30B9\uFF08\u7E70\u308A\u8FD4\u3057\u6307\u5B9A\u30FBInstagram \u306F\u5FC5\u9808\u30FB\u30B9\u30EC\u30C3\u30C9\u3067\u306F1\u4EF6\u76EE\u306B\u3060\u3051\u4ED8\u304F\uFF09",
|
|
86
88
|
takesValue:true,placeholder:"<\u30D1\u30B9>",repeatable:true},{name:"--at",summary:"\u4E88\u7D04\u3059\u308B\u65E5\u6642\uFF08YYYY-MM-DDTHH:MM \u306F\u65E5\u672C\u6642\u9593\uFF09",takesValue:true,placeholder:"<\u65E5\u6642>"}],async prepare(input,ctx){if(input.args.length>0)throw new UsageError(`\u4F4D\u7F6E\u5F15\u6570\u306F\u53D7\u3051\u4ED8\u3051\u307E\u305B\u3093: ${input.args.join(" ")}`,POST_USAGE);const threaded=repeatedValues(input,THREAD_FLAG.name).length+repeatedValues(input,THREAD_FILE_FLAG.
|
|
87
|
-
name).length>0;if(threaded&&repeatedValues(input,"--channel").some(c=>c.trim().toLowerCase()!=="x")){throw new UsageError("\u30B9\u30EC\u30C3\u30C9\uFF08--thread / --thread-file\uFF09\u306F X \u306E\u6295\u7A3F\u3060\u3051\u3067\u4F7F\u3048\u307E\u3059",POST_USAGE)}const
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
"x")}\
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
`\
|
|
95
|
-
|
|
96
|
-
""}\
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
\
|
|
101
|
-
|
|
102
|
-
"\u6295\u7A3F
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
row
|
|
107
|
-
|
|
108
|
-
notes.push(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
89
|
+
name).length>0;if(threaded&&repeatedValues(input,"--channel").some(c=>c.trim().toLowerCase()!=="x")){throw new UsageError("\u30B9\u30EC\u30C3\u30C9\uFF08--thread / --thread-file\uFF09\u306F X \u306E\u6295\u7A3F\u3060\u3051\u3067\u4F7F\u3048\u307E\u3059",POST_USAGE)}const rawQuote=input.flags.get(QUOTE_FLAG.name);let quote=null;if(rawQuote!==void 0){if(repeatedValues(input,"--channel").some(c=>c.trim().toLowerCase()!=="x")){throw new UsageError("\u5F15\u7528\uFF08--quote\uFF09\u306F X \u306E\u6295\u7A3F\u3060\u3051\u3067\u4F7F\u3048\u307E\u3059",
|
|
90
|
+
POST_USAGE)}quote=tweetIdOf(rawQuote);if(quote===null){throw new UsageError(`--quote \u306B\u306F X \u306E\u6295\u7A3F ID\uFF08\u6570\u5B57\uFF09\u304B\u6295\u7A3F URL\uFF08https://x.com/<\u30E6\u30FC\u30B6\u30FC\u540D>/status/<ID>\uFF09\u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${oneLine(rawQuote)}\uFF09`,POST_USAGE)}}const channels=manyChannels(input,POSTABLE_CHANNELS,POST_USAGE);const media=mediaFiles(input,channels);const text=await readText(input,
|
|
91
|
+
POST_USAGE,media.length===0)??"";for(const channel of channels){const violation=textViolation(channel,text);if(violation!==null)throw new UsageError(`${violation}\u3002`,POST_USAGE)}const thread=await readThread(input);if(channels.includes("x")){const violation=xPartsViolation([text,...thread],X_LONG_POST_LIMIT);if(violation!==null)throw new UsageError(`${violation}\u3002`,POST_USAGE)}const rawAt=input.flags.get("--at");const at=rawAt===void 0?void 0:parseAt(rawAt);const targets=[];for(const channel of channels){
|
|
92
|
+
const account=await resolveAccount(input,ctx,channel,POST_USAGE);let limit;if(channel==="x"){limit=xLimitOf(account);const violation=xPartsViolation([text,...thread],limit);if(violation!==null){throw new UsageError(`${violation}\u3002`,limit<X_LONG_POST_LIMIT?`${account["accountText"]} \u306E\u4E0A\u9650\u306F ${limit} \u3067\u3059\u3002X \u306E\u6709\u6599\u30D7\u30E9\u30F3\uFF08Basic\u30FBPremium\uFF09\u306E\u30A2\u30AB\u30A6\u30F3\u30C8\u306A\u3089\u9577\u6587\u6295\u7A3F\uFF08${X_LONG_POST_LIMIT}\
|
|
93
|
+
\uFF09\u307E\u3067\u51FA\u305B\u307E\u3059\u3002\u30D7\u30E9\u30F3\u3092\u5951\u7D04\u6E08\u307F\u306A\u3089 ${connectScreen("x")}\u3067\u9023\u643A\u3057\u76F4\u3059\u3068\u4E0A\u9650\u304C\u8AAD\u307F\u76F4\u3055\u308C\u307E\u3059\u3002`:POST_USAGE)}}targets.push({channel,connectionId:account["connectionId"],accountText:account["accountText"],defaulted:account["accountDefaulted"],limit})}return withResolved(input,{text:JSON.stringify(text),...thread.length>0?{thread:JSON.stringify(thread)}:{},
|
|
94
|
+
...quote!==null?{quote}:{},targets:JSON.stringify(targets),media:JSON.stringify(media),...at!==void 0?{at:at.iso,atAssumedJst:at.assumedJst?"1":"0"}:{}})},plan:draftPlan,plannedNotes(input){const targets=JSON.parse(requireResolved(input,"targets"));const media=JSON.parse(requireResolved(input,"media"));const at=input.resolved?.["at"];const text=postText(input);const notes=targets.map(t=>`\u6295\u7A3F\u5148: ${t.accountText}${t.defaulted==="1"?"\uFF08\u9023\u643A\u304C1\u4EF6\u306E\u305F\u3081\u81EA\u52D5\u3067\u9078\u3073\u307E\u3057\u305F\uFF09":
|
|
95
|
+
""}`);const thread=postThread(input);const xLimit=targets.find(t=>t.channel==="x")?.limit;const images=media.length===0?"\u306A\u3057":media.map(m=>m.name).join("\u3001");if(thread.length===0){notes.push(xLimit===void 0?`\u672C\u6587: ${charCount(text)} \u6587\u5B57\u300C${oneLine(text)}\u300D / \u753B\u50CF: ${images}`:`\u672C\u6587: ${countX(text)}/${xLimit}\uFF08X \u306E\u6570\u3048\u65B9\u30FB\u65E5\u672C\u8A9E\u306F1\u5B572\uFF09\u300C${oneLine(text)}\u300D / \u753B\u50CF: ${images}`)}else{
|
|
96
|
+
notes.push(`\u30B9\u30EC\u30C3\u30C9: ${thread.length+1} \u4EF6\uFF08\u6587\u5B57\u6570\u306F X \u306E\u6570\u3048\u65B9\u30FB\u4E0A\u9650 ${xLimit??X_TEXT_LIMIT}\uFF09 / \u753B\u50CF\uFF081\u4EF6\u76EE\uFF09: ${images}`);for(const[i,part]of[text,...thread].entries())notes.push(` ${i+1}\u4EF6\u76EE: ${countX(part)}/${xLimit??X_TEXT_LIMIT}\u300C${oneLine(part)}\u300D`)}const quote=postQuote(input);if(quote!==null)notes.push(`\u5F15\u7528\u3059\u308B\u6295\u7A3F: https://x.com/i/web/status/${quote}${thread.
|
|
97
|
+
length>0?"\uFF081\u4EF6\u76EE\u304C\u5F15\u7528\u306B\u306A\u308A\u307E\u3059\uFF09":""}`);notes.push(at===void 0?"\u3053\u306E\u3042\u3068: \u4E0B\u66F8\u304D\u3092\u4F5C\u308A"+(media.length>0?"\u3001\u753B\u50CF\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u7D10\u3065\u3051":"")+"\u3001\u3059\u3050\u306B\u6295\u7A3F\u3057\u307E\u3059\uFF08POST .../publish\uFF09\u3002":`\u3053\u306E\u3042\u3068: \u4E0B\u66F8\u304D\u3092\u4F5C\u308A${media.length>0?"\u3001\u753B\u50CF\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u7D10\u3065\u3051":
|
|
98
|
+
""}\u3001${at} \u306B\u4E88\u7D04\u3057\u307E\u3059\uFF08POST .../schedule\uFF09${input.resolved?.["atAssumedJst"]==="1"?"\u3002\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3\u306E\u7121\u3044 --at \u306F\u65E5\u672C\u6642\u9593\u3068\u3057\u3066\u6271\u3044\u307E\u3057\u305F":""}\u3002`);return notes},async preview(input,ctx){const count=postTargets(input).filter(t=>t.channel==="x").length;if(count===0)return{notes:[],warnings:[]};const price=await xPricing(ctx);const text=postText(input);const quoted=postQuote(
|
|
99
|
+
input)!==null;const withLink=URL_PATTERN.test(text);const thread=postThread(input);if(thread.length>0){const parts=[text,...thread];const each=parts.map((part,i)=>partCredits(price,part,quoted&&i===0));const total=each.reduce((sum,v)=>sum+v,0)*count;const notes2=[`X \u3078\u306E\u30B9\u30EC\u30C3\u30C9\u6295\u7A3F\uFF08${parts.length} \u4EF6${count>1?`\u30FB\u6295\u7A3F\u5148 ${count} \u4EF6`:""}\uFF09\u3067\u5408\u8A08 ${credits(total)} \u3092\u6D88\u8CBB\u3057\u307E\u3059\u3002`,...parts.map((part,i)=>`\
|
|
100
|
+
${i+1}\u4EF6\u76EE: ${credits(each[i])}${quoted&&i===0?"\uFF08\u26A0 \u5F15\u7528\u6295\u7A3F\u306E\u305F\u3081\u30EA\u30F3\u30AF\u4ED8\u304D\u6295\u7A3F\u306E\u5358\u4FA1\uFF09":URL_PATTERN.test(part)?"\uFF08\u26A0 URL \u304C\u3042\u308B\u305F\u3081\u30EA\u30F3\u30AF\u4ED8\u304D\u6295\u7A3F\u306E\u5358\u4FA1\uFF09":""}`)];if(URL_PATTERN.test(text)&&!quoted)notes2.push("\u26A0 1\u4EF6\u76EE\u306B URL \u304C\u3042\u308A\u307E\u3059\u3002URL \u30922\u4EF6\u76EE\u4EE5\u964D\u3078\u79FB\u3059\u30681\u4EF6\u76EE\u306F\u901A\u5E38\u306E\u5358\u4FA1\u306B\u306A\u308A\u307E\u3059\u3002");
|
|
101
|
+
return{notes:notes2,warnings:[]}}if(quoted){return{notes:[`\u26A0 \u5F15\u7528\u6295\u7A3F\u306F\u300C\u30EA\u30F3\u30AF\u4ED8\u304D\u6295\u7A3F\u300D\u306E\u5358\u4FA1\u3067 ${credits(price.postWithLink*count)} \u3092\u6D88\u8CBB\u3057\u307E\u3059\uFF08\u5F15\u7528\u3057\u306A\u3044\u901A\u5E38\u306E\u6295\u7A3F\u306A\u3089 ${credits(price.post*count)}\uFF09\u3002`],warnings:[]}}const notes=[withLink?`\u26A0 \u672C\u6587\u306B URL \u304C\u3042\u308B\u305F\u3081\u300C\u30EA\u30F3\u30AF\u4ED8\u304D\u6295\u7A3F\u300D\u3068\u3057\u3066 ${credits(
|
|
102
|
+
price.postWithLink*count)} \u3092\u6D88\u8CBB\u3057\u307E\u3059\uFF08\u30EA\u30F3\u30AF\u7121\u3057\u306A\u3089 ${credits(price.post*count)}\uFF09\u3002`:`X \u3078\u306E\u6295\u7A3F\u3067 ${credits(price.post*count)} \u3092\u6D88\u8CBB\u3057\u307E\u3059\uFF08\u672C\u6587\u306B URL \u3092\u5165\u308C\u308B\u3068 ${credits(price.postWithLink*count)}\uFF09\u3002`];return{notes,warnings:[]}},async execute(input,ctx){const created=items(await ctx.send(draftPlan(input)),"SNS\u6295\u7A3F\u306E\u4F5C\u6210");
|
|
103
|
+
if(created.length!==postTargets(input).length){for(const row of created)await discardDraft(ctx,row);throw new ApiResponseError("SNS\u6295\u7A3F\u306E\u4F5C\u6210\u306E\u5FDC\u7B54\u306E\u4EF6\u6570\u304C\u6295\u7A3F\u5148\u306E\u6570\u3068\u5408\u3044\u307E\u305B\u3093\u3002twp sns list --channel <\u30C1\u30E3\u30CD\u30EB> --status draft \u3067\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002")}const quote=postQuote(input);if(quote!==null&&created.some(row=>row["quote_tweet_id"]!==quote)){for(const row of created)
|
|
104
|
+
await discardDraft(ctx,row);throw new ApiResponseError("\u63A5\u7D9A\u5148\u306E\u30B5\u30FC\u30D0\u304C\u5F15\u7528\u6295\u7A3F\uFF08--quote\uFF09\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u306A\u3044\u305F\u3081\u3001\u6295\u7A3F\u305B\u305A\u306B\u6B62\u3081\u307E\u3057\u305F\u3002")}const latest=new Map(created.map(row=>[postId(row),row]));let rows=created;const at=input.resolved?.["at"];try{const media=JSON.parse(requireResolved(input,"media"));if(media.length>0){const ids=[];for(const m of media){
|
|
105
|
+
const{id,uploadUrl}=issued(await ctx.send({method:"POST",path:"/api/v2/sns/media/upload-url",body:{file_name:m.name,content_type:m.contentType,file_size:m.size}}));const bytes=new Uint8Array(fs.readFileSync(m.file));if(bytes.byteLength!==m.size)throw new UsageError(`\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u4E2D\u306B\u30D5\u30A1\u30A4\u30EB\u306E\u5927\u304D\u3055\u304C\u5909\u308F\u308A\u307E\u3057\u305F\uFF08${m.size} \u2192 ${bytes.byteLength} \u30D0\u30A4\u30C8\uFF09: ${m.file}`);await ctx.putSigned(
|
|
106
|
+
uploadUrl,bytes,m.contentType);ids.push(id)}rows=[];for(const row of created){const updated=dataRecord(await ctx.send({method:"PUT",path:`${POSTS_PATH}/${postId(row)}/media`,body:{attachment_ids:ids,expected_updated_at:row["updated_at"]??null}}),"\u753B\u50CF\u306E\u7D10\u3065\u3051");const next={...row,updated_at:updated["updated_at"]??row["updated_at"]};latest.set(postId(row),next);rows.push(next)}}}catch(error){for(const row of latest.values())await discardDraft(ctx,row);throw error}const results=[];
|
|
107
|
+
for(const row of rows){const id=postId(row);try{const sent=dataRecord(await ctx.send(at===void 0?{method:"POST",path:`${POSTS_PATH}/${id}/publish`,body:{expected_updated_at:row["updated_at"]??null}}:{method:"POST",path:`${POSTS_PATH}/${id}/schedule`,body:{scheduled_at:at,expected_updated_at:row["updated_at"]??null}}),at===void 0?"\u6295\u7A3F":"\u4E88\u7D04");results.push(sent)}catch(error){const rejected=error instanceof ApiError&&error.status>=400&&error.status<500;if(rejected)await discardDraft(
|
|
108
|
+
ctx,row);const failed={...row,status:"error",failure_reason:error.message,unsent:rejected};Object.defineProperty(failed,ERROR_KEY,{value:error,enumerable:false});results.push(failed)}}return{items:results,scheduled:at!==void 0,thread:postThread(input).length>0}},summarize:body=>items(body,"SNS\u6295\u7A3F").map(row=>postRow(row)),raw:body=>items(body,"SNS\u6295\u7A3F"),failures(body){return items(body,"SNS\u6295\u7A3F").filter(row=>row["status"]==="failed"||row["status"]==="error").map(row=>({target:`${channelName(
|
|
109
|
+
String(row["channel"]??""))}\uFF08${String(row["id"]??"")}\uFF09`,error:row[ERROR_KEY]??new ApiRejectedError(`\u6295\u7A3F\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${String(row["failure_reason"]??"\u7406\u7531\u4E0D\u660E")}`)}))},notes(body){const rows=items(body,"SNS\u6295\u7A3F");const notes=[];const multi=rows.length>1;for(const row of rows){const status=row["status"];const channel=str(row["channel"])??"x";const label=channelName(channel);const head=multi?`${label}: `:"";if(status===
|
|
110
|
+
"published")notes.push(`${head}\u6295\u7A3F\u3057\u307E\u3057\u305F: ${String(row["external_post_url"]??row["external_post_id"]??"")}`);else if(status==="scheduled"&&isRecord(body)&&body["scheduled"]===true)notes.push(`${head}${String(row["scheduled_at"])} \u306B\u4E88\u7D04\u3057\u307E\u3057\u305F\uFF08id: ${String(row["id"])}\uFF09\u3002`);else if(status==="scheduled"){notes.push(`\u26A0 ${head}\u4E00\u6642\u7684\u306A\u5931\u6557\u306E\u305F\u3081\u3001TWP \u304C ${String(row["scheduled_at"])}\
|
|
111
|
+
\u306B\u9001\u308A\u76F4\u3057\u307E\u3059\uFF08id: ${String(row["id"])}\uFF09\u3002twp sns list --channel ${channel} --status scheduled \u3067\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002`)}else if(status==="failed"||status==="error"&&row["unsent"]===true){if(multi)notes.push(`\u26A0 ${head}\u6295\u7A3F\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F: ${String(row["failure_reason"]??"\u7406\u7531\u4E0D\u660E")}`)}else if(status==="error"){notes.push(isRecord(body)&&body["scheduled"]===
|
|
112
|
+
true?`\u26A0 ${head}\u4E88\u7D04\u306E\u9001\u4FE1\u3067\u6B62\u307E\u308A\u307E\u3057\u305F\uFF08id: ${String(row["id"])}\uFF09\u3002\u4E88\u7D04\u304C\u6210\u7ACB\u3057\u3066\u3044\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\u3002\u6253\u3061\u76F4\u3059\u524D\u306B twp sns list --channel ${channel} --status scheduled \u3067\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002`:`\u26A0 ${head}\u6295\u7A3F\u306E\u9001\u4FE1\u3067\u6B62\u307E\u308A\u307E\u3057\u305F\uFF08id: ${String(
|
|
113
|
+
row["id"])}\uFF09\u3002${label} \u5074\u3067\u6295\u7A3F\u3055\u308C\u3066\u3044\u306A\u3044\u304B twp sns list --channel ${channel}${channel==="linkedin"?" --status all":""} \u3067\u78BA\u304B\u3081\u3066\u304F\u3060\u3055\u3044\u3002`)}const maybePartial=status==="failed"||status==="error"&&row["unsent"]!==true;if(maybePartial&&isRecord(body)&&body["thread"]===true&&body["scheduled"]!==true){notes.push(`\u26A0 \u30B9\u30EC\u30C3\u30C9\u304C\u9014\u4E2D\u3067\u6B62\u307E\u3063\u305F\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059\uFF08id: ${String(
|
|
114
|
+
row["id"])}\uFF09\u3002\u4F55\u4EF6\u76EE\u307E\u3067 X \u306B\u51FA\u305F\u304B\u3092 twp sns list --channel x --status all\uFF08TWP \u306E\u8A18\u9332\uFF09\u3068 twp sns list --channel x\uFF08X \u4E0A\u306E\u6295\u7A3F\uFF09\u3067\u78BA\u304B\u3081\u3066\u304B\u3089\u6253\u3061\u76F4\u3057\u3066\u304F\u3060\u3055\u3044\uFF08\u305D\u306E\u307E\u307E\u6253\u3061\u76F4\u3059\u3068\u3001\u51FA\u305F\u5206\u304C\u4E8C\u91CD\u306B\u6295\u7A3F\u3055\u308C\u307E\u3059\uFF09\u3002`)}}return notes}};var DELETE_USAGE="\
|
|
115
|
+
twp sns delete --channel <x|linkedin|facebook|instagram> <ID> [--account <ID|@\u540D\u524D>] --yes";var FACEBOOK_POST_ID=/^[0-9]{1,30}(_[0-9]{1,30})?$/;var INSTAGRAM_MEDIA_ID=/^[0-9]{1,30}$/;var EXTERNAL_ID={x:TWEET_ID,facebook:FACEBOOK_POST_ID,instagram:INSTAGRAM_MEDIA_ID};function externalDeletePath(input){const connection=segment(requireResolved(input,"connectionId"),"\u9023\u643AID");const id=segment(requireResolved(input,"id"),"\u6295\u7A3FID");switch(requireResolved(input,"kind")){case"fac\
|
|
116
|
+
ebook":return`${FACEBOOK_PATH}/connections/${connection}/posts/${id}`;case"instagram":return`${INSTAGRAM_PATH}/connections/${connection}/media/${id}`;default:return`${X_PATH}/connections/${connection}/tweets/${id}`}}var deleteOperation={name:"delete",summary:"SNS \u4E0A\u306E\u6295\u7A3F\u304B\u3001TWP \u306E\u4E0B\u66F8\u304D\u30FB\u4E88\u7D04\u3092\u524A\u9664\u3059\u308B\uFF08--yes \u304C\u5FC5\u8981\uFF09",usage:DELETE_USAGE,description:"ID \u306E\u5F62\u3067\u6D88\u3059\u3082\u306E\u304C\u5909\u308F\u308A\u307E\u3059\u3002\n SNS \u4E0A\u306E\u6295\u7A3F\u306E ID\uFF08twp sns list --channe\
|
|
117
|
+
l <\u30C1\u30E3\u30CD\u30EB> \u306E id\uFF09\u2026 SNS \u4E0A\u306E\u6295\u7A3F\u3092\u524A\u9664\u3057\u307E\u3059\uFF08\u53D6\u308A\u6D88\u305B\u307E\u305B\u3093\uFF09\n x \u306F\u6570\u5B57\uFF08\u30AF\u30EC\u30B8\u30C3\u30C8\u3092\u6D88\u8CBB\uFF09\u3001facebook \u306F\u300C\u30DA\u30FC\u30B8ID_\u6295\u7A3FID\u300D\u304B\u6570\u5B57\u3001instagram \u306F\u6570\u5B57\u3067\u3059\u3002\n UUID\uFF08twp sns list --channel <\u30C1\u30E3\u30CD\u30EB> --status \u2026 \u306E id\uFF09\u2026 TWP \u306E\u4E0B\u66F8\u304D\u30FB\u4E88\u7D04\u30FB\u5931\u6557\u3057\u305F\u6295\u7A3F\u3092\u524A\u9664\u3057\u307E\u3059\uFF08\u4E88\u7D04\u306E\u53D6\u308A\u6D88\u3057\uFF09\nLinkedIn \u306F SNS \u4E0A\u306E ID \u3092\u4F7F\u308F\u305A\u3001TWP \u306E\u6295\u7A3FID\uFF08UUID\uFF09\u3067\u6D88\u3057\u307E\u3059\u3002\u6295\u7A3F\u6E08\u307F\u306A\u3089 LinkedIn \u4E0A\u306E\u6295\u7A3F\u3068 TWP \u306E\u8A18\u9332\u306E\u4E21\u65B9\u3092\u6D88\u3057\u307E\u3059\n\uFF08TWP \u304B\u3089\u6295\u7A3F\u3057\u305F\u81EA\u5206\u306E\u6295\u7A3F\u3060\u3051\uFF09\u3002\nX\u30FBFacebook\u30DA\u30FC\u30B8\u30FBInstagram \u3067 TWP \u304B\u3089\u6295\u7A3F\u6E08\u307F\u306E\u8A18\u9332\uFF08status=published\uFF09\u306F TWP \u5074\u3067\u306F\u6D88\u305B\u307E\u305B\u3093\u3002SNS \u4E0A\u306E\u6295\u7A3F\n\uFF08external_post_id\uFF09\u3092\u6D88\u3057\u3066\u304F\u3060\u3055\u3044\uFF08TWP \u306E\u8A18\u9332\u3082\u4E00\u7DD2\u306B\u5916\u308C\u307E\u3059\uFF09\u3002\nFacebook\u30DA\u30FC\u30B8\u30FBInstagram \u306F\u7D44\u7E54\u3067\u5171\u6709\u3059\u308B\u9023\u643A\u3067\u3001\u5E83\u5831\u306E\u30E1\u30F3\u30D0\u30FC\u4EE5\u4E0A\u306E\u6A29\u9650\u304C\u8981\u308A\u307E\u3059\u3002",
|
|
112
118
|
destructive:true,confirmation:"\u6295\u7A3F\u3092\u524A\u9664\u3059\u308B\u64CD\u4F5C\uFF08SNS \u4E0A\u306E\u6295\u7A3F\u306F\u53D6\u308A\u6D88\u305B\u305A\u3001X \u306F\u30AF\u30EC\u30B8\u30C3\u30C8\u3092\u6D88\u8CBB\u3057\u307E\u3059\uFF09",flags:[CHANNEL_FLAG,ACCOUNT_FLAG,{name:"--id",summary:"\u6295\u7A3FID\uFF08\u4F4D\u7F6E\u5F15\u6570\u3068\u540C\u3058\u610F\u5473\uFF09",takesValue:true,placeholder:"<ID>"}],async prepare(input,ctx){const ref=singleRef(input,{flag:"--id",label:"\u6295\u7A3FID",
|
|
113
119
|
usage:DELETE_USAGE});const channel=oneChannel(input,DELETE_USAGE);const external=EXTERNAL_ID[channel];if(!UUID.test(ref)){if(external===void 0){throw new UsageError(`${channelName(channel)} \u306E\u6295\u7A3F\u306F TWP \u306E\u6295\u7A3FID\uFF08UUID\uFF09\u3067\u524A\u9664\u3057\u307E\u3059\uFF08\u53D7\u3051\u53D6\u3063\u305F\u5024: ${ref}\uFF09`,`twp sns list --channel ${channel} \u306E id \u3092\u6E21\u3057\u3066\u304F\u3060\u3055\u3044\u3002`)}if(!external.test(ref)){throw new UsageError(`\u6295\u7A3FI\
|
|
114
120
|
D ${ref} \u306F ${channelName(channel)} \u306E\u6295\u7A3FID \u3067\u3082 TWP \u306E\u6295\u7A3FID\uFF08UUID\uFF09\u3067\u3082\u3042\u308A\u307E\u305B\u3093`,DELETE_USAGE)}return withResolved(input,{kind:channel,id:ref,channel,...await resolveAccount(input,ctx,channel,DELETE_USAGE)})}if(input.flags.has("--account"))throw new UsageError("TWP \u306E\u6295\u7A3F\uFF08UUID\uFF09\u306E\u524A\u9664\u306B --account \u306F\u8981\u308A\u307E\u305B\u3093",DELETE_USAGE);const post=await ctx.resolver.snsJson(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { createRequire as __twpCreateRequire } from 'node:module';
|
|
2
2
|
const require = __twpCreateRequire(import.meta.url);
|
|
3
|
-
import{teamsDomain}from"./chunk-
|
|
3
|
+
import{teamsDomain}from"./chunk-ROAZEXMJ.js";import"./chunk-LJWU23D2.js";import"./chunk-K2TO4DFJ.js";import"./chunk-Q3B65OFC.js";import"./chunk-V5WDGX4S.js";import"./chunk-W4NLJ2YK.js";import"./chunk-BD7O73GK.js";import"./chunk-6NHLWYI2.js";import"./chunk-YJP4FUY4.js";import"./chunk-DYT22FTA.js";import"./chunk-7DCWZ2NF.js";import"./chunk-HCTPCUST.js";import"./chunk-STILP3Z6.js";import"./chunk-OKATZ4SN.js";import"./chunk-NHYMHCAT.js";
|
|
4
4
|
import"./chunk-VSJBJXZO.js";export{teamsDomain};
|