@tunasand/sdk 0.8.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 (215) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/README.md +162 -143
  3. package/dist/analytics.js +76 -65
  4. package/dist/app.js +184 -163
  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 +1 -13
  15. package/dist/build-file-DNi0PHC5.js +31 -0
  16. package/dist/cli.js +6212 -8
  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-DuNMsdXw.js → declared-CE4a61qb.js} +35 -35
  23. package/dist/delivery.js +121 -114
  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/endUsers-DODfjnv1.js +77 -0
  30. package/dist/{errorLabels-BgtQ_zUn.js → errorLabels-aT2bnMsO.js} +355 -235
  31. package/dist/i18n.js +4 -4
  32. package/dist/ids-DmtIoqBX.js +109 -0
  33. package/dist/integrations.js +95 -24
  34. package/dist/{ja-Du6ooL6i.js → ja-CrY_72Tn.js} +88 -44
  35. package/dist/{ja-CeHU0EaY.js → ja-axQPxMJ-.js} +3 -3
  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-Bzrj24sJ.js → page-yo1cw1kW.js} +1 -1
  40. package/dist/preview.js +8 -1
  41. package/dist/{profile-1em_lcxq.js → profile-DBsXLvvI.js} +48 -48
  42. package/dist/rich-text.js +16 -16
  43. package/dist/{schema-WnobuwLg.js → schema-Dcg1ajnW.js} +496 -263
  44. package/dist/schema.js +66 -88
  45. package/dist/types/access/src/handoff.d.ts +19 -14
  46. package/dist/types/access/src/index.d.ts +2 -2
  47. package/dist/types/access/src/jws.d.ts +41 -0
  48. package/dist/types/access/src/oidc.d.ts +10 -2
  49. package/dist/types/access/src/signed.d.ts +0 -2
  50. package/dist/types/adapter-cloudflare/src/eventLog/viewSchema.d.ts +11 -0
  51. package/dist/types/contract/src/accountProfile.d.ts +7 -0
  52. package/dist/types/contract/src/apiKeys.d.ts +6 -2
  53. package/dist/types/contract/src/app.d.ts +15 -5
  54. package/dist/types/contract/src/appChannels.d.ts +114 -0
  55. package/dist/types/contract/src/appDefinition.d.ts +11 -5
  56. package/dist/types/contract/src/appDependencies.d.ts +87 -24
  57. package/dist/types/contract/src/appIdentities.d.ts +21 -0
  58. package/dist/types/contract/src/appInbound.d.ts +28 -0
  59. package/dist/types/contract/src/appMail.d.ts +106 -0
  60. package/dist/types/contract/src/appSecrets.d.ts +45 -0
  61. package/dist/types/contract/src/appServer.d.ts +408 -43
  62. package/dist/types/contract/src/approvals.d.ts +1 -1
  63. package/dist/types/contract/src/apps.d.ts +112 -55
  64. package/dist/types/contract/src/auditActions.d.ts +2 -2
  65. package/dist/types/contract/src/auditLabels.d.ts +111 -15
  66. package/dist/types/contract/src/authorize.d.ts +42 -14
  67. package/dist/types/contract/src/bridge.d.ts +34 -35
  68. package/dist/types/contract/src/consents.d.ts +32 -25
  69. package/dist/types/contract/src/deletion.d.ts +18 -0
  70. package/dist/types/contract/src/embeds.d.ts +16 -82
  71. package/dist/types/contract/src/{customerLabels.d.ts → endUserLabels.d.ts} +6 -9
  72. package/dist/types/contract/src/endUsers.d.ts +241 -0
  73. package/dist/types/contract/src/errorLabels.d.ts +63 -36
  74. package/dist/types/contract/src/errorLabelsEn.d.ts +46 -32
  75. package/dist/types/contract/src/errors.d.ts +28 -16
  76. package/dist/types/contract/src/eventSchemas.d.ts +70 -0
  77. package/dist/types/contract/src/eventTraces.d.ts +43 -0
  78. package/dist/types/contract/src/failureStatus.d.ts +14 -22
  79. package/dist/types/contract/src/fieldAccess.d.ts +8 -8
  80. package/dist/types/contract/src/formLabels.d.ts +3 -0
  81. package/dist/types/contract/src/forms.d.ts +4 -0
  82. package/dist/types/contract/src/grants.d.ts +26 -0
  83. package/dist/types/contract/src/headers.d.ts +5 -0
  84. package/dist/types/contract/src/hostingRpc.d.ts +23 -17
  85. package/dist/types/contract/src/identifiers.d.ts +45 -17
  86. package/dist/types/contract/src/ids.d.ts +18 -10
  87. package/dist/types/contract/src/import.d.ts +17 -16
  88. package/dist/types/contract/src/index.d.ts +52 -27
  89. package/dist/types/contract/src/integrationGraph.d.ts +83 -0
  90. package/dist/types/contract/src/issueLabels.d.ts +113 -81
  91. package/dist/types/contract/src/issueLabelsEn.d.ts +57 -41
  92. package/dist/types/contract/src/manage.d.ts +11 -7
  93. package/dist/types/contract/src/manageLabels.d.ts +2 -0
  94. package/dist/types/contract/src/manifestText.d.ts +66 -0
  95. package/dist/types/contract/src/messagePort.d.ts +208 -0
  96. package/dist/types/contract/src/migration.d.ts +2 -2
  97. package/dist/types/contract/src/notices.d.ts +38 -0
  98. package/dist/types/contract/src/operatorOperations.d.ts +0 -63
  99. package/dist/types/contract/src/outbound.d.ts +29 -0
  100. package/dist/types/contract/src/paths.d.ts +13 -0
  101. package/dist/types/contract/src/pending.d.ts +2 -0
  102. package/dist/types/contract/src/permissions.d.ts +7 -11
  103. package/dist/types/contract/src/perspective.d.ts +26 -0
  104. package/dist/types/contract/src/powers.d.ts +5 -0
  105. package/dist/types/contract/src/principal.d.ts +127 -56
  106. package/dist/types/contract/src/recordLabels.d.ts +6 -0
  107. package/dist/types/contract/src/roles.d.ts +7 -4
  108. package/dist/types/contract/src/ruleLabels.d.ts +16 -0
  109. package/dist/types/contract/src/ruleProblems.d.ts +16 -0
  110. package/dist/types/contract/src/schemaLabels.d.ts +8 -0
  111. package/dist/types/contract/src/settingProblems.d.ts +1 -1
  112. package/dist/types/contract/src/settings.d.ts +5 -7
  113. package/dist/types/contract/src/siteDeclaration.d.ts +7 -7
  114. package/dist/types/contract/src/siteIndex.d.ts +76 -0
  115. package/dist/types/contract/src/transfer.d.ts +1 -1
  116. package/dist/types/contract/src/trial.d.ts +4 -1
  117. package/dist/types/contract/src/versions.d.ts +1 -3
  118. package/dist/types/contract/src/viewEvent.d.ts +0 -9
  119. package/dist/types/contract/src/webhooks.d.ts +24 -3
  120. package/dist/types/contract/src/workflow.d.ts +13 -19
  121. package/dist/types/contract/src/workspaceItems.d.ts +20 -6
  122. package/dist/types/rich-text/src/html.d.ts +1 -1
  123. package/dist/types/rich-text/src/index.d.ts +8 -7
  124. package/dist/types/rich-text/src/labels/en.d.ts +1 -1
  125. package/dist/types/rich-text/src/labels/ja.d.ts +2 -2
  126. package/dist/types/rich-text/src/library.d.ts +1 -1
  127. package/dist/types/rich-text/src/media.d.ts +2 -0
  128. package/dist/types/rich-text/src/normalize.d.ts +1 -1
  129. package/dist/types/rich-text/src/problems.d.ts +5 -5
  130. package/dist/types/rich-text/src/profile.d.ts +10 -10
  131. package/dist/types/rich-text/src/render.d.ts +1 -1
  132. package/dist/types/rich-text/src/schema.d.ts +2 -2
  133. package/dist/types/rich-text/src/standard.d.ts +4 -4
  134. package/dist/types/rich-text/src/types.d.ts +2 -2
  135. package/dist/types/schema/src/audience.d.ts +1 -3
  136. package/dist/types/schema/src/capabilities.d.ts +18 -27
  137. package/dist/types/schema/src/changes.d.ts +3 -1
  138. package/dist/types/schema/src/collection.d.ts +138 -111
  139. package/dist/types/schema/src/defaultSchema.d.ts +8 -2
  140. package/dist/types/schema/src/fieldIds.d.ts +18 -0
  141. package/dist/types/schema/src/file.d.ts +22 -11
  142. package/dist/types/schema/src/fileRefs.d.ts +14 -0
  143. package/dist/types/schema/src/fileSignature.d.ts +20 -0
  144. package/dist/types/schema/src/filesCollection.d.ts +7 -0
  145. package/dist/types/schema/src/forms.d.ts +43 -0
  146. package/dist/types/schema/src/imageMetadata.d.ts +9 -0
  147. package/dist/types/schema/src/index.d.ts +18 -10
  148. package/dist/types/schema/src/input.d.ts +1 -1
  149. package/dist/types/schema/src/integrity.d.ts +8 -7
  150. package/dist/types/schema/src/kinds.d.ts +26 -0
  151. package/dist/types/schema/src/labels/en.d.ts +87 -46
  152. package/dist/types/schema/src/labels/ja.d.ts +89 -45
  153. package/dist/types/schema/src/mediaUrl.d.ts +26 -33
  154. package/dist/types/schema/src/page.d.ts +4 -4
  155. package/dist/types/schema/src/problems.d.ts +82 -41
  156. package/dist/types/schema/src/refs.d.ts +0 -9
  157. package/dist/types/schema/src/schema.d.ts +17 -12
  158. package/dist/types/schema/src/selfOps.d.ts +20 -19
  159. package/dist/types/schema/src/traits.d.ts +28 -0
  160. package/dist/types/schema/src/typesSource.d.ts +1 -1
  161. package/dist/types/schema/src/values.d.ts +5 -2
  162. package/dist/types/schema/src/widening.d.ts +3 -0
  163. package/dist/types/sdk/src/analytics.d.ts +2 -1
  164. package/dist/types/sdk/src/app.d.ts +40 -14
  165. package/dist/types/sdk/src/astro-image.d.ts +19 -0
  166. package/dist/types/sdk/src/astro-response.d.ts +6 -0
  167. package/dist/types/sdk/src/astro-server.d.ts +16 -0
  168. package/dist/types/sdk/src/astro.d.ts +19 -0
  169. package/dist/types/sdk/src/bridge.d.ts +2 -4
  170. package/dist/types/sdk/src/code.d.ts +61 -0
  171. package/dist/types/sdk/src/delegation.d.ts +13 -3
  172. package/dist/types/sdk/src/delivery/changes.d.ts +4 -4
  173. package/dist/types/sdk/src/delivery/client.d.ts +33 -22
  174. package/dist/types/sdk/src/delivery/fields.d.ts +3 -3
  175. package/dist/types/sdk/src/delivery/index.d.ts +3 -3
  176. package/dist/types/sdk/src/delivery/media.d.ts +5 -8
  177. package/dist/types/sdk/src/delivery/query.d.ts +15 -11
  178. package/dist/types/sdk/src/delivery/schema.d.ts +1 -1
  179. package/dist/types/sdk/src/delivery/values.d.ts +10 -14
  180. package/dist/types/sdk/src/delivery.d.ts +2 -2
  181. package/dist/types/sdk/src/dev-operations.d.ts +20 -0
  182. package/dist/types/sdk/src/dev.d.ts +6 -5
  183. package/dist/types/sdk/src/end-users.d.ts +190 -0
  184. package/dist/types/sdk/src/i18n.d.ts +2 -2
  185. package/dist/types/sdk/src/integrations.d.ts +14 -21
  186. package/dist/types/sdk/src/operations.d.ts +17 -0
  187. package/dist/types/sdk/src/preview.d.ts +2 -1
  188. package/dist/types/sdk/src/rich-text.d.ts +2 -2
  189. package/dist/types/sdk/src/schema.d.ts +1 -1
  190. package/dist/types/sdk/src/site/artifact.d.ts +64 -0
  191. package/dist/types/sdk/src/site/build-file.d.ts +30 -0
  192. package/dist/types/sdk/src/site/check-code.d.ts +14 -0
  193. package/dist/types/sdk/src/site/check-text.d.ts +19 -0
  194. package/dist/types/sdk/src/site/cli.d.ts +52 -0
  195. package/dist/types/sdk/src/site/content-type.d.ts +2 -0
  196. package/dist/types/sdk/src/site/labels.d.ts +14 -0
  197. package/dist/types/sdk/src/types.d.ts +1 -1
  198. package/dist/{types-B77qvqPJ.js → types-DkO2N7u2.js} +5 -6
  199. package/dist/types.js +1 -1
  200. package/dist/{typesSource-CWybQYus.js → typesSource-VJIxtN9b.js} +17 -15
  201. package/dist/workflow-CUpl6hO_.js +148 -0
  202. package/package.json +32 -6
  203. package/dist/apps-BxnJ1RlU.js +0 -435
  204. package/dist/bridge-DtHw9hS6.js +0 -74
  205. package/dist/collection-BEOxeISR.js +0 -189
  206. package/dist/customers-DTbL0qn6.js +0 -86
  207. package/dist/customers.d.ts +0 -1
  208. package/dist/customers.js +0 -185
  209. package/dist/embeds-B5V54Zur.js +0 -34
  210. package/dist/ids--RF7hGyC.js +0 -36
  211. package/dist/src-sazhzYui.js +0 -71
  212. package/dist/types/contract/src/customers.d.ts +0 -266
  213. package/dist/types/schema/src/legacy.d.ts +0 -2
  214. package/dist/types/schema/src/media.d.ts +0 -5
  215. package/dist/types/sdk/src/customers.d.ts +0 -184
