@tunasand/sdk 0.7.0 → 0.11.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.
Files changed (285) hide show
  1. package/CHANGELOG.md +233 -88
  2. package/README.md +296 -273
  3. package/dist/analytics.js +657 -10
  4. package/dist/app.js +323 -96
  5. package/dist/apps-DIxAWBSZ.js +318 -0
  6. package/dist/astro-image.d.ts +1 -0
  7. package/dist/astro-image.js +33 -0
  8. package/dist/astro-server-Bwau8F6d.js +99 -0
  9. package/dist/astro-server.d.ts +1 -0
  10. package/dist/astro-server.js +1 -0
  11. package/dist/astro.d.ts +1 -0
  12. package/dist/astro.js +306 -0
  13. package/dist/bridge-Dv4NxGZ7.js +81 -0
  14. package/dist/bridge.js +2 -14
  15. package/dist/build-file-DNi0PHC5.js +31 -0
  16. package/dist/cli.js +6214 -9
  17. package/dist/{client-Derrexwr.js → client-C8STAw9T.js} +43 -24
  18. package/dist/code-N8pBUDbq.js +30 -0
  19. package/dist/code.d.ts +1 -0
  20. package/dist/code.js +1 -0
  21. package/dist/collection-nUz1RetA.js +264 -0
  22. package/dist/{declared-C_GvPiGF.js → declared-CE4a61qb.js} +124 -36
  23. package/dist/delivery.js +124 -132
  24. package/dist/dev-operations-Tutwi1On.js +46 -0
  25. package/dist/dev.js +9 -16
  26. package/dist/embeds-B-Dbn64k.js +29 -0
  27. package/dist/end-users.d.ts +1 -0
  28. package/dist/end-users.js +185 -0
  29. package/dist/{customers-C_vJY2_v.js → endUsers-DODfjnv1.js} +31 -38
  30. package/dist/{errorLabels-CPKiPabZ.js → errorLabels-aT2bnMsO.js} +593 -460
  31. package/dist/i18n.js +4 -4
  32. package/dist/ids-DmtIoqBX.js +109 -0
  33. package/dist/integrations.js +95 -49
  34. package/dist/{ja-C6lX0CeJ.js → ja-CrY_72Tn.js} +99 -54
  35. package/dist/{ja-C1HEWWTQ.js → ja-axQPxMJ-.js} +6 -6
  36. package/dist/operations-CIB99rIY.js +95 -0
  37. package/dist/operations.d.ts +1 -0
  38. package/dist/operations.js +1 -0
  39. package/dist/{page-E_cYgZx-.js → page-yo1cw1kW.js} +5 -5
  40. package/dist/preview.js +8 -1
  41. package/dist/{profile-D6t1QMQh.js → profile-DBsXLvvI.js} +52 -52
  42. package/dist/rich-text.d.ts +1 -0
  43. package/dist/{body.js → rich-text.js} +20 -21
  44. package/dist/schema-Dcg1ajnW.js +1267 -0
  45. package/dist/schema.js +324 -1
  46. package/dist/types/access/src/handoff.d.ts +22 -17
  47. package/dist/types/access/src/index.d.ts +2 -2
  48. package/dist/types/access/src/jws.d.ts +41 -0
  49. package/dist/types/access/src/jwt.d.ts +1 -1
  50. package/dist/types/access/src/oidc.d.ts +11 -3
  51. package/dist/types/access/src/signed.d.ts +0 -2
  52. package/dist/types/adapter-cloudflare/src/eventLog/viewSchema.d.ts +11 -0
  53. package/dist/types/contract/src/accountProfile.d.ts +7 -0
  54. package/dist/types/{cms-contract → contract}/src/apiKeys.d.ts +7 -3
  55. package/dist/types/contract/src/app.d.ts +38 -0
  56. package/dist/types/contract/src/appChannels.d.ts +114 -0
  57. package/dist/types/contract/src/appDefinition.d.ts +133 -0
  58. package/dist/types/{cms-contract → contract}/src/appDependencies.d.ts +91 -35
  59. package/dist/types/contract/src/appIdentities.d.ts +21 -0
  60. package/dist/types/contract/src/appInbound.d.ts +28 -0
  61. package/dist/types/contract/src/appMail.d.ts +106 -0
  62. package/dist/types/contract/src/appSecrets.d.ts +45 -0
  63. package/dist/types/contract/src/appServer.d.ts +501 -0
  64. package/dist/types/contract/src/approvalLabels.d.ts +26 -0
  65. package/dist/types/contract/src/approvals.d.ts +63 -0
  66. package/dist/types/contract/src/apps.d.ts +295 -0
  67. package/dist/types/contract/src/auditActions.d.ts +18 -0
  68. package/dist/types/contract/src/auditLabels.d.ts +223 -0
  69. package/dist/types/contract/src/authorize.d.ts +133 -0
  70. package/dist/types/{cms-contract → contract}/src/bridge.d.ts +39 -40
  71. package/dist/types/{cms-contract → contract}/src/consents.d.ts +32 -25
  72. package/dist/types/contract/src/deletion.d.ts +18 -0
  73. package/dist/types/contract/src/embeds.d.ts +105 -0
  74. package/dist/types/{cms-contract/src/customerLabels.d.ts → contract/src/endUserLabels.d.ts} +6 -9
  75. package/dist/types/contract/src/endUsers.d.ts +241 -0
  76. package/dist/types/{cms-contract → contract}/src/errorLabels.d.ts +76 -47
  77. package/dist/types/{cms-contract → contract}/src/errorLabelsEn.d.ts +52 -36
  78. package/dist/types/contract/src/errors.d.ts +117 -0
  79. package/dist/types/contract/src/eventSchemas.d.ts +70 -0
  80. package/dist/types/contract/src/eventTraces.d.ts +43 -0
  81. package/dist/types/{cms-contract → contract}/src/failureStatus.d.ts +16 -23
  82. package/dist/types/contract/src/fieldAccess.d.ts +45 -0
  83. package/dist/types/contract/src/fieldRules.d.ts +41 -0
  84. package/dist/types/{cms-contract/src/assets.d.ts → contract/src/files.d.ts} +5 -5
  85. package/dist/types/contract/src/formLabels.d.ts +3 -0
  86. package/dist/types/contract/src/forms.d.ts +4 -0
  87. package/dist/types/{cms-contract → contract}/src/functions.d.ts +3 -3
  88. package/dist/types/contract/src/grants.d.ts +26 -0
  89. package/dist/types/contract/src/headers.d.ts +5 -0
  90. package/dist/types/contract/src/hostingRpc.d.ts +149 -0
  91. package/dist/types/contract/src/hostnames.d.ts +30 -0
  92. package/dist/types/contract/src/identifiers.d.ts +148 -0
  93. package/dist/types/contract/src/ids.d.ts +112 -0
  94. package/dist/types/{cms-contract → contract}/src/import.d.ts +20 -19
  95. package/dist/types/contract/src/importLabels.d.ts +3 -0
  96. package/dist/types/contract/src/index.d.ts +92 -0
  97. package/dist/types/contract/src/integrationGraph.d.ts +83 -0
  98. package/dist/types/{cms-contract → contract}/src/issueLabels.d.ts +135 -99
  99. package/dist/types/{cms-contract → contract}/src/issueLabelsEn.d.ts +70 -52
  100. package/dist/types/contract/src/labels.d.ts +11 -0
  101. package/dist/types/contract/src/legacyAuditLabels.d.ts +10 -0
  102. package/dist/types/contract/src/livePeriods.d.ts +18 -0
  103. package/dist/types/contract/src/manage.d.ts +51 -0
  104. package/dist/types/contract/src/manageLabels.d.ts +11 -0
  105. package/dist/types/contract/src/manifestText.d.ts +66 -0
  106. package/dist/types/contract/src/mcpAuth.d.ts +139 -0
  107. package/dist/types/contract/src/mcpLabels.d.ts +5 -0
  108. package/dist/types/contract/src/messagePort.d.ts +208 -0
  109. package/dist/types/{cms-contract → contract}/src/migration.d.ts +3 -3
  110. package/dist/types/contract/src/notices.d.ts +38 -0
  111. package/dist/types/contract/src/operatorOperations.d.ts +640 -0
  112. package/dist/types/contract/src/operators.d.ts +33 -0
  113. package/dist/types/contract/src/outbound.d.ts +29 -0
  114. package/dist/types/contract/src/paths.d.ts +34 -0
  115. package/dist/types/contract/src/pending.d.ts +6 -0
  116. package/dist/types/{cms-contract → contract}/src/permissions.d.ts +9 -11
  117. package/dist/types/contract/src/perspective.d.ts +26 -0
  118. package/dist/types/contract/src/powers.d.ts +5 -0
  119. package/dist/types/contract/src/principal.d.ts +181 -0
  120. package/dist/types/{cms-contract → contract}/src/problems.d.ts +4 -4
  121. package/dist/types/contract/src/projectRole.d.ts +6 -0
  122. package/dist/types/contract/src/recordLabels.d.ts +6 -0
  123. package/dist/types/{cms-contract → contract}/src/roles.d.ts +10 -6
  124. package/dist/types/contract/src/ruleLabels.d.ts +16 -0
  125. package/dist/types/contract/src/ruleProblems.d.ts +16 -0
  126. package/dist/types/contract/src/schemaLabels.d.ts +8 -0
  127. package/dist/types/{cms-contract → contract}/src/settingProblems.d.ts +3 -3
  128. package/dist/types/{cms-contract → contract}/src/settings.d.ts +6 -8
  129. package/dist/types/contract/src/settingsLabels.d.ts +3 -0
  130. package/dist/types/{cms-contract → contract}/src/siteDeclaration.d.ts +7 -7
  131. package/dist/types/contract/src/siteIndex.d.ts +76 -0
  132. package/dist/types/contract/src/slugs.d.ts +6 -0
  133. package/dist/types/{cms-contract → contract}/src/transfer.d.ts +4 -4
  134. package/dist/types/contract/src/trial.d.ts +13 -0
  135. package/dist/types/contract/src/versions.d.ts +7 -0
  136. package/dist/types/{analytics/src/view.d.ts → contract/src/viewEvent.d.ts} +0 -9
  137. package/dist/types/contract/src/webhooks.d.ts +135 -0
  138. package/dist/types/contract/src/workflow.d.ts +43 -0
  139. package/dist/types/contract/src/workspaceItems.d.ts +87 -0
  140. package/dist/types/contract/src/workspacePaths.d.ts +4 -0
  141. package/dist/types/{body → rich-text}/src/declared.d.ts +2 -2
  142. package/dist/types/{body → rich-text}/src/embed.d.ts +1 -1
  143. package/dist/types/{body → rich-text}/src/html.d.ts +1 -1
  144. package/dist/types/{body → rich-text}/src/index.d.ts +8 -7
  145. package/dist/types/{body → rich-text}/src/labels/en.d.ts +1 -1
  146. package/dist/types/{body → rich-text}/src/labels/ja.d.ts +4 -4
  147. package/dist/types/{body → rich-text}/src/library.d.ts +1 -1
  148. package/dist/types/rich-text/src/media.d.ts +2 -0
  149. package/dist/types/{body → rich-text}/src/normalize.d.ts +1 -1
  150. package/dist/types/{body → rich-text}/src/problems.d.ts +5 -5
  151. package/dist/types/{body → rich-text}/src/profile.d.ts +11 -11
  152. package/dist/types/{body → rich-text}/src/render.d.ts +1 -1
  153. package/dist/types/{body → rich-text}/src/schema.d.ts +2 -2
  154. package/dist/types/{body → rich-text}/src/standard.d.ts +4 -4
  155. package/dist/types/{body → rich-text}/src/types.d.ts +2 -2
  156. package/dist/types/schema/src/audience.d.ts +36 -0
  157. package/dist/types/schema/src/brand.d.ts +5 -0
  158. package/dist/types/schema/src/capabilities.d.ts +19 -0
  159. package/dist/types/{model → schema}/src/changes.d.ts +9 -7
  160. package/dist/types/{model → schema}/src/check.d.ts +2 -2
  161. package/dist/types/{model/src/model.d.ts → schema/src/collection.d.ts} +150 -121
  162. package/dist/types/schema/src/defaultSchema.d.ts +15 -0
  163. package/dist/types/schema/src/fieldIds.d.ts +18 -0
  164. package/dist/types/{model/src/asset.d.ts → schema/src/file.d.ts} +36 -25
  165. package/dist/types/schema/src/fileRefs.d.ts +14 -0
  166. package/dist/types/schema/src/fileSignature.d.ts +20 -0
  167. package/dist/types/schema/src/filesCollection.d.ts +7 -0
  168. package/dist/types/schema/src/forms.d.ts +43 -0
  169. package/dist/types/{model → schema}/src/image.d.ts +3 -3
  170. package/dist/types/schema/src/imageMetadata.d.ts +9 -0
  171. package/dist/types/schema/src/index.d.ts +35 -0
  172. package/dist/types/{model → schema}/src/input.d.ts +3 -3
  173. package/dist/types/{model → schema}/src/integrity.d.ts +9 -8
  174. package/dist/types/schema/src/kinds.d.ts +26 -0
  175. package/dist/types/{model → schema}/src/labels/en.d.ts +93 -51
  176. package/dist/types/{model → schema}/src/labels/ja.d.ts +97 -52
  177. package/dist/types/schema/src/mediaUrl.d.ts +60 -0
  178. package/dist/types/{model → schema}/src/page.d.ts +6 -6
  179. package/dist/types/{model → schema}/src/problems.d.ts +95 -53
  180. package/dist/types/{model → schema}/src/refs.d.ts +1 -10
  181. package/dist/types/{model → schema}/src/rules.d.ts +2 -2
  182. package/dist/types/{model → schema}/src/schema.d.ts +25 -20
  183. package/dist/types/schema/src/selfOps.d.ts +31 -0
  184. package/dist/types/{model/src/capabilities.d.ts → schema/src/traits.d.ts} +6 -6
  185. package/dist/types/schema/src/typesSource.d.ts +16 -0
  186. package/dist/types/{model → schema}/src/values.d.ts +7 -4
  187. package/dist/types/schema/src/widening.d.ts +3 -0
  188. package/dist/types/sdk/src/analytics.d.ts +3 -2
  189. package/dist/types/sdk/src/app.d.ts +70 -16
  190. package/dist/types/sdk/src/astro-image.d.ts +19 -0
  191. package/dist/types/sdk/src/astro-response.d.ts +6 -0
  192. package/dist/types/sdk/src/astro-server.d.ts +16 -0
  193. package/dist/types/sdk/src/astro.d.ts +19 -0
  194. package/dist/types/sdk/src/bridge.d.ts +13 -15
  195. package/dist/types/sdk/src/code.d.ts +61 -0
  196. package/dist/types/sdk/src/delegation.d.ts +49 -0
  197. package/dist/types/sdk/src/delivery/changes.d.ts +4 -4
  198. package/dist/types/sdk/src/delivery/client.d.ts +40 -28
  199. package/dist/types/sdk/src/delivery/fields.d.ts +5 -5
  200. package/dist/types/sdk/src/delivery/index.d.ts +3 -3
  201. package/dist/types/sdk/src/delivery/media.d.ts +8 -11
  202. package/dist/types/sdk/src/delivery/query.d.ts +16 -12
  203. package/dist/types/sdk/src/delivery/schema.d.ts +5 -5
  204. package/dist/types/sdk/src/delivery/values.d.ts +16 -20
  205. package/dist/types/sdk/src/delivery.d.ts +3 -3
  206. package/dist/types/sdk/src/dev-operations.d.ts +20 -0
  207. package/dist/types/sdk/src/dev.d.ts +6 -5
  208. package/dist/types/sdk/src/end-users.d.ts +190 -0
  209. package/dist/types/sdk/src/i18n.d.ts +11 -11
  210. package/dist/types/sdk/src/integrations.d.ts +20 -27
  211. package/dist/types/sdk/src/operations.d.ts +17 -0
  212. package/dist/types/sdk/src/preview.d.ts +2 -1
  213. package/dist/types/sdk/src/rich-text.d.ts +2 -0
  214. package/dist/types/sdk/src/schema.d.ts +5 -21
  215. package/dist/types/sdk/src/site/artifact.d.ts +64 -0
  216. package/dist/types/sdk/src/site/build-file.d.ts +30 -0
  217. package/dist/types/sdk/src/site/check-code.d.ts +14 -0
  218. package/dist/types/sdk/src/site/check-text.d.ts +19 -0
  219. package/dist/types/sdk/src/site/cli.d.ts +52 -0
  220. package/dist/types/sdk/src/site/content-type.d.ts +2 -0
  221. package/dist/types/sdk/src/site/labels.d.ts +14 -0
  222. package/dist/types/sdk/src/site.d.ts +1 -1
  223. package/dist/types/sdk/src/types.d.ts +21 -0
  224. package/dist/{schema-BPHL7Qr-.js → types-DkO2N7u2.js} +9 -9
  225. package/dist/types.d.ts +1 -0
  226. package/dist/types.js +1 -0
  227. package/dist/typesSource-VJIxtN9b.js +136 -0
  228. package/dist/workflow-CUpl6hO_.js +148 -0
  229. package/package.json +42 -16
  230. package/dist/apps-9u4XMi7E.js +0 -114
  231. package/dist/body.d.ts +0 -1
  232. package/dist/bridge-DYAYGV7t.js +0 -74
  233. package/dist/customers.d.ts +0 -1
  234. package/dist/customers.js +0 -185
  235. package/dist/embed-R-OvDYAw.js +0 -90
  236. package/dist/model-pmXzGX12.js +0 -152
  237. package/dist/model.d.ts +0 -1
  238. package/dist/model.js +0 -345
  239. package/dist/schema-UQJWRyfJ.js +0 -995
  240. package/dist/src-sazhzYui.js +0 -71
  241. package/dist/types/analytics/src/index.d.ts +0 -5
  242. package/dist/types/analytics/src/schedule.d.ts +0 -2
  243. package/dist/types/analytics/src/shared.d.ts +0 -21
  244. package/dist/types/analytics/src/source.d.ts +0 -19
  245. package/dist/types/analytics/src/store.d.ts +0 -24
  246. package/dist/types/cms-contract/src/app.d.ts +0 -35
  247. package/dist/types/cms-contract/src/apps.d.ts +0 -195
  248. package/dist/types/cms-contract/src/authorize.d.ts +0 -146
  249. package/dist/types/cms-contract/src/customers.d.ts +0 -266
  250. package/dist/types/cms-contract/src/embeds.d.ts +0 -165
  251. package/dist/types/cms-contract/src/errors.d.ts +0 -105
  252. package/dist/types/cms-contract/src/identifiers.d.ts +0 -117
  253. package/dist/types/cms-contract/src/paths.d.ts +0 -23
  254. package/dist/types/cms-contract/src/urlLabel.d.ts +0 -13
  255. package/dist/types/cms-contract/src/webhooks.d.ts +0 -139
  256. package/dist/types/model/src/audience.d.ts +0 -38
  257. package/dist/types/model/src/brand.d.ts +0 -25
  258. package/dist/types/model/src/index.d.ts +0 -26
  259. package/dist/types/model/src/legacy.d.ts +0 -2
  260. package/dist/types/model/src/media.d.ts +0 -5
  261. package/dist/types/model/src/mediaUrl.d.ts +0 -67
  262. package/dist/types/model/src/selfOps.d.ts +0 -30
  263. package/dist/types/model/src/typesSource.d.ts +0 -8
  264. package/dist/types/platform/src/defaultModel.d.ts +0 -8
  265. package/dist/types/sdk/src/body.d.ts +0 -2
  266. package/dist/types/sdk/src/customers.d.ts +0 -190
  267. package/dist/types/sdk/src/model.d.ts +0 -5
  268. package/dist/typesSource-bO0jFw1I.js +0 -88
  269. /package/dist/types/{cms-contract → contract}/src/appProblems.d.ts +0 -0
  270. /package/dist/types/{analytics → contract}/src/day.d.ts +0 -0
  271. /package/dist/types/{cms-contract → contract}/src/functionLabels.d.ts +0 -0
  272. /package/dist/types/{cms-contract → contract}/src/permissionLabels.d.ts +0 -0
  273. /package/dist/types/{cms-contract → contract}/src/siteArtifact.d.ts +0 -0
  274. /package/dist/types/{cms-contract → contract}/src/views.d.ts +0 -0
  275. /package/dist/types/{cms-contract → contract}/src/webhookLabels.d.ts +0 -0
  276. /package/dist/types/{body → rich-text}/src/components.d.ts +0 -0
  277. /package/dist/types/{body → rich-text}/src/derive.d.ts +0 -0
  278. /package/dist/types/{body → rich-text}/src/description.d.ts +0 -0
  279. /package/dist/types/{body → rich-text}/src/href.d.ts +0 -0
  280. /package/dist/types/{body → rich-text}/src/inline.d.ts +0 -0
  281. /package/dist/types/{body → rich-text}/src/markdown.d.ts +0 -0
  282. /package/dist/types/{model → schema}/src/contact.d.ts +0 -0
  283. /package/dist/types/{model → schema}/src/json.d.ts +0 -0
  284. /package/dist/types/{model → schema}/src/screens.d.ts +0 -0
  285. /package/dist/types/{model → schema}/src/time.d.ts +0 -0
