@appgrowstack/app-contract 0.0.0-stage → 0.1.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.md +5 -0
- package/LICENSE +21 -0
- package/README.md +50 -2
- package/dist/access.d.ts +746 -0
- package/dist/access.js +144 -0
- package/dist/audience.d.ts +34 -0
- package/dist/audience.js +44 -0
- package/dist/creatives.d.ts +313 -0
- package/dist/creatives.js +301 -0
- package/dist/d1.d.ts +4791 -0
- package/dist/d1.js +1227 -0
- package/dist/events.d.ts +16 -0
- package/dist/events.js +27 -0
- package/dist/generated/schema.d.ts +17173 -0
- package/dist/generated/schema.js +4 -0
- package/dist/http.d.ts +3362 -0
- package/dist/http.js +349 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +16 -0
- package/dist/ledger.d.ts +16 -0
- package/dist/ledger.js +21 -0
- package/dist/prices.d.ts +25 -0
- package/dist/prices.js +41 -0
- package/dist/registry.d.ts +7 -0
- package/dist/registry.js +8 -0
- package/dist/revenuecat.d.ts +5 -0
- package/dist/revenuecat.js +43 -0
- package/dist/reviews.d.ts +10 -0
- package/dist/reviews.js +11 -0
- package/dist/rpc.d.ts +929 -0
- package/dist/rpc.js +111 -0
- package/dist/sessions.d.ts +34 -0
- package/dist/sessions.js +78 -0
- package/dist/touch.d.ts +28 -0
- package/dist/touch.js +49 -0
- package/package.json +34 -4
package/dist/access.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
// 権限の表(docs/access-control.md の 4.3節・8節と docs/sessions.md の 8節)。core・CLI・console・テストが同じ物を読む。
|
|
2
|
+
// 実際の権限 = 組織の所属の役割の権限 ∪ そのプロジェクトの所属の役割の権限 ∩ トークンの scope ∩ トークンのプロジェクトの絞り。
|
|
3
|
+
// エージェント(agt_)は ai の列が上限で、表の役割に何を書いても ai を超えない。
|
|
4
|
+
// schema/access/permission.schema.json の列挙と、この表の名前は同じでなければならない(test/access.test.ts)
|
|
5
|
+
export const ROLES = ["owner", "admin", "editor", "support", "viewer", "billing"];
|
|
6
|
+
/** エージェントに付けられない役割(付けても確かめのときに外す) */
|
|
7
|
+
export const AGENT_FORBIDDEN_ROLES = ["owner", "admin", "billing"];
|
|
8
|
+
/** read 読む・create 作る・stop 止める・outward 外に出る・settings 設定 */
|
|
9
|
+
export const PERMISSION_GROUPS = ["read", "create", "stop", "outward", "settings"];
|
|
10
|
+
const Y = "yes";
|
|
11
|
+
const N = "no";
|
|
12
|
+
function roles(owner, admin, editor, support, viewer, billing = N) {
|
|
13
|
+
return { owner, admin, editor, support, viewer, billing };
|
|
14
|
+
}
|
|
15
|
+
export const permissions = {
|
|
16
|
+
// --- 読む ---------------------------------------------------------------
|
|
17
|
+
"registry.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: null, note: "一覧・詳細・export・doctor・health・承認待ちの一覧(KD-1)" },
|
|
18
|
+
"campaigns.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: 1, note: "組の履歴・simulate の数・件ごとの結果(KD-2)" },
|
|
19
|
+
"notify.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: 1, note: "案・施策・週の流れの結果・preview の数・配信の数(KD-3)" },
|
|
20
|
+
"links.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: 1, note: "リンク・押された数・流入元ごとの数(KD-5)" },
|
|
21
|
+
"people.aggregate.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: 1, note: "段階1: 数だけ(人の数・KD-4 の summary)" },
|
|
22
|
+
"people.person.read": { group: "read", roles: roles(Y, Y, Y, Y, N), ai: "local_only", approval: "audit", level: 2, note: "段階2: 人ごとの値・explain の跡・人の検索(KD-4 の find)" },
|
|
23
|
+
"support.aggregate.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: 1, note: "段階1: 問い合わせの数だけ(MG-5 の summary)。本文と端末の文脈は入れない" },
|
|
24
|
+
"support.ticket.list": { group: "read", roles: roles(Y, Y, N, Y, N), ai: "yes", approval: "none", level: 2, note: "段階2: 状態・端末の文脈・題の無い一覧" },
|
|
25
|
+
"support.ticket.read": { group: "read", roles: roles(Y, N, N, Y, N), ai: "local_only", approval: "audit_each", level: 3, note: "段階3: 本文・下書き" },
|
|
26
|
+
"support.attachment.read": { group: "read", roles: roles(Y, N, N, Y, N), ai: "local_only", approval: "audit_each", level: 3, note: "段階3: 添付の画像" },
|
|
27
|
+
"support.review.read": { group: "read", roles: roles(Y, Y, N, Y, N), ai: "yes", approval: "audit", level: 2, note: "K11: ストアのレビューと下書き。文はストアで公開だが利用者が書いた物なので段階2で監査に残す。書いた人の名前は持たない" },
|
|
28
|
+
"support.feedback.read": { group: "read", roles: roles(Y, Y, N, Y, N), ai: "local_only", approval: "audit_each", level: 3, note: "段階3: アンケートの文の話題ごとの数と例の文(人の id は返さない)" },
|
|
29
|
+
"audit.read": { group: "read", roles: roles(Y, Y, N, N, N), ai: "yes", approval: "none", level: null, note: "audit_event の一覧" },
|
|
30
|
+
"access.approval.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: null, note: "承認の依頼の一覧と1件(app-playbook の Worker が5分ごとに読む)。access-control.md 9.1節の「access.approval の一覧を読む」を操作の名前にした" },
|
|
31
|
+
"access.member.read": { group: "read", roles: roles(Y, N, N, N, N), ai: "no", approval: "none", level: null, note: "メンバーの一覧(listMembers)。書く操作(access.member.write)と分け、人が2人以上の組織でも一覧が承認の依頼にならない" },
|
|
32
|
+
"access.agent.read": { group: "read", roles: roles(Y, N, N, N, N), ai: "no", approval: "none", level: null, note: "エージェントの一覧(listAgents)" },
|
|
33
|
+
"sessions.aggregate.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: 1, note: "R8: マップ・流れ・つまずく所の表・週のまとめ" },
|
|
34
|
+
"sessions.person.read": { group: "read", roles: roles(Y, Y, Y, Y, N), ai: "local_only", approval: "audit", level: 2, note: "R8: 1人のセッションの出来事の列・マーク・要約・一覧" },
|
|
35
|
+
"sessions.replay.read": { group: "read", roles: roles(Y, N, N, Y, N), ai: "local_only", approval: "audit_each", level: 3, note: "R8: 録画のコマを見る・書き出す・代表のコマ" },
|
|
36
|
+
"sessions.live.watch": { group: "read", roles: roles(Y, N, N, Y, N), ai: "no", approval: "audit_each", level: 3, note: "R8: ライブを頼む・見る" },
|
|
37
|
+
"config.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: 1, note: "R9: 組の履歴・実験ごとの数(ConfigReport)" },
|
|
38
|
+
"releases.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: 1, note: "R11: バージョンの一覧と1つ・タイムライン・requires の解決・変更の一覧" },
|
|
39
|
+
"creatives.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: 1, note: "R12: 撮影の組・デザイントークン・ページ・ストアの文字・案・実験・数・タグの効果・キーワード・手で行う手順・週の流れ・参考の素材。仮説と学んだことは ledger.read" },
|
|
40
|
+
"insights.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: 1, note: "R13: 指標の値と前後・検知・指摘・週の表(数だけ。人ごとの行は返さない)" },
|
|
41
|
+
"insights.sql": { group: "read", roles: roles(Y, Y, Y, N, Y), ai: "yes", approval: "audit_each", level: 3, note: "R13: データレイクへの読むだけの SQL。1回ごとに insights_query と監査に残す。トークンに絞って出す" },
|
|
42
|
+
"ledger.read": { group: "read", roles: roles(Y, Y, Y, Y, Y), ai: "yes", approval: "none", level: 1, note: "R13: 仮説の記録(仮説・つながり・学んだこと・ナレッジの検索)" },
|
|
43
|
+
// --- 作る ---------------------------------------------------------------
|
|
44
|
+
"links.create": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "" },
|
|
45
|
+
"registry.device.write": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "本人とテスターの端末" },
|
|
46
|
+
"support.redraft": { group: "create", roles: roles(Y, N, N, Y, N), ai: "yes", approval: "audit", level: null, note: "AI の下書きを作り直させる(問い合わせ・ストアのレビュー)" },
|
|
47
|
+
"sessions.summarize": { group: "create", roles: roles(Y, Y, Y, Y, N), ai: "yes", approval: "audit", level: 2, note: "R8: 要約を作らせる(お金がかかる)" },
|
|
48
|
+
"sessions.keep": { group: "create", roles: roles(Y, Y, Y, Y, N), ai: "yes", approval: "audit", level: 2, note: "R8: 長く残す" },
|
|
49
|
+
"releases.sync": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R11: ストアの同期をすぐ回す。ストアは読むだけ" },
|
|
50
|
+
"releases.manifest.push": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R11: ビルドのマニフェストを送る。解決が変わった組は core が作り、監査は sys:releases" },
|
|
51
|
+
"releases.change.write": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R11: 変更を作る・直す・判定の結果を書く・消す" },
|
|
52
|
+
"creatives.capture.write": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R12: 撮影の組を作る・上げ終える" },
|
|
53
|
+
"creatives.brand.write": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R12: デザイントークンと声の決まりを送る・フォントと素材を上げる" },
|
|
54
|
+
"creatives.page.write": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R12: 既定のページ・CPP・Play のカスタムの掲載を登録する" },
|
|
55
|
+
"creatives.text.write": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R12: ストアの文字の案を足す・落とす" },
|
|
56
|
+
"creatives.variant.generate": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R12: 案を作らせる(お金がかかる。予算で止めている時は 409 budget_stop)" },
|
|
57
|
+
"creatives.keyword.sync": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R12: キーワードの人気度をすぐ読む" },
|
|
58
|
+
"creatives.step.complete": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R12: 手で行う手順の結果を書く" },
|
|
59
|
+
"creatives.run": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R12: 週の流れをすぐ回す" },
|
|
60
|
+
"creatives.reference.write": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R12: 参考の素材を足す・ファイルを上げる・メモとタグとつなぐ先を直す。外に何も出さない" },
|
|
61
|
+
"insights.collect": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R13: 外の数の取り込みをすぐ回す" },
|
|
62
|
+
"ledger.write": { group: "create", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R13: 仮説を足す・直す・当てた日を書く・学んだことを足す。outcome は書けない" },
|
|
63
|
+
// --- 止める -------------------------------------------------------------
|
|
64
|
+
"campaigns.stop": { group: "stop", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "notify_after", level: null, note: "" },
|
|
65
|
+
"notify.campaign.stop": { group: "stop", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "notify_after", level: null, note: "" },
|
|
66
|
+
"notify.variant.reject": { group: "stop", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "notify_after", level: null, note: "" },
|
|
67
|
+
"notify.variant.retire": { group: "stop", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "notify_after", level: null, note: "" },
|
|
68
|
+
"support.resolve": { group: "stop", roles: roles(Y, N, N, Y, N), ai: "yes", approval: "audit", level: null, note: "" },
|
|
69
|
+
"support.draft.reject": { group: "stop", roles: roles(Y, N, N, Y, N), ai: "yes", approval: "audit", level: null, note: "下書きを却下する(rejectDraft・rejectReviewDraft)。access-control.md 4.3節に無かった道に名前を付けた" },
|
|
70
|
+
"config.stop": { group: "stop", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "notify_after", level: null, note: "R9: 実験を外した新しいバージョンを足す" },
|
|
71
|
+
"creatives.variant.write": { group: "stop", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R12: 案を落とす・下ろす" },
|
|
72
|
+
"creatives.test.stop": { group: "stop", roles: roles(Y, Y, Y, N, N), ai: "yes", approval: "audit", level: null, note: "R12: 実験を止める" },
|
|
73
|
+
// --- 外に出る -----------------------------------------------------------
|
|
74
|
+
"campaigns.push": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "request", approval: "approval", level: null, note: "本番の core。staging は承認の決まりが「なし」" },
|
|
75
|
+
"campaigns.resume": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "request", approval: "approval", level: null, note: "" },
|
|
76
|
+
"campaigns.rollback": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "request", approval: "approval", level: null, note: "" },
|
|
77
|
+
"notify.variant.approve": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "queue", approval: "approval", level: null, note: "AI の依頼=案を作る(持ち物の待ち行列)" },
|
|
78
|
+
"notify.campaign.resume": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "request", approval: "approval", level: null, note: "" },
|
|
79
|
+
"support.reply": { group: "outward", roles: roles(Y, N, N, Y, N), ai: "queue", approval: "approval", level: null, note: "下書きの approve・自分で返す。AI の依頼=下書き(持ち物の待ち行列)" },
|
|
80
|
+
"support.review.reply": { group: "outward", roles: roles(Y, N, N, Y, N), ai: "request", approval: "approval", level: null, note: "K11: ストアのレビューに返事を送る(下書きの approve)。ストアで公開されるので、エージェントが呼ぶと 202 の依頼になり、本人が承認した本文だけが出る" },
|
|
81
|
+
"help.push": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "request", approval: "approval", level: null, note: "ヘルプの記事の索引" },
|
|
82
|
+
"sessions.policy.push": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "request", approval: "approval", level: null, note: "R8: マニフェストを送る(全部の端末の撮る・隠す・送る量が変わる)" },
|
|
83
|
+
"config.push": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "request", approval: "approval", level: null, note: "R9: 組を送る(全部の端末の値が変わる)" },
|
|
84
|
+
"creatives.text.approve": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "queue", approval: "approval", level: null, note: "R12: ストアの文字を承認して公開する。AI の依頼=文字の案を作る(持ち物の待ち行列)" },
|
|
85
|
+
"creatives.variant.approve": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "queue", approval: "approval", level: null, note: "R12: 素材の案を承認して公開する。AI の依頼=案を作る(持ち物の待ち行列)" },
|
|
86
|
+
"creatives.test.write": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "queue", approval: "approval", level: null, note: "R12: 実験を決めて始める(広告とストアのページの配り方が変わる)" },
|
|
87
|
+
"creatives.submit": { group: "outward", roles: roles(Y, Y, N, N, N), ai: "queue", approval: "step_up", level: null, note: "R12: CPP・イベント・素材・PPO の treatment を審査に出す。本人の確認つき" },
|
|
88
|
+
"insights.finding.decide": { group: "outward", roles: roles(Y, Y, Y, N, N), ai: "request", approval: "approval", level: null, note: "R13: 指摘を採る・却下・後で。採ると仮説を作り、基盤の操作の依頼を出す。エージェントは 202 で承認を通す" },
|
|
89
|
+
// --- 設定 ---------------------------------------------------------------
|
|
90
|
+
"registry.project.create": { group: "settings", roles: roles(Y, Y, N, N, N), ai: "request", approval: "step_up", level: null, note: "" },
|
|
91
|
+
"registry.project.update": { group: "settings", roles: roles(Y, Y, N, N, N), ai: "request", approval: "step_up", level: null, note: "features・status・web_domain・support_email" },
|
|
92
|
+
"registry.app.write": { group: "settings", roles: roles(Y, Y, N, N, N), ai: "request", approval: "step_up", level: null, note: "" },
|
|
93
|
+
"registry.budget.write": { group: "settings", roles: roles(Y, Y, N, N, N), ai: "request", approval: "step_up", level: null, note: "" },
|
|
94
|
+
"keys.create": { group: "settings", roles: roles(Y, Y, N, N, N), ai: "request", approval: "step_up", level: null, note: "pk_・sk_" },
|
|
95
|
+
"keys.revoke": { group: "settings", roles: roles(Y, Y, N, N, N), ai: "request", approval: "step_up", level: null, note: "pk_・sk_" },
|
|
96
|
+
"people.forget": { group: "settings", roles: roles(Y, N, N, Y, N), ai: "request", approval: "step_up", level: 2, note: "管理の道からの手での削除。利用者の操作の forget(RPC)は承認を通さない" },
|
|
97
|
+
"access.member.write": { group: "settings", roles: roles(Y, N, N, N, N), ai: "no", approval: "step_up", level: null, note: "" },
|
|
98
|
+
"access.agent.write": { group: "settings", roles: roles(Y, N, N, N, N), ai: "no", approval: "step_up", level: null, note: "" },
|
|
99
|
+
"access.token.issue": { group: "settings", roles: roles(Y, N, N, N, N), ai: "request_own", approval: "step_up", level: null, note: "" },
|
|
100
|
+
"access.token.revoke": { group: "settings", roles: roles(Y, N, N, N, N), ai: "own_only", approval: "audit", level: null, note: "" },
|
|
101
|
+
"access.approval.decide": { group: "settings", roles: roles(Y, "if_permitted", "if_permitted", "if_permitted", N), ai: "no", approval: "human_step_up", level: null, note: "依頼の操作の権限を持つ、本人の確認つきの人だけ。依頼した主体と別(1人の組織は self_approved)" },
|
|
102
|
+
"access.policy.write": { group: "settings", roles: roles(Y, N, N, N, N), ai: "no", approval: "step_up", level: null, note: "承認の決まり(AccessPolicy)" },
|
|
103
|
+
"billing.manage": { group: "settings", roles: roles(Y, N, N, N, N, Y), ai: "no", approval: "after_sale", level: null, note: "access-control.md の billing.*。売った後に作る" },
|
|
104
|
+
};
|
|
105
|
+
export const PERMISSION_NAMES = Object.keys(permissions);
|
|
106
|
+
/** 人のデータの段階3(本文・録画・データレイクの SQL)の操作。schema/access/permission.schema.json の $defs.level3Permission と同じ並び */
|
|
107
|
+
export const LEVEL3_PERMISSIONS = PERMISSION_NAMES.filter((n) => permissions[n].level === 3);
|
|
108
|
+
/**
|
|
109
|
+
* トークンの scope がその操作を許すか(docs/design/access.md 4.1節)。役割とエージェントの上限は別に見る。
|
|
110
|
+
* - 段階1・2と人のデータに触れない操作: scopes が null(役割に従う)か、一覧にあれば許す
|
|
111
|
+
* - 段階3: scopes が null でも役割からは付かない。scopes の一覧か level3_scopes に書いた時だけ許す
|
|
112
|
+
*/
|
|
113
|
+
export function tokenAllows(token, name) {
|
|
114
|
+
if (permissions[name].level === 3)
|
|
115
|
+
return (token.scopes ?? []).includes(name) || (token.level3_scopes ?? []).includes(name);
|
|
116
|
+
return token.scopes === null || token.scopes.includes(name);
|
|
117
|
+
}
|
|
118
|
+
/** 承認を通す操作(approval の列が approval・step_up・human_step_up)。役割に関係なく、本人の確認つきの人が直接するか、依頼を承認する */
|
|
119
|
+
export function needsApproval(name) {
|
|
120
|
+
const a = permissions[name].approval;
|
|
121
|
+
return a === "approval" || a === "step_up" || a === "human_step_up";
|
|
122
|
+
}
|
|
123
|
+
/** 本人の確認の無い主体(エージェント)が呼ぶと、core が実行せずに 202 PendingApproval を返す操作(ai が request・request_own) */
|
|
124
|
+
export function mayReturnPendingApproval(name) {
|
|
125
|
+
const ai = permissions[name].ai;
|
|
126
|
+
return ai === "request" || ai === "request_own";
|
|
127
|
+
}
|
|
128
|
+
/** 役割がその操作をできるか(if_permitted は呼び手が依頼の操作の権限を持つかを別に見る) */
|
|
129
|
+
export function roleGrant(role, name) {
|
|
130
|
+
return permissions[name].roles[role];
|
|
131
|
+
}
|
|
132
|
+
/** 主体の種類。端末は記録の主体にしない */
|
|
133
|
+
export const PRINCIPAL_KINDS = ["user", "agent", "service", "system"];
|
|
134
|
+
/** 監査の via(どの証で来たか)。legacy は前の inapp_audit_log から1回だけ移した行(principal_id は前の文字列のまま) */
|
|
135
|
+
export const AUDIT_VIA = ["access_email", "user_token", "agent_token", "server_key", "binding", "system", "legacy"];
|
|
136
|
+
/** マイグレーション 0301 が入れる最初の組織(本人の5本) */
|
|
137
|
+
/** 本人の組織。id はマイグレーション 0301 で入れた物で変えない。slug は URL に出る(0503 で self から替えた) */
|
|
138
|
+
export const OWNER_ORG = { id: "org_self000000000000", slug: "taniguchi-kyoichi" };
|
|
139
|
+
/** 中の処理の主体(sys:<名前>) */
|
|
140
|
+
export const SYSTEM_PRINCIPALS = ["sys:support-drafter", "sys:notify-weekly", "sys:core-cron", "sys:session-summarizer", "sys:releases", "sys:creatives", "sys:creatives-weekly", "sys:insights-daily"];
|
|
141
|
+
/** 承認の URL(KD-8)。承認の画面は console だけに置く(core に画面を作らない) */
|
|
142
|
+
export function approvalUrl(org, approvalId, host = "console.appgrowstack.com") {
|
|
143
|
+
return `https://${host}/${org}/approvals/${approvalId}`;
|
|
144
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Audience, BuildChannel } from "./generated/schema.js";
|
|
2
|
+
export declare const AUDIENCES: readonly ["real", "owner", "test", "review", "robot"];
|
|
3
|
+
/** 自動の見分け(channel・ネットワーク・テスターのマーク)。owner は本人のマークだけが付ける */
|
|
4
|
+
export type AutoAudience = Exclude<Audience, "owner">;
|
|
5
|
+
/**
|
|
6
|
+
* Apple の AS。ここから来た端末は審査(App Review)とみなす(review)。出典は PeeringDB の各 AS の記録(2026-11-22 に確かめた)
|
|
7
|
+
* - AS714 Apple Inc. https://www.peeringdb.com/asn/714
|
|
8
|
+
* - AS6185 Apple CDN https://www.peeringdb.com/asn/6185
|
|
9
|
+
* iCloud プライベートリレーの出口は Akamai・Cloudflare・Fastly の AS なので、ここに入らない
|
|
10
|
+
*/
|
|
11
|
+
export declare const APPLE_ASNS: ReadonlySet<number>;
|
|
12
|
+
/**
|
|
13
|
+
* Google の AS。ここから来た端末はロボット(Google Play の公開前テスト・Firebase Test Lab の端末)とみなす(robot)。
|
|
14
|
+
* 出典は PeeringDB の各 AS の記録(2026-11-22 に確かめた)
|
|
15
|
+
* - AS15169 Google LLC https://www.peeringdb.com/asn/15169
|
|
16
|
+
* - AS396982 Google Cloud https://www.peeringdb.com/asn/396982
|
|
17
|
+
* - AS19527 Google Cloud https://www.peeringdb.com/asn/19527
|
|
18
|
+
* - AS36040 Google LLC https://www.peeringdb.com/asn/36040
|
|
19
|
+
* - AS43515 Google LLC https://www.peeringdb.com/asn/43515
|
|
20
|
+
* - AS139070 Google Cloud Korea https://www.peeringdb.com/asn/139070
|
|
21
|
+
* - AS16550 Google Private Cloud https://www.peeringdb.com/asn/16550
|
|
22
|
+
* Test Lab の端末の IP の範囲(https://firebase.google.com/docs/test-lab/android/get-started#ip-blocks)は AS15169 の中にある。
|
|
23
|
+
* Google Fiber(AS16591)は家の回線なので入れない
|
|
24
|
+
*/
|
|
25
|
+
export declare const GOOGLE_ASNS: ReadonlySet<number>;
|
|
26
|
+
/** 通信の AS 番号からの見分け。どちらでもなければ null */
|
|
27
|
+
export declare function networkAudience(asn: number | null | undefined): "review" | "robot" | null;
|
|
28
|
+
/** ビルドの出どころからの見分け。debug・testflight・play_test は test */
|
|
29
|
+
export declare function channelAudience(channel: BuildChannel | string | null | undefined): "test" | "real";
|
|
30
|
+
/**
|
|
31
|
+
* 2つの見分けの強い方。owner > robot・review > test > real。robot と review は同じ強さで、先に付いた方(a)を残す。
|
|
32
|
+
* 一度 real でなくなった人は real に戻らない(自動の見分けはこの関数で重ねるだけ)
|
|
33
|
+
*/
|
|
34
|
+
export declare function strongerAudience<A extends Audience>(a: A, b: A): A;
|
package/dist/audience.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export const AUDIENCES = ["real", "owner", "test", "review", "robot"];
|
|
2
|
+
/**
|
|
3
|
+
* Apple の AS。ここから来た端末は審査(App Review)とみなす(review)。出典は PeeringDB の各 AS の記録(2026-11-22 に確かめた)
|
|
4
|
+
* - AS714 Apple Inc. https://www.peeringdb.com/asn/714
|
|
5
|
+
* - AS6185 Apple CDN https://www.peeringdb.com/asn/6185
|
|
6
|
+
* iCloud プライベートリレーの出口は Akamai・Cloudflare・Fastly の AS なので、ここに入らない
|
|
7
|
+
*/
|
|
8
|
+
export const APPLE_ASNS = new Set([714, 6185]);
|
|
9
|
+
/**
|
|
10
|
+
* Google の AS。ここから来た端末はロボット(Google Play の公開前テスト・Firebase Test Lab の端末)とみなす(robot)。
|
|
11
|
+
* 出典は PeeringDB の各 AS の記録(2026-11-22 に確かめた)
|
|
12
|
+
* - AS15169 Google LLC https://www.peeringdb.com/asn/15169
|
|
13
|
+
* - AS396982 Google Cloud https://www.peeringdb.com/asn/396982
|
|
14
|
+
* - AS19527 Google Cloud https://www.peeringdb.com/asn/19527
|
|
15
|
+
* - AS36040 Google LLC https://www.peeringdb.com/asn/36040
|
|
16
|
+
* - AS43515 Google LLC https://www.peeringdb.com/asn/43515
|
|
17
|
+
* - AS139070 Google Cloud Korea https://www.peeringdb.com/asn/139070
|
|
18
|
+
* - AS16550 Google Private Cloud https://www.peeringdb.com/asn/16550
|
|
19
|
+
* Test Lab の端末の IP の範囲(https://firebase.google.com/docs/test-lab/android/get-started#ip-blocks)は AS15169 の中にある。
|
|
20
|
+
* Google Fiber(AS16591)は家の回線なので入れない
|
|
21
|
+
*/
|
|
22
|
+
export const GOOGLE_ASNS = new Set([15169, 396982, 19527, 36040, 43515, 139070, 16550]);
|
|
23
|
+
/** 通信の AS 番号からの見分け。どちらでもなければ null */
|
|
24
|
+
export function networkAudience(asn) {
|
|
25
|
+
if (asn === null || asn === undefined)
|
|
26
|
+
return null;
|
|
27
|
+
if (APPLE_ASNS.has(asn))
|
|
28
|
+
return "review";
|
|
29
|
+
if (GOOGLE_ASNS.has(asn))
|
|
30
|
+
return "robot";
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
/** ビルドの出どころからの見分け。debug・testflight・play_test は test */
|
|
34
|
+
export function channelAudience(channel) {
|
|
35
|
+
return channel === "debug" || channel === "testflight" || channel === "play_test" ? "test" : "real";
|
|
36
|
+
}
|
|
37
|
+
const RANK = { real: 0, test: 1, review: 2, robot: 2, owner: 3 };
|
|
38
|
+
/**
|
|
39
|
+
* 2つの見分けの強い方。owner > robot・review > test > real。robot と review は同じ強さで、先に付いた方(a)を残す。
|
|
40
|
+
* 一度 real でなくなった人は real に戻らない(自動の見分けはこの関数で重ねるだけ)
|
|
41
|
+
*/
|
|
42
|
+
export function strongerAudience(a, b) {
|
|
43
|
+
return RANK[b] > RANK[a] ? b : a;
|
|
44
|
+
}
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import type { CaptureFile, CreateCreativeAssetUploadRequest, CreativeDevice, CreativeLayout } from "./generated/schema.js";
|
|
2
|
+
export interface CreativeSize {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}
|
|
6
|
+
export interface CreativeSurfaceRule {
|
|
7
|
+
store: "app_store" | "play";
|
|
8
|
+
/** 描画に使うテンプレート */
|
|
9
|
+
layouts: readonly CreativeLayout[];
|
|
10
|
+
/** 端末ごとの寸法。比率だけが決まっている面は空で、ratio を見る */
|
|
11
|
+
sizes: Partial<Record<CreativeDevice, CreativeSize>>;
|
|
12
|
+
/** 寸法の決まっていない面の比率(幅:高さ) */
|
|
13
|
+
ratio: string | null;
|
|
14
|
+
/** 1つの言語・端末あたりの枚数 */
|
|
15
|
+
min: number;
|
|
16
|
+
max: number;
|
|
17
|
+
format: "jpeg" | "png" | "mp4";
|
|
18
|
+
/** 動画の長さ(秒) */
|
|
19
|
+
seconds: {
|
|
20
|
+
min: number;
|
|
21
|
+
max: number;
|
|
22
|
+
} | null;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 面ごとの寸法・枚数・形式。App Store は iPhone 6.9インチと iPad 13インチを描画し、6.3インチは ASC が求める時だけ 6.9インチから縮めて作る。
|
|
26
|
+
* スクリーンショットは透明を持たないので品質95の JPEG。ヘッダーは PNG で出し、Containers で透明を外す
|
|
27
|
+
*/
|
|
28
|
+
export declare const creativeSurfaces: {
|
|
29
|
+
readonly screenshots: {
|
|
30
|
+
readonly store: "app_store";
|
|
31
|
+
readonly layouts: readonly ["caption_top", "caption_bottom", "hero_full_ui", "panorama"];
|
|
32
|
+
readonly sizes: {
|
|
33
|
+
readonly iphone_69: {
|
|
34
|
+
readonly width: 1320;
|
|
35
|
+
readonly height: 2868;
|
|
36
|
+
};
|
|
37
|
+
readonly iphone_63: {
|
|
38
|
+
readonly width: 1206;
|
|
39
|
+
readonly height: 2622;
|
|
40
|
+
};
|
|
41
|
+
readonly ipad_13: {
|
|
42
|
+
readonly width: 2064;
|
|
43
|
+
readonly height: 2752;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
readonly ratio: null;
|
|
47
|
+
readonly min: 1;
|
|
48
|
+
readonly max: 10;
|
|
49
|
+
readonly format: "jpeg";
|
|
50
|
+
readonly seconds: null;
|
|
51
|
+
};
|
|
52
|
+
readonly app_preview: {
|
|
53
|
+
readonly store: "app_store";
|
|
54
|
+
readonly layouts: readonly ["caption_overlay"];
|
|
55
|
+
readonly sizes: {
|
|
56
|
+
readonly iphone_69: {
|
|
57
|
+
readonly width: 886;
|
|
58
|
+
readonly height: 1920;
|
|
59
|
+
};
|
|
60
|
+
readonly ipad_13: {
|
|
61
|
+
readonly width: 1200;
|
|
62
|
+
readonly height: 1600;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
readonly ratio: null;
|
|
66
|
+
readonly min: 1;
|
|
67
|
+
readonly max: 3;
|
|
68
|
+
readonly format: "mp4";
|
|
69
|
+
readonly seconds: {
|
|
70
|
+
readonly min: 15;
|
|
71
|
+
readonly max: 30;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
readonly header: {
|
|
75
|
+
readonly store: "app_store";
|
|
76
|
+
readonly layouts: readonly ["header"];
|
|
77
|
+
readonly sizes: {};
|
|
78
|
+
readonly ratio: "3840:1646";
|
|
79
|
+
readonly min: 1;
|
|
80
|
+
readonly max: 1;
|
|
81
|
+
readonly format: "png";
|
|
82
|
+
readonly seconds: null;
|
|
83
|
+
};
|
|
84
|
+
readonly search: {
|
|
85
|
+
readonly store: "app_store";
|
|
86
|
+
readonly layouts: readonly ["search"];
|
|
87
|
+
readonly sizes: {};
|
|
88
|
+
readonly ratio: "3:2";
|
|
89
|
+
readonly min: 1;
|
|
90
|
+
readonly max: 1;
|
|
91
|
+
readonly format: "png";
|
|
92
|
+
readonly seconds: null;
|
|
93
|
+
};
|
|
94
|
+
readonly event_card: {
|
|
95
|
+
readonly store: "app_store";
|
|
96
|
+
readonly layouts: readonly ["event_card"];
|
|
97
|
+
readonly sizes: {};
|
|
98
|
+
readonly ratio: "16:9";
|
|
99
|
+
readonly min: 1;
|
|
100
|
+
readonly max: 1;
|
|
101
|
+
readonly format: "jpeg";
|
|
102
|
+
readonly seconds: null;
|
|
103
|
+
};
|
|
104
|
+
readonly event_detail: {
|
|
105
|
+
readonly store: "app_store";
|
|
106
|
+
readonly layouts: readonly ["event_detail"];
|
|
107
|
+
readonly sizes: {};
|
|
108
|
+
readonly ratio: "9:16";
|
|
109
|
+
readonly min: 1;
|
|
110
|
+
readonly max: 1;
|
|
111
|
+
readonly format: "jpeg";
|
|
112
|
+
readonly seconds: null;
|
|
113
|
+
};
|
|
114
|
+
readonly play_phone: {
|
|
115
|
+
readonly store: "play";
|
|
116
|
+
readonly layouts: readonly ["play_phone"];
|
|
117
|
+
readonly sizes: {
|
|
118
|
+
readonly android_phone: {
|
|
119
|
+
readonly width: 1080;
|
|
120
|
+
readonly height: 1920;
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
readonly ratio: null;
|
|
124
|
+
readonly min: 2;
|
|
125
|
+
readonly max: 8;
|
|
126
|
+
readonly format: "jpeg";
|
|
127
|
+
readonly seconds: null;
|
|
128
|
+
};
|
|
129
|
+
readonly feature_graphic: {
|
|
130
|
+
readonly store: "play";
|
|
131
|
+
readonly layouts: readonly ["feature_graphic"];
|
|
132
|
+
readonly sizes: {
|
|
133
|
+
readonly android_phone: {
|
|
134
|
+
readonly width: 1024;
|
|
135
|
+
readonly height: 500;
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
readonly ratio: null;
|
|
139
|
+
readonly min: 1;
|
|
140
|
+
readonly max: 1;
|
|
141
|
+
readonly format: "png";
|
|
142
|
+
readonly seconds: null;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
export interface StoreTextFieldRule {
|
|
146
|
+
stores: readonly ("app_store" | "play")[];
|
|
147
|
+
/** 上限 */
|
|
148
|
+
max: number;
|
|
149
|
+
/** graphemes は Intl.Segmenter の書記素、bytes は UTF-8 */
|
|
150
|
+
count: "graphemes" | "bytes";
|
|
151
|
+
/** version はバージョンと一緒に審査・none は審査なしですぐ出る・google は Google の審査・event はイベントごとの審査 */
|
|
152
|
+
review: "version" | "none" | "google" | "event";
|
|
153
|
+
}
|
|
154
|
+
/** 欄ごとの上限・数え方・審査(docs/design/creatives.md 11.1節)。name と description の Play は Google の審査 */
|
|
155
|
+
export declare const creativeFields: {
|
|
156
|
+
readonly name: {
|
|
157
|
+
readonly stores: readonly ["app_store", "play"];
|
|
158
|
+
readonly max: 30;
|
|
159
|
+
readonly count: "graphemes";
|
|
160
|
+
readonly review: "version";
|
|
161
|
+
};
|
|
162
|
+
readonly subtitle: {
|
|
163
|
+
readonly stores: readonly ["app_store"];
|
|
164
|
+
readonly max: 30;
|
|
165
|
+
readonly count: "graphemes";
|
|
166
|
+
readonly review: "version";
|
|
167
|
+
};
|
|
168
|
+
readonly keywords: {
|
|
169
|
+
readonly stores: readonly ["app_store"];
|
|
170
|
+
readonly max: 100;
|
|
171
|
+
readonly count: "bytes";
|
|
172
|
+
readonly review: "version";
|
|
173
|
+
};
|
|
174
|
+
readonly promotional_text: {
|
|
175
|
+
readonly stores: readonly ["app_store"];
|
|
176
|
+
readonly max: 170;
|
|
177
|
+
readonly count: "graphemes";
|
|
178
|
+
readonly review: "none";
|
|
179
|
+
};
|
|
180
|
+
readonly description: {
|
|
181
|
+
readonly stores: readonly ["app_store", "play"];
|
|
182
|
+
readonly max: 4000;
|
|
183
|
+
readonly count: "graphemes";
|
|
184
|
+
readonly review: "version";
|
|
185
|
+
};
|
|
186
|
+
readonly whats_new: {
|
|
187
|
+
readonly stores: readonly ["app_store"];
|
|
188
|
+
readonly max: 4000;
|
|
189
|
+
readonly count: "graphemes";
|
|
190
|
+
readonly review: "version";
|
|
191
|
+
};
|
|
192
|
+
readonly short_description: {
|
|
193
|
+
readonly stores: readonly ["play"];
|
|
194
|
+
readonly max: 80;
|
|
195
|
+
readonly count: "graphemes";
|
|
196
|
+
readonly review: "google";
|
|
197
|
+
};
|
|
198
|
+
readonly event_name: {
|
|
199
|
+
readonly stores: readonly ["app_store"];
|
|
200
|
+
readonly max: 30;
|
|
201
|
+
readonly count: "graphemes";
|
|
202
|
+
readonly review: "event";
|
|
203
|
+
};
|
|
204
|
+
readonly event_short: {
|
|
205
|
+
readonly stores: readonly ["app_store"];
|
|
206
|
+
readonly max: 50;
|
|
207
|
+
readonly count: "graphemes";
|
|
208
|
+
readonly review: "event";
|
|
209
|
+
};
|
|
210
|
+
readonly event_long: {
|
|
211
|
+
readonly stores: readonly ["app_store"];
|
|
212
|
+
readonly max: 120;
|
|
213
|
+
readonly count: "graphemes";
|
|
214
|
+
readonly review: "event";
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* 撮影の組の1つのファイルの上限(バイト)。ファイルは core と creative の Worker を通して R2 に書くので、Workers の受けるリクエストの本文の上限
|
|
219
|
+
* (Free と Pro で 100MB)より小さくする。App Preview の元の録画(30秒まで)はこれに収まる。超えるファイルは分けて上げる形が要る(docs/plans/2026-11-22-creatives.md 2.5節)
|
|
220
|
+
*/
|
|
221
|
+
export declare const CAPTURE_FILE_MAX_BYTES: number;
|
|
222
|
+
/** 撮影の種類ごとのファイルの形式。撮った画面は PNG、録画は MP4 */
|
|
223
|
+
export declare const captureFormats: {
|
|
224
|
+
readonly image: {
|
|
225
|
+
readonly ext: "png";
|
|
226
|
+
readonly contentType: "image/png";
|
|
227
|
+
};
|
|
228
|
+
readonly video: {
|
|
229
|
+
readonly ext: "mp4";
|
|
230
|
+
readonly contentType: "video/mp4";
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
/** 撮影の組の1つのファイルの R2 のキー(docs/design/creatives.md 4.3節) */
|
|
234
|
+
export declare function captureR2Key(o: {
|
|
235
|
+
project: string;
|
|
236
|
+
platform: string;
|
|
237
|
+
version: string;
|
|
238
|
+
set: string;
|
|
239
|
+
file: CaptureFile;
|
|
240
|
+
}): string;
|
|
241
|
+
/** 1つのファイルを上げる core の道(putCaptureFile) */
|
|
242
|
+
export declare function captureFilePath(project: string, set: string, file: CaptureFile): string;
|
|
243
|
+
/** 組の中のファイルの名前(誤りの文と CLI の表示に使う) */
|
|
244
|
+
export declare function captureFileName(file: CaptureFile): string;
|
|
245
|
+
/** 1つの素材の上限(バイト)。可変のフォント(Noto Sans JP で約4MB)と端末の枠の PNG が収まる大きさ */
|
|
246
|
+
export declare const CREATIVE_ASSET_MAX_BYTES: number;
|
|
247
|
+
/** フォントの family を R2 のキーの部分にする(Noto Sans JP → noto-sans-jp) */
|
|
248
|
+
export declare function fontSlug(family: string): string;
|
|
249
|
+
/** 端末の枠の R2 のキー。色ごとに1枚 */
|
|
250
|
+
export declare function frameR2Key(device: CreativeDevice, color: string): string;
|
|
251
|
+
/**
|
|
252
|
+
* 素材の R2 のキー。フォントと端末の枠は全部の製品で同じ物を使うので製品を含めない。背景は製品ごと。
|
|
253
|
+
* meta の形が kind に合わなければ null
|
|
254
|
+
*/
|
|
255
|
+
export declare function assetR2Key(project: string, r: Pick<CreateCreativeAssetUploadRequest, "kind" | "name" | "meta">): string | null;
|
|
256
|
+
/** 1つの素材を上げる core の道(putAssetFile) */
|
|
257
|
+
export declare function assetFilePath(project: string, asset: string): string;
|
|
258
|
+
/** PNG の頭(IHDR)から寸法を読む。PNG でなければ null。頭の24バイトがあればよい */
|
|
259
|
+
export declare function pngSize(head: Uint8Array): {
|
|
260
|
+
width: number;
|
|
261
|
+
height: number;
|
|
262
|
+
} | null;
|
|
263
|
+
/** ファイルの一部を読む物。R2 の Range と手元のファイルの両方で使う */
|
|
264
|
+
export type ByteReader = (offset: number, length: number) => Promise<Uint8Array>;
|
|
265
|
+
/**
|
|
266
|
+
* MP4 の寸法と長さを読む。いちばん上の箱を頭だけ読んで moov を探し、moov の中の mvhd(長さ)と、幅の0でない tkhd(映像の寸法)を読む。
|
|
267
|
+
* MP4 として読めなければ null
|
|
268
|
+
*/
|
|
269
|
+
export declare function mp4Info(read: ByteReader, size: number): Promise<{
|
|
270
|
+
width: number;
|
|
271
|
+
height: number;
|
|
272
|
+
duration_ms: number;
|
|
273
|
+
} | null>;
|
|
274
|
+
/** 参考の素材の1つのファイルの上限(バイト)。撮影の組と同じく core と creative の Worker を通して R2 に書くので、同じ 90MB */
|
|
275
|
+
export declare const REFERENCE_FILE_MAX_BYTES: number;
|
|
276
|
+
/** 参考の素材のファイルの R2 のキー。同じ sha256 の物は1回だけ置く。バケットは公開の URL を持たない */
|
|
277
|
+
export declare function referenceR2Key(sha256: string): string;
|
|
278
|
+
/** 参考の素材の1つのファイルを送る・読む core のパス(putReferenceFile・getReferenceFile) */
|
|
279
|
+
export declare function referenceFilePath(reference: string, sha256: string): string;
|
|
280
|
+
/** JPEG の SOF から寸法を読む。JPEG でなければ null */
|
|
281
|
+
export declare function jpegSize(bytes: Uint8Array): {
|
|
282
|
+
width: number;
|
|
283
|
+
height: number;
|
|
284
|
+
} | null;
|
|
285
|
+
/** App Store のアプリのページの国(大文字)と id。違えば null */
|
|
286
|
+
export declare function appStorePage(url: URL): {
|
|
287
|
+
country: string;
|
|
288
|
+
id: string;
|
|
289
|
+
} | null;
|
|
290
|
+
/**
|
|
291
|
+
* 国の店の言語(lookup の lang)。タイの店は th と英語の2つを持ち、lang が無いと英語(ごほうび習慣では en-GB)の組を返す(2026-11-23 に確かめた)。
|
|
292
|
+
* 端末の言語がその国の言葉の人が見る組を読むため、国ごとに決めて渡す。無い国は lang を付けない
|
|
293
|
+
*/
|
|
294
|
+
export declare const APP_STORE_LANG: Readonly<Record<string, string>>;
|
|
295
|
+
/** iTunes の lookup の URL。複数の id を , でつなげて1回で読める */
|
|
296
|
+
export declare function appStoreLookupUrl(ids: readonly string[], country: string, lang?: string | null): string;
|
|
297
|
+
/**
|
|
298
|
+
* iTunes の lookup の画像の URL を元の寸法の URL にする。パスの最後の `<幅>x<高さ>bb.<拡張子>` が縮小の寸法で、
|
|
299
|
+
* 大きな箱(3000x3000bb)を渡すと元の寸法(iPhone 6.9インチなら 1320×2868)で返る(2026-11-23 に確かめた)。形が違えば null
|
|
300
|
+
*/
|
|
301
|
+
export declare function fullSizeStoreImage(url: string): string | null;
|
|
302
|
+
/** lookup の1件のうち、ページが変わったかを見る物 */
|
|
303
|
+
export interface AppStoreListing {
|
|
304
|
+
version: string | null;
|
|
305
|
+
description: string | null;
|
|
306
|
+
screenshotUrls: readonly string[];
|
|
307
|
+
ipadScreenshotUrls: readonly string[];
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* ページが変わったかを見る値。枚の URL の並び・説明・バージョンをつないだ文の sha256。
|
|
311
|
+
* 同じ値なら残さない(docs/design/creatives.md 16節)
|
|
312
|
+
*/
|
|
313
|
+
export declare function appStoreFingerprint(l: AppStoreListing): Promise<string>;
|