@@ -18,11 +18,14 @@ export declare const ERROR_MESSAGES_EN: {
18
18
  readonly external_function: "external function";
19
19
  readonly external_screen: "external screen";
20
20
  readonly api_key: "API key";
21
- readonly preview: "preview signing key";
21
+ readonly read_token: "read token";
22
+ readonly mail_domain: "sending domain";
23
+ readonly channel: "channel";
24
+ readonly channel_address: "channel address";
22
25
  readonly trash: "trash";
23
- readonly customer: "customer";
24
- readonly customer_identity: "customer identity";
25
- readonly customer_grant: "customer grant";
26
+ readonly end_user: "end user";
27
+ readonly end_user_identity: "end user identity";
28
+ readonly entitlement: "end user entitlement";
26
29
  readonly app: "app";
27
30
  readonly installation: "installation";
28
31
  readonly invitation: "invitation";
@@ -30,8 +33,8 @@ export declare const ERROR_MESSAGES_EN: {
30
33
  };
31
34
  readonly codes: {
32
35
  readonly invalid_input: "The input is invalid.";
33
- readonly infra_id_uuid: "Specify the 26-character ID of lowercase letters and digits, not a UUID.";
34
- readonly submit_unmet: "The submission requirements are not met.";
36
+ readonly uuid_not_accepted: "Specify the 26-character ID of lowercase letters and digits, not a UUID.";
37
+ readonly transition_unmet: "The submission requirements are not met.";
35
38
  readonly publish_unmet: "The publishing requirements are not met.";
36
39
  readonly save_unmet: "The saving requirements are not met.";
37
40
  readonly version_required: "The base version (version) is required.";
@@ -46,8 +49,8 @@ export declare const ERROR_MESSAGES_EN: {
46
49
  readonly invalid_mcp_token: "The call from MCP is invalid.";
47
50
  readonly mcp_signature_invalid: "Cannot verify the call from the MCP server. Contact the operator.";
48
51
  readonly invalid_account_token: "The app account credential token is invalid. Replace it with the token shown on the screen.";
49
- readonly preview_token_required: "A preview signature is required to get drafts.";
50
- readonly invalid_preview_token: "The preview signature does not match.";
52
+ readonly read_token_required: "An API key, read token or perspective ticket that can read unpublished versions is required.";
53
+ readonly invalid_read_token: "The read token or ticket is invalid or expired.";
51
54
  readonly api_key_required: "An API key is required (Authorization: Bearer).";
52
55
  readonly invalid_api_key: "The API key is invalid.";
53
56
  readonly invalid_id_token: "The ID token is invalid. Get a new one and send it again.";
@@ -60,28 +63,28 @@ export declare const ERROR_MESSAGES_EN: {
60
63
  readonly operator_read_only: "The operator support access is read-only, so changes are not allowed.";
61
64
  readonly not_trial: "This operation is only for projects with the trial flag.";
62
65
  readonly not_live: "This operation is only available in the live environment. Use the admin screen of the live environment.";
63
- readonly operator_closed: "This operation is outside what operator support access allows (accounts, roles, integrations, apps, customer IDs, permissions and so on).";
66
+ readonly operator_closed: "This operation is outside what operator support access allows (accounts, roles, integrations, apps, end user IDs, permissions and so on).";
64
67
  readonly forbidden: "{target, select, none {You do not have permission for this operation.} other {You do not have permission for this operation on {target}.}}";
65
- readonly editorial_only: "{target, select, none {This} other {The {target}}} can only be created by accounts with publishing permission.";
68
+ readonly create_requires_publish: "{target, select, none {This} other {The {target}}} can only be created by accounts with publishing permission.";
66
69
  readonly no_linked_record: "Accounts without a linked {name} cannot do this.";
67
70
  readonly own_only: "You can only operate on your own {target, select, none {items} other {{target}}}.";
68
71
  readonly not_visible: "You cannot view unpublished {target, select, none {items} other {{target}}} of other people.";
69
- readonly published_admin_only: "Editing published records requires publishing permission.";
72
+ readonly edit_requires_publish: "Editing published records requires publishing permission.";
70
73
  readonly cannot_remove_self: "You cannot remove yourself from the link.";
71
74
  readonly cannot_change_owner: "The owner cannot be changed.";
72
75
  readonly not_found: "{target, select, none {The target} other {The {target}}} was not found.";
73
76
  readonly method_not_allowed: "This path does not accept this method.";
74
- readonly customer_not_linked: "No customer is linked to this account.";
75
- readonly customer_pending: "The link of this account becomes usable after review by the operator.";
76
- readonly in_use: "{by, select, uses {Cannot delete because it is used in {count, number} items.} places {Cannot delete because it is used in {count, number} places.} outputs {Cannot delete because it is used by {count, number} planning outputs.} record {Cannot delete because it is used by {name, select, none {other content} other {{name}}}.} writers {Cannot delete because it is linked to {count, number} records.} customers {Cannot delete because {count, number} records belong to it.} accounts {Cannot delete because {count, number} accounts have this role.} app {Cannot delete because it is referenced by {count, number} {name, select, none {extension records} other {{name}}}.} other {Cannot delete because it is in use.}}";
77
+ readonly end_user_not_linked: "No end user is linked to this account.";
78
+ readonly end_user_pending: "The link of this account becomes usable after review by the operator.";
79
+ readonly in_use: "{by, select, uses {Cannot delete because it is used in {count, number} items.} places {Cannot delete because it is used in {count, number} places.} outputs {Cannot delete because it is used by {count, number} planning outputs.} record {Cannot delete because it is used by {name, select, none {other content} other {{name}}}.} writers {Cannot delete because it is linked to {count, number} records.} end_users {Cannot delete because {count, number} records belong to it.} accounts {Cannot delete because {count, number} accounts have this role.} app {Cannot delete because it is referenced by {count, number} {name, select, none {extension records} other {{name}}}.} other {Cannot delete because it is in use.}}";
77
80
  readonly duplicate_name: "The same name already exists.";
78
81
  readonly duplicate_email: "An account with the same email address already exists.";
79
82
  readonly duplicate_id: "This ID is already in use.";
80
83
  readonly duplicate_slug: "This slug is already in use.";
81
84
  readonly version_conflict: "This conflicted with another update. Load the latest version and try again.";
82
- readonly article_editing: "{name, select, none {Someone else} other {{name}}} is editing this in the CMS, so it cannot be saved. Saving becomes possible within 2 minutes after the editor is closed or another tab is selected.";
85
+ readonly record_locked: "{name, select, none {Someone else} other {{name}}} is editing this in the CMS, so it cannot be saved. Saving becomes possible within 2 minutes after the editor is closed or another tab is selected.";
83
86
  readonly invalid_state: "This operation is not possible in the current state.";
84
- readonly unpublish_first: "Unpublish published records before deleting them.";
87
+ readonly still_published: "Unpublish published records before deleting them.";
85
88
  readonly last_admin: "The last administrator cannot be removed or demoted from the administrator role.";
86
89
  readonly exceeds_own: "You cannot grant permissions wider than your own role.";
87
90
  readonly reauth_required: "Log in again before approving.";
@@ -89,7 +92,7 @@ export declare const ERROR_MESSAGES_EN: {
89
92
  readonly stale: "The content changed after the request. Request again.";
90
93
  readonly approval_closed: "This request can no longer be approved (applied, rejected, withdrawn or expired).";
91
94
  readonly cursor_expired: "The change log retention period has passed. Get all items again without cursor.";
92
- readonly already_linked: "{reason, select, identity {This account is already linked to another customer.} other {This customer is already linked to an account of the same issuer.}}";
95
+ readonly already_linked: "{reason, select, identity {This account is already linked to another end user.} record {This account is already linked to a record in this project.} other {This end user is already linked to an account of the same issuer.}}";
93
96
  readonly run_done: "This import run is already complete. Start a new run.";
94
97
  readonly invalid_invite: "{reason, select, expired {The invitation has expired.} used {The invitation has already been used.} other {The invitation was not found.}}";
95
98
  readonly body_too_large: "The request body must be at most {bodyMaxMB, number} MB.";
@@ -108,33 +111,40 @@ export declare const ERROR_MESSAGES_EN: {
108
111
  readonly no_draft: "There are no unpublished changes apart from the published version.";
109
112
  readonly not_in_review: "Not in review.";
110
113
  readonly request_handled: "This request has already been handled.";
114
+ readonly requester_unauthorized: "The requester no longer has permission to request this operation.";
111
115
  readonly deleted: "Already deleted.";
112
116
  readonly not_deleted: "Cannot restore because it is not deleted.";
113
117
  readonly schema_confirm: "This includes changes with impact. Check the counts before saving.";
114
- readonly no_publishing: "This collection has no workflow.";
118
+ readonly no_publication: "This collection has no workflow.";
115
119
  readonly no_review: "The workflow of this collection has no review.";
116
120
  readonly not_published: "Not published or scheduled.";
117
121
  readonly collection_rows: "Records remain. Check the counts before deleting.";
118
122
  readonly restore_conflict: "Cannot restore because {name, select, none {the same content} other {{name}}} already exists.";
123
+ readonly restore_target_trashed: "Cannot restore because {name} is in the trash. Restore the referenced record first.";
119
124
  readonly collection_exists: "Cannot restore because a collection with the same id already exists.";
120
125
  readonly collection_missing: "Cannot restore because the collection is deleted. Restore the collection first.";
121
- readonly not_restorable: "Cannot restore because it was deleted by a personal deletion request or after the retention of a closed customer.";
126
+ readonly not_restorable: "Cannot restore because it was deleted by a personal deletion request.";
122
127
  readonly installation_state: "This operation is not possible in the current installation state.";
123
128
  readonly site_deploy: "The site cannot be uploaded now. Another upload is in progress, or the site is stopped or removed.";
124
- readonly site_stopped_by_check: "The site was stopped because the check right after the upload failed. Upload a fix and ask the operator to restore it.";
129
+ readonly site_check_failed: "The placement was discarded because the check right after it failed. The published site is unchanged. Upload a fix.";
130
+ readonly deployment_stale: "The active deployment was changed by another operation. Reload and activate again.";
131
+ readonly deployment_not_ready: "This deployment cannot be activated. Its placement failed or no longer exists.";
132
+ readonly deployment_consent: "This deployment cannot be activated because consent for the capabilities it uses is missing.";
125
133
  readonly required_app: "Required standard features cannot be stopped or uninstalled.";
126
134
  readonly app_installed: "An app can be installed only once per project.";
127
135
  readonly app_dependencies: "Cannot satisfy the app dependencies. Check the reasons in conflicts.";
136
+ readonly app_required_by: "Cannot uninstall because other installed apps depend on it: {name}.";
128
137
  readonly app_reinstalled: "The data of the old installation cannot be deleted because the same app has been reinstalled.";
129
138
  readonly app_managed: "This registration is managed by an app installation. Change it by consenting to a new app version.";
130
139
  readonly request_key_reused: "A record with another person, channel or purpose already exists for the same deduplication key.";
131
140
  readonly no_organization: "Cannot invite because the project does not belong to an organization. Ask the operator to add it to an organization.";
132
141
  readonly schema_changed: "Could not save because the schema changed. Reload the screen.";
133
- readonly customer_inactive: "This customer is suspended or closed, so the operation is not possible.";
142
+ readonly end_user_inactive: "This end user is suspended or closed, so the operation is not possible.";
134
143
  readonly self_limit: "The limit of records per person has been reached.";
135
144
  readonly already_live: "This environment is already live.";
136
145
  readonly target_live: "The live environment cannot be deleted. Switch to another environment first.";
137
146
  readonly target_synthetic: "An environment with synthetic data cannot become live.";
147
+ readonly target_anonymized: "A copy with personal information replaced or excluded cannot become live. Ask the operator for a copy that retains the values. You can apply only its schema.";
138
148
  readonly no_changes: "There are no differences from live.";
139
149
  readonly schema_values: "Cannot apply because the changes remove fields with values. Move the values in live and try again.";
140
150
  readonly environment_limit: "The number of environments has reached the plan limit.";
@@ -142,19 +152,23 @@ export declare const ERROR_MESSAGES_EN: {
142
152
  readonly unregistered_table: "Cannot copy because some tables have no decided handling of personal information.";
143
153
  readonly not_frozen: "Writes to live are not stopped.";
144
154
  readonly approval_running: "An approved operation is running. Wait a moment and try again.";
155
+ readonly aggregate_read_only: "Aggregate collections are read-only. Only the rebuild writes their values.";
156
+ readonly not_aggregate: "This is not an aggregate collection.";
157
+ readonly condition_unmet: "The record given as the condition has changed or cannot be read.";
158
+ readonly app_state_keys_full: "The number of app state keys has reached the limit.";
145
159
  };
146
160
  readonly own: {
147
161
  readonly profile: "You can only edit your own profile.";
148
162
  readonly portrait: "You can only change your own portrait.";
149
163
  };
150
- readonly noLink: {
164
+ readonly no_link: {
151
165
  readonly mcp: "Accounts without a linked {name} cannot use MCP.";
152
166
  };
153
167
  readonly linkedRecord: "record";
154
168
  readonly titles: {
155
169
  readonly invalid_input: "Input error";
156
- readonly infra_id_uuid: "Input error";
157
- readonly submit_unmet: "Cannot submit";
170
+ readonly uuid_not_accepted: "Input error";
171
+ readonly transition_unmet: "Cannot submit";
158
172
  readonly publish_unmet: "Cannot publish";
159
173
  readonly save_unmet: "Cannot save";
160
174
  readonly version_required: "Input error";
@@ -169,8 +183,8 @@ export declare const ERROR_MESSAGES_EN: {
169
183
  readonly invalid_mcp_token: "Login error";
170
184
  readonly mcp_signature_invalid: "Login error";
171
185
  readonly invalid_account_token: "Login error";
172
- readonly preview_token_required: "Login error";
173
- readonly invalid_preview_token: "Login error";
186
+ readonly read_token_required: "Login error";
187
+ readonly invalid_read_token: "Login error";
174
188
  readonly api_key_required: "Login error";
175
189
  readonly invalid_api_key: "Login error";
176
190
  readonly invalid_id_token: "Login error";
@@ -185,26 +199,26 @@ export declare const ERROR_MESSAGES_EN: {
185
199
  readonly not_trial: "Not allowed";
186
200
  readonly not_live: "Live environment only";
187
201
  readonly forbidden: "Not allowed";
188
- readonly editorial_only: "Not allowed";
202
+ readonly create_requires_publish: "Not allowed";
189
203
  readonly no_linked_record: "Not allowed";
190
204
  readonly own_only: "Not allowed";
191
205
  readonly not_visible: "Not allowed";
192
- readonly published_admin_only: "Not allowed";
206
+ readonly edit_requires_publish: "Not allowed";
193
207
  readonly cannot_remove_self: "Not allowed";
194
208
  readonly cannot_change_owner: "Not allowed";
195
209
  readonly not_found: "Not found";
196
210
  readonly method_not_allowed: "Not possible";
197
- readonly customer_not_linked: "Not found";
198
- readonly customer_pending: "Pending review";
211
+ readonly end_user_not_linked: "Not found";
212
+ readonly end_user_pending: "Pending review";
199
213
  readonly in_use: "Cannot delete";
200
214
  readonly duplicate_name: "Duplicate";
201
215
  readonly duplicate_email: "Duplicate";
202
216
  readonly duplicate_id: "Duplicate";
203
217
  readonly duplicate_slug: "Duplicate";
204
218
  readonly version_conflict: "Update conflict";
205
- readonly article_editing: "Being edited";
219
+ readonly record_locked: "Being edited";
206
220
  readonly invalid_state: "Not possible";
207
- readonly unpublish_first: "Cannot delete";
221
+ readonly still_published: "Cannot delete";
208
222
  readonly last_admin: "Not possible";
209
223
  readonly exceeds_own: "Not allowed";
210
224
  readonly reauth_required: "Log in again";
@@ -5,7 +5,7 @@ export declare const JSON_BODY_MAX: number;
5
5
  /** 画面の側だけのコード(通信の失敗と JSON でない応答。HTTP の状態を持たない) */
6
6
  declare const NETWORK_ERROR = "network_error";
7
7
  /** CMS の API のエラーのコード(状態は failureStatus.ts の表) */
8
- declare const ERROR_CODES: readonly ["invalid_input", "submit_unmet", "publish_unmet", "save_unmet", "version_required", "file_required", "file_too_large", "unsupported_image", "unsupported_file", "invalid_dimensions", "https_required", "invalid_style", "infra_id_uuid", "login_required", "invalid_mcp_token", "mcp_signature_invalid", "invalid_account_token", "preview_token_required", "api_key_required", "invalid_api_key", "invalid_id_token", "invalid_app_token", "account_not_found", "invalid_preview_token", "api_key_forbidden", "mcp_not_allowed", "insufficient_scope", "admin_only", "operator_read_only", "operator_closed", "not_trial", "not_live", "forbidden", "editorial_only", "no_linked_record", "own_only", "not_visible", "published_admin_only", "cannot_remove_self", "cannot_change_owner", "not_found", "customer_not_linked", "customer_pending", "method_not_allowed", "in_use", "duplicate_name", "duplicate_email", "duplicate_id", "duplicate_slug", "version_conflict", "article_editing", "invalid_state", "unpublish_first", "last_admin", "exceeds_own", "reauth_required", "approval_required", "stale", "approval_closed", "already_linked", "invalid_invite", "run_done", "cursor_expired", "body_too_large", "rate_limited", "upstream_failed", "not_configured", "unavailable", "writes_paused", "environment_frozen", "job_failed", "internal_error", "network_error"];
8
+ declare const ERROR_CODES: readonly ["invalid_input", "transition_unmet", "publish_unmet", "save_unmet", "version_required", "file_required", "file_too_large", "unsupported_image", "unsupported_file", "invalid_dimensions", "https_required", "invalid_style", "uuid_not_accepted", "login_required", "invalid_mcp_token", "mcp_signature_invalid", "invalid_account_token", "read_token_required", "api_key_required", "invalid_api_key", "invalid_id_token", "invalid_app_token", "account_not_found", "invalid_read_token", "api_key_forbidden", "mcp_not_allowed", "insufficient_scope", "admin_only", "operator_read_only", "operator_closed", "not_trial", "not_live", "forbidden", "create_requires_publish", "no_linked_record", "own_only", "not_visible", "edit_requires_publish", "cannot_remove_self", "cannot_change_owner", "not_found", "end_user_not_linked", "end_user_pending", "method_not_allowed", "in_use", "duplicate_name", "duplicate_email", "duplicate_id", "duplicate_slug", "version_conflict", "record_locked", "invalid_state", "still_published", "last_admin", "exceeds_own", "reauth_required", "approval_required", "stale", "approval_closed", "already_linked", "invalid_invite", "run_done", "cursor_expired", "body_too_large", "rate_limited", "upstream_failed", "not_configured", "unavailable", "writes_paused", "environment_frozen", "job_failed", "internal_error", "network_error"];
9
9
  /** エラーのコード */
10
10
  export type ErrorCode = (typeof ERROR_CODES)[number];
11
11
  /** やり直せば通りうるエラー(画面はこれだけに再試行のボタンを出す) */
@@ -19,14 +19,14 @@ export declare const ERROR_STATUS: { readonly [K in ServerErrorCode]: (typeof FA
19
19
  * - コレクションの対象: コレクションの id、表示名はスキーマ
20
20
  * - アプリの対象: AppManifest の targets
21
21
  */
22
- export type ErrorTarget = 'request' | 'role' | 'files' | 'record' | 'file' | 'mcp' | 'version' | 'profile' | 'portrait' | 'standard_app' | 'account' | 'comment' | 'view' | 'webhook' | 'external_function' | 'external_screen' | 'api_key' | 'preview' | 'trash' | 'customer' | 'customer_identity' | 'customer_grant' | 'app' | 'installation' | 'invitation' | 'environment';
22
+ export type ErrorTarget = 'request' | 'role' | 'files' | 'record' | 'file' | 'mcp' | 'version' | 'profile' | 'portrait' | 'standard_app' | 'account' | 'comment' | 'view' | 'webhook' | 'external_function' | 'external_screen' | 'api_key' | 'read_token' | 'mail_domain' | 'channel' | 'channel_address' | 'trash' | 'end_user' | 'end_user_identity' | 'entitlement' | 'app' | 'installation' | 'invitation' | 'environment';
23
23
  /** 状態の不一致の理由(invalid_state) */
24
- export type InvalidStateReason = 'not_draft' | 'no_draft' | 'not_in_review' | 'request_handled' | 'deleted' | 'not_deleted' | 'schema_confirm' | 'no_publishing' | 'no_review' | 'not_published' | 'collection_rows' | 'restore_conflict' | 'collection_exists' | 'collection_missing' | 'not_restorable' | 'installation_state' | 'required_app' | 'app_installed' | 'app_dependencies' | 'app_reinstalled' | 'app_managed' | 'request_key_reused' | 'no_organization' | 'schema_changed' | 'site_deploy' | 'site_stopped_by_check' | 'customer_inactive' | 'self_limit' | 'already_live' | 'target_live' | 'target_synthetic' | 'no_changes' | 'schema_values' | 'environment_limit' | 'environment_busy' | 'unregistered_table' | 'not_frozen' | 'approval_running';
24
+ export type InvalidStateReason = 'not_draft' | 'no_draft' | 'not_in_review' | 'request_handled' | 'requester_unauthorized' | 'deleted' | 'not_deleted' | 'schema_confirm' | 'no_publication' | 'no_review' | 'not_published' | 'collection_rows' | 'restore_conflict' | 'restore_target_trashed' | 'collection_exists' | 'collection_missing' | 'not_restorable' | 'installation_state' | 'required_app' | 'app_installed' | 'app_dependencies' | 'app_required_by' | 'app_reinstalled' | 'app_managed' | 'request_key_reused' | 'no_organization' | 'schema_changed' | 'site_deploy' | 'site_check_failed' | 'deployment_stale' | 'deployment_not_ready' | 'deployment_consent' | 'end_user_inactive' | 'self_limit' | 'already_live' | 'target_live' | 'target_synthetic' | 'target_anonymized' | 'no_changes' | 'schema_values' | 'environment_limit' | 'environment_busy' | 'unregistered_table' | 'not_frozen' | 'approval_running' | 'aggregate_read_only' | 'not_aggregate' | 'condition_unmet' | 'app_state_keys_full';
25
25
  /**
26
26
  * 権限の拒否で足りないもの(403 forbidden の params.required)
27
27
  * - operation: 拒んだ操作(Operation か、プロジェクトの管理の操作 ManagementOperation)
28
28
  * - roles: その操作を持つロール(ロールで決まる操作だけ。管理の操作は組織のロール)
29
- * - capability: 足りない能力(アプリ・インストールの能力の文字列、例 `op:<コレクション>:read_customers`)
29
+ * - capability: 足りない能力(アプリ・インストールの能力の文字列、例 `op:<コレクション>:read_entitled`)
30
30
  */
31
31
  export type ErrorRequired = Readonly<{
32
32
  operation: Operation | ManagementOperation;
@@ -36,19 +36,21 @@ export type ErrorRequired = Readonly<{
36
36
  /** エラーの補足の値(コードごとに使用する項目だけ) */
37
37
  export type ErrorParams = {
38
38
  /**
39
- * 対象: not_found・own_only・forbidden・not_visible・no_linked_record・editorial_only・api_key_forbidden
39
+ * 対象: not_found・own_only・forbidden・not_visible・no_linked_record・create_requires_publish・
40
+ * api_key_forbidden
40
41
  * - 文字列: アプリの対象・コレクションの id
41
42
  */
42
43
  target?: ErrorTarget | (string & {});
43
44
  /** 件数: in_use */
44
45
  count?: number;
45
46
  /** 使用先: in_use */
46
- by?: 'uses' | 'places' | 'outputs' | 'record' | 'writers' | 'customers' | 'accounts' | 'app';
47
+ by?: 'uses' | 'places' | 'outputs' | 'record' | 'writers' | 'end_users' | 'accounts' | 'app';
47
48
  /**
48
- * 理由: invalid_state(InvalidStateReason)、already_linked(identity は相手の ID、customer は顧客)
49
+ * 理由: invalid_state(InvalidStateReason)
50
+ * - already_linked: identity は相手の ID、endUser はエンドユーザー、record はアカウントの結び付くレコード
49
51
  * - invalid_invite: not_found・expired・used
50
52
  */
51
- reason?: InvalidStateReason | 'identity' | 'customer' | 'not_found' | 'expired' | 'used';
53
+ reason?: InvalidStateReason | 'identity' | 'end_user' | 'record' | 'not_found' | 'expired' | 'used';
52
54
  /** 取得の対象: upstream_failed */
53
55
  resource?: 'page' | 'image' | 'webhook' | 'source' | 'file' | 'hosting';
54
56
  /**
@@ -57,6 +59,8 @@ export type ErrorParams = {
57
59
  * - not_configured: 設定の名前、job_failed: 失敗の理由、in_use の record: 参照するコレクションと項目、
58
60
  * in_use の app: 参照するアプリの表の表示名
59
61
  * - invalid_state の restore_conflict: 戻すレコードとぶつかるレコードの表示名
62
+ * - invalid_state の app_required_by: 依存元のアプリの表示名
63
+ * - invalid_state の restore_target_trashed: 戻すレコードが参照する、ゴミ箱にあるレコードの表示名
60
64
  */
61
65
  name?: string;
62
66
  /** 権限の拒否で足りないもの: forbidden */
@@ -64,12 +68,6 @@ export type ErrorParams = {
64
68
  /** MCP の接続に足りない範囲: insufficient_scope(MCP の Worker が403の WWW-Authenticate の scope に写す) */
65
69
  scope?: string;
66
70
  };
67
- /**
68
- * エラーの応答の本文
69
- * - message: 英語の定型の文(画面は code と params で引く)、requestId: 相関の ID(すべてのエラー)
70
- * - login: ログインなしのとき、CMS 自身が受け持つログインの入り口
71
- * - capability: アプリの主体の閲覧の拒否で、足りない能力(顧客だけの項目を持つコレクションの `op:<コレクション>:read_customers`)
72
- */
73
71
  /** 検査の結果の重さ(error は保存・提出・取り込みを止め、warning は止めない) */
74
72
  export declare const ISSUE_SEVERITIES: readonly ["error", "warning"];
75
73
  export type IssueSeverity = (typeof ISSUE_SEVERITIES)[number];
@@ -93,13 +91,27 @@ export type IssueInput = Readonly<{
93
91
  params?: Issue['params'];
94
92
  severity?: IssueSeverity;
95
93
  }>;
94
+ export declare const PROBLEM_CONTENT_TYPE = "application/problem+json";
95
+ /** problem+json の type の基点(コードを続ける。型は string: 公開の SDK の型の宣言にホスト名を出さない) */
96
+ export declare const PROBLEM_TYPE_BASE: string;
97
+ /**
98
+ * エラーの応答の本文(problem+json)
99
+ * - detail: 英語の定型の文(画面は code と params で引く)、request_id: 相関の ID(すべてのエラー)
100
+ * - login: ログインなしのとき、CMS 自身が受け持つログインの入り口
101
+ * - capability: アプリの主体の閲覧の拒否で、足りない能力(エンドユーザーだけの項目を持つコレクションの `op:<コレクション>:read_entitled`)
102
+ */
96
103
  export type ErrorBody = {
104
+ type: string;
105
+ title: string;
106
+ status: number;
107
+ detail: string;
97
108
  code: ErrorCode;
98
- message: string;
109
+ request_id: string;
99
110
  params?: ErrorParams;
100
111
  issues?: Issue[];
101
112
  login?: string;
102
- requestId: string;
103
113
  capability?: string;
104
114
  };
115
+ /** 本文に足せる項目(type・title・status・code・request_id は組み立てる側が決める。ほかの項目は problem+json の拡張の項目) */
116
+ export type ProblemFields = Partial<Pick<ErrorBody, 'detail' | 'params' | 'issues' | 'login' | 'capability'>> & Readonly<Record<string, unknown>>;
105
117
  export {};
@@ -0,0 +1,70 @@
1
+ import { z } from 'zod';
2
+ /** レコードのイベントの data(record.<操作> と form.submitted。説明は WebhookRecordData) */
3
+ export declare const RECORD_EVENT_DATA: z.ZodObject<{
4
+ environment: z.ZodString;
5
+ collection: z.ZodObject<{
6
+ id: z.ZodString;
7
+ slug: z.ZodNullable<z.ZodString>;
8
+ }, z.core.$strip>;
9
+ record: z.ZodObject<{
10
+ id: z.ZodString;
11
+ slug: z.ZodString;
12
+ previous_slug: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ }, z.core.$strip>;
15
+ /** アプリのイベントの data(説明は AppEventData) */
16
+ export declare const APP_EVENT_DATA: z.ZodObject<{
17
+ environment: z.ZodString;
18
+ collection: z.ZodObject<{
19
+ id: z.ZodString;
20
+ }, z.core.$strip>;
21
+ record: z.ZodObject<{
22
+ id: z.ZodString;
23
+ }, z.core.$strip>;
24
+ actor: z.ZodObject<{
25
+ kind: z.ZodEnum<{
26
+ account: "account";
27
+ system: "system";
28
+ installation: "installation";
29
+ operator: "operator";
30
+ on_behalf_of_account: "on_behalf_of_account";
31
+ on_behalf_of_end_user: "on_behalf_of_end_user";
32
+ }>;
33
+ }, z.core.$strip>;
34
+ }, z.core.$strip>;
35
+ /** エンドユーザーのイベントの data(from・to は前後の状態で、作成の前と削除の後は null) */
36
+ export declare const END_USER_EVENT_DATA: z.ZodObject<{
37
+ end_user_id: z.ZodString;
38
+ from: z.ZodNullable<z.ZodEnum<{
39
+ active: "active";
40
+ suspended: "suspended";
41
+ }>>;
42
+ to: z.ZodNullable<z.ZodEnum<{
43
+ active: "active";
44
+ suspended: "suspended";
45
+ }>>;
46
+ }, z.core.$strip>;
47
+ /** 取り込みの完了のイベントの data(rows はコレクションの ID ごとの件数) */
48
+ export declare const IMPORT_COMPLETED_DATA: z.ZodObject<{
49
+ run_id: z.ZodString;
50
+ source: z.ZodString;
51
+ rows: z.ZodRecord<z.ZodString, z.ZodNumber>;
52
+ }, z.core.$strip>;
53
+ /** アンインストールのイベントの data(旧い形のインストールの app_id は null) */
54
+ export declare const INSTALLATION_DELETED_DATA: z.ZodObject<{
55
+ installation_id: z.ZodString;
56
+ app_id: z.ZodNullable<z.ZodString>;
57
+ }, z.core.$strip>;
58
+ /** アプリのイベントの JSON Schema の名前(アプリのイベントの種類は宣言ごとに違うので、data の形の1つを共有する) */
59
+ export declare const APP_EVENTS_SCHEMA_NAME = "apps";
60
+ /** 外へ送るイベントの短縮名と data の形(アプリのイベントは APP_EVENTS_SCHEMA_NAME の1つ) */
61
+ export declare const EVENT_DATA_SCHEMAS: Readonly<Record<string, z.ZodType>>;
62
+ /**
63
+ * イベントの data の JSON Schema の置き場所(CloudEvents の dataschema。バージョンを含めない不変の URL)
64
+ * - 型は string(公開の SDK の型の宣言にホスト名を出さない)
65
+ */
66
+ export declare const EVENT_SCHEMA_BASE_URL: string;
67
+ /** イベントの短縮名から dataschema の URL(アプリのイベントは共有の1つ) */
68
+ export declare const eventDataSchemaUrl: (type: string) => string;
69
+ /** 公開する JSON Schema(キーはファイル名、index.json は短縮名と dataschema の一覧) */
70
+ export declare function eventJsonSchemaFiles(): Readonly<Record<string, unknown>>;
@@ -0,0 +1,43 @@
1
+ import type { TraceResult } from './integrationGraph.js';
2
+ export declare const DELIVERY_SOURCE_KINDS: readonly ["workspace", "mcp", "apiKey", "endUser", "system", "installation"];
3
+ export type DeliverySourceKind = (typeof DELIVERY_SOURCE_KINDS)[number];
4
+ /** 発行の主体(installationId は kind が installation のときだけ) */
5
+ export type DeliverySource = Readonly<{
6
+ kind: DeliverySourceKind;
7
+ installationId?: string;
8
+ }>;
9
+ /** 受け手(Webhook の登録と、その持ち主のインストール) */
10
+ export type DeliveryReceiver = Readonly<{
11
+ webhookId: string;
12
+ installationId: string | null;
13
+ }>;
14
+ /** 1件の配信(受け手ごとの最後の試行。status は HTTP の状態で、未送信は0) */
15
+ export type TraceDelivery = Readonly<{
16
+ eventId: string;
17
+ type: string;
18
+ at: string;
19
+ source: DeliverySource;
20
+ receiver: DeliveryReceiver;
21
+ result: TraceResult;
22
+ status: number;
23
+ }>;
24
+ /** 同じ correlationid の連鎖(at は起点の時刻、deliveries は時刻の順) */
25
+ export type EventTrace = Readonly<{
26
+ correlationId: string;
27
+ at: string;
28
+ deliveries: readonly TraceDelivery[];
29
+ }>;
30
+ /** 配信の集計の1行(同じ主体・受け手・イベントの種類の件数) */
31
+ export type DeliverySummaryRow = Readonly<{
32
+ source: DeliverySource;
33
+ receiver: DeliveryReceiver;
34
+ type: string;
35
+ count: number;
36
+ failed: number;
37
+ undelivered: number;
38
+ }>;
39
+ export declare const EVENT_TRACE_LIMITS: {
40
+ readonly periodDaysMax: 30;
41
+ readonly tracesMax: 50;
42
+ readonly tracesDefault: 20;
43
+ };
@@ -1,7 +1,7 @@
1
1
  /** 失敗のコードと HTTP の状態 */
2
2
  export declare const FAILURE_STATUS: {
3
3
  readonly invalid_input: 400;
4
- readonly submit_unmet: 400;
4
+ readonly transition_unmet: 400;
5
5
  readonly publish_unmet: 400;
6
6
  readonly save_unmet: 400;
7
7
  readonly version_required: 400;
@@ -15,7 +15,7 @@ export declare const FAILURE_STATUS: {
15
15
  readonly invalid_slug: 400;
16
16
  readonly reserved_slug: 400;
17
17
  readonly invalid_id: 400;
18
- readonly infra_id_uuid: 400;
18
+ readonly uuid_not_accepted: 400;
19
19
  readonly reserved_id: 400;
20
20
  readonly organization_required: 400;
21
21
  readonly same_environment: 400;
@@ -27,13 +27,13 @@ export declare const FAILURE_STATUS: {
27
27
  readonly invalid_mcp_token: 401;
28
28
  readonly mcp_signature_invalid: 401;
29
29
  readonly invalid_account_token: 401;
30
- readonly preview_token_required: 401;
30
+ readonly read_token_required: 401;
31
31
  readonly api_key_required: 401;
32
32
  readonly invalid_api_key: 401;
33
33
  readonly invalid_id_token: 401;
34
34
  readonly invalid_app_token: 401;
35
35
  readonly account_not_found: 403;
36
- readonly invalid_preview_token: 403;
36
+ readonly invalid_read_token: 401;
37
37
  readonly api_key_forbidden: 403;
38
38
  readonly mcp_not_allowed: 403;
39
39
  readonly insufficient_scope: 403;
@@ -45,17 +45,17 @@ export declare const FAILURE_STATUS: {
45
45
  readonly forbidden: 403;
46
46
  readonly mfa_required: 403;
47
47
  readonly cross_origin: 403;
48
- readonly editorial_only: 403;
48
+ readonly create_requires_publish: 403;
49
49
  readonly no_linked_record: 403;
50
50
  readonly own_only: 403;
51
51
  readonly not_visible: 403;
52
- readonly published_admin_only: 403;
52
+ readonly edit_requires_publish: 403;
53
53
  readonly cannot_remove_self: 403;
54
54
  readonly cannot_change_owner: 403;
55
55
  readonly not_found: 404;
56
- readonly customer_not_linked: 404;
56
+ readonly end_user_not_linked: 404;
57
57
  readonly method_not_allowed: 405;
58
- readonly customer_pending: 409;
58
+ readonly end_user_pending: 409;
59
59
  readonly in_use: 409;
60
60
  readonly conflict: 409;
61
61
  readonly already_exists: 409;
@@ -65,9 +65,9 @@ export declare const FAILURE_STATUS: {
65
65
  readonly duplicate_slug: 409;
66
66
  readonly slug_taken: 409;
67
67
  readonly version_conflict: 409;
68
- readonly article_editing: 409;
68
+ readonly record_locked: 409;
69
69
  readonly invalid_state: 409;
70
- readonly unpublish_first: 409;
70
+ readonly still_published: 409;
71
71
  readonly last_owner: 409;
72
72
  readonly last_admin: 409;
73
73
  readonly exceeds_own: 403;
@@ -78,6 +78,7 @@ export declare const FAILURE_STATUS: {
78
78
  readonly already_live: 409;
79
79
  readonly target_live: 409;
80
80
  readonly target_synthetic: 409;
81
+ readonly target_anonymized: 409;
81
82
  readonly cross_organization: 409;
82
83
  readonly target_busy: 409;
83
84
  readonly target_frozen: 409;
@@ -88,7 +89,7 @@ export declare const FAILURE_STATUS: {
88
89
  readonly still_frozen: 409;
89
90
  readonly schema_values: 409;
90
91
  readonly confirm_required: 409;
91
- readonly pii_unregistered_table: 409;
92
+ readonly unregistered_table: 409;
92
93
  readonly environment_limit_exceeded: 409;
93
94
  readonly cursor_expired: 410;
94
95
  readonly body_too_large: 413;
@@ -98,7 +99,7 @@ export declare const FAILURE_STATUS: {
98
99
  readonly unavailable: 503;
99
100
  readonly writes_paused: 503;
100
101
  readonly environment_frozen: 503;
101
- readonly audit_unshipped: 503;
102
+ readonly audit_pending: 503;
102
103
  readonly grants_not_revoked: 503;
103
104
  readonly notice_failed: 503;
104
105
  readonly job_failed: 500;
@@ -110,16 +111,7 @@ export type FailureCode = keyof typeof FAILURE_STATUS;
110
111
  /** 待てば通る失敗の Retry-After(秒) */
111
112
  export declare const RETRY_AFTER_SEC: {
112
113
  readonly environment_frozen: 60;
114
+ readonly unavailable: 1;
113
115
  };
114
116
  /** 失敗の応答の見出し(待てば通るコードだけ Retry-After) */
115
117
  export declare const retryHeadersOf: (code: FailureCode) => Record<string, string>;
116
- /**
117
- * スキーマだけの本番に反映の失敗のコード(サーバーと console の RPC で共通)
118
- * - already_live は元が live の環境、invalid_input は保存の検査の誤りか禁止の変更か一意の組の重なり(issues、保存と同じ形)
119
- * - schema_values は値を失うか補充の要る差か常に止める差(blocked に件数)、confirm_required は承認していない差(pending に ID)
120
- * - stale は確認のステップの後に版か live の向きか止める差の件数が変わった、environment_frozen は live が切り替えの準備で止まっている(解除を待つ)
121
- * - incomplete は確定の途中の例外
122
- */
123
- export declare const SCHEMA_PROMOTION_ERRORS: readonly ["not_found", "forbidden", "invalid_input", "already_live", "not_configured", "reauth_required", "approval_required", "ticket_invalid", "schema_values", "confirm_required", "stale", "environment_frozen", "incomplete"];
124
- /** スキーマだけの本番に反映の失敗のコード */
125
- export type SchemaPromotionError = (typeof SCHEMA_PROMOTION_ERRORS)[number];
@@ -1,11 +1,11 @@
1
- import { type SelfWrite, type CustomerProof, type Audience, type Collection, type FieldDef } from '../../schema/src/index.js';
2
- import { type PrincipalContext } from './principal.js';
1
+ import { type SelfWrite, type EndUserProof, type Audience, type Collection, type FieldDef } from '../../schema/src/index.js';
2
+ import { type Subject } from './principal.js';
3
3
  /** 項目の読み替えに要るコレクションの宣言 */
4
4
  type FieldType = Pick<Collection, 'private' | 'fields'>;
5
5
  /** 判定の対象のコレクション(id と、個人の情報を持つコレクションかと読み替えに要る宣言) */
6
6
  export type AudienceCollection = Pick<Collection, 'id' | 'private' | 'fields'>;
7
- /** 読む主体(主体の文脈と、コアが自分で読む system) */
8
- export type FieldReader = PrincipalContext | 'system';
7
+ /** 読む主体 */
8
+ export type FieldReader = Subject;
9
9
  /** 配信 API に出せる見える範囲(公開とアクセス権、* の範囲) */
10
10
  export declare const DELIVERED: ReadonlySet<Audience>;
11
11
  /** 本人のレコードで見られる見える範囲(#712の read_self: 本人の項目まで、スタッフの項目は出さない。本人のレコードを返す層だけが使う) */
@@ -15,7 +15,7 @@ export declare const PUBLIC_ONLY: ReadonlySet<Audience>;
15
15
  /** 主体がすべての項目を見られるか(値をそのまま返してよい) */
16
16
  export declare const seesAll: (audiences: ReadonlySet<Audience>) => boolean;
17
17
  /** 主体がコレクションのレコードで見られる見える範囲 */
18
- export declare function audiencesFor(reader: FieldReader, collection: AudienceCollection): ReadonlySet<Audience>;
18
+ export declare function audiencesFor(subject: FieldReader, collection: AudienceCollection): ReadonlySet<Audience>;
19
19
  /** コレクションの最上位の項目を見られるか(読み替えは schema のパッケージの audienceOf) */
20
20
  export declare const canReadField: (audiences: ReadonlySet<Audience>, field: FieldDef, collection: FieldType) => boolean;
21
21
  /** 見られる最上位の項目 */
@@ -36,10 +36,10 @@ export declare function unwritableKeys(collection: FieldType, input: Readonly<Re
36
36
  /**
37
37
  * 人の代わりの書き込み(create は submit・create_self、update は update_self)で本人が書けない入力の key(#712)
38
38
  * - 書けるのは schema の selfWritableKeysOf だけ
39
- * (コレクションの宣言の印か、ID トークンの本人のアンケートの形の読み替え。update は一意の組の項目を除く)
40
- * - 本人の顧客フィールド、スタッフの項目、印のない項目、コレクションにない key は書けない。入力にあれば保存で拒む(黙って捨てない)
39
+ * (コレクションの宣言の印か、フォームの宣言の項目。update は一意の組の項目を除く)
40
+ * - 本人のエンドユーザーへの参照のフィールド、スタッフの項目、印のない項目、コレクションにない key は書けない。入力にあれば保存で拒む(黙って捨てない)
41
41
  */
42
- export declare function selfUnwritableKeys(collection: Collection, input: Readonly<Record<string, unknown>>, proof: CustomerProof, write: SelfWrite): string[];
42
+ export declare function selfUnwritableKeys(collection: Collection, input: Readonly<Record<string, unknown>>, proof: EndUserProof, write: SelfWrite): string[];
43
43
  /** 保存する値に、主体が見られない項目の保存済みの値を重ねる(最上位の見られない項目と、単数のまとまりの中の見られない項目) */
44
44
  export declare function withHiddenValues(collection: FieldType, values: Readonly<Record<string, unknown>>, previous: Readonly<Record<string, unknown>>, audiences: ReadonlySet<Audience>): Record<string, unknown>;
45
45
  export {};
@@ -0,0 +1,3 @@
1
+ import type { FORM_EVENTS } from './forms.js';
2
+ /** フォームのイベントの表示名(Webhook の選択肢) */
3
+ export declare const FORM_EVENT_LABELS: Readonly<Record<(typeof FORM_EVENTS)[keyof typeof FORM_EVENTS], string>>;
@@ -0,0 +1,4 @@
1
+ /** フォームのイベント(送信の値を持たない薄い本文) */
2
+ export declare const FORM_EVENTS: {
3
+ readonly submitted: "form.submitted";
4
+ };
@@ -0,0 +1,26 @@
1
+ import { type Collection } from '../../schema/src/index.js';
2
+ import { type Operation } from './authorize.js';
3
+ import { type Permissions } from './permissions.js';
4
+ import { type DelegatedGrant, type PrincipalShape } from './principal.js';
5
+ /** 付与の種類(直接、委任、インストール済みアプリ) */
6
+ export declare const GRANT_TYPES: readonly ["direct", "delegated", "installation"];
7
+ /** 付与の種類 */
8
+ export type GrantType = (typeof GRANT_TYPES)[number];
9
+ /** 上限の対象の「機密を除くすべてのコレクション」 */
10
+ export declare const NON_SENSITIVE = "@non_sensitive";
11
+ /** 委任の上限(対象から、展開して固定した操作) */
12
+ export type Ceiling = Readonly<Record<string, readonly Operation[]>>;
13
+ /** 何も含まない上限 */
14
+ export declare const EMPTY_CEILING: Ceiling;
15
+ /** 保存した上限(読めない値、すべての対象の *、知らない操作、空の操作の列は null で、上限のない付与と同じく拒む) */
16
+ export declare function ceilingOf(stored: string | null): Ceiling | null;
17
+ /** コレクションの、付与の和の表(直接の付与の行と、委任の付与ごとの段階。委任の付与がなければ null) */
18
+ export declare function unionPermissions(principal: PrincipalShape, collection: Collection, access: Readonly<{
19
+ published: boolean;
20
+ }>): Permissions | null;
21
+ /** ロールの表の操作でない操作(権利を要するフィールドの取得など)を、委任の付与のどれかが上限に明示しているか */
22
+ export declare const grantsOperation: (principal: PrincipalShape, operation: Operation, collection: Collection) => boolean;
23
+ /** 管理の権限の対象(manage:<チェック>)を、委任の付与のどれかが持つか(代理の主体は持たない) */
24
+ export declare const grantsManagement: (principal: PrincipalShape, target: string) => boolean;
25
+ /** 委任の付与(ロールの権限は保存した表の JSON) */
26
+ export declare const delegatedGrant: (role: string, storedPermissions: string, ceilings: readonly Ceiling[]) => DelegatedGrant;