@@ -6,6 +6,8 @@ export declare const API_ISSUE_MESSAGES_EN: {
6
6
  readonly slug_chars: "Slug may contain only lowercase letters, digits, hyphens and underscores";
7
7
  readonly slug_uuid: "Slug must not be in UUID form";
8
8
  readonly url_format: "Invalid URL";
9
+ readonly infra_id: "Invalid ID (26 lowercase letters and digits)";
10
+ readonly uuid_not_accepted: "UUID-form IDs are not accepted (26 lowercase letters and digits)";
9
11
  readonly https_only: "Only https URLs are allowed";
10
12
  readonly body_not_json: "The request body is not JSON";
11
13
  readonly email_format: "Invalid email address";
@@ -13,29 +15,32 @@ export declare const API_ISSUE_MESSAGES_EN: {
13
15
  readonly link_collection_missing: "Collection {collection} does not exist";
14
16
  readonly unknown_environment: "Environment {id} does not exist in this project";
15
17
  readonly not_operator: "Not an operator email address";
16
- readonly invitations_unavailable: "This runtime has no invitation ledger";
18
+ readonly invitations_unavailable: "This runtime has no invitation registry";
17
19
  readonly app_manifest: "The manifest is malformed";
18
20
  readonly app_manifest_detail: "The manifest is malformed ({detail})";
19
21
  readonly app_namespace: "The namespace must be 3 to 32 lowercase letters and digits, starting with a letter";
20
22
  readonly app_namespace_taken: "This namespace is already taken (namespaces cannot be reused)";
21
- readonly app_no_tenant: "Apps cannot be registered in a project that is not linked to a tenant";
22
- readonly app_slots: "Choose the collections to embed into (embeds that need a body require a collection with a body field)";
23
- readonly app_not_installable: "This app cannot be installed (only apps of your own tenant and reviewed apps)";
24
- readonly app_no_registry: "Not connected to the app registry";
23
+ readonly app_no_organization: "Apps cannot be registered in a project that is not linked to a organization";
24
+ readonly app_collections: "Choose the existing collections to map and the fields to map (each field must have the same type; unmapped fields are added by the installation, so map any field that already uses the same key)";
25
+ readonly channel_capabilities: "Choose one or more channel capabilities from the kind declaration";
26
+ readonly channel_address: "Use a local part of lowercase letters, digits, \".\", \"_\" and \"-\" on a domain verified in this project (only for kinds with addresses)";
27
+ readonly channel_setting: "{key} is not a setting of this kind or has an invalid value";
28
+ readonly app_slugs: "A collection slug of the app is taken or invalid. Specify the slugs";
29
+ readonly app_not_installable: "This app cannot be installed (only apps of your own organization and reviewed apps)";
30
+ readonly app_no_registration: "Apps cannot be added to this project";
25
31
  readonly app_changed: "The app version or capabilities changed after you reviewed them. Review them again";
26
- readonly app_dependency: "A dependency is missing from the registry, is not an app, or does not have the referenced setting";
32
+ readonly app_dependency: "A dependency is not a registered app, is not an app, or does not have the referenced setting";
27
33
  readonly app_incompatible: "Incompatible change within the same major version. Bump the major version or revert the change";
28
34
  readonly app_incompatible_detail: "Incompatible change within the same major version. Bump the major version or revert the change ({detail})";
29
35
  readonly app_key_private: "Keys with private parts (such as d) cannot be registered. Send only the public key";
30
- readonly app_key_unsupported: "Only ES256 (EC P-256) or RS256 (RSA) public signing keys can be registered";
36
+ readonly app_key_unsupported: "Only ES256 (EC P-256), RS256 (RSA) or ML-DSA-44 public signing keys can be registered";
31
37
  readonly app_key_weak: "RSA keys must be at least 2048 bits";
32
38
  readonly app_key_kid: "kid must be a string of 1 to 128 characters";
33
39
  readonly app_key_duplicate_kid: "Multiple keys share the same kid";
34
40
  readonly app_key_duplicate_key: "The same key appears more than once (use different keys for exchange and upload)";
35
41
  readonly deploy_artifact: "The artifact is malformed";
36
- readonly deploy_artifact_required: "Send exactly one of artifact or version (to redeploy)";
42
+ readonly deploy_artifact_required: "Send the artifact (artifact)";
37
43
  readonly deploy_secrets: "secrets must be a JSON object from names to strings";
38
- readonly deploy_version_not_found: "No artifact exists for that version";
39
44
  readonly deploy_binding: "A variable or secret name or value is not accepted";
40
45
  readonly artifact_too_large: "The artifact exceeds the size limit";
41
46
  readonly artifact_format: "Not an artifact (build it with tunasand site)";
@@ -49,34 +54,35 @@ export declare const API_ISSUE_MESSAGES_EN: {
49
54
  readonly binding_duplicate_name: "The same name is used by a variable and a secret";
50
55
  readonly binding_tunasand_value: "Tunasand secrets, or values containing them, cannot be used";
51
56
  readonly binding_too_many: "Too many variables, secrets and resources";
52
- readonly customer_invalid_date: "The date must be a real day in YYYY-MM-DD";
53
- readonly customer_no_target_collection: "The grant target collection does not exist (the collection referenced by a collection’s required grant field)";
54
- readonly customer_no_target: "The grant target record does not exist";
55
- readonly customer_ends_before_start: "The end date is before the start date";
56
- readonly customer_ends_required: "An end date is required (the target collection has no period in months, or the target record has no value)";
57
- readonly customer_months_invalid: "The target record’s period in months is not an integer from 1 to 1200 (fix it or specify an end date)";
58
- readonly customer_ends_unchecked: "The end date follows the target’s period in months (not checked in a test run because the target is an earlier record of the same run)";
59
- readonly customer_no_provider: "The issuer is not in the settings";
60
- readonly customer_profile_collection: "The profile collection must have a unique reference field to customers";
61
- readonly customer_not_configured: "enabling customers, or an identity issuer";
62
- readonly customer_read_log_not_configured: "storage for the log of reads of personal records";
63
- readonly customer_version_too_long: "The question version must be at most 64 characters";
64
- readonly customer_id_shape: "{field} must be a customer ID";
65
- readonly customer_missing: "Customer {id} of {field} does not exist";
66
- readonly customer_singleton: "{field} of {collection} (customer fields of object-format collections cannot be handled by customer deletion; remove the field first)";
67
- readonly customer_cascade_other: "{field} of {collection} (a record deleted by cascade points to another customer)";
68
- readonly customer_cascade_vanished: "{collection} (a record to delete by cascade disappeared after planning; delete again)";
69
- readonly customer_erasure_confirm: "For confirmation, enter the customer ID again in confirm";
70
- readonly customer_deletion_too_large: "{count, number} records, rewritten records and revisions do not fit in one deletion (reduce the referencing records first)";
71
- readonly customer_statements_too_large: "{count, number} statements exceed the limit for one deletion (reduce the referencing records and customer data first)";
72
- readonly customer_undeclared_on_delete: "{field} of {collection} (onDelete for deleted customers is not set; set it in the schema first)";
73
- readonly consent_purpose: "The purpose must be service, marketing, or a purpose declared in the customer settings";
74
- readonly consent_address: "The address does not match the channel (email address for email, phone number for sms, userId for line)";
75
- readonly consent_target: "email and sms require address (line requires customerId or address)";
57
+ readonly end_user_invalid_date: "The date must be a real day in YYYY-MM-DD";
58
+ readonly end_user_no_target_collection: "The entitlement target collection does not exist (the collection referenced by a collection’s required entitlement field)";
59
+ readonly end_user_no_target: "The entitlement target record does not exist";
60
+ readonly end_user_ends_before_start: "The end date is before the start date";
61
+ readonly end_user_ends_required: "An end date is required (the target collection has no period in months, or the target record has no value)";
62
+ readonly end_user_months_invalid: "The target record’s period in months is not an integer from 1 to 1200 (fix it or specify an end date)";
63
+ readonly end_user_ends_unchecked: "The end date follows the target’s period in months (not checked in a test run because the target is an earlier record of the same run)";
64
+ readonly end_user_no_provider: "The issuer is not in the settings";
65
+ readonly end_user_not_configured: "enabling end users, or an identity issuer";
66
+ readonly end_user_read_log_not_configured: "storage for the log of reads of personal records";
67
+ readonly end_user_version_too_long: "The question version must be at most 64 characters";
68
+ readonly end_user_id_shape: "{field} must be an end user ID";
69
+ readonly end_user_missing: "End user {id} of {field} does not exist";
70
+ readonly end_user_singleton: "{field} of {collection} (end user fields of object-format collections cannot be handled by end user deletion; remove the field first)";
71
+ readonly end_user_cascade_other: "{field} of {collection} (a record deleted by cascade points to another end user)";
72
+ readonly cascade_vanished: "{collection} (a record to delete by cascade disappeared after planning; delete again)";
73
+ readonly end_user_erasure_confirm: "For confirmation, enter the end user ID again in confirm";
74
+ readonly deletion_too_large: "{count, number} records, rewritten records and revisions do not fit in one deletion (reduce the referencing records first)";
75
+ readonly end_user_statements_too_large: "{count, number} statements exceed the limit for one deletion (reduce the referencing records and end user data first)";
76
+ readonly end_user_undeclared_on_delete: "{field} of {collection} (onDelete for deleted end users is not set; set it in the schema first)";
77
+ readonly consent_purpose: "The purpose must be service, marketing, or a purpose declared in the end user settings";
78
+ readonly consent_address: "The address does not match the channel (email address for email, phone number for sms; channel IDs take no address)";
79
+ readonly consent_target: "email and sms require address; channel IDs require end_user_id";
80
+ readonly consent_channel: "The channel must be email, sms, or the ID of a channel in this project";
76
81
  readonly consent_method: "This method is not available for the source kind (account is staff only)";
77
82
  readonly unfilterable_field: "{key} cannot be used as a filter";
83
+ readonly undeclared_field: "{key} is not a field of the collection";
78
84
  readonly unwritable_field: "{key} cannot be written because it is not visible to this credential (visibility)";
79
- readonly self_unwritable: "{key} cannot be written by the customer";
85
+ readonly self_unwritable: "{key} cannot be written by the end user";
80
86
  readonly unique_part_required: "{key} is required because it is part of a one-row-per-person key";
81
87
  readonly reference_unavailable: "The reference of {key} cannot be chosen (published records only)";
82
88
  readonly request_reject_note_required: "A rejection reason is required";
@@ -84,26 +90,31 @@ export declare const API_ISSUE_MESSAGES_EN: {
84
90
  readonly record_no_review: "This collection has no review";
85
91
  readonly generated_slug: "Slugs in this collection are assigned by the CMS and cannot be specified";
86
92
  readonly unique_taken: "A record with the same {labels} already exists";
93
+ readonly transition_not_allowed: "Cannot change from {from} to {to}";
94
+ readonly transition_create_not_allowed: "Cannot create with {to}";
87
95
  readonly unique_duplicates: "{count, number} records in {collection} share the same {labels} (fix the duplicates before making it unique)";
96
+ readonly publish_check_unavailable: "No enabled app provides the publish check {check}";
97
+ readonly table_field_limit: "{collection} can have at most {max} fields (now {fields})";
88
98
  readonly use_at: "{field}{rest, select, none {} other { ({rest})}} of {collection}";
99
+ readonly file_missing: "Image or file {id} does not exist (it was deleted or never existed)";
89
100
  readonly public_in_private_field: "A field for private media only contains public images or files (upload them again from this field)";
90
101
  readonly trash_record: "record {id} of {collection}";
91
102
  readonly trash_unique_holder: "a record of {collection} ({reason})";
92
- readonly trash_customer_missing: "customer {id} referenced by {field} of {collection} (the customer does not exist)";
103
+ readonly trash_end_user_missing: "end user {id} referenced by {field} of {collection} (the end user does not exist)";
93
104
  readonly renamed_replacement: "Save the replacement of options of a collection whose id changes separately from the id change";
94
105
  readonly project_name_required: "Project name is required";
95
106
  readonly project_slug_invalid: "Use lowercase letters, digits and hyphens; ID-shaped slugs are not allowed";
96
107
  readonly project_slug_reserved: "This slug is reserved";
97
108
  readonly project_slug_taken: "Another project in this organization uses this slug";
98
109
  readonly time_zone_invalid: "Invalid time zone name (e.g. Asia/Tokyo)";
99
- readonly required_extension: "This extension is required by the deployment settings";
110
+ readonly required_app: "This standard feature cannot be stopped";
100
111
  readonly unknown_setting_field: "Not a field of the settings page";
101
- readonly module_no_settings: "This extension has no settings";
102
- readonly module_invalid_settings: "The settings are invalid.";
112
+ readonly app_invalid_settings: "The settings are invalid.";
103
113
  readonly config_corrupt: "Settings in the DB of project {id} are corrupt ({parts}; the values need repair).";
104
114
  readonly config_missing: "Settings are missing from the DB of project {id} ({parts}; apply the project template).";
105
115
  readonly setting_text: "Enter text for \"{field}\".";
106
116
  readonly setting_integer_min: "\"{field}\" must be an integer of at least {min, number}.";
117
+ readonly setting_integer_max: "\"{field}\" must be an integer of at most {max, number}.";
107
118
  readonly setting_boolean: "\"{field}\" must be on or off.";
108
119
  readonly setting_text_list: "\"{field}\" must be a list of strings.";
109
120
  readonly setting_choice: "\"{field}\" must be one of: {choices}";
@@ -120,7 +131,7 @@ export declare const API_ISSUE_MESSAGES_EN: {
120
131
  readonly import_publish_failed: "Left as a draft because it could not be published: {problem}";
121
132
  readonly import_image_not_url: "{src}: the image reference is not a URL";
122
133
  readonly import_ogp_failed: "{href}: could not fetch the OGP of the link (the title stays the URL)";
123
- readonly import_media_value: "Images must be a URL string, '{' url, alt '}' or '{' asset '}'";
134
+ readonly import_file_value: "Images must be a URL string, '{' url, alt '}' or '{' file '}'";
124
135
  readonly import_origin_required: "origin_id is required for imports with an import map";
125
136
  readonly import_origin_unresolved: "{path}: the record of the original ID is not in the import map (import the referenced records first)";
126
137
  readonly import_map_changed: "The record changed after the import (the version differs from the import map)";
@@ -128,20 +139,21 @@ export declare const API_ISSUE_MESSAGES_EN: {
128
139
  readonly import_map_closed: "The import map row is being deleted or is a tombstone";
129
140
  readonly import_map_no_key: "Cannot open the import map key (the DB was copied from another project)";
130
141
  readonly import_map_raced: "The import map or record changed first, by a concurrent import or an edit";
142
+ readonly import_map_held: "Another holder holds the record";
131
143
  readonly import_duplicate_identity: "The same identity appears more than once";
132
- readonly import_duplicate_grant: "The same grant (target collection and record, or key) appears more than once";
133
- readonly import_grant_target_changed: "The target of an imported grant cannot change (use another key for a different grant)";
134
- readonly import_identity_taken: "{customer, select, none {The identity belongs to another customer} other {The identity belongs to another customer {customer}}}";
135
- readonly import_closed_in_conflict: "Applied only the closure from the source (other changes are not written because of the conflict)";
136
- readonly import_closes_in_conflict: "Will apply only the closure from the source (other changes are not written because of the conflict)";
144
+ readonly import_duplicate_entitlement: "The same entitlement (target collection and record, or key) appears more than once";
145
+ readonly import_entitlement_target_changed: "The target of an imported entitlement cannot change (use another key for a different entitlement)";
146
+ readonly import_identity_taken: "{endUser, select, none {The identity belongs to another end user} other {The identity belongs to another end user {endUser}}}";
147
+ readonly import_suspended_in_conflict: "Applied only the suspension from the source (other changes are not written because of the conflict)";
148
+ readonly import_suspends_in_conflict: "Will apply only the suspension from the source (other changes are not written because of the conflict)";
137
149
  readonly import_overwritten: "Changes after the import were overwritten with the source values";
138
- readonly import_overwrite_note: "A reason note is required when customers are overwritten (overwrite)";
139
- readonly import_asset_not_stored: "No stored image or file has the same content";
140
- readonly import_media_failed: "{reason, select, forbidden {No permission to create images and files} https_required {Only https URLs are allowed} upstream_failed {Could not fetch it} unsupported_image {Unsupported image format (PNG, JPEG, GIF, WebP)} unsupported_file {Unsupported file format} file_too_large {Exceeds the size limit} other {Cannot be imported}}";
150
+ readonly import_overwrite_note: "A reason note is required when end users are overwritten (overwrite)";
151
+ readonly import_file_not_stored: "No stored image or file has the same content";
152
+ readonly import_file_failed: "{reason, select, forbidden {No permission to create images and files} https_required {Only https URLs are allowed} upstream_failed {Could not fetch it} unsupported_image {Unsupported image format (PNG, JPEG, GIF, WebP)} unsupported_file {Unsupported file format} file_too_large {Exceeds the size limit} other {Cannot be imported}}";
141
153
  readonly import_phase_unpublishable: "Steps of a cycle between collections require collections with editing (the first step creates drafts)";
142
154
  readonly integration_event_name: "Invalid event name";
143
155
  readonly integration_collections_max: "Up to {max, number} collections";
144
- readonly api_keys_unavailable: "API key ledger";
156
+ readonly api_keys_unavailable: "API key registry";
145
157
  readonly hosting_unavailable: "site hosting";
146
158
  readonly page_has_no_collection: "Menu pages, dashboards, and screens outside app settings have no collection";
147
159
  readonly only_field_has_field: "Only screens outside field inputs have a field";
@@ -158,7 +170,6 @@ export declare const API_ISSUE_MESSAGES_EN: {
158
170
  readonly function_not_json: "The response is not JSON";
159
171
  readonly function_invalid_shape: "The response has an invalid shape";
160
172
  readonly function_list_column_failed: "Could not receive the list column response (see the delivery log for the reason)";
161
- readonly og_missing_chars: "The title has characters missing from the OG image font: {chars}";
162
173
  readonly import_kind_unknown_collection: "Collection cannot be imported";
163
174
  readonly import_kind_forbidden: "No permission to create";
164
175
  readonly import_kind_invalid_id: "Invalid ID";
@@ -173,16 +184,21 @@ export declare const API_ISSUE_MESSAGES_EN: {
173
184
  readonly import_kind_origin_missing: "Source ID not found in the import map";
174
185
  readonly import_kind_map_conflict: "Row does not match the import map (changed or removed after import)";
175
186
  readonly import_kind_map_unavailable: "No key for the import map (SECRETS_KEY missing)";
176
- readonly import_kind_identity_taken: "The identity belongs to another customer";
187
+ readonly import_kind_identity_taken: "The identity belongs to another end user";
177
188
  readonly delivery_path_count: "path must have 1 to {max, number} entries";
178
189
  readonly delivery_path_format: "path must be a delivery API path starting with /: {path}";
179
190
  readonly delivery_path_bundle: "path cannot include the bundle";
180
- readonly delivery_path_route_checked: "path cannot include the customer API";
191
+ readonly delivery_path_route_checked: "path cannot include the end user API";
181
192
  readonly delivery_path_wildcard: "path can have at most one *: {path}";
182
193
  readonly delivery_expanded_max: "At most {max, number} routes after expansion";
183
194
  readonly delivery_limit_range: "limit must be an integer from 1 to {max, number}";
184
195
  readonly delivery_since_invalid: "Invalid since (use next from the previous response)";
185
196
  readonly delivery_at_format: "at must be an ISO 8601 date-time";
197
+ readonly read_token_expiry: "expiresAt must be a future date-time within {max, number} days";
198
+ readonly delivery_at_past: "at must not be in the past";
199
+ readonly delivery_perspective_value: "perspective must be published or latest";
200
+ readonly delivery_perspective_combined: "Use only one of perspective=latest, revision and at";
201
+ readonly delivery_revision_list: "revision is only for a single record";
186
202
  readonly delivery_singleton_list: "A single-record collection cannot be listed";
187
203
  readonly delivery_fields_empty: "fields must be comma-separated non-empty fields";
188
204
  readonly delivery_expand_depth: "Expansion depth is at most {max, number}: {token}";
@@ -192,13 +208,14 @@ export declare const API_ISSUE_MESSAGES_EN: {
192
208
  readonly delivery_field_not_expandable: "Field cannot be expanded: {key}";
193
209
  readonly delivery_expanded_not_selectable: "Field cannot be selected in the expanded collection {collection}: {key}";
194
210
  readonly delivery_single: "{name} can be given only once";
211
+ readonly reference_single: "{field} takes only one record";
195
212
  readonly delivery_op_planned: "Not implemented operator: {op}";
196
213
  readonly delivery_filter_format: "Filters are filter[key] or filter[key][operator]";
197
214
  readonly delivery_filter_nested_planned: "Not implemented filter: field inside a group {key}";
198
215
  readonly delivery_field_not_filterable: "Field cannot be filtered: {key}";
199
216
  readonly delivery_op_not_allowed: "Operator not allowed for field {key}: {op}";
200
217
  readonly delivery_filter_value: "Invalid value for field {key}: {raw}";
201
- readonly delivery_ids_format: "ids must be up to {max, number} comma-separated non-empty ids";
218
+ readonly delivery_ids_format: "ids must be up to {max, number} non-empty ids, one per repeated parameter";
202
219
  readonly delivery_offset_planned: "Not implemented: offset (use cursor for paging)";
203
220
  readonly delivery_order_max: "At most {max, number} sort keys";
204
221
  readonly delivery_field_not_sortable: "Field cannot be sorted: {name}";
@@ -214,4 +231,5 @@ export declare const API_ISSUE_MESSAGES_EN: {
214
231
  readonly form_too_many: "At most {max, number} choices";
215
232
  readonly form_too_few: "At least {min, number} choices";
216
233
  readonly form_unknown_form: "Unknown form name";
234
+ readonly form_unwritable: "{key} cannot be submitted";
217
235
  };
@@ -0,0 +1,11 @@
1
+ /** 公開の状態 */
2
+ export declare const STATUS: {
3
+ readonly draft: "下書き";
4
+ readonly review: "レビュー待ち";
5
+ readonly published: "公開済み";
6
+ };
7
+ /** 公開中・予約のレコードの未公開の変更(#596) */
8
+ export declare const CHANGES_LABELS: {
9
+ readonly draft: "未公開の変更あり";
10
+ readonly review: "変更のレビュー待ち";
11
+ };
@@ -0,0 +1,10 @@
1
+ import type { AuditActionCode } from './auditActions.js';
2
+ /** 対象の名前を差し込む操作の、旧い文の接尾辞(旧い文は「<対象の表示名><接尾辞>」、連携の登録は英字の名前のあとに空白) */
3
+ export declare const LEGACY_AUDIT_SUFFIXES: readonly [readonly ["を作成", "record.create"], readonly ["を更新", "record.update"], readonly ["を削除", "record.delete"], readonly ["を提出", "record.submit"], readonly ["を差し戻し", "record.reject"], readonly ["を公開", "record.publish"], readonly ["を下書きに戻す", "record.unpublish"], readonly ["の参考資料を変更", "record.setSources"], readonly ["の出典を変更", "record.setSources"], readonly ["の参照を変更", "record.setRefs"]];
4
+ /**
5
+ * 旧い文(コードにする前に action に保存した文)からコード
6
+ * migration(platform の0134、registry の0032)が同じ表で行を書き換える。旧い文の行がレジストリと環境の DB から消えたら外す
7
+ */
8
+ export declare const LEGACY_AUDIT_ACTIONS: Readonly<Record<string, AuditActionCode>>;
9
+ /** アプリの操作の旧い文(アプリのマニフェストに移したコード) */
10
+ export declare const LEGACY_APP_AUDIT_ACTIONS: Readonly<Record<string, string>>;
@@ -0,0 +1,18 @@
1
+ /** 切り替えの行(at は ISO 8601、detail は JSON の { from, to }) */
2
+ export type PromoteRow = Readonly<{
3
+ at: string;
4
+ detail: string | null;
5
+ }>;
6
+ /** live だった期間(after はその環境へ切り替えた時刻、before は外した時刻。なしは端なし。ISO 8601) */
7
+ export type LivePeriod = Readonly<{
8
+ environmentId: string;
9
+ after?: string;
10
+ before?: string;
11
+ }>;
12
+ /**
13
+ * 環境の履歴のつながり(切り替えの行は新しい順、環境の ID は UUID でも base32 でもよく、期間の環境の ID は base32)
14
+ * 今の環境はその環境へ切り替えた後、前の環境は live だった期間だけを引き継ぐ。最後の切り替えの先でない環境は、自分の全期間の1つだけ
15
+ */
16
+ export declare function livePeriodsOf(switchesNewestFirst: readonly PromoteRow[], given: string): LivePeriod[];
17
+ /** 環境の時刻 at の行が、つながりの live だった期間にあるか */
18
+ export declare const withinLivePeriods: (periods: readonly LivePeriod[], environmentId: string, at: string) => boolean;
@@ -0,0 +1,51 @@
1
+ import { type ManagementPrincipal, type Operation } from './authorize.js';
2
+ import { type PrincipalShape, type Subject } from './principal.js';
3
+ import type { Permissions } from './permissions.js';
4
+ /**
5
+ * 管理の権限のチェック
6
+ * - schema: スキーマの変更、environments: 環境の作成と削除、request_production: 本番への反映の申請
7
+ * - api_keys: API の鍵、secrets: 連携の秘密値(Webhook の送信先と鍵、外部関数の鍵)、memberships: メンバーとロールと招待
8
+ * - deployments: サイトの配置(公開は替えない)、activations: 配置したサイトの有効化(公開するデプロイを替える)
9
+ */
10
+ export declare const MANAGE_CHECKS: readonly ["schema", "environments", "request_production", "api_keys", "secrets", "memberships", "deployments", "activations"];
11
+ /** 管理の権限のチェック */
12
+ export type ManageCheck = (typeof MANAGE_CHECKS)[number];
13
+ /** 権限の表での管理の権限の id */
14
+ export declare const manageTarget: (check: ManageCheck) => string;
15
+ /** 権限の表の対象が管理の権限か */
16
+ export declare const isManageTarget: (id: string) => boolean;
17
+ /** 管理の権限を持つか(判定は authorize) */
18
+ export declare const canManage: (user: Subject, check: ManageCheck) => boolean;
19
+ /** 持つ管理の権限 */
20
+ export declare const manageChecksOf: (user: Subject) => readonly ManageCheck[];
21
+ /** MCP の上限で MCP に開く管理の領域(本番への反映の申請だけ。承認とほかの管理の領域は MCP で行えない) */
22
+ export declare const MCP_MANAGED_AREAS: readonly string[];
23
+ /** MCP の接続が管理の領域を操作できるか(MCP に開く領域で、接続したアカウントのロールが持ち、接続の段階が content:write を含む) */
24
+ export declare function mcpManages(principal: PrincipalShape, operation: Operation, area: string): boolean;
25
+ /** 管理の権限の行(更新の可だけ) */
26
+ export declare const manageRowsOf: (checks: readonly ManageCheck[]) => Permissions;
27
+ /** ロールの開ける環境(all はすべて) */
28
+ type Environments = 'all' | readonly string[];
29
+ /** 比べるロール(admin は管理者のロール) */
30
+ export type RoleScope = Readonly<{
31
+ admin: boolean;
32
+ permissions: Permissions;
33
+ environments: Environments;
34
+ }>;
35
+ /**
36
+ * ロールが自分のロールに含まれるか(自分より広い権限を付けない)
37
+ * - コレクションの表と管理の権限は対象と操作ごとの段階、開ける環境は集合で比べる。管理者は何でも付けられ、管理者のロールは管理者だけが付けられる
38
+ */
39
+ export declare function roleWithin(candidate: RoleScope, own: RoleScope): boolean;
40
+ /**
41
+ * 承認の再認証の要素(後で足すのはここだけ。組織の設定はこの中から選ぶ)
42
+ * - login: ログインし直し(全組織で必ず求め、外せない)、totp: 認証アプリの確認コード
43
+ */
44
+ export declare const REAUTH_FACTORS: readonly ["login", "totp"];
45
+ /** 承認の再認証の要素 */
46
+ export type ReauthFactor = (typeof REAUTH_FACTORS)[number];
47
+ /** 組織の設定の要素の値(未知の値を捨て、login を必ず含める。厳しくはできるが緩められない) */
48
+ export declare const reauthFactorsOf: (raw: unknown) => readonly ReauthFactor[];
49
+ /** プロジェクトのワークスペースのアカウントを、プロジェクトの管理の操作の主体に(MCP とアプリは管理の権限を持たないので、管理者でも表を空にする) */
50
+ export declare const projectAccountPrincipal: (user: Subject, projectId: string) => ManagementPrincipal;
51
+ export {};
@@ -0,0 +1,11 @@
1
+ /** 管理の権限の表示名 */
2
+ export declare const MANAGE_CHECK_LABELS: {
3
+ readonly schema: "スキーマの変更";
4
+ readonly environments: "環境の作成と削除";
5
+ readonly request_production: "本番への反映の申請";
6
+ readonly api_keys: "API キー";
7
+ readonly secrets: "連携の秘密値";
8
+ readonly memberships: "メンバーとロール";
9
+ readonly deployments: "サイトの配置";
10
+ readonly activations: "サイトの有効化";
11
+ };
@@ -0,0 +1,66 @@
1
+ import type { AppCollection, AppSettingDef } from './appDependencies.js';
2
+ import { type AppManifest, type AppManifestProblem, type AppUi } from './apps.js';
3
+ /** 表示の文字列の塊の言語(ja は必須で基準、en がない文字列は ja) */
4
+ export declare const APP_TEXT_LANGS: readonly ["ja", "en"];
5
+ export type AppTextLang = (typeof APP_TEXT_LANGS)[number];
6
+ type TextTable = Readonly<Record<string, string>>;
7
+ /** 言語ごとの表示の文字列の塊 */
8
+ export type AppManifestText = Readonly<{
9
+ label?: string;
10
+ description?: string;
11
+ targets?: TextTable;
12
+ audit_actions?: TextTable;
13
+ problems?: TextTable;
14
+ permissions?: TextTable;
15
+ ui?: TextTable;
16
+ settings?: Readonly<Record<string, Readonly<{
17
+ label?: string;
18
+ unit?: string;
19
+ }>>>;
20
+ collections?: Readonly<Record<string, Readonly<{
21
+ label?: string;
22
+ fields?: TextTable;
23
+ }>>>;
24
+ }>;
25
+ type Json = Readonly<Record<string, unknown>>;
26
+ /** 塊に移したフィールドの宣言(label を持たない) */
27
+ export type AppManifestDocumentField = Json & Readonly<{
28
+ key: string;
29
+ fields?: readonly AppManifestDocumentField[];
30
+ }>;
31
+ /** 塊に移したコレクションの宣言 */
32
+ export type AppManifestDocumentCollection = Omit<AppCollection, 'label' | 'fields'> & Readonly<{
33
+ fields: readonly AppManifestDocumentField[];
34
+ }>;
35
+ /** 登録と保存のマニフェスト */
36
+ export type AppManifestDocument = Readonly<Omit<AppManifest, 'label' | 'description' | 'targets' | 'audit_actions' | 'problems' | 'en' | 'permissions' | 'ui' | 'settings' | 'collections'> & {
37
+ permissions?: readonly Readonly<{
38
+ id: string;
39
+ }>[];
40
+ ui?: readonly Omit<AppUi, 'label'>[];
41
+ settings?: readonly Omit<AppSettingDef, 'label' | 'unit'>[];
42
+ collections?: readonly AppManifestDocumentCollection[];
43
+ ja: AppManifestText & Readonly<{
44
+ label: string;
45
+ }>;
46
+ en?: AppManifestText;
47
+ }>;
48
+ /** 登録のマニフェストの項目(登録はこれ以外の項目を拒否する) */
49
+ export declare const APP_MANIFEST_DOCUMENT_KEYS: readonly string[];
50
+ /**
51
+ * 登録と保存の形から、表示の文字列を本体に戻した形(lang の文字列、なければ ja)
52
+ * - 形を確かめない(検査は appManifestDocumentProblems)。塊の文字列のない項目は label なしのまま
53
+ */
54
+ export declare function manifestFromDocument(document: unknown, lang?: AppTextLang): unknown;
55
+ /** 読む側の形から登録と保存の形(同梱のアプリのマニフェストを登録の形で扱うときと、試験の材料) */
56
+ export declare function manifestDocumentOf(manifest: AppManifest): AppManifestDocument;
57
+ /**
58
+ * 保存したマニフェストの検査(読み取り。知らない項目は拒否しない)
59
+ * - 塊の形、本体に残った表示の文字列、塊を解いた形の検査(appManifestProblems、箇所は登録と保存の形で)
60
+ */
61
+ export declare function appManifestDocumentProblems(input: unknown, namespace: string | null): AppManifestProblem[];
62
+ /** 登録するマニフェストの検査(形のバージョン、知らない項目の拒否、registeringManifestProblems の決まり) */
63
+ export declare function registeringDocumentProblems(input: unknown, namespace: string | null): AppManifestProblem[];
64
+ /** 保存したマニフェストの JSON を読む側の形に(壊れていれば null) */
65
+ export declare function storedManifestOf(raw: string | null, namespace: string | null): AppManifest | null;
66
+ export {};
@@ -0,0 +1,139 @@
1
+ import type { Operation } from './authorize.js';
2
+ import type { Capabilities } from './principal.js';
3
+ /** 範囲(下から順、上は下を含む) */
4
+ export declare const MCP_SCOPES: readonly ["content:read", "content:write", "content:publish"];
5
+ /** 範囲 */
6
+ export type McpScope = (typeof MCP_SCOPES)[number];
7
+ /** 資源のメタデータの scopes_supported(基本の最小、公開は範囲の不足の応答で足す) */
8
+ export declare const MCP_BASIC_SCOPES: readonly McpScope[];
9
+ /** 範囲の文字列(空白区切り)から、知っている範囲(下から順、重なりなし。知らない語は捨てる) */
10
+ export declare const parseMcpScope: (text: string | null | undefined) => McpScope[];
11
+ /** 範囲の文字列(空白区切り、下から順) */
12
+ export declare const formatMcpScope: (scopes: readonly McpScope[]) => string;
13
+ /** 範囲の能力(対象 * とファイルに、含む範囲の操作) */
14
+ export declare function mcpCapabilitiesOf(scopes: readonly McpScope[]): Capabilities;
15
+ /** 操作に要る最小の範囲(範囲で出せない操作は null。read は read_drafts で満たす) */
16
+ export declare function mcpScopeFor(operation: Operation): McpScope | null;
17
+ /** 同意の画面のプリセット(読み取りだけ、下書きまで、公開まで。公開まではロールが公開できるときだけ出す) */
18
+ export declare const MCP_PRESETS: {
19
+ readonly read: readonly ["content:read"];
20
+ readonly draft: readonly ["content:read", "content:write"];
21
+ readonly publish: readonly ["content:read", "content:write", "content:publish"];
22
+ };
23
+ /** 同意の画面のプリセットの名前 */
24
+ export type McpPreset = keyof typeof MCP_PRESETS;
25
+ /** 同意の画面の既定のプリセット */
26
+ export declare const MCP_DEFAULT_PRESET: McpPreset;
27
+ /**
28
+ * MCP のアクセストークンの形(環境の値 MCP_TOKEN と名前を分ける)
29
+ * - JWS のコンパクトな形、HS256。発行と検証はどちらもプロジェクトの CMS だけ
30
+ * - 鍵は SECRETS_KEY の各鍵から用途 mcpAccessToken でプロジェクトごとに導く(署名は今の鍵、照合はどれか、鍵の回転はこの移行の期間)
31
+ * - トークンの全体は接頭辞 tns_at_ と JWS。更新のトークンは tns_rt_ の秘密の値のトークン(ids.ts。保存はハッシュだけ、使うたびに作り直す)
32
+ * - idleSec: 使わずに付与が切れる秒数、absoluteSec: つないでから同意のやり直しまでの秒数
33
+ * - codeTtlSec: 認可のコード、requestTtlSec: 認可の途中の要求、refreshGraceSec: 同時の更新の猶予(付与ごとに1回)
34
+ */
35
+ export declare const MCP_ACCESS_TOKEN: {
36
+ readonly typ: "tunasand-mcp+jwt";
37
+ readonly alg: "HS256";
38
+ readonly ttlSec: 3600;
39
+ readonly idleSec: number;
40
+ readonly absoluteSec: number;
41
+ readonly codeTtlSec: 60;
42
+ readonly requestTtlSec: 600;
43
+ readonly refreshGraceSec: 60;
44
+ };
45
+ /** MCP のアクセストークンのクレーム(iss は発行者 = 資源の URL、aud は資源の URL、sub はアカウントの ID、gid は付与の ID、scope は範囲、時刻は秒) */
46
+ export type McpAccessTokenClaims = Readonly<{
47
+ iss: string;
48
+ aud: string;
49
+ sub: string;
50
+ gid: string;
51
+ scope: string;
52
+ iat: number;
53
+ exp: number;
54
+ jti: string;
55
+ }>;
56
+ /** プロジェクトの MCP の資源の URL(発行者も同じ。末尾の / なし) */
57
+ export declare const mcpResourceOf: (mcpOrigin: string, project: string) => string;
58
+ /**
59
+ * 要求の resource が資源の URL か、その環境を選ぶ URL(<資源>/env/<…>)か(末尾の / の有無、スキームとホストの大文字を許す)
60
+ * - 発行するトークンの aud は資源の URL のまま
61
+ */
62
+ export declare function sameMcpResource(requested: string, resource: string): boolean;
63
+ /** CIMD の client_id のホストの許可の一覧(Claude Code の CIMD も claude.ai の上にある) */
64
+ export declare const MCP_CIMD_HOSTS: readonly ["claude.ai", "claude.com", "chatgpt.com"];
65
+ /** DCR の戻り先の許可の一覧(完全一致。ループバックは別に、ポートを問わず許す) */
66
+ export declare const MCP_DCR_REDIRECTS: readonly ["https://claude.ai/api/mcp/auth_callback", "https://claude.com/api/mcp/auth_callback"];
67
+ /** ループバックの戻り先か(http、ポートを問わない、利用者の情報と断片なし) */
68
+ export declare function isLoopbackRedirect(uri: string): boolean;
69
+ /** URL の形の client_id か(CIMD) */
70
+ export declare const isCimdClientId: (clientId: string) => boolean;
71
+ /** CIMD の client_id を受けるか(HTTPS、許可の一覧のホスト、パスあり、利用者の情報と問い合わせと断片なし) */
72
+ export declare function allowedCimdClientId(clientId: string): boolean;
73
+ /** DCR の戻り先を受けるか */
74
+ export declare const allowedDcrRedirect: (uri: string) => boolean;
75
+ /**
76
+ * 認可の要求の戻り先がクライアントに登録した戻り先か
77
+ * - ループバックはポートを除いて比べる(RFC 8252の7.3)。ほかは完全一致
78
+ * - CIMD はクライアントの文書の redirect_uris、DCR は登録の redirect_uris(どちらも登録の時に許可の一覧で絞ってある)
79
+ */
80
+ export declare function matchesRedirect(requested: string, registered: readonly string[]): boolean;
81
+ /** クライアントの検査の材料(kind はクライアントの種類、redirectUris は文書か登録の戻り先) */
82
+ export type McpClientFacts = Readonly<{
83
+ kind: 'cimd' | 'dcr';
84
+ clientId: string;
85
+ redirectUris: readonly string[];
86
+ }>;
87
+ /** クライアントの戻り先の検査の問題(なしは null) */
88
+ export type McpClientProblem = 'client_not_allowed' | 'redirect_not_allowed' | 'redirect_mismatch';
89
+ /** CIMD の文書の戻り先を受けるか(ループバックか、client_id と同じ持ち主のホストの HTTPS) */
90
+ export declare function allowedCimdRedirect(clientId: string, uri: string): boolean;
91
+ /**
92
+ * 認可の要求のクライアントと戻り先の検査(Worker が画面で止めるときと、CMS がコードを発行し交換するときの両方で同じ関数)
93
+ * - CIMD: client_id が許可の一覧、文書の戻り先はループバックか client_id と同じ持ち主のホストだけを残す
94
+ * - DCR: 登録の戻り先は許可の一覧だけ
95
+ */
96
+ export declare function mcpClientProblem(client: McpClientFacts, redirectUri: string): McpClientProblem | null;
97
+ /** Authorization の Bearer の値(RFC 6750の b64token の形。なし・形の違いは null。CMS と MCP の Worker で同じ判定) */
98
+ export declare const bearerTokenOf: (header: string | null | undefined) => string | null;
99
+ /** PKCE の code_challenge の形(S256、base64url の43文字) */
100
+ export declare const isS256Challenge: (challenge: string | null | undefined) => boolean;
101
+ /** PKCE の code_verifier の形(RFC 7636、43〜128文字) */
102
+ export declare const isCodeVerifier: (verifier: string | null | undefined) => boolean;
103
+ /** AI の名前の鍵(保存する値。表示は mcpLabels.ts の辞書で引く) */
104
+ export declare const MCP_CLIENT_KEYS: readonly ["claude", "claude_code", "chatgpt", "local"];
105
+ /** AI の名前の鍵 */
106
+ export type McpClientKey = (typeof MCP_CLIENT_KEYS)[number];
107
+ /**
108
+ * AI の名前の鍵(同意の画面と「つないだ AI」。申告の名前より先に使い、名前を偽れないようにする)
109
+ * - CIMD: client_id から(知っている文書は完全一致、ほかは許可のホストの持ち主)
110
+ * - DCR: 照合を通った要求の戻り先から(ループバックは local。登録に別の戻り先が並んでいても使わない)
111
+ */
112
+ export declare function mcpClientKeyOf(client: McpClientFacts, redirectUri: string): McpClientKey;
113
+ /** 申告の名前の保存の形(前後の空白を除き60文字まで、空は null) */
114
+ export declare const declaredNameOf: (name: unknown) => string | null;
115
+ /**
116
+ * DCR の登録の上限
117
+ * - unusedClients: プロジェクトごとの一度も使っていないクライアントの件数、unusedPerRegistrant: 接続元の指紋(IPv4 か IPv6 の /64)ごとの同じ件数
118
+ * - unusedHours: 一度も使っていないクライアントを消すまでの時間(使ったことのあるものは付与の絶対期限の後に消す)
119
+ */
120
+ export declare const MCP_DCR_LIMITS: {
121
+ readonly unusedClients: 200;
122
+ readonly unusedPerRegistrant: 5;
123
+ readonly unusedHours: 24;
124
+ };
125
+ /** つないだ AI(MCP の接続の付与の1行。ワークスペースの一覧、email は管理者の全員の一覧だけ) */
126
+ export type McpConnection = Readonly<{
127
+ id: string;
128
+ accountId: string;
129
+ clientLabel: string;
130
+ clientKind: 'cimd' | 'dcr';
131
+ redirectHost: string;
132
+ scope: McpScope[];
133
+ createdAt: string;
134
+ lastUsedAt: string | null;
135
+ expiresAt: string;
136
+ email?: string | null;
137
+ }>;
138
+ /** 接続元の指紋の元(IPv4 はそのまま、IPv6 は前半の64ビット。DCR の登録の接続元ごとの上限) */
139
+ export declare function registrantOf(ip: string | null | undefined): string | null;
@@ -0,0 +1,5 @@
1
+ import type { McpClientKey } from './mcpAuth.js';
2
+ /** AI の名前の鍵の表示名 */
3
+ export declare const MCP_CLIENT_LABELS: Readonly<Record<McpClientKey, string>>;
4
+ /** 表示する AI の名前(申告の名前は表の名前に括弧で添えるだけ。知らない鍵は local) */
5
+ export declare function mcpClientLabelOf(key: string, declared: string | null): string;