@tunasand/sdk 0.0.0-stage → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +114 -0
- package/README.md +516 -2
- package/dist/analytics.d.ts +1 -0
- package/dist/analytics.js +43 -0
- package/dist/app.d.ts +1 -0
- package/dist/app.js +825 -0
- package/dist/apps-9u4XMi7E.js +114 -0
- package/dist/body.d.ts +1 -0
- package/dist/body.js +455 -0
- package/dist/bridge-DYAYGV7t.js +74 -0
- package/dist/bridge.d.ts +1 -0
- package/dist/bridge.js +189 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +283 -0
- package/dist/client-Derrexwr.js +159 -0
- package/dist/customers-C_vJY2_v.js +84 -0
- package/dist/customers.d.ts +1 -0
- package/dist/customers.js +185 -0
- package/dist/declared-C_GvPiGF.js +397 -0
- package/dist/delivery.d.ts +1 -0
- package/dist/delivery.js +394 -0
- package/dist/dev.d.ts +1 -0
- package/dist/dev.js +93 -0
- package/dist/embed-R-OvDYAw.js +90 -0
- package/dist/errorLabels-CPKiPabZ.js +1510 -0
- package/dist/i18n.d.ts +1 -0
- package/dist/i18n.js +4 -0
- package/dist/integrations.d.ts +1 -0
- package/dist/integrations.js +62 -0
- package/dist/ja-C1HEWWTQ.js +241 -0
- package/dist/ja-C6lX0CeJ.js +213 -0
- package/dist/model-pmXzGX12.js +152 -0
- package/dist/model.d.ts +1 -0
- package/dist/model.js +345 -0
- package/dist/page-E_cYgZx-.js +138 -0
- package/dist/preview.d.ts +1 -0
- package/dist/preview.js +1 -0
- package/dist/profile-D6t1QMQh.js +223 -0
- package/dist/schema-BPHL7Qr-.js +115 -0
- package/dist/schema-UQJWRyfJ.js +995 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.js +1 -0
- package/dist/src-sazhzYui.js +71 -0
- package/dist/types/access/src/handoff.d.ts +52 -0
- package/dist/types/access/src/index.d.ts +5 -0
- package/dist/types/access/src/jws.d.ts +5 -0
- package/dist/types/access/src/jwt.d.ts +35 -0
- package/dist/types/access/src/oidc.d.ts +50 -0
- package/dist/types/access/src/signed.d.ts +15 -0
- package/dist/types/analytics/src/day.d.ts +2 -0
- package/dist/types/analytics/src/index.d.ts +5 -0
- package/dist/types/analytics/src/schedule.d.ts +2 -0
- package/dist/types/analytics/src/shared.d.ts +21 -0
- package/dist/types/analytics/src/source.d.ts +19 -0
- package/dist/types/analytics/src/store.d.ts +24 -0
- package/dist/types/analytics/src/view.d.ts +33 -0
- package/dist/types/body/src/components.d.ts +25 -0
- package/dist/types/body/src/declared.d.ts +34 -0
- package/dist/types/body/src/derive.d.ts +13 -0
- package/dist/types/body/src/description.d.ts +8 -0
- package/dist/types/body/src/embed.d.ts +16 -0
- package/dist/types/body/src/href.d.ts +4 -0
- package/dist/types/body/src/html.d.ts +30 -0
- package/dist/types/body/src/index.d.ts +19 -0
- package/dist/types/body/src/inline.d.ts +20 -0
- package/dist/types/body/src/labels/en.d.ts +90 -0
- package/dist/types/body/src/labels/ja.d.ts +153 -0
- package/dist/types/body/src/library.d.ts +113 -0
- package/dist/types/body/src/markdown.d.ts +14 -0
- package/dist/types/body/src/normalize.d.ts +5 -0
- package/dist/types/body/src/problems.d.ts +103 -0
- package/dist/types/body/src/profile.d.ts +80 -0
- package/dist/types/body/src/render.d.ts +29 -0
- package/dist/types/body/src/schema.d.ts +6 -0
- package/dist/types/body/src/standard.d.ts +20 -0
- package/dist/types/body/src/types.d.ts +140 -0
- package/dist/types/cms-contract/src/apiKeys.d.ts +41 -0
- package/dist/types/cms-contract/src/app.d.ts +35 -0
- package/dist/types/cms-contract/src/appDependencies.d.ts +265 -0
- package/dist/types/cms-contract/src/appProblems.d.ts +22 -0
- package/dist/types/cms-contract/src/apps.d.ts +195 -0
- package/dist/types/cms-contract/src/assets.d.ts +12 -0
- package/dist/types/cms-contract/src/authorize.d.ts +146 -0
- package/dist/types/cms-contract/src/bridge.d.ts +318 -0
- package/dist/types/cms-contract/src/consents.d.ts +97 -0
- package/dist/types/cms-contract/src/customerLabels.d.ts +33 -0
- package/dist/types/cms-contract/src/customers.d.ts +266 -0
- package/dist/types/cms-contract/src/embeds.d.ts +165 -0
- package/dist/types/cms-contract/src/errorLabels.d.ts +269 -0
- package/dist/types/cms-contract/src/errorLabelsEn.d.ts +228 -0
- package/dist/types/cms-contract/src/errors.d.ts +105 -0
- package/dist/types/cms-contract/src/failureStatus.d.ts +124 -0
- package/dist/types/cms-contract/src/functionLabels.d.ts +5 -0
- package/dist/types/cms-contract/src/functions.d.ts +144 -0
- package/dist/types/cms-contract/src/identifiers.d.ts +117 -0
- package/dist/types/cms-contract/src/import.d.ts +277 -0
- package/dist/types/cms-contract/src/issueLabels.d.ts +435 -0
- package/dist/types/cms-contract/src/issueLabelsEn.d.ts +217 -0
- package/dist/types/cms-contract/src/migration.d.ts +103 -0
- package/dist/types/cms-contract/src/paths.d.ts +23 -0
- package/dist/types/cms-contract/src/permissionLabels.d.ts +8 -0
- package/dist/types/cms-contract/src/permissions.d.ts +77 -0
- package/dist/types/cms-contract/src/problems.d.ts +34 -0
- package/dist/types/cms-contract/src/roles.d.ts +57 -0
- package/dist/types/cms-contract/src/settingProblems.d.ts +13 -0
- package/dist/types/cms-contract/src/settings.d.ts +19 -0
- package/dist/types/cms-contract/src/siteArtifact.d.ts +45 -0
- package/dist/types/cms-contract/src/siteDeclaration.d.ts +70 -0
- package/dist/types/cms-contract/src/transfer.d.ts +57 -0
- package/dist/types/cms-contract/src/urlLabel.d.ts +13 -0
- package/dist/types/cms-contract/src/views.d.ts +21 -0
- package/dist/types/cms-contract/src/webhookLabels.d.ts +7 -0
- package/dist/types/cms-contract/src/webhooks.d.ts +139 -0
- package/dist/types/i18n/src/index.d.ts +50 -0
- package/dist/types/i18n/src/problems.d.ts +21 -0
- package/dist/types/model/src/asset.d.ts +111 -0
- package/dist/types/model/src/audience.d.ts +38 -0
- package/dist/types/model/src/brand.d.ts +25 -0
- package/dist/types/model/src/capabilities.d.ts +28 -0
- package/dist/types/model/src/changes.d.ts +34 -0
- package/dist/types/model/src/check.d.ts +15 -0
- package/dist/types/model/src/contact.d.ts +22 -0
- package/dist/types/model/src/image.d.ts +38 -0
- package/dist/types/model/src/index.d.ts +26 -0
- package/dist/types/model/src/input.d.ts +26 -0
- package/dist/types/model/src/integrity.d.ts +79 -0
- package/dist/types/model/src/json.d.ts +2 -0
- package/dist/types/model/src/labels/en.d.ts +169 -0
- package/dist/types/model/src/labels/ja.d.ts +198 -0
- package/dist/types/model/src/legacy.d.ts +2 -0
- package/dist/types/model/src/media.d.ts +5 -0
- package/dist/types/model/src/mediaUrl.d.ts +67 -0
- package/dist/types/model/src/model.d.ts +415 -0
- package/dist/types/model/src/page.d.ts +52 -0
- package/dist/types/model/src/problems.d.ts +184 -0
- package/dist/types/model/src/refs.d.ts +27 -0
- package/dist/types/model/src/rules.d.ts +15 -0
- package/dist/types/model/src/schema.d.ts +58 -0
- package/dist/types/model/src/screens.d.ts +76 -0
- package/dist/types/model/src/selfOps.d.ts +30 -0
- package/dist/types/model/src/time.d.ts +25 -0
- package/dist/types/model/src/typesSource.d.ts +8 -0
- package/dist/types/model/src/values.d.ts +24 -0
- package/dist/types/platform/src/defaultModel.d.ts +8 -0
- package/dist/types/sdk/src/analytics.d.ts +2 -0
- package/dist/types/sdk/src/app.d.ts +20 -0
- package/dist/types/sdk/src/body.d.ts +2 -0
- package/dist/types/sdk/src/bridge.d.ts +92 -0
- package/dist/types/sdk/src/cli.d.ts +2 -0
- package/dist/types/sdk/src/customers.d.ts +190 -0
- package/dist/types/sdk/src/delivery/cache.d.ts +18 -0
- package/dist/types/sdk/src/delivery/changes.d.ts +28 -0
- package/dist/types/sdk/src/delivery/client.d.ts +90 -0
- package/dist/types/sdk/src/delivery/fields.d.ts +48 -0
- package/dist/types/sdk/src/delivery/index.d.ts +9 -0
- package/dist/types/sdk/src/delivery/media.d.ts +28 -0
- package/dist/types/sdk/src/delivery/query.d.ts +85 -0
- package/dist/types/sdk/src/delivery/schema.d.ts +19 -0
- package/dist/types/sdk/src/delivery/values.d.ts +82 -0
- package/dist/types/sdk/src/delivery.d.ts +3 -0
- package/dist/types/sdk/src/dev.d.ts +29 -0
- package/dist/types/sdk/src/i18n.d.ts +12 -0
- package/dist/types/sdk/src/integrations.d.ts +33 -0
- package/dist/types/sdk/src/model.d.ts +5 -0
- package/dist/types/sdk/src/preview.d.ts +1 -0
- package/dist/types/sdk/src/schema.d.ts +21 -0
- package/dist/types/sdk/src/site.d.ts +43 -0
- package/dist/typesSource-bO0jFw1I.js +88 -0
- package/package.json +86 -3
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/** CMS の API の検査の問題の英語の文 */
|
|
2
|
+
export declare const API_ISSUE_MESSAGES_EN: {
|
|
3
|
+
readonly name_required: "Name is required";
|
|
4
|
+
readonly slug_required: "Slug is required";
|
|
5
|
+
readonly slug_max: "Slug must be at most 40 characters";
|
|
6
|
+
readonly slug_chars: "Slug may contain only lowercase letters, digits, hyphens and underscores";
|
|
7
|
+
readonly slug_uuid: "Slug must not be in UUID form";
|
|
8
|
+
readonly url_format: "Invalid URL";
|
|
9
|
+
readonly https_only: "Only https URLs are allowed";
|
|
10
|
+
readonly body_not_json: "The request body is not JSON";
|
|
11
|
+
readonly email_format: "Invalid email address";
|
|
12
|
+
readonly role_id_chars: "ID may contain only lowercase letters, digits, hyphens and underscores";
|
|
13
|
+
readonly link_collection_missing: "Collection {collection} does not exist";
|
|
14
|
+
readonly unknown_environment: "Environment {id} does not exist in this project";
|
|
15
|
+
readonly not_operator: "Not an operator email address";
|
|
16
|
+
readonly invitations_unavailable: "This runtime has no invitation ledger";
|
|
17
|
+
readonly app_manifest: "The manifest is malformed";
|
|
18
|
+
readonly app_manifest_detail: "The manifest is malformed ({detail})";
|
|
19
|
+
readonly app_namespace: "The namespace must be 3 to 32 lowercase letters and digits, starting with a letter";
|
|
20
|
+
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";
|
|
25
|
+
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";
|
|
27
|
+
readonly app_incompatible: "Incompatible change within the same major version. Bump the major version or revert the change";
|
|
28
|
+
readonly app_incompatible_detail: "Incompatible change within the same major version. Bump the major version or revert the change ({detail})";
|
|
29
|
+
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";
|
|
31
|
+
readonly app_key_weak: "RSA keys must be at least 2048 bits";
|
|
32
|
+
readonly app_key_kid: "kid must be a string of 1 to 128 characters";
|
|
33
|
+
readonly app_key_duplicate_kid: "Multiple keys share the same kid";
|
|
34
|
+
readonly app_key_duplicate_key: "The same key appears more than once (use different keys for exchange and upload)";
|
|
35
|
+
readonly deploy_artifact: "The artifact is malformed";
|
|
36
|
+
readonly deploy_artifact_required: "Send exactly one of artifact or version (to redeploy)";
|
|
37
|
+
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
|
+
readonly deploy_binding: "A variable or secret name or value is not accepted";
|
|
40
|
+
readonly artifact_too_large: "The artifact exceeds the size limit";
|
|
41
|
+
readonly artifact_format: "Not an artifact (build it with tunasand site)";
|
|
42
|
+
readonly artifact_header: "An artifact header field or value is invalid";
|
|
43
|
+
readonly artifact_main: "The entry (main) is not an ESM or CommonJS module";
|
|
44
|
+
readonly artifact_module: "A module name or type is invalid (names must have an extension)";
|
|
45
|
+
readonly artifact_asset: "An asset path or size is invalid";
|
|
46
|
+
readonly artifact_size_mismatch: "The sizes in the artifact header do not match its contents";
|
|
47
|
+
readonly binding_invalid_name: "Names must be up to 32 uppercase letters, digits and _, starting with a letter";
|
|
48
|
+
readonly binding_reserved_name: "The name is used by Tunasand or reserved";
|
|
49
|
+
readonly binding_duplicate_name: "The same name is used by a variable and a secret";
|
|
50
|
+
readonly binding_tunasand_value: "Tunasand secrets, or values containing them, cannot be used";
|
|
51
|
+
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)";
|
|
76
|
+
readonly consent_method: "This method is not available for the source kind (account is staff only)";
|
|
77
|
+
readonly unfilterable_field: "{key} cannot be used as a filter";
|
|
78
|
+
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";
|
|
80
|
+
readonly unique_part_required: "{key} is required because it is part of a one-row-per-person key";
|
|
81
|
+
readonly reference_unavailable: "The reference of {key} cannot be chosen (published records only)";
|
|
82
|
+
readonly request_reject_note_required: "A rejection reason is required";
|
|
83
|
+
readonly patch_body_shape: "The body must be an object of field keys and values";
|
|
84
|
+
readonly record_no_review: "This collection has no review";
|
|
85
|
+
readonly generated_slug: "Slugs in this collection are assigned by the CMS and cannot be specified";
|
|
86
|
+
readonly unique_taken: "A record with the same {labels} already exists";
|
|
87
|
+
readonly unique_duplicates: "{count, number} records in {collection} share the same {labels} (fix the duplicates before making it unique)";
|
|
88
|
+
readonly use_at: "{field}{rest, select, none {} other { ({rest})}} of {collection}";
|
|
89
|
+
readonly public_in_private_field: "A field for private media only contains public images or files (upload them again from this field)";
|
|
90
|
+
readonly trash_record: "record {id} of {collection}";
|
|
91
|
+
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)";
|
|
93
|
+
readonly renamed_replacement: "Save the replacement of options of a collection whose id changes separately from the id change";
|
|
94
|
+
readonly project_name_required: "Project name is required";
|
|
95
|
+
readonly project_slug_invalid: "Use lowercase letters, digits and hyphens; ID-shaped slugs are not allowed";
|
|
96
|
+
readonly project_slug_reserved: "This slug is reserved";
|
|
97
|
+
readonly project_slug_taken: "Another project in this organization uses this slug";
|
|
98
|
+
readonly time_zone_invalid: "Invalid time zone name (e.g. Asia/Tokyo)";
|
|
99
|
+
readonly required_extension: "This extension is required by the deployment settings";
|
|
100
|
+
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.";
|
|
103
|
+
readonly config_corrupt: "Settings in the DB of project {id} are corrupt ({parts}; the values need repair).";
|
|
104
|
+
readonly config_missing: "Settings are missing from the DB of project {id} ({parts}; apply the project template).";
|
|
105
|
+
readonly setting_text: "Enter text for \"{field}\".";
|
|
106
|
+
readonly setting_integer_min: "\"{field}\" must be an integer of at least {min, number}.";
|
|
107
|
+
readonly setting_boolean: "\"{field}\" must be on or off.";
|
|
108
|
+
readonly setting_text_list: "\"{field}\" must be a list of strings.";
|
|
109
|
+
readonly setting_choice: "\"{field}\" must be one of: {choices}";
|
|
110
|
+
readonly setting_duplicate: "\"{value}\" in \"{field}\" is duplicated.";
|
|
111
|
+
readonly setting_required: "Specify at least one \"{field}\".";
|
|
112
|
+
readonly setting_shape: "\"{field}\" is malformed.";
|
|
113
|
+
readonly unmapped_rows: "Collection {collection} has records with the same IDs imported before the import map ({ids}{more, plural, =0 {} other { and # more}}), so they cannot be imported (projects imported before the map are not reimported)";
|
|
114
|
+
readonly screens_shape: "The screen settings are malformed";
|
|
115
|
+
readonly reimport_unknown: "This environment has no import map for source {source}, so it is not reimported (reimport only into environments moved from the same source)";
|
|
116
|
+
readonly import_duplicate_in_input: "ID {id} appears more than once in the input";
|
|
117
|
+
readonly import_conflict_in_input: "{raw} conflicts with another record as lowercase {id}";
|
|
118
|
+
readonly import_existing_id: "A record with ID {id} already exists";
|
|
119
|
+
readonly import_conflict_with_existing: "{raw} conflicts with an existing record as lowercase {id}";
|
|
120
|
+
readonly import_publish_failed: "Left as a draft because it could not be published: {problem}";
|
|
121
|
+
readonly import_image_not_url: "{src}: the image reference is not a URL";
|
|
122
|
+
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 '}'";
|
|
124
|
+
readonly import_origin_required: "origin_id is required for imports with an import map";
|
|
125
|
+
readonly import_origin_unresolved: "{path}: the record of the original ID is not in the import map (import the referenced records first)";
|
|
126
|
+
readonly import_map_changed: "The record changed after the import (the version differs from the import map)";
|
|
127
|
+
readonly import_map_missing: "The import map row is gone (not recreated)";
|
|
128
|
+
readonly import_map_closed: "The import map row is being deleted or is a tombstone";
|
|
129
|
+
readonly import_map_no_key: "Cannot open the import map key (the DB was copied from another project)";
|
|
130
|
+
readonly import_map_raced: "The import map or record changed first, by a concurrent import or an edit";
|
|
131
|
+
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)";
|
|
137
|
+
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}}";
|
|
141
|
+
readonly import_phase_unpublishable: "Steps of a cycle between collections require collections with editing (the first step creates drafts)";
|
|
142
|
+
readonly integration_event_name: "Invalid event name";
|
|
143
|
+
readonly integration_collections_max: "Up to {max, number} collections";
|
|
144
|
+
readonly api_keys_unavailable: "API key ledger";
|
|
145
|
+
readonly hosting_unavailable: "site hosting";
|
|
146
|
+
readonly page_has_no_collection: "Menu pages, dashboards, and screens outside app settings have no collection";
|
|
147
|
+
readonly only_field_has_field: "Only screens outside field inputs have a field";
|
|
148
|
+
readonly destination_https: "Only https URLs (do not include user information)";
|
|
149
|
+
readonly destination_ip: "The destination host cannot be an IP address";
|
|
150
|
+
readonly destination_local: "The destination cannot be localhost or a host name without a dot";
|
|
151
|
+
readonly destination_own: "The destination cannot be a {brand} domain or a host name {brand} assigns";
|
|
152
|
+
readonly webhook_installation: "Only active channels and app installations can have webhooks";
|
|
153
|
+
readonly outside_consent: "\"{target}\" is outside the installation consent";
|
|
154
|
+
readonly mcp_staff_collection_missing: "Collection {collection} is not in the schema";
|
|
155
|
+
readonly mcp_staff_collection_personal: "Collection {collection} holds personal information or is private (staff fields cannot be exposed to MCP)";
|
|
156
|
+
readonly function_unfinished: "Cannot {action, select, save {save} submit {submit} other {publish}} because the external function \"{label}\" could not finish its check ({failure})";
|
|
157
|
+
readonly function_budget_exceeded: "Exceeded the total time for one operation ({sec, number} s)";
|
|
158
|
+
readonly function_not_json: "The response is not JSON";
|
|
159
|
+
readonly function_invalid_shape: "The response has an invalid shape";
|
|
160
|
+
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
|
+
readonly import_kind_unknown_collection: "Collection cannot be imported";
|
|
163
|
+
readonly import_kind_forbidden: "No permission to create";
|
|
164
|
+
readonly import_kind_invalid_id: "Invalid ID";
|
|
165
|
+
readonly import_kind_id_conflict: "IDs collide after conversion";
|
|
166
|
+
readonly import_kind_duplicate_id: "Duplicate ID";
|
|
167
|
+
readonly import_kind_unknown_field: "Field not in the schema (not imported)";
|
|
168
|
+
readonly import_kind_invalid_value: "Invalid value";
|
|
169
|
+
readonly import_kind_image_failed: "Image cannot be imported";
|
|
170
|
+
readonly import_kind_markdown: "Body cannot be converted";
|
|
171
|
+
readonly import_kind_save_rejected: "Rejected by the save check";
|
|
172
|
+
readonly import_kind_reference_lowercased: "Reference ID converted to lowercase";
|
|
173
|
+
readonly import_kind_origin_missing: "Source ID not found in the import map";
|
|
174
|
+
readonly import_kind_map_conflict: "Row does not match the import map (changed or removed after import)";
|
|
175
|
+
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";
|
|
177
|
+
readonly delivery_path_count: "path must have 1 to {max, number} entries";
|
|
178
|
+
readonly delivery_path_format: "path must be a delivery API path starting with /: {path}";
|
|
179
|
+
readonly delivery_path_bundle: "path cannot include the bundle";
|
|
180
|
+
readonly delivery_path_route_checked: "path cannot include the customer API";
|
|
181
|
+
readonly delivery_path_wildcard: "path can have at most one *: {path}";
|
|
182
|
+
readonly delivery_expanded_max: "At most {max, number} routes after expansion";
|
|
183
|
+
readonly delivery_limit_range: "limit must be an integer from 1 to {max, number}";
|
|
184
|
+
readonly delivery_since_invalid: "Invalid since (use next from the previous response)";
|
|
185
|
+
readonly delivery_at_format: "at must be an ISO 8601 date-time";
|
|
186
|
+
readonly delivery_singleton_list: "A single-record collection cannot be listed";
|
|
187
|
+
readonly delivery_fields_empty: "fields must be comma-separated non-empty fields";
|
|
188
|
+
readonly delivery_expand_depth: "Expansion depth is at most {max, number}: {token}";
|
|
189
|
+
readonly delivery_expand_deep_planned: "Not implemented: expansion of depth 2 or more {token}";
|
|
190
|
+
readonly delivery_field_not_selectable: "Field cannot be selected: {key}";
|
|
191
|
+
readonly delivery_body_in_list: "Body field cannot be selected in a list: {key}";
|
|
192
|
+
readonly delivery_field_not_expandable: "Field cannot be expanded: {key}";
|
|
193
|
+
readonly delivery_expanded_not_selectable: "Field cannot be selected in the expanded collection {collection}: {key}";
|
|
194
|
+
readonly delivery_single: "{name} can be given only once";
|
|
195
|
+
readonly delivery_op_planned: "Not implemented operator: {op}";
|
|
196
|
+
readonly delivery_filter_format: "Filters are filter[key] or filter[key][operator]";
|
|
197
|
+
readonly delivery_filter_nested_planned: "Not implemented filter: field inside a group {key}";
|
|
198
|
+
readonly delivery_field_not_filterable: "Field cannot be filtered: {key}";
|
|
199
|
+
readonly delivery_op_not_allowed: "Operator not allowed for field {key}: {op}";
|
|
200
|
+
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";
|
|
202
|
+
readonly delivery_offset_planned: "Not implemented: offset (use cursor for paging)";
|
|
203
|
+
readonly delivery_order_max: "At most {max, number} sort keys";
|
|
204
|
+
readonly delivery_field_not_sortable: "Field cannot be sorted: {name}";
|
|
205
|
+
readonly delivery_order_duplicate: "Duplicate sort key: {name}";
|
|
206
|
+
readonly delivery_cursor_invalid: "Invalid cursor (the order differs from the previous page)";
|
|
207
|
+
readonly form_required: "Required";
|
|
208
|
+
readonly form_too_long: "At most {max, number} characters";
|
|
209
|
+
readonly form_too_short: "At least {min, number} characters";
|
|
210
|
+
readonly form_invalid_email: "Invalid email address";
|
|
211
|
+
readonly form_invalid_url: "Invalid URL";
|
|
212
|
+
readonly form_url_host: "URL host is not accepted";
|
|
213
|
+
readonly form_invalid_choice: "Not one of the choices";
|
|
214
|
+
readonly form_too_many: "At most {max, number} choices";
|
|
215
|
+
readonly form_too_few: "At least {min, number} choices";
|
|
216
|
+
readonly form_unknown_form: "Unknown form name";
|
|
217
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/** コレクションごとの行の数(取り出し元ごと。人はコレクション CUSTOMER_MAP_TYPE) */
|
|
2
|
+
export type SourceCounts = Readonly<Record<string, Readonly<Record<string, number>>>>;
|
|
3
|
+
/**
|
|
4
|
+
* 計画の本文(ほかのキーは診断と人が埋めた判断)
|
|
5
|
+
* - open: 未決の問い。残っていれば試しを止める
|
|
6
|
+
* - extracted: 取り出し元で数えたコレクションごとの行の数。excluded(移さないと決めた行の数)を引いた数が入力の行の数と違えば試しを止める
|
|
7
|
+
*/
|
|
8
|
+
export type TransferPlanBody = Readonly<Record<string, unknown> & {
|
|
9
|
+
open: readonly string[];
|
|
10
|
+
extracted: SourceCounts;
|
|
11
|
+
excluded?: SourceCounts;
|
|
12
|
+
}>;
|
|
13
|
+
/** 計画の本文の上限(JSON の文字数。版を書き換えずに足すため) */
|
|
14
|
+
export declare const TRANSFER_PLAN_BODY_MAX: number;
|
|
15
|
+
/** 計画の本文の形か(open は文字列の配列、extracted と excluded は取り出し元とコレクションごとの0以上の整数) */
|
|
16
|
+
export declare const isPlanBody: (v: unknown) => v is TransferPlanBody;
|
|
17
|
+
/** テスト実行を結ぶ計画(完了の本文と、対応表の完了の記録) */
|
|
18
|
+
export type RunPlan = Readonly<{
|
|
19
|
+
version: number;
|
|
20
|
+
inputHash: string;
|
|
21
|
+
}>;
|
|
22
|
+
/** 計画の1つの版(sources は入力の取り出し元、inputHash は inputHashOf の値、lines は入力の行の数) */
|
|
23
|
+
export type TransferPlan = Readonly<{
|
|
24
|
+
version: number;
|
|
25
|
+
sources: readonly string[];
|
|
26
|
+
inputHash: string;
|
|
27
|
+
lines: number;
|
|
28
|
+
body: TransferPlanBody;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
createdBy: string | null;
|
|
31
|
+
}>;
|
|
32
|
+
/** 計画を足す本文(base は読んだ版で、最初の版は null。今の版と違えば version_conflict) */
|
|
33
|
+
export type TransferPlanInput = Readonly<{
|
|
34
|
+
base: number | null;
|
|
35
|
+
sources: readonly string[];
|
|
36
|
+
input_hash: string;
|
|
37
|
+
lines: number;
|
|
38
|
+
body: TransferPlanBody;
|
|
39
|
+
}>;
|
|
40
|
+
/** 入力の全行のハッシュ(行を入力の順に並べた配列の正規化した JSON の SHA-256) */
|
|
41
|
+
export declare const inputHashOf: (lines: readonly unknown[]) => Promise<string>;
|
|
42
|
+
/** 取り込みの対応表の状態(active は有効、pending_second は2段目待ち、deleting は削除中、tombstone は墓標) */
|
|
43
|
+
export declare const IMPORT_MAP_STATES: readonly ["active", "pending_second", "deleting", "tombstone"];
|
|
44
|
+
export type ImportMapState = (typeof IMPORT_MAP_STATES)[number];
|
|
45
|
+
/**
|
|
46
|
+
* 接続済みの取り込みの要約(/api/transfer/summary と manage の移行の画面、#713)
|
|
47
|
+
* - sources: 取り出し元ごと。collections はコレクションごと、状態ごとの対応表の行の数、runs は完了した取り込みの実行の数、lastCompletedAt は最後の完了
|
|
48
|
+
* - planVersion: 移行の計画の今の版(なしは null)
|
|
49
|
+
* - 元の ID、外部 ID、項目の値を含めない(数と取り出し元の名前とコレクションだけ)
|
|
50
|
+
*/
|
|
51
|
+
export type TransferSummary = Readonly<{
|
|
52
|
+
sources: readonly Readonly<{
|
|
53
|
+
source: string;
|
|
54
|
+
collections: Readonly<Record<string, Readonly<Record<string, number>>>>;
|
|
55
|
+
runs: number;
|
|
56
|
+
lastCompletedAt: string | null;
|
|
57
|
+
}>[];
|
|
58
|
+
planVersion: number | null;
|
|
59
|
+
}>;
|
|
60
|
+
/** 数えるエンドポイントの1回で調べる対応表の行の数の上限(limit の既定と上限) */
|
|
61
|
+
export declare const VERIFY_PAGE_MAX = 200;
|
|
62
|
+
/**
|
|
63
|
+
* 対応表と保存した行から数えた照合(取り出し元ごと、行を調べる部分はページに分ける)
|
|
64
|
+
* - collections: コレクションごと、状態ごとの対応表の行の数(知らない状態も数える。ページによらず全部)
|
|
65
|
+
* - runs: 完了した取り込みの実行(plan は完了のときに結んだ計画、なしは null。ページによらず全部)
|
|
66
|
+
* - missing: このページの有効か2段目待ちの対応表の行で、行(人は人)がない数(コレクションごと)
|
|
67
|
+
* - dangling: このページの有効な対応表の行のうち、参照の項目か顧客フィールドの先がない値の位置(id は新しい ID、path は項目の道)
|
|
68
|
+
* - next: 次のページの after(コレクションと新しい ID)、なしは終わり
|
|
69
|
+
*/
|
|
70
|
+
export type TransferCounts = Readonly<{
|
|
71
|
+
source: string;
|
|
72
|
+
collections: Readonly<Record<string, Readonly<Record<string, number>>>>;
|
|
73
|
+
runs: readonly Readonly<{
|
|
74
|
+
runId: string;
|
|
75
|
+
plan: RunPlan | null;
|
|
76
|
+
completedAt: string;
|
|
77
|
+
}>[];
|
|
78
|
+
missing: Readonly<Record<string, number>>;
|
|
79
|
+
dangling: readonly Readonly<{
|
|
80
|
+
collection: string;
|
|
81
|
+
id: string;
|
|
82
|
+
path: string;
|
|
83
|
+
}>[];
|
|
84
|
+
next: Readonly<{
|
|
85
|
+
collection: string;
|
|
86
|
+
id: string;
|
|
87
|
+
}> | null;
|
|
88
|
+
}>;
|
|
89
|
+
/** 読み戻しの結果(match は同じ、mismatch は paths の項目が違う、missing は有効な対応表の行か保存した行がない) */
|
|
90
|
+
export declare const READBACK_STATUSES: readonly ["match", "mismatch", "missing"];
|
|
91
|
+
export type ReadbackStatus = (typeof READBACK_STATUSES)[number];
|
|
92
|
+
/** 1件の読み戻し(source は入力の位置、id は新しい ID) */
|
|
93
|
+
export type ReadbackItem = Readonly<{
|
|
94
|
+
source: string;
|
|
95
|
+
collection: string;
|
|
96
|
+
id: string | null;
|
|
97
|
+
status: ReadbackStatus;
|
|
98
|
+
paths: readonly string[];
|
|
99
|
+
}>;
|
|
100
|
+
/** 読み戻しの報告 */
|
|
101
|
+
export type ReadbackReport = Readonly<{
|
|
102
|
+
items: readonly ReadbackItem[];
|
|
103
|
+
}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** サーバーが受け持つパスの頭(API・画像・プレビュー・ログインの入り口) */
|
|
2
|
+
export declare const SERVER_PATHS: readonly ["/api", "/media", "/preview", "/auth"];
|
|
3
|
+
/** サーバーのパスの頭と同じ名前の管理画面の経路(サーバーは頭の下だけを受け持つ。スタジオのメディアの画面 /media、画像は /media/<id>) */
|
|
4
|
+
export declare const SCREEN_PATHS: readonly ["/media"];
|
|
5
|
+
/** ヘルスチェックのパス(どのホストでもサーバー。運営者の経路は運営者のホストの全部のパスで、管理画面の Worker がホストで振り分ける) */
|
|
6
|
+
export declare const OPS_PATHS: readonly ["/healthz"];
|
|
7
|
+
/** MCP の認可の窓口の CMS の側(MCP の Worker が service binding でだけ呼ぶ。管理画面の Worker は転送しない) */
|
|
8
|
+
export declare const MCP_OAUTH_PATH = "/mcp/oauth";
|
|
9
|
+
/** 環境を選ぶパスの頭(/env/<live か環境の URL のラベル>/…)。省略は live。管理画面、API、配信 API で共通 */
|
|
10
|
+
export declare const ENV_PATH = "/env";
|
|
11
|
+
/** 環境を選ぶパスの分解(label は live か環境の URL のラベル、rest は残りのパス、prefix は除いた頭。環境の指定のないパスは null) */
|
|
12
|
+
export declare function envPathOf(pathname: string): Readonly<{
|
|
13
|
+
label: string;
|
|
14
|
+
rest: string;
|
|
15
|
+
prefix: string;
|
|
16
|
+
}> | null;
|
|
17
|
+
/**
|
|
18
|
+
* 管理画面のパス(画面の経路、API、画像、プレビュー)に、開いた画面の URL(opened)の環境の頭を付ける(外の URL、// で始まる URL、/auth はそのまま)
|
|
19
|
+
* - 付け済みの頭は開いた画面の頭に置き換える(環境の切り替えはページの読み直しで、この関数からは別の環境へ出ない)
|
|
20
|
+
*/
|
|
21
|
+
export declare function withEnvPrefix(path: string, opened: string): string;
|
|
22
|
+
/** サーバーが受け持つパスか(パスの頭と一致、または頭の下、運営者の経路を含む。環境を選ぶ頭の下は運営者の経路を除く) */
|
|
23
|
+
export declare const isServerPath: (pathname: string) => boolean;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** 権限の表の問題の文 */
|
|
2
|
+
export declare const PERMISSION_PROBLEMS: {
|
|
3
|
+
readonly shape: "権限の表の形が不正";
|
|
4
|
+
readonly missingTarget: (target: string) => string;
|
|
5
|
+
readonly targetShape: (target: string) => string;
|
|
6
|
+
readonly missingAction: (target: string, action: string) => string;
|
|
7
|
+
readonly level: (target: string, action: string, level: string) => string;
|
|
8
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { User } from './roles.js';
|
|
2
|
+
/** 操作 */
|
|
3
|
+
export declare const ACTIONS: readonly ["read", "create", "update", "publish", "delete"];
|
|
4
|
+
/** 操作 */
|
|
5
|
+
export type Action = (typeof ACTIONS)[number];
|
|
6
|
+
/** 段階 */
|
|
7
|
+
export declare const LEVELS: readonly ["all", "own", "approval", "none"];
|
|
8
|
+
/** 段階 */
|
|
9
|
+
export type Level = (typeof LEVELS)[number];
|
|
10
|
+
/** 操作ごとに選択できる段階(作成に持ち主はなく、承認は作成と公開だけ) */
|
|
11
|
+
export declare const ACTION_LEVELS: Readonly<Record<Action, readonly Level[]>>;
|
|
12
|
+
/** 権限の表(キーは対象の id、'*' は表にない対象の既定、操作がなければ不可) */
|
|
13
|
+
export type Permissions = Readonly<Record<string, Readonly<Partial<Record<Action, Level>>>>>;
|
|
14
|
+
/** 表にない対象の既定のキー */
|
|
15
|
+
export declare const ANY_TARGET = "*";
|
|
16
|
+
type Holder = Pick<User, 'permissions'> & Partial<Pick<User, 'role' | 'operator' | 'app' | 'mcp'>>;
|
|
17
|
+
/** 対象と操作の段階 */
|
|
18
|
+
export declare const levelOf: (user: Holder, target: string, action: Action) => Level;
|
|
19
|
+
/** 対象の操作に、どれかの段階(自分のものだけ、承認が必要を含む)で届くか(レコードを読む前の入口の判定、判定は authorizeReach) */
|
|
20
|
+
export declare const reaches: (user: Holder, target: string, action: Action) => boolean;
|
|
21
|
+
/** 操作できるか(owned は自分が持ち主の行か、承認が必要は不可。判定は判定の関数 authorize) */
|
|
22
|
+
export declare const allows: (user: Holder, target: string, action: Action, owned?: boolean) => boolean;
|
|
23
|
+
/**
|
|
24
|
+
* 非公開のコレクション(個人の情報を持つコレクション)の権限: 表にない操作に既定の '*' を当てない
|
|
25
|
+
* - closed: すべての操作を不可にする(MCP からの要求、AI に個人の情報を渡さない)
|
|
26
|
+
* - 管理者の固定の表('*' がすべて可)は closed のときだけ閉じる
|
|
27
|
+
*/
|
|
28
|
+
export declare function withPrivateTargets(permissions: Permissions, targets: readonly string[], closed: boolean): Permissions;
|
|
29
|
+
/** レコードの値(持ち主か・公開中か) */
|
|
30
|
+
export type RowAccess = Readonly<{
|
|
31
|
+
owned: boolean;
|
|
32
|
+
published: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
/** レコードを閲覧できるか */
|
|
35
|
+
export declare const canReadRow: (user: Holder, target: string, row: RowAccess) => boolean;
|
|
36
|
+
/** レコードを変更・削除できるか(公開中のレコードは公開の権限も必要) */
|
|
37
|
+
export declare const canChangeRow: (user: Holder, target: string, action: "update" | "delete", row: RowAccess) => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* 権限の表の検査(不正な値は理由の文の配列)
|
|
40
|
+
* - targets: 対象の id('*' は常に可)
|
|
41
|
+
*/
|
|
42
|
+
export declare function checkPermissions(input: unknown, targets: readonly string[]): {
|
|
43
|
+
value: Permissions;
|
|
44
|
+
} | {
|
|
45
|
+
problems: string[];
|
|
46
|
+
};
|
|
47
|
+
/** アカウントの結び付き(設定): type はアカウントが結び付くコレクション、owners は対象ごとに持ち主を表す参照の項目の key */
|
|
48
|
+
export type AccountLink = Readonly<{
|
|
49
|
+
collection: string | null;
|
|
50
|
+
owners: Readonly<Record<string, string>>;
|
|
51
|
+
}>;
|
|
52
|
+
type Owner = Pick<User, 'id' | 'recordId' | 'link'>;
|
|
53
|
+
/**
|
|
54
|
+
* レコードの持ち主か
|
|
55
|
+
* - 持ち主の項目がある対象: 項目の値に、アカウントが結び付くレコードを含む
|
|
56
|
+
* - 結び付くコレクションのレコード: 結び付くレコードそのもの
|
|
57
|
+
* - ほかの対象: 作成したアカウント(レコードの created_by、アカウントの ID)
|
|
58
|
+
*/
|
|
59
|
+
export declare const ownsRow: (user: Owner, target: string, row: Readonly<Record<string, unknown>>) => boolean;
|
|
60
|
+
type Subject = Pick<User, 'permissions' | 'id' | 'recordId' | 'link'>;
|
|
61
|
+
/** 権限の判定で使用するレコードの値(レコードのまま、持ち主の項目を含む) */
|
|
62
|
+
export type ContentAccess = Readonly<Record<string, unknown>> & Readonly<{
|
|
63
|
+
status: string;
|
|
64
|
+
}>;
|
|
65
|
+
/** レコードの持ち主か(ownsRow、持ち主のいないレコードは公開が全体で可のアカウント) */
|
|
66
|
+
export declare const ownsContent: (user: Subject, target: string, a: ContentAccess) => boolean;
|
|
67
|
+
/** レコードを編集できるか(公開中のレコードは公開の権限も必要、サーバーは公開中のレコードの拒否を別のエラーで返す) */
|
|
68
|
+
export declare const canEditContent: (user: Subject, target: string, a: ContentAccess) => boolean;
|
|
69
|
+
/** レコードを閲覧できるか */
|
|
70
|
+
export declare const canReadContent: (user: Subject, target: string, a: ContentAccess) => boolean;
|
|
71
|
+
/** レコードを公開・予約・差し戻し・非公開にできるか(本文を変更しない操作のため、編集の権限は不要) */
|
|
72
|
+
export declare const canPublishContent: (user: Subject, target: string, a: ContentAccess) => boolean;
|
|
73
|
+
/** レコードをレビューに提出できるか(編集でき、公開が承認が必要以上) */
|
|
74
|
+
export declare const canSubmitContent: (user: Subject, target: string, a: ContentAccess) => boolean;
|
|
75
|
+
/** レコードを削除できるか */
|
|
76
|
+
export declare const canDeleteContent: (user: Subject, target: string, a: ContentAccess) => boolean;
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ParamValue } from '../../i18n/src/index.js';
|
|
2
|
+
import type { ImportProblem } from './import.js';
|
|
3
|
+
export declare const PROBLEM_MESSAGES: Readonly<Record<string, string>>;
|
|
4
|
+
export declare const PROBLEM_MESSAGES_EN: Readonly<Record<string, string>>;
|
|
5
|
+
/** 既定の形を日本語の文に(問題でない文はそのまま、差し込みの中の問題も文に。extra はモジュールとアプリの表) */
|
|
6
|
+
export declare const problemLabel: (text: string, extra?: Readonly<Record<string, string>>) => string;
|
|
7
|
+
/** 既定の形を英語の文に(問題でない文はそのまま。extra はモジュールとアプリの英語の表) */
|
|
8
|
+
export declare const problemEnglish: (text: string, extra?: Readonly<Record<string, string>>) => string;
|
|
9
|
+
/**
|
|
10
|
+
* コードと差し込みを持つ結果の画面の文(issues、スキーマの変更、取り込みの問題)
|
|
11
|
+
* - コードが表にあり差し込みがそろえば表の文、ほかは message(既定の形なら表の文)
|
|
12
|
+
* - extra: モジュールとアプリの表(コードは `<id>_` で始まり、コアの表と重ならない)
|
|
13
|
+
*/
|
|
14
|
+
export declare function issueLabel(issue: Readonly<{
|
|
15
|
+
message: string;
|
|
16
|
+
code?: string;
|
|
17
|
+
params?: Readonly<Record<string, ParamValue>>;
|
|
18
|
+
}>, extra?: Readonly<Record<string, string>>): string;
|
|
19
|
+
/** 取り込みの問題の画面の文(code は取り込みの種類で、問題のコードは problem) */
|
|
20
|
+
export declare const importProblemLabel: (p: Pick<ImportProblem, "message" | "problem" | "params">, extra?: Readonly<Record<string, string>>) => string;
|
|
21
|
+
/** 取り込みの問題の種類の名前(ImportProblem の code) */
|
|
22
|
+
export declare const importKindLabel: (code: ImportProblem["code"]) => string;
|
|
23
|
+
type Table = Readonly<Record<string, string>>;
|
|
24
|
+
/** モジュールとアプリの文言の表の誤り(問題のコードの接頭辞 `<id>_`、コアの問題の表との重なり、英語の表のキーの過不足) */
|
|
25
|
+
export declare function labelTableProblems(tables: Readonly<{
|
|
26
|
+
id: string;
|
|
27
|
+
targets?: Table;
|
|
28
|
+
problems?: Table;
|
|
29
|
+
en?: Readonly<{
|
|
30
|
+
targets?: Table;
|
|
31
|
+
problems?: Table;
|
|
32
|
+
}>;
|
|
33
|
+
}>): string[];
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Capabilities } from './authorize.js';
|
|
2
|
+
import { type AccountLink, type Permissions } from './permissions.js';
|
|
3
|
+
/** 管理者のロールの ID */
|
|
4
|
+
export declare const ADMIN_ROLE = "admin";
|
|
5
|
+
/** 新しいアカウントの既定のロールの ID(テンプレートのロールの ID、あれば既定、削除できる) */
|
|
6
|
+
export declare const DEFAULT_ROLE = "writer";
|
|
7
|
+
/** 管理者の権限の表(すべての対象・操作が可、DB の値より優先) */
|
|
8
|
+
export declare const ADMIN_PERMISSIONS: Permissions;
|
|
9
|
+
/** ロールの権限の表(管理者のロールは固定の表、ほかは保存した表) */
|
|
10
|
+
export declare const rolePermissionsOf: (roleId: string, stored: Permissions) => Permissions;
|
|
11
|
+
/** 削除できないロールの ID */
|
|
12
|
+
export declare const SYSTEM_ROLES: readonly string[];
|
|
13
|
+
/** 新しいアカウントの既定のロール(DEFAULT_ROLE、なければ管理者以外の最初のロール、それもなければ管理者) */
|
|
14
|
+
export declare const defaultRoleOf: (roles: readonly Pick<Role, "id">[]) => string;
|
|
15
|
+
/** ロール(API /api/roles の行) */
|
|
16
|
+
export type Role = Readonly<{
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
permissions: Permissions;
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* ログイン中のアカウント
|
|
23
|
+
* - id: アカウントの ID(操作の履歴・版の作成者・担当者などに保存する値、メールアドレスは表 accounts だけ)
|
|
24
|
+
* - role: ロールの ID、recordId: 結び付くレコード(なしは null)、link: 結び付きの設定
|
|
25
|
+
* - operator: 運営者のサポートのアクセスの許可で入った運営者(操作の履歴の主体は運営者)
|
|
26
|
+
* - app: アプリのアカウントの資格(client はクライアントの ID、installation はインストールの ID)
|
|
27
|
+
* - mcp: MCP の接続(grant は付与の ID、client はクライアントの ID、capabilities は付与の範囲の能力、
|
|
28
|
+
* staffCollections はスタッフの項目のコレクション)
|
|
29
|
+
* rolePermissions は範囲で絞る前のロールの表(範囲の不足とロールの不足を分ける)
|
|
30
|
+
* - app と mcp の permissions は人 ∩ 委ねた能力に絞った値で、管理者として扱わない
|
|
31
|
+
*/
|
|
32
|
+
export type User = Readonly<{
|
|
33
|
+
id: string;
|
|
34
|
+
email: string;
|
|
35
|
+
role: string;
|
|
36
|
+
roleLabel: string;
|
|
37
|
+
permissions: Permissions;
|
|
38
|
+
recordId: string | null;
|
|
39
|
+
link: AccountLink;
|
|
40
|
+
operator?: true;
|
|
41
|
+
app?: Readonly<{
|
|
42
|
+
client: string;
|
|
43
|
+
installation: string;
|
|
44
|
+
capabilities: Capabilities;
|
|
45
|
+
consented?: Capabilities;
|
|
46
|
+
withheld?: readonly string[];
|
|
47
|
+
}>;
|
|
48
|
+
mcp?: Readonly<{
|
|
49
|
+
grant: string;
|
|
50
|
+
client: string;
|
|
51
|
+
capabilities: Capabilities;
|
|
52
|
+
rolePermissions: Permissions;
|
|
53
|
+
staffCollections: readonly string[];
|
|
54
|
+
}>;
|
|
55
|
+
}>;
|
|
56
|
+
/** 設定を扱える(管理者のロールの)アカウントか */
|
|
57
|
+
export declare const isAdmin: (user: Pick<User, "role" | "app" | "mcp">) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ParamValue } from '../../i18n/src/index.js';
|
|
2
|
+
/** モジュールの設定値の問題のコード */
|
|
3
|
+
export declare const SETTING_PROBLEMS: readonly ["text", "integer_min", "boolean", "text_list", "choice", "duplicate", "required", "shape"];
|
|
4
|
+
export type SettingProblemCode = (typeof SETTING_PROBLEMS)[number];
|
|
5
|
+
/** モジュールの設定値の問題(key は設定値のキー、params は文に差し込む値) */
|
|
6
|
+
export declare class SettingProblem extends Error {
|
|
7
|
+
readonly key: string;
|
|
8
|
+
readonly problem: SettingProblemCode;
|
|
9
|
+
readonly params: Readonly<Record<string, ParamValue>>;
|
|
10
|
+
constructor(key: string, problem: SettingProblemCode, params?: Readonly<Record<string, ParamValue>>);
|
|
11
|
+
}
|
|
12
|
+
/** 設定値の問題の既定の形(field は項目名) */
|
|
13
|
+
export declare const settingProblemText: (p: SettingProblem, field: string) => string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { User } from './roles.js';
|
|
2
|
+
/**
|
|
3
|
+
* 設定の領域
|
|
4
|
+
* - general: 一般、content: コレクション・メニュー・画像サイズ、extensions: 拡張機能
|
|
5
|
+
* - integrations: 連携・プレビューとデプロイ、data: インポート・エクスポート、customers: 顧客の設定
|
|
6
|
+
*/
|
|
7
|
+
export declare const SETTINGS_AREAS: readonly ["general", "content", "extensions", "integrations", "data", "customers"];
|
|
8
|
+
/** 設定の領域 */
|
|
9
|
+
export type SettingsArea = (typeof SETTINGS_AREAS)[number];
|
|
10
|
+
/** 権限の表での設定の領域の id */
|
|
11
|
+
export declare const settingsTarget: (area: SettingsArea) => string;
|
|
12
|
+
/** 権限の表の対象が設定の領域か */
|
|
13
|
+
export declare const isSettingsTarget: (id: string) => boolean;
|
|
14
|
+
type Holder = Pick<User, 'role' | 'permissions'> & Partial<Pick<User, 'mcp' | 'operator' | 'app'>>;
|
|
15
|
+
/** 設定の領域を扱えるか(判定は authorize。管理者は可、ほかは対象の更新が可のときだけ、人の代わりとアプリは不可) */
|
|
16
|
+
export declare const canManageSettings: (user: Holder, area: SettingsArea) => boolean;
|
|
17
|
+
/** 扱える設定の領域(空は設定の層を開けない) */
|
|
18
|
+
export declare const managedAreasOf: (user: Holder) => readonly SettingsArea[];
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** 成果物の先頭の印と上限(大きさはバイト。資産の1つの上限は Workers の静的な資産の上限) */
|
|
2
|
+
export declare const SITE_ARTIFACT: {
|
|
3
|
+
readonly magic: "TUNASANDSITE1\n";
|
|
4
|
+
readonly totalBytes: number;
|
|
5
|
+
readonly headerBytes: number;
|
|
6
|
+
readonly modules: 64;
|
|
7
|
+
readonly assets: 5000;
|
|
8
|
+
readonly assetBytes: number;
|
|
9
|
+
};
|
|
10
|
+
/** モジュールの種類と、アップロードの multipart の Content-Type */
|
|
11
|
+
export declare const MODULE_CONTENT_TYPES: {
|
|
12
|
+
readonly esm: "application/javascript+module";
|
|
13
|
+
readonly cjs: "application/javascript";
|
|
14
|
+
readonly text: "text/plain";
|
|
15
|
+
readonly data: "application/octet-stream";
|
|
16
|
+
readonly wasm: "application/wasm";
|
|
17
|
+
readonly sourcemap: "application/source-map";
|
|
18
|
+
};
|
|
19
|
+
export type SiteModuleType = keyof typeof MODULE_CONTENT_TYPES;
|
|
20
|
+
/**
|
|
21
|
+
* モジュールの種類ごとに許す拡張子。モジュールの名前は拡張子つきの形だけを受けるので、
|
|
22
|
+
* Upload User Worker API の multipart の指示の部分(`metadata`)と同じ名前を持てない
|
|
23
|
+
*/
|
|
24
|
+
export declare const MODULE_EXTENSIONS: {
|
|
25
|
+
readonly esm: readonly ["js", "mjs"];
|
|
26
|
+
readonly cjs: readonly ["cjs"];
|
|
27
|
+
readonly text: readonly ["txt", "html", "md", "sql", "json"];
|
|
28
|
+
readonly data: readonly ["bin"];
|
|
29
|
+
readonly wasm: readonly ["wasm"];
|
|
30
|
+
readonly sourcemap: readonly ["map"];
|
|
31
|
+
};
|
|
32
|
+
/** モジュールの名前の形: 相対の道で、区切りは英数字か `_`、`-` で始まり(`.` と `..` の区切りを含まない)、最後は拡張子。長さの上限つき */
|
|
33
|
+
export declare const MODULE_NAME: {
|
|
34
|
+
readonly pattern: RegExp;
|
|
35
|
+
readonly maxLength: 256;
|
|
36
|
+
};
|
|
37
|
+
/** アップロードの multipart の、Cloudflare への指示の部分の名前(モジュールの名前に使えない) */
|
|
38
|
+
export declare const UPLOAD_FORM_PARTS: readonly ["metadata"];
|
|
39
|
+
/** 名前から決まるモジュールの種類(形の外か、表にない拡張子は null) */
|
|
40
|
+
export declare function siteModuleTypeOf(name: string): SiteModuleType | null;
|
|
41
|
+
/** 成果物の置き場所(R2 の SITE_ARTIFACTS)のキーの接頭辞: CMS が受けたものを置く所と、digest を確認して保存した所 */
|
|
42
|
+
export declare const ARTIFACT_KEYS: {
|
|
43
|
+
readonly incoming: "incoming/";
|
|
44
|
+
readonly stored: "sites/";
|
|
45
|
+
};
|