@tunasand/sdk 0.7.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +233 -88
- package/README.md +296 -273
- package/dist/analytics.js +657 -10
- package/dist/app.js +323 -96
- package/dist/apps-DIxAWBSZ.js +318 -0
- package/dist/astro-image.d.ts +1 -0
- package/dist/astro-image.js +33 -0
- package/dist/astro-server-Bwau8F6d.js +99 -0
- package/dist/astro-server.d.ts +1 -0
- package/dist/astro-server.js +1 -0
- package/dist/astro.d.ts +1 -0
- package/dist/astro.js +306 -0
- package/dist/bridge-Dv4NxGZ7.js +81 -0
- package/dist/bridge.js +2 -14
- package/dist/build-file-DNi0PHC5.js +31 -0
- package/dist/cli.js +6214 -9
- package/dist/{client-Derrexwr.js → client-C8STAw9T.js} +43 -24
- package/dist/code-N8pBUDbq.js +30 -0
- package/dist/code.d.ts +1 -0
- package/dist/code.js +1 -0
- package/dist/collection-nUz1RetA.js +264 -0
- package/dist/{declared-C_GvPiGF.js → declared-CE4a61qb.js} +124 -36
- package/dist/delivery.js +124 -132
- package/dist/dev-operations-Tutwi1On.js +46 -0
- package/dist/dev.js +9 -16
- package/dist/embeds-B-Dbn64k.js +29 -0
- package/dist/end-users.d.ts +1 -0
- package/dist/end-users.js +185 -0
- package/dist/{customers-C_vJY2_v.js → endUsers-DODfjnv1.js} +31 -38
- package/dist/{errorLabels-CPKiPabZ.js → errorLabels-aT2bnMsO.js} +593 -460
- package/dist/i18n.js +4 -4
- package/dist/ids-DmtIoqBX.js +109 -0
- package/dist/integrations.js +95 -49
- package/dist/{ja-C6lX0CeJ.js → ja-CrY_72Tn.js} +99 -54
- package/dist/{ja-C1HEWWTQ.js → ja-axQPxMJ-.js} +6 -6
- package/dist/operations-CIB99rIY.js +95 -0
- package/dist/operations.d.ts +1 -0
- package/dist/operations.js +1 -0
- package/dist/{page-E_cYgZx-.js → page-yo1cw1kW.js} +5 -5
- package/dist/preview.js +8 -1
- package/dist/{profile-D6t1QMQh.js → profile-DBsXLvvI.js} +52 -52
- package/dist/rich-text.d.ts +1 -0
- package/dist/{body.js → rich-text.js} +20 -21
- package/dist/schema-Dcg1ajnW.js +1267 -0
- package/dist/schema.js +324 -1
- package/dist/types/access/src/handoff.d.ts +22 -17
- package/dist/types/access/src/index.d.ts +2 -2
- package/dist/types/access/src/jws.d.ts +41 -0
- package/dist/types/access/src/jwt.d.ts +1 -1
- package/dist/types/access/src/oidc.d.ts +11 -3
- package/dist/types/access/src/signed.d.ts +0 -2
- package/dist/types/adapter-cloudflare/src/eventLog/viewSchema.d.ts +11 -0
- package/dist/types/contract/src/accountProfile.d.ts +7 -0
- package/dist/types/{cms-contract → contract}/src/apiKeys.d.ts +7 -3
- package/dist/types/contract/src/app.d.ts +38 -0
- package/dist/types/contract/src/appChannels.d.ts +114 -0
- package/dist/types/contract/src/appDefinition.d.ts +133 -0
- package/dist/types/{cms-contract → contract}/src/appDependencies.d.ts +91 -35
- package/dist/types/contract/src/appIdentities.d.ts +21 -0
- package/dist/types/contract/src/appInbound.d.ts +28 -0
- package/dist/types/contract/src/appMail.d.ts +106 -0
- package/dist/types/contract/src/appSecrets.d.ts +45 -0
- package/dist/types/contract/src/appServer.d.ts +501 -0
- package/dist/types/contract/src/approvalLabels.d.ts +26 -0
- package/dist/types/contract/src/approvals.d.ts +63 -0
- package/dist/types/contract/src/apps.d.ts +295 -0
- package/dist/types/contract/src/auditActions.d.ts +18 -0
- package/dist/types/contract/src/auditLabels.d.ts +223 -0
- package/dist/types/contract/src/authorize.d.ts +133 -0
- package/dist/types/{cms-contract → contract}/src/bridge.d.ts +39 -40
- package/dist/types/{cms-contract → contract}/src/consents.d.ts +32 -25
- package/dist/types/contract/src/deletion.d.ts +18 -0
- package/dist/types/contract/src/embeds.d.ts +105 -0
- package/dist/types/{cms-contract/src/customerLabels.d.ts → contract/src/endUserLabels.d.ts} +6 -9
- package/dist/types/contract/src/endUsers.d.ts +241 -0
- package/dist/types/{cms-contract → contract}/src/errorLabels.d.ts +76 -47
- package/dist/types/{cms-contract → contract}/src/errorLabelsEn.d.ts +52 -36
- package/dist/types/contract/src/errors.d.ts +117 -0
- package/dist/types/contract/src/eventSchemas.d.ts +70 -0
- package/dist/types/contract/src/eventTraces.d.ts +43 -0
- package/dist/types/{cms-contract → contract}/src/failureStatus.d.ts +16 -23
- package/dist/types/contract/src/fieldAccess.d.ts +45 -0
- package/dist/types/contract/src/fieldRules.d.ts +41 -0
- package/dist/types/{cms-contract/src/assets.d.ts → contract/src/files.d.ts} +5 -5
- package/dist/types/contract/src/formLabels.d.ts +3 -0
- package/dist/types/contract/src/forms.d.ts +4 -0
- package/dist/types/{cms-contract → contract}/src/functions.d.ts +3 -3
- package/dist/types/contract/src/grants.d.ts +26 -0
- package/dist/types/contract/src/headers.d.ts +5 -0
- package/dist/types/contract/src/hostingRpc.d.ts +149 -0
- package/dist/types/contract/src/hostnames.d.ts +30 -0
- package/dist/types/contract/src/identifiers.d.ts +148 -0
- package/dist/types/contract/src/ids.d.ts +112 -0
- package/dist/types/{cms-contract → contract}/src/import.d.ts +20 -19
- package/dist/types/contract/src/importLabels.d.ts +3 -0
- package/dist/types/contract/src/index.d.ts +92 -0
- package/dist/types/contract/src/integrationGraph.d.ts +83 -0
- package/dist/types/{cms-contract → contract}/src/issueLabels.d.ts +135 -99
- package/dist/types/{cms-contract → contract}/src/issueLabelsEn.d.ts +70 -52
- package/dist/types/contract/src/labels.d.ts +11 -0
- package/dist/types/contract/src/legacyAuditLabels.d.ts +10 -0
- package/dist/types/contract/src/livePeriods.d.ts +18 -0
- package/dist/types/contract/src/manage.d.ts +51 -0
- package/dist/types/contract/src/manageLabels.d.ts +11 -0
- package/dist/types/contract/src/manifestText.d.ts +66 -0
- package/dist/types/contract/src/mcpAuth.d.ts +139 -0
- package/dist/types/contract/src/mcpLabels.d.ts +5 -0
- package/dist/types/contract/src/messagePort.d.ts +208 -0
- package/dist/types/{cms-contract → contract}/src/migration.d.ts +3 -3
- package/dist/types/contract/src/notices.d.ts +38 -0
- package/dist/types/contract/src/operatorOperations.d.ts +640 -0
- package/dist/types/contract/src/operators.d.ts +33 -0
- package/dist/types/contract/src/outbound.d.ts +29 -0
- package/dist/types/contract/src/paths.d.ts +34 -0
- package/dist/types/contract/src/pending.d.ts +6 -0
- package/dist/types/{cms-contract → contract}/src/permissions.d.ts +9 -11
- package/dist/types/contract/src/perspective.d.ts +26 -0
- package/dist/types/contract/src/powers.d.ts +5 -0
- package/dist/types/contract/src/principal.d.ts +181 -0
- package/dist/types/{cms-contract → contract}/src/problems.d.ts +4 -4
- package/dist/types/contract/src/projectRole.d.ts +6 -0
- package/dist/types/contract/src/recordLabels.d.ts +6 -0
- package/dist/types/{cms-contract → contract}/src/roles.d.ts +10 -6
- package/dist/types/contract/src/ruleLabels.d.ts +16 -0
- package/dist/types/contract/src/ruleProblems.d.ts +16 -0
- package/dist/types/contract/src/schemaLabels.d.ts +8 -0
- package/dist/types/{cms-contract → contract}/src/settingProblems.d.ts +3 -3
- package/dist/types/{cms-contract → contract}/src/settings.d.ts +6 -8
- package/dist/types/contract/src/settingsLabels.d.ts +3 -0
- package/dist/types/{cms-contract → contract}/src/siteDeclaration.d.ts +7 -7
- package/dist/types/contract/src/siteIndex.d.ts +76 -0
- package/dist/types/contract/src/slugs.d.ts +6 -0
- package/dist/types/{cms-contract → contract}/src/transfer.d.ts +4 -4
- package/dist/types/contract/src/trial.d.ts +13 -0
- package/dist/types/contract/src/versions.d.ts +7 -0
- package/dist/types/{analytics/src/view.d.ts → contract/src/viewEvent.d.ts} +0 -9
- package/dist/types/contract/src/webhooks.d.ts +135 -0
- package/dist/types/contract/src/workflow.d.ts +43 -0
- package/dist/types/contract/src/workspaceItems.d.ts +87 -0
- package/dist/types/contract/src/workspacePaths.d.ts +4 -0
- package/dist/types/{body → rich-text}/src/declared.d.ts +2 -2
- package/dist/types/{body → rich-text}/src/embed.d.ts +1 -1
- package/dist/types/{body → rich-text}/src/html.d.ts +1 -1
- package/dist/types/{body → rich-text}/src/index.d.ts +8 -7
- package/dist/types/{body → rich-text}/src/labels/en.d.ts +1 -1
- package/dist/types/{body → rich-text}/src/labels/ja.d.ts +4 -4
- package/dist/types/{body → rich-text}/src/library.d.ts +1 -1
- package/dist/types/rich-text/src/media.d.ts +2 -0
- package/dist/types/{body → rich-text}/src/normalize.d.ts +1 -1
- package/dist/types/{body → rich-text}/src/problems.d.ts +5 -5
- package/dist/types/{body → rich-text}/src/profile.d.ts +11 -11
- package/dist/types/{body → rich-text}/src/render.d.ts +1 -1
- package/dist/types/{body → rich-text}/src/schema.d.ts +2 -2
- package/dist/types/{body → rich-text}/src/standard.d.ts +4 -4
- package/dist/types/{body → rich-text}/src/types.d.ts +2 -2
- package/dist/types/schema/src/audience.d.ts +36 -0
- package/dist/types/schema/src/brand.d.ts +5 -0
- package/dist/types/schema/src/capabilities.d.ts +19 -0
- package/dist/types/{model → schema}/src/changes.d.ts +9 -7
- package/dist/types/{model → schema}/src/check.d.ts +2 -2
- package/dist/types/{model/src/model.d.ts → schema/src/collection.d.ts} +150 -121
- package/dist/types/schema/src/defaultSchema.d.ts +15 -0
- package/dist/types/schema/src/fieldIds.d.ts +18 -0
- package/dist/types/{model/src/asset.d.ts → schema/src/file.d.ts} +36 -25
- package/dist/types/schema/src/fileRefs.d.ts +14 -0
- package/dist/types/schema/src/fileSignature.d.ts +20 -0
- package/dist/types/schema/src/filesCollection.d.ts +7 -0
- package/dist/types/schema/src/forms.d.ts +43 -0
- package/dist/types/{model → schema}/src/image.d.ts +3 -3
- package/dist/types/schema/src/imageMetadata.d.ts +9 -0
- package/dist/types/schema/src/index.d.ts +35 -0
- package/dist/types/{model → schema}/src/input.d.ts +3 -3
- package/dist/types/{model → schema}/src/integrity.d.ts +9 -8
- package/dist/types/schema/src/kinds.d.ts +26 -0
- package/dist/types/{model → schema}/src/labels/en.d.ts +93 -51
- package/dist/types/{model → schema}/src/labels/ja.d.ts +97 -52
- package/dist/types/schema/src/mediaUrl.d.ts +60 -0
- package/dist/types/{model → schema}/src/page.d.ts +6 -6
- package/dist/types/{model → schema}/src/problems.d.ts +95 -53
- package/dist/types/{model → schema}/src/refs.d.ts +1 -10
- package/dist/types/{model → schema}/src/rules.d.ts +2 -2
- package/dist/types/{model → schema}/src/schema.d.ts +25 -20
- package/dist/types/schema/src/selfOps.d.ts +31 -0
- package/dist/types/{model/src/capabilities.d.ts → schema/src/traits.d.ts} +6 -6
- package/dist/types/schema/src/typesSource.d.ts +16 -0
- package/dist/types/{model → schema}/src/values.d.ts +7 -4
- package/dist/types/schema/src/widening.d.ts +3 -0
- package/dist/types/sdk/src/analytics.d.ts +3 -2
- package/dist/types/sdk/src/app.d.ts +70 -16
- package/dist/types/sdk/src/astro-image.d.ts +19 -0
- package/dist/types/sdk/src/astro-response.d.ts +6 -0
- package/dist/types/sdk/src/astro-server.d.ts +16 -0
- package/dist/types/sdk/src/astro.d.ts +19 -0
- package/dist/types/sdk/src/bridge.d.ts +13 -15
- package/dist/types/sdk/src/code.d.ts +61 -0
- package/dist/types/sdk/src/delegation.d.ts +49 -0
- package/dist/types/sdk/src/delivery/changes.d.ts +4 -4
- package/dist/types/sdk/src/delivery/client.d.ts +40 -28
- package/dist/types/sdk/src/delivery/fields.d.ts +5 -5
- package/dist/types/sdk/src/delivery/index.d.ts +3 -3
- package/dist/types/sdk/src/delivery/media.d.ts +8 -11
- package/dist/types/sdk/src/delivery/query.d.ts +16 -12
- package/dist/types/sdk/src/delivery/schema.d.ts +5 -5
- package/dist/types/sdk/src/delivery/values.d.ts +16 -20
- package/dist/types/sdk/src/delivery.d.ts +3 -3
- package/dist/types/sdk/src/dev-operations.d.ts +20 -0
- package/dist/types/sdk/src/dev.d.ts +6 -5
- package/dist/types/sdk/src/end-users.d.ts +190 -0
- package/dist/types/sdk/src/i18n.d.ts +11 -11
- package/dist/types/sdk/src/integrations.d.ts +20 -27
- package/dist/types/sdk/src/operations.d.ts +17 -0
- package/dist/types/sdk/src/preview.d.ts +2 -1
- package/dist/types/sdk/src/rich-text.d.ts +2 -0
- package/dist/types/sdk/src/schema.d.ts +5 -21
- package/dist/types/sdk/src/site/artifact.d.ts +64 -0
- package/dist/types/sdk/src/site/build-file.d.ts +30 -0
- package/dist/types/sdk/src/site/check-code.d.ts +14 -0
- package/dist/types/sdk/src/site/check-text.d.ts +19 -0
- package/dist/types/sdk/src/site/cli.d.ts +52 -0
- package/dist/types/sdk/src/site/content-type.d.ts +2 -0
- package/dist/types/sdk/src/site/labels.d.ts +14 -0
- package/dist/types/sdk/src/site.d.ts +1 -1
- package/dist/types/sdk/src/types.d.ts +21 -0
- package/dist/{schema-BPHL7Qr-.js → types-DkO2N7u2.js} +9 -9
- package/dist/types.d.ts +1 -0
- package/dist/types.js +1 -0
- package/dist/typesSource-VJIxtN9b.js +136 -0
- package/dist/workflow-CUpl6hO_.js +148 -0
- package/package.json +42 -16
- package/dist/apps-9u4XMi7E.js +0 -114
- package/dist/body.d.ts +0 -1
- package/dist/bridge-DYAYGV7t.js +0 -74
- package/dist/customers.d.ts +0 -1
- package/dist/customers.js +0 -185
- package/dist/embed-R-OvDYAw.js +0 -90
- package/dist/model-pmXzGX12.js +0 -152
- package/dist/model.d.ts +0 -1
- package/dist/model.js +0 -345
- package/dist/schema-UQJWRyfJ.js +0 -995
- package/dist/src-sazhzYui.js +0 -71
- package/dist/types/analytics/src/index.d.ts +0 -5
- package/dist/types/analytics/src/schedule.d.ts +0 -2
- package/dist/types/analytics/src/shared.d.ts +0 -21
- package/dist/types/analytics/src/source.d.ts +0 -19
- package/dist/types/analytics/src/store.d.ts +0 -24
- package/dist/types/cms-contract/src/app.d.ts +0 -35
- package/dist/types/cms-contract/src/apps.d.ts +0 -195
- package/dist/types/cms-contract/src/authorize.d.ts +0 -146
- package/dist/types/cms-contract/src/customers.d.ts +0 -266
- package/dist/types/cms-contract/src/embeds.d.ts +0 -165
- package/dist/types/cms-contract/src/errors.d.ts +0 -105
- package/dist/types/cms-contract/src/identifiers.d.ts +0 -117
- package/dist/types/cms-contract/src/paths.d.ts +0 -23
- package/dist/types/cms-contract/src/urlLabel.d.ts +0 -13
- package/dist/types/cms-contract/src/webhooks.d.ts +0 -139
- package/dist/types/model/src/audience.d.ts +0 -38
- package/dist/types/model/src/brand.d.ts +0 -25
- package/dist/types/model/src/index.d.ts +0 -26
- package/dist/types/model/src/legacy.d.ts +0 -2
- package/dist/types/model/src/media.d.ts +0 -5
- package/dist/types/model/src/mediaUrl.d.ts +0 -67
- package/dist/types/model/src/selfOps.d.ts +0 -30
- package/dist/types/model/src/typesSource.d.ts +0 -8
- package/dist/types/platform/src/defaultModel.d.ts +0 -8
- package/dist/types/sdk/src/body.d.ts +0 -2
- package/dist/types/sdk/src/customers.d.ts +0 -190
- package/dist/types/sdk/src/model.d.ts +0 -5
- package/dist/typesSource-bO0jFw1I.js +0 -88
- /package/dist/types/{cms-contract → contract}/src/appProblems.d.ts +0 -0
- /package/dist/types/{analytics → contract}/src/day.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/functionLabels.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/permissionLabels.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/siteArtifact.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/views.d.ts +0 -0
- /package/dist/types/{cms-contract → contract}/src/webhookLabels.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/components.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/derive.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/description.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/href.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/inline.d.ts +0 -0
- /package/dist/types/{body → rich-text}/src/markdown.d.ts +0 -0
- /package/dist/types/{model → schema}/src/contact.d.ts +0 -0
- /package/dist/types/{model → schema}/src/json.d.ts +0 -0
- /package/dist/types/{model → schema}/src/screens.d.ts +0 -0
- /package/dist/types/{model → schema}/src/time.d.ts +0 -0
|
@@ -1,23 +0,0 @@
|
|
|
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;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** UUID の base32 のラベルの形か */
|
|
2
|
-
export declare const isBase32Label: (value: string) => boolean;
|
|
3
|
-
/**
|
|
4
|
-
* URL に出すプロジェクトか環境のラベル(決定は tunasand#717: URL に UUID を直接出さない)
|
|
5
|
-
* - UUID は base32 の26文字、UUID でない値はそのまま
|
|
6
|
-
*/
|
|
7
|
-
export declare function urlLabelOf(id: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* URL のラベルから台帳を引く識別子(base32 のラベルは UUID の文字列、ラベルの形でない値はそのまま)
|
|
10
|
-
* - UUID をそのまま書いた値は null(正の URL はラベルの1つだけ。入口は見つからないと同じ応答にする)
|
|
11
|
-
* - 戻り値はブランドの型にしない(入口は台帳で引き直してレコードの値を使う)
|
|
12
|
-
*/
|
|
13
|
-
export declare function idOfUrlLabel(label: string): string | null;
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/** 送れる操作(レビューの依頼・公開・非公開・差し戻しと、データの変更の作成・更新・削除) */
|
|
2
|
-
export declare const WEBHOOK_ACTIONS: readonly ["submitted", "published", "unpublished", "rejected", "created", "updated", "deleted"];
|
|
3
|
-
/** データの変更の操作(配信 API の変更の一覧と同じ記録から送る) */
|
|
4
|
-
export declare const WEBHOOK_CHANGE_ACTIONS: readonly ["created", "updated", "deleted"];
|
|
5
|
-
/** データの変更の操作 */
|
|
6
|
-
export type WebhookChangeAction = (typeof WEBHOOK_CHANGE_ACTIONS)[number];
|
|
7
|
-
/** 送れる操作 */
|
|
8
|
-
export type WebhookAction = (typeof WEBHOOK_ACTIONS)[number];
|
|
9
|
-
/** Webhook の契約の版(本文の version) */
|
|
10
|
-
export declare const WEBHOOK_VERSION = 1;
|
|
11
|
-
/** Webhook の契約の版 */
|
|
12
|
-
export type WebhookVersion = typeof WEBHOOK_VERSION;
|
|
13
|
-
/** サーバーの内側のイベントのキー(編集のイベントは <コレクションの id>.<操作>、拡張機能のイベントは宣言の名前) */
|
|
14
|
-
export type WebhookEvent = `${string}.${string}`;
|
|
15
|
-
/** 購読するイベント(操作か拡張機能のイベントの名前) */
|
|
16
|
-
export type WebhookSubscription = WebhookAction | WebhookEvent;
|
|
17
|
-
/** データの変更の操作か */
|
|
18
|
-
export declare const isWebhookChangeAction: (value: string) => value is WebhookChangeAction;
|
|
19
|
-
/**
|
|
20
|
-
* インストールのイベント(購読によらず送る)
|
|
21
|
-
* - uninstalled: アンインストールの最後の知らせ。そのインストールの Webhook(止めた後も、このイベントだけ)と、アプリの削除のエンドポイントへ
|
|
22
|
-
*/
|
|
23
|
-
export declare const INSTALLATION_EVENTS: {
|
|
24
|
-
readonly uninstalled: "app.uninstalled";
|
|
25
|
-
};
|
|
26
|
-
/** アンインストールのイベントの値(インストールの ID と登録簿のアプリの ID、旧い形のインストールは null) */
|
|
27
|
-
export type InstallationUninstalledData = Readonly<{
|
|
28
|
-
installation_id: string;
|
|
29
|
-
app_id: string | null;
|
|
30
|
-
}>;
|
|
31
|
-
/** 送れる操作か */
|
|
32
|
-
export declare const isWebhookAction: (value: string) => value is WebhookAction;
|
|
33
|
-
/** コレクションと操作のイベントのキー */
|
|
34
|
-
export declare const webhookEventOf: (collection: string, action: WebhookAction) => WebhookEvent;
|
|
35
|
-
/** イベントのキーの型と操作(編集のイベントでなければ null) */
|
|
36
|
-
export declare function parseWebhookEvent(event: string): Readonly<{
|
|
37
|
-
collection: string;
|
|
38
|
-
action: WebhookAction;
|
|
39
|
-
}> | null;
|
|
40
|
-
/** イベントのキーの表示名(types はコレクションの id と表示名でコレクションの表示名と操作の表示名、moduleEvents は拡張機能のイベントの表示名) */
|
|
41
|
-
export declare function webhookEventLabel(event: string, collections: Readonly<Record<string, string>>, moduleEvents?: Readonly<Record<string, string>>): string;
|
|
42
|
-
/** 購読するイベントの表示名(操作か拡張機能のイベント) */
|
|
43
|
-
export declare const webhookSubscriptionLabel: (subscription: string, moduleEvents?: Readonly<Record<string, string>>) => string;
|
|
44
|
-
/** Webhook の形式 */
|
|
45
|
-
export type WebhookKind = 'json' | 'slack';
|
|
46
|
-
/**
|
|
47
|
-
* Webhook(url・secret は末尾だけを伏せずに返す、secret の null は署名なし)
|
|
48
|
-
* - installationId: 送り先を持つインストール(チャネルかアプリ)。なしは Webhook だけの旧い形のインストール
|
|
49
|
-
* - events: 購読するイベント(操作と拡張機能のイベント)、collections: 購読するコレクションの id(編集のイベントは events の操作 × collections)
|
|
50
|
-
* - previousSecret: 鍵の移行の期間の古い鍵の末尾、期間の外は null
|
|
51
|
-
* - sendOutsideLive: live 以外の環境でも送るか(既定は記録だけ。合成のデータの環境と、方針の無効な live では印があっても送らない)
|
|
52
|
-
* - lastStatus: 最新の送信で返った HTTP の状態、送れなかったときは0
|
|
53
|
-
*/
|
|
54
|
-
export type Webhook = Readonly<{
|
|
55
|
-
id: string;
|
|
56
|
-
installationId: string | null;
|
|
57
|
-
label: string;
|
|
58
|
-
kind: WebhookKind;
|
|
59
|
-
url: string;
|
|
60
|
-
secret: string | null;
|
|
61
|
-
previousSecret: string | null;
|
|
62
|
-
events: readonly WebhookSubscription[];
|
|
63
|
-
collections: readonly string[];
|
|
64
|
-
enabled: boolean;
|
|
65
|
-
sendOutsideLive: boolean;
|
|
66
|
-
lastStatus: number | null;
|
|
67
|
-
lastAt: string | null;
|
|
68
|
-
}>;
|
|
69
|
-
/**
|
|
70
|
-
* json の形式の本文(編集機能を持つコレクションのイベント、署名は Standard Webhooks で登録ごとの鍵、webhook-id は本文の id)
|
|
71
|
-
* - version: 契約の版(1)
|
|
72
|
-
* - id: イベントの ID(再送しても同じ値、受け手は処理済みの id を捨てて重複を除く)
|
|
73
|
-
* - event: 操作、collection: コレクションの id とスラッグ
|
|
74
|
-
* - item: レコードの id とスラッグと題、by: 操作した人の表示名、at: イベントの日時(ISO 8601、再送しても同じ値)
|
|
75
|
-
* - 受け手の同期と突き合わせは id で(スラッグは変更でき、旧いスラッグを別のレコードが使える)
|
|
76
|
-
*/
|
|
77
|
-
export type WebhookBody = Readonly<{
|
|
78
|
-
version: WebhookVersion;
|
|
79
|
-
id: string;
|
|
80
|
-
event: Exclude<WebhookAction, WebhookChangeAction>;
|
|
81
|
-
collection: Readonly<{
|
|
82
|
-
id: string;
|
|
83
|
-
slug: string;
|
|
84
|
-
}>;
|
|
85
|
-
item: Readonly<{
|
|
86
|
-
id: string;
|
|
87
|
-
slug: string;
|
|
88
|
-
title: string;
|
|
89
|
-
}>;
|
|
90
|
-
by: string;
|
|
91
|
-
at: string;
|
|
92
|
-
}>;
|
|
93
|
-
/**
|
|
94
|
-
* json の形式のデータの変更の本文(レコードの値は持たない。受け手は配信 API で今の値を取り直し、順序の入れ替えに左右されない)
|
|
95
|
-
* - id: イベントの ID(変更の記録1件に1つ、全送り先と再送で同じ)
|
|
96
|
-
* - at: 変更の一覧の記録の日時(ISO 8601)
|
|
97
|
-
* - collection: コレクションの id とスラッグ(消したコレクションのスラッグは null)、item: レコードの id と記録の時点のスラッグ
|
|
98
|
-
* - item.previous_slug: スラッグを変えた記録だけ、変更の前のスラッグ(サイトの旧い URL の転送に使う)
|
|
99
|
-
*/
|
|
100
|
-
export type WebhookChangeBody = Readonly<{
|
|
101
|
-
version: WebhookVersion;
|
|
102
|
-
id: string;
|
|
103
|
-
event: WebhookChangeAction;
|
|
104
|
-
collection: Readonly<{
|
|
105
|
-
id: string;
|
|
106
|
-
slug: string | null;
|
|
107
|
-
}>;
|
|
108
|
-
item: Readonly<{
|
|
109
|
-
id: string;
|
|
110
|
-
slug: string;
|
|
111
|
-
previous_slug?: string;
|
|
112
|
-
}>;
|
|
113
|
-
at: string;
|
|
114
|
-
}>;
|
|
115
|
-
/**
|
|
116
|
-
* json の形式の名前つきのイベントの本文(顧客・取り込み・インストール・拡張機能のイベント。Stripe の Event と同じ並び)
|
|
117
|
-
* - type: イベントの名前(ドットつき、例 customer.status_changed)、created_at: イベントの日時(ISO 8601、再送しても同じ値)
|
|
118
|
-
* - data: イベントの値(顧客のイベントは CustomerEventData)
|
|
119
|
-
*/
|
|
120
|
-
export type WebhookModuleBody = Readonly<{
|
|
121
|
-
version: WebhookVersion;
|
|
122
|
-
id: string;
|
|
123
|
-
type: WebhookEvent;
|
|
124
|
-
created_at: string;
|
|
125
|
-
data: Readonly<Record<string, unknown>>;
|
|
126
|
-
}>;
|
|
127
|
-
/** 送信の記録(event はイベントのキー、attempt は何回目の送信か、retryAt は次の再送の予定の日時、再送なしは null) */
|
|
128
|
-
export type WebhookDelivery = Readonly<{
|
|
129
|
-
id: number;
|
|
130
|
-
source: 'webhook' | 'function';
|
|
131
|
-
event: string;
|
|
132
|
-
status: number;
|
|
133
|
-
error: string | null;
|
|
134
|
-
eventId: string | null;
|
|
135
|
-
attempt: number;
|
|
136
|
-
retryAt: string | null;
|
|
137
|
-
label: string | null;
|
|
138
|
-
created_at: string;
|
|
139
|
-
}>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { type Audience, type ContentModel, type ResolvedModel } from './model.js';
|
|
2
|
-
/** 台帳の1件(コレクションの id × 項目の path、path はまとまりの中を `.` で連結、audience は記録の時点の見える範囲、fieldType は記録の時点の種類) */
|
|
3
|
-
export type AudienceLedgerEntry = Readonly<{
|
|
4
|
-
collection: string;
|
|
5
|
-
path: string;
|
|
6
|
-
fieldType: string;
|
|
7
|
-
audience: Audience;
|
|
8
|
-
}>;
|
|
9
|
-
/** 旧い形の入力か(どの項目にも audience がない、まとまりの中も) */
|
|
10
|
-
export declare function isLegacyInput(json: unknown): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* 読み替えた定義(最上位の項目は見える範囲を必ず持つ、旧い印を外す)
|
|
13
|
-
* - 実行の側(配信、判定、管理の API)と保存の検査が使う。保存の形と GET の応答は読み込んだ値のまま
|
|
14
|
-
*/
|
|
15
|
-
export declare const resolvedModel: (model: ContentModel) => ResolvedModel;
|
|
16
|
-
/**
|
|
17
|
-
* 保存で台帳に足す記録(公開でない項目のうち、台帳にない・台帳より狭い・機密で種類が替わった項目)
|
|
18
|
-
* - 広げた記録は保存の側が変更の一覧の audience-widened から足す
|
|
19
|
-
*/
|
|
20
|
-
export declare function ledgerAdditions(model: ContentModel, ledger: readonly AudienceLedgerEntry[]): AudienceLedgerEntry[];
|
|
21
|
-
/** 広げた項目(from は保存済みの見える範囲か、作り直した key の台帳の最も狭い見える範囲) */
|
|
22
|
-
export type AudienceWidening = AudienceLedgerEntry & Readonly<{
|
|
23
|
-
from: Audience;
|
|
24
|
-
}>;
|
|
25
|
-
/** 機密だった key を別の種類で作り直した項目(previousType は台帳の種類) */
|
|
26
|
-
export type ConfidentialReuse = Readonly<{
|
|
27
|
-
collection: string;
|
|
28
|
-
path: string;
|
|
29
|
-
previousType: string;
|
|
30
|
-
}>;
|
|
31
|
-
/**
|
|
32
|
-
* 保存済みの定義 prev から next への見える範囲の変更(どちらも読み込んだ形、読み替えは audienceOf)
|
|
33
|
-
* - 保存済みの項目は保存済みの見える範囲と、追加の項目(作り直した key とコレクション)は台帳と比べる
|
|
34
|
-
*/
|
|
35
|
-
export declare function audienceFindings(prev: ContentModel, next: ContentModel, ledger: readonly AudienceLedgerEntry[]): {
|
|
36
|
-
widened: AudienceWidening[];
|
|
37
|
-
reused: ConfidentialReuse[];
|
|
38
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 製品の表示の名前(画面の題、メールの差出人と件名、Access と MCP の表示名)
|
|
3
|
-
* - 改名の夜はこの値だけを替える。Terraform の terraform/modules/company/access.tf の brand_name も同じ値(brand.test.ts)
|
|
4
|
-
*/
|
|
5
|
-
export declare const BRAND_NAME = "Tunasand";
|
|
6
|
-
/**
|
|
7
|
-
* 製品の記号(くさび形のサンド、#769の「4.」)の SVG の形。layers は上から上面と層・帯・帯(隙間で分かれる)
|
|
8
|
-
* - 素材の正は docs/brand/tunasand(生成は scripts/brand-assets.ts)。ここは小さい用の mark-small.svg の形(白い線なし)
|
|
9
|
-
* - fills は明るい地の色(素材の mark-small.svg と同じ)。1色にするときは使う側が currentColor で塗る
|
|
10
|
-
* - LP の apps/lp/src/assets/brand/mark.svg と同じ形(scripts/lib/brand.test.ts)
|
|
11
|
-
*/
|
|
12
|
-
export declare const BRAND_MARK: {
|
|
13
|
-
readonly viewBox: "0 0 32 32";
|
|
14
|
-
readonly layers: readonly ["M2.8 16.42L2.8 13.7A1.1 1.1 0 0 1 3.35 12.75L18.85 3.72A1.8 1.8 0 0 1 20.94 3.92L28.43 10.46A1.1 1.1 0 0 1 28.8 11.29L28.8 14.33A1.1 1.1 0 0 1 27.8 15.43L4 17.51A1.1 1.1 0 0 1 2.8 16.42Z", "M2.8 21.42L2.8 20.12A1.1 1.1 0 0 1 3.81 19.03L27.61 16.95A1.1 1.1 0 0 1 28.8 18.04L28.8 19.33A1.1 1.1 0 0 1 27.8 20.43L4 22.51A1.1 1.1 0 0 1 2.8 21.42Z", "M2.8 26.42L2.8 25.12A1.1 1.1 0 0 1 3.81 24.03L27.61 21.95A1.1 1.1 0 0 1 28.8 23.04L28.8 24.33A1.1 1.1 0 0 1 27.8 25.43L4 27.51A1.1 1.1 0 0 1 2.8 26.42Z"];
|
|
15
|
-
readonly fills: readonly ["#E0703E", "#D64C7C", "#E0703E"];
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* 製品のワードマーク(先頭が大文字の製品名、書体 Figtree の字形のパス)。fill は明るい地の文字の色(素材の wordmark.svg と同じ)
|
|
19
|
-
* - 素材は docs/brand/tunasand/wordmark-mono.svg、LP の apps/lp/src/assets/brand/wordmark.svg と同じ形
|
|
20
|
-
*/
|
|
21
|
-
export declare const BRAND_WORDMARK: {
|
|
22
|
-
readonly viewBox: "0.19 -10 60.76 10.17";
|
|
23
|
-
readonly fill: "#19120F";
|
|
24
|
-
readonly path: "M3.26 0L3.26 -8.48L0.19 -8.48L0.19 -10L7.98 -10L7.98 -8.48L4.92 -8.48L4.92 0L3.26 0ZM11.03 0.17Q10.19 0.17 9.58 -0.17Q8.97 -0.51 8.65 -1.24Q8.32 -1.97 8.32 -3.11L8.32 -7.14L9.91 -7.14L9.91 -3.49Q9.91 -2.64 10.11 -2.17Q10.31 -1.7 10.67 -1.52Q11.02 -1.33 11.47 -1.32Q12.28 -1.32 12.72 -1.86Q13.17 -2.4 13.17 -3.42L13.17 -7.14L14.76 -7.14L14.76 0L13.26 0L13.19 -1.01Q12.84 -0.44 12.29 -0.14Q11.74 0.17 11.03 0.17ZM16.53 0L16.53 -7.14L18.03 -7.14L18.1 -6.13Q18.45 -6.71 19 -7.01Q19.55 -7.31 20.26 -7.31Q21.11 -7.31 21.72 -6.97Q22.32 -6.63 22.65 -5.91Q22.98 -5.19 22.97 -4.03L22.97 0L21.38 0L21.38 -3.66Q21.38 -4.51 21.18 -4.97Q20.98 -5.44 20.63 -5.63Q20.28 -5.81 19.82 -5.82Q19.01 -5.83 18.57 -5.29Q18.12 -4.74 18.12 -3.73L18.12 0L16.53 0ZM26.88 0.17Q25.6 0.17 24.9 -0.4Q24.19 -0.98 24.19 -2.01Q24.19 -3.13 24.94 -3.71Q25.69 -4.29 27.03 -4.29L28.84 -4.29Q28.75 -5.09 28.4 -5.5Q28.04 -5.91 27.34 -5.91Q26.83 -5.91 26.44 -5.7Q26.05 -5.48 25.79 -5.03L24.38 -5.54Q24.61 -6.01 24.99 -6.42Q25.38 -6.82 25.96 -7.07Q26.53 -7.31 27.34 -7.31Q28.39 -7.31 29.09 -6.91Q29.78 -6.5 30.12 -5.75Q30.46 -4.99 30.45 -3.92L30.42 0L28.94 0L28.9 -0.88Q28.61 -0.37 28.1 -0.1Q27.6 0.17 26.88 0.17ZM27.09 -1.18Q27.61 -1.18 28.02 -1.41Q28.42 -1.64 28.65 -2.04Q28.88 -2.44 28.88 -2.93L28.88 -3.07L27.54 -3.07Q26.58 -3.07 26.2 -2.8Q25.81 -2.54 25.81 -2.06Q25.81 -1.64 26.15 -1.41Q26.49 -1.18 27.09 -1.18ZM34.68 0.17Q33.95 0.17 33.36 -0.05Q32.76 -0.26 32.33 -0.65Q31.9 -1.04 31.67 -1.57L33.05 -2.19Q33.27 -1.79 33.69 -1.52Q34.11 -1.25 34.63 -1.25Q35.18 -1.25 35.52 -1.44Q35.85 -1.62 35.85 -1.97Q35.85 -2.3 35.59 -2.48Q35.34 -2.66 34.87 -2.78L34.2 -2.95Q33.19 -3.22 32.62 -3.78Q32.04 -4.35 32.04 -5.07Q32.04 -6.14 32.73 -6.73Q33.42 -7.31 34.73 -7.31Q35.38 -7.31 35.94 -7.12Q36.49 -6.93 36.89 -6.58Q37.28 -6.23 37.45 -5.76L36.11 -5.16Q35.97 -5.52 35.57 -5.71Q35.17 -5.9 34.69 -5.9Q34.2 -5.9 33.93 -5.7Q33.66 -5.49 33.66 -5.12Q33.66 -4.89 33.9 -4.72Q34.14 -4.55 34.61 -4.43L35.45 -4.22Q36.15 -4.05 36.59 -3.69Q37.03 -3.33 37.24 -2.88Q37.46 -2.43 37.46 -1.97Q37.46 -1.32 37.09 -0.84Q36.73 -0.36 36.1 -0.09Q35.48 0.17 34.68 0.17ZM41.02 0.17Q39.75 0.17 39.04 -0.4Q38.33 -0.98 38.33 -2.01Q38.33 -3.13 39.08 -3.71Q39.83 -4.29 41.18 -4.29L42.98 -4.29Q42.9 -5.09 42.54 -5.5Q42.18 -5.91 41.48 -5.91Q40.97 -5.91 40.58 -5.7Q40.2 -5.48 39.93 -5.03L38.52 -5.54Q38.75 -6.01 39.14 -6.42Q39.52 -6.82 40.1 -7.07Q40.68 -7.31 41.48 -7.31Q42.53 -7.31 43.23 -6.91Q43.92 -6.5 44.26 -5.75Q44.6 -4.99 44.59 -3.92L44.56 0L43.08 0L43.04 -0.88Q42.75 -0.37 42.25 -0.1Q41.74 0.17 41.02 0.17ZM41.23 -1.18Q41.75 -1.18 42.16 -1.41Q42.57 -1.64 42.79 -2.04Q43.02 -2.44 43.02 -2.93L43.02 -3.07L41.68 -3.07Q40.72 -3.07 40.34 -2.8Q39.96 -2.54 39.96 -2.06Q39.96 -1.64 40.29 -1.41Q40.63 -1.18 41.23 -1.18ZM46.22 0L46.22 -7.14L47.72 -7.14L47.78 -6.13Q48.13 -6.71 48.68 -7.01Q49.23 -7.31 49.95 -7.31Q50.79 -7.31 51.4 -6.97Q52.01 -6.63 52.34 -5.91Q52.66 -5.19 52.66 -4.03L52.66 0L51.06 0L51.06 -3.66Q51.06 -4.51 50.86 -4.97Q50.66 -5.44 50.31 -5.63Q49.97 -5.81 49.51 -5.82Q48.69 -5.83 48.25 -5.29Q47.81 -4.74 47.81 -3.73L47.81 0L46.22 0ZM57.1 0.17Q56.13 0.17 55.4 -0.29Q54.68 -0.76 54.28 -1.6Q53.88 -2.45 53.88 -3.57Q53.88 -4.71 54.28 -5.55Q54.68 -6.39 55.4 -6.85Q56.13 -7.31 57.1 -7.31Q57.84 -7.31 58.41 -6.99Q58.99 -6.67 59.35 -6.09L59.35 -10L60.95 -10L60.95 0L59.43 0L59.38 -1.09Q59.02 -0.49 58.43 -0.16Q57.85 0.17 57.1 0.17ZM57.5 -1.29Q58.03 -1.29 58.44 -1.57Q58.85 -1.84 59.09 -2.34Q59.34 -2.84 59.35 -3.47L59.35 -3.67Q59.34 -4.31 59.09 -4.8Q58.85 -5.29 58.44 -5.57Q58.02 -5.85 57.48 -5.85Q56.91 -5.85 56.47 -5.56Q56.02 -5.27 55.77 -4.75Q55.52 -4.24 55.52 -3.57Q55.52 -2.9 55.78 -2.39Q56.03 -1.87 56.48 -1.58Q56.93 -1.29 57.5 -1.29Z";
|
|
25
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
export { BRAND_MARK, BRAND_NAME, BRAND_WORDMARK } from './brand.js';
|
|
2
|
-
export { fieldZod, jsonSchemaOf, normalizeValues, zodOf, type ValueOptions } from './input.js';
|
|
3
|
-
export { assetRefSchema, cropSchema, hotspotSchema, mediaSchema, type Asset, type AssetRef, type Crop, type DeliveredAsset, type Hotspot, type LocalImage, type Media } from './asset.js';
|
|
4
|
-
export { coverPosition, coverStart, cropRect, croppedHotspot, objectPosition, stillOf, type CropRect } from './image.js';
|
|
5
|
-
export { IMAGE_TYPE, VIDEO_TYPE } from './media.js';
|
|
6
|
-
export { IMAGE_SIZE_MAX, imageParamsOf, isMediaId, MEDIA_SIGNING_KEY_BLOB, MEDIA_SIGNING_KEY_SPOT, mediaBlobKeyOf, mediaExtOf, mediaKindOf, mediaMimeOf, mediaPathOf, parseMediaPath, signMediaUrl, verifyMediaUrl, withImageParams, type ImageParams, type AssetKind, type MediaPath } from './mediaUrl.js';
|
|
7
|
-
export { diffSchema, type ChangeKind, type ChangeLevel, type DiffOptions, type SchemaChange } from './changes.js';
|
|
8
|
-
export { dateRoleFieldsOf, primaryCollectionOf, requiredPrimaryCollectionOf, SOURCES_FIELD, sourceIdsOf, sourcesFieldOf, sourceCollectionOf, type SourcesField } from './capabilities.js';
|
|
9
|
-
export { appliesTo, checkFields, fieldsFor, shapeProblems } from './check.js';
|
|
10
|
-
export { deliveredFields, emptyValues, pickValues, referencedIds, referencesOf, valueFieldsOf } from './values.js';
|
|
11
|
-
export { typesSourceOf } from './typesSource.js';
|
|
12
|
-
export { mapReferences, recordRefsOf, type RecordRef, referencedIdsOf, referenceInputOf, type ReferenceValue, renameRecordRefs } from './refs.js';
|
|
13
|
-
export { sameJson } from './json.js';
|
|
14
|
-
export { isSelfField, isSelfRow, ownerFieldOf, type SelfWrite, selfFieldsOf, selfWritableKeysOf, selfWritableOf, selfWritableProblems, type CustomerOperation, selfOpsOf, selfOpsProblems, type CustomerProof, surveyInputField } from './selfOps.js';
|
|
15
|
-
export { ledgerAdditions, resolvedModel, type AudienceLedgerEntry } from './audience.js';
|
|
16
|
-
export { acceptsRole, addedFieldAudienceOf, defaultPiiOf, fieldPiiOf, isPersonalCollection, isCustomerLinkedCollection, PII_CLASSES, PII_STRENGTH, type PiiClass, anonymizedKeysOf, audienceOf, withoutAudience, declaredAudienceOf, innerAudienceOf, AUDIENCES, type Audience, bodyFieldsOf, cascadeDepths, type CascadeCollection, ON_DELETE, onDeleteOf, type OnDelete, type CustomerOnDelete, grantedKeysOf, isDeliveredAudience, computedFieldsOf, FIELD_ROLES, hasCustomerRules, editsSlug, SLUG_MODES, type SlugMode, initialValueOf, isPublishable, isInputField, isSequenceField, isListCollection, isDeliveredCollection, isMediaCollection, isPrivateCollection, isSingleton, isStoredCollection, isUndeliveredField, MEDIA_COLLECTION_IDS, CUSTOMER_FIELD_TYPE, SELF_OPS, type SelfOp, customerFieldsOf, type CustomerField, type ReferenceField, optionLabelOf, optionsOf, publishingOf, requestReferencesOf, resolvedRolesOf, roleFieldOf, toneOf, collectionOf, collectionByRef, isUuidShape, type ComputedKind, type FieldRole, type FieldRoles, type FieldComputed, type ContentFormat, type ContentModel, type Collection, type ResolvedModel, type FieldCondition, type FieldDef, type FieldDerive, type FieldFixedBy, type CountDef, type FieldProblem, type MediaKind, type OptionTone, type Publishing, type ReferenceRules, type SelectOption, usesReview } from './model.js';
|
|
17
|
-
export { hasPublicPage, imageFrameOf, pagePathOf, publicPathOf, withPagesFrom, type ImageFrame, type ImageFrameDef, type PageDef, type PageRecord, type PageRule } from './page.js';
|
|
18
|
-
export { schemaRulesOf, type SchemaRule } from './rules.js';
|
|
19
|
-
export { acceptsUnique, hasTransitions, integrityProblems, transitionAllowed, transitionFieldsOf, transitionProblems, transitionTargets, type Transition, type TransitionActor, type TransitionActors, type TransitionField, sequenceFieldsOf, UNIQUE_FIELDS_MAX, UNIQUE_NORMALIZATION_VERSION, uniqueDefsOf, uniquePartOf, uniqueDuplicatesOf, uniquesColumnOf, uniqueValueOf, type UniqueDef, type UniqueDuplicate } from './integrity.js';
|
|
20
|
-
export { fieldDefSchema, MAX_CASCADE_DEPTH, parseModel, RESERVED_FIELD_KEYS, RETENTION_DAYS_MAX, retentionProblems, ruleIssues, undeclaredDeleteProblems, validateModelForSave } from './schema.js';
|
|
21
|
-
export { MENU_GROUP_ID, menuItemsOf, parseScreens, placedItemsOf, resolveLayout, resolveMenu, embedItem, collectionItem, collectionOfItem, viewItem, viewOfItem, type EditorLayout, type EditorSection, type MenuEntry, type MenuGroup, type ResolvedMenuEntry, type ScreenSettings } from './screens.js';
|
|
22
|
-
export { createClock, isDateOnly, isDateTimeText, type Clock, type DateString } from './time.js';
|
|
23
|
-
export { phoneNationalOf, type PhoneRegion, type UrlScheme } from './contact.js';
|
|
24
|
-
export { AUDIENCE_LABELS, MODEL_PROBLEM_MESSAGES } from './labels/ja.js';
|
|
25
|
-
export { MODEL_PROBLEM_MESSAGES_EN } from './labels/en.js';
|
|
26
|
-
export { type ModelProblemCode, modelProblemText } from './problems.js';
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import type { CropRect } from './image.js';
|
|
2
|
-
/** 実体の種類 */
|
|
3
|
-
export type AssetKind = 'image' | 'video' | 'file';
|
|
4
|
-
/** 形式の実体の種類 */
|
|
5
|
-
export declare const mediaKindOf: (mimeType: string) => AssetKind;
|
|
6
|
-
/** 形式の拡張子(配信しない形式は null) */
|
|
7
|
-
export declare const mediaExtOf: (mimeType: string) => string | null;
|
|
8
|
-
/** 拡張子の形式(配信しない拡張子は null) */
|
|
9
|
-
export declare const mediaMimeOf: (ext: string) => string | null;
|
|
10
|
-
/** 配信 URL のパスの要素(寸法は画像だけ) */
|
|
11
|
-
export type MediaPath = Readonly<{
|
|
12
|
-
kind: AssetKind;
|
|
13
|
-
project: string;
|
|
14
|
-
id: string;
|
|
15
|
-
ext: string;
|
|
16
|
-
width?: number;
|
|
17
|
-
height?: number;
|
|
18
|
-
}>;
|
|
19
|
-
/** 実体の ID の形か(CMS の /media と配信の Worker の共通、保存先のほかのキーを ID として読ませない) */
|
|
20
|
-
export declare const isMediaId: (id: string) => boolean;
|
|
21
|
-
/** 配信 URL のパス(プロジェクト・ID の形が不正、配信しない形式なら null) */
|
|
22
|
-
export declare function mediaPathOf({ kind, project, id, mimeType, width, height }: Readonly<{
|
|
23
|
-
kind: AssetKind;
|
|
24
|
-
project: string;
|
|
25
|
-
id: string;
|
|
26
|
-
mimeType: string;
|
|
27
|
-
width: number;
|
|
28
|
-
height: number;
|
|
29
|
-
}>): string | null;
|
|
30
|
-
/** 配信 URL のパスを解析(形が違えば null) */
|
|
31
|
-
export declare function parseMediaPath(pathname: string): MediaPath | null;
|
|
32
|
-
/** 保存先のキー(プロジェクトの接頭辞の後、非公開は private/ の下) */
|
|
33
|
-
export declare const mediaBlobKeyOf: (id: string, visibility: "public" | "private") => string;
|
|
34
|
-
/** 非公開のメディアの署名の鍵の保存先のキー(プロジェクトの接頭辞の後、配信 URL の ID の形にない「.」で始め、パスから届かない) */
|
|
35
|
-
export declare const MEDIA_SIGNING_KEY_BLOB = ".media-signing";
|
|
36
|
-
/** 署名の鍵の封印の場所(AAD の表、レコード、列。プロジェクトを足して CMS と配信の Worker が同じ場所で封印と開封をする) */
|
|
37
|
-
export declare const MEDIA_SIGNING_KEY_SPOT: {
|
|
38
|
-
readonly table: "blobs";
|
|
39
|
-
readonly row: ".media-signing";
|
|
40
|
-
readonly column: "secret";
|
|
41
|
-
};
|
|
42
|
-
/**
|
|
43
|
-
* 非公開のメディアの署名つきの URL(exp と sig のクエリを付ける、ほかのクエリは残す)
|
|
44
|
-
* - secret: プロジェクトの非公開のメディアの署名の鍵、expiresInSec: 期限までの秒、now: 今の UNIX ミリ秒
|
|
45
|
-
*/
|
|
46
|
-
export declare function signMediaUrl(url: string, secret: string, options?: Readonly<{
|
|
47
|
-
expiresInSec?: number;
|
|
48
|
-
now?: number;
|
|
49
|
-
}>): Promise<string>;
|
|
50
|
-
/** 署名つきの URL の検査(期限の内で、どれかの鍵の署名と一致すれば期限の UNIX 秒、ほかは null) */
|
|
51
|
-
export declare function verifyMediaUrl(url: URL, secrets: readonly string[], now?: number): Promise<number | null>;
|
|
52
|
-
/** 画像の変換のクエリ(w・h は表示の画素、rect は元の画像の画素での切り抜き、auto=format はブラウザに合わせた形式) */
|
|
53
|
-
export type ImageParams = Readonly<{
|
|
54
|
-
w?: number;
|
|
55
|
-
h?: number;
|
|
56
|
-
fit?: 'scale-down' | 'contain' | 'cover' | 'crop' | 'pad';
|
|
57
|
-
rect?: CropRect;
|
|
58
|
-
q?: number;
|
|
59
|
-
fm?: 'jpg' | 'png' | 'webp' | 'avif';
|
|
60
|
-
auto?: 'format';
|
|
61
|
-
}>;
|
|
62
|
-
/** 幅・高さの上限(画素) */
|
|
63
|
-
export declare const IMAGE_SIZE_MAX = 4096;
|
|
64
|
-
/** URL に画像の変換のクエリを設定(ほかのクエリは残す) */
|
|
65
|
-
export declare function withImageParams(url: string, params: ImageParams): string;
|
|
66
|
-
/** クエリから画像の変換(不正な値があれば null、変換なしは空のオブジェクト) */
|
|
67
|
-
export declare function imageParamsOf(query: URLSearchParams): ImageParams | null;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { type Collection, type FieldDef, type CustomerField, type SelfOp } from './model.js';
|
|
2
|
-
/** 本人の確認の方法(id_token は Tunasand が ID トークンで確認した、site はサイトが名乗った) */
|
|
3
|
-
export type CustomerProof = 'id_token' | 'site';
|
|
4
|
-
/** コレクションごとに受けるかが決まる人の操作(宣言の操作と、エンドポイントの submit) */
|
|
5
|
-
export type CustomerOperation = SelfOp | 'submit';
|
|
6
|
-
/** 人の書き込みの種類(create は create_self と submit、update は update_self) */
|
|
7
|
-
export type SelfWrite = 'create' | 'update';
|
|
8
|
-
/** 本人の顧客フィールドか(コレクションの最上位の項目) */
|
|
9
|
-
export declare const isSelfField: (f: FieldDef, collection: Pick<Collection, "private" | "fields">) => f is CustomerField;
|
|
10
|
-
/** コレクションの本人の顧客フィールド */
|
|
11
|
-
export declare const selfFieldsOf: (collection: Pick<Collection, "private" | "fields">) => CustomerField[];
|
|
12
|
-
/** レコードの値で、本人がそのレコードの本人か(本人の顧客フィールドのどれかが本人を指す。DM のように複数でも同じ) */
|
|
13
|
-
export declare const isSelfRow: (collection: Pick<Collection, "private" | "fields">, values: Readonly<Record<string, unknown>>, customerId: string) => boolean;
|
|
14
|
-
/**
|
|
15
|
-
* アンケートのエンドポイントのフォームに出す項目か(最上位の入力の項目のうち、文字・複数行の文字・
|
|
16
|
-
* 連絡先(メールアドレス・電話番号・URL)・選択肢。スタッフ・管理者だけ・計算・条件つき・顧客フィールドは除く)
|
|
17
|
-
*/
|
|
18
|
-
export declare function surveyInputField(f: FieldDef, collection: Pick<Collection, 'private' | 'fields'>): boolean;
|
|
19
|
-
/** 人の操作の宣言の誤り(配信しない一覧のコレクション、本人の顧客フィールドがちょうど1つで onDelete は cascade か anonymize、一意の組はすべて本人の顧客フィールドを含む) */
|
|
20
|
-
export declare function selfOpsProblems(collection: Collection): string[];
|
|
21
|
-
/** 本人が書ける印の誤り(付けられない項目、まとまりの中、create_self か update_self を受けないコレクション) */
|
|
22
|
-
export declare function selfWritableProblems(collection: Collection): string[];
|
|
23
|
-
/** コレクションが本人の確認の方法 proof で受ける人の操作 */
|
|
24
|
-
export declare function selfOpsOf(collection: Collection, proof: CustomerProof): CustomerOperation[];
|
|
25
|
-
/** 作成で本人を入れる顧客フィールド(site は本人の顧客フィールド、id_token のアンケートの形は顧客フィールド。受けないコレクションは null) */
|
|
26
|
-
export declare function ownerFieldOf(collection: Collection, proof: CustomerProof): CustomerField | null;
|
|
27
|
-
/** 本人が書ける最上位の項目か(本人の確認の方法 proof と書き込みの種類 write で読み替える) */
|
|
28
|
-
export declare function selfWritableOf(f: FieldDef, collection: Collection, proof: CustomerProof, write: SelfWrite): boolean;
|
|
29
|
-
/** 本人が書ける最上位の項目の key */
|
|
30
|
-
export declare const selfWritableKeysOf: (collection: Collection, proof: CustomerProof, write: SelfWrite) => string[];
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { type ContentModel } from './model.js';
|
|
2
|
-
/**
|
|
3
|
-
* スキーマから配信 API の値の型の定義(TypeScript のモジュールの文)
|
|
4
|
-
* - コレクションごとに `export type <PascalCase のコレクションのスラッグ>`
|
|
5
|
-
* - 全体の対応 `CmsTypes`(キーはスラッグ)とスラッグの一覧 `COLLECTION_SLUGS`
|
|
6
|
-
* - types: 配信するコレクションだけ(メディアのコレクションを除いた一覧、配信 API の `/collections` の値)。非公開のコレクションは渡されても除く
|
|
7
|
-
*/
|
|
8
|
-
export declare function typesSourceOf(model: Pick<ContentModel, 'collections'>): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { BodyProfile } from '../../body/src/index.js';
|
|
2
|
-
import { type ContentModel, type ScreenSettings } from '../../model/src/index.js';
|
|
3
|
-
/** 既定の本文の設定(本文の項目 profile と同じ値) */
|
|
4
|
-
export declare const DEFAULT_BODY_PROFILE: BodyProfile;
|
|
5
|
-
/** 中立の既定のスキーマ(新しいプロジェクトの作成で適用するコレクション: post・author・tag・image・video、設定の移入の土台) */
|
|
6
|
-
export declare const DEFAULT_SCHEMA: ContentModel;
|
|
7
|
-
/** 既定の画面設定(新しいプロジェクトの作成で適用する中立の値、移入する screens の土台) */
|
|
8
|
-
export declare const DEFAULT_SCREENS: ScreenSettings;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { blockSchemaOf, bodyToHtml, cellParagraphs, citesOf, DESCRIPTION_MAX, descriptionOf, EMBED_PROVIDERS, embedOfUrl, embedSrcOf, excerptOf, isSafeCssValue, isSafeHref, isTableCell, linksOf, plainOf, READING_SPEED, readMinOf } from '../../body/src/index.js';
|
|
2
|
-
export type { Align, Block, Body, BodyProfile, Cell, ComponentBlock, DeclaredComponent, EmbedProvider, EmbedTarget, HeadingLevel, ImageAlign, Inline, InlineComponent, Link, List, ListItem, Mark, Named, NamedStyle, NamedValue, PropSchema, PropsSchema, PropType, RenderedImage, RenderOptions, Rich, StandardBlock, TableCell, Text, TextStyle } from '../../body/src/index.js';
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import { type SelfApiError, CUSTOMER_EVENTS, type CustomerApiGrant, type CustomerApiError, type CustomerApiResult, type CustomerEventData } from '../../cms-contract/src/customers.js';
|
|
2
|
-
import type { Issue } from '../../cms-contract/src/errors.js';
|
|
3
|
-
import { WEBHOOK_VERSION } from '../../cms-contract/src/webhooks.js';
|
|
4
|
-
import { type Delivery } from './delivery/client.js';
|
|
5
|
-
export { SELF_API_ERRORS, CUSTOMER_API_ERRORS, CUSTOMER_EVENTS, CUSTOMER_STATUSES } from '../../cms-contract/src/customers.js';
|
|
6
|
-
export type { Issue, IssueSeverity } from '../../cms-contract/src/errors.js';
|
|
7
|
-
export type { SelfApiError, CustomerApiGrant, CustomerApiError, CustomerApiResult, CustomerCandidateResult, CustomerEventData, CustomerStatus } from '../../cms-contract/src/customers.js';
|
|
8
|
-
export { grantedKeysOf } from '../../model/src/index.js';
|
|
9
|
-
/** 業務の失敗の補足(エラーの本文の params と requestId) */
|
|
10
|
-
type FailureDetail = Readonly<{
|
|
11
|
-
params?: Readonly<Record<string, unknown>>;
|
|
12
|
-
requestId?: string;
|
|
13
|
-
}>;
|
|
14
|
-
/** 顧客の API の結果(業務の失敗は error のコード、T は成功の値) */
|
|
15
|
-
export type CustomerCall<T = CustomerApiResult> = Readonly<{
|
|
16
|
-
ok: true;
|
|
17
|
-
value: T;
|
|
18
|
-
}> | (Readonly<{
|
|
19
|
-
ok: false;
|
|
20
|
-
error: CustomerApiError;
|
|
21
|
-
}> & FailureDetail);
|
|
22
|
-
/** 紐付けの入力(招待のコードは管理画面で発行したもの) */
|
|
23
|
-
export type LinkInput = Readonly<{
|
|
24
|
-
idToken: string;
|
|
25
|
-
inviteCode: string;
|
|
26
|
-
}>;
|
|
27
|
-
/** 顧客の API の呼び出し(delivery は配信 API への接続、外のサイトは鍵を付けた fetch) */
|
|
28
|
-
export declare function createCustomersClient(delivery: Delivery): {
|
|
29
|
-
/** LIFF の ID トークンで照合(紐付けがなければ customer_not_linked、確認待ちは customer_pending、検証できなければ invalid_id_token) */
|
|
30
|
-
verify: (idToken: string) => Promise<CustomerCall<Readonly<{
|
|
31
|
-
customer: Readonly<{
|
|
32
|
-
id: string;
|
|
33
|
-
status: import("./customers.js").CustomerStatus;
|
|
34
|
-
version?: number;
|
|
35
|
-
}>;
|
|
36
|
-
grants: readonly CustomerApiGrant[];
|
|
37
|
-
today: string;
|
|
38
|
-
grace_sec?: number;
|
|
39
|
-
}>>>;
|
|
40
|
-
/** 顧客の ID で状態を取り直す(セッションの照合し直し、顧客がいなければ not_found) */
|
|
41
|
-
lookup: (customerId: string) => Promise<CustomerCall<Readonly<{
|
|
42
|
-
customer: Readonly<{
|
|
43
|
-
id: string;
|
|
44
|
-
status: import("./customers.js").CustomerStatus;
|
|
45
|
-
version?: number;
|
|
46
|
-
}>;
|
|
47
|
-
grants: readonly CustomerApiGrant[];
|
|
48
|
-
today: string;
|
|
49
|
-
grace_sec?: number;
|
|
50
|
-
}>>>;
|
|
51
|
-
/** 招待のコードの顧客に ID トークンの本人を紐付ける(紐付け済みは already_linked、招待のコードの誤りは invalid_invite) */
|
|
52
|
-
link: ({ idToken, inviteCode }: LinkInput) => Promise<CustomerCall<Readonly<{
|
|
53
|
-
customer: Readonly<{
|
|
54
|
-
id: string;
|
|
55
|
-
status: import("./customers.js").CustomerStatus;
|
|
56
|
-
version?: number;
|
|
57
|
-
}>;
|
|
58
|
-
grants: readonly CustomerApiGrant[];
|
|
59
|
-
today: string;
|
|
60
|
-
grace_sec?: number;
|
|
61
|
-
}>>>;
|
|
62
|
-
/** 友だち追加の userId で顧客候補を作る(Messaging API の Webhook の署名を確認した後だけ、紐付けがあれば何もしない) */
|
|
63
|
-
createCandidate: (userId: string) => Promise<CustomerCall<Readonly<{
|
|
64
|
-
customer: Readonly<{
|
|
65
|
-
id: string;
|
|
66
|
-
status: import("./customers.js").CustomerStatus;
|
|
67
|
-
}>;
|
|
68
|
-
created: boolean;
|
|
69
|
-
}>>>;
|
|
70
|
-
/** ID トークンの人がアンケート(コレクション type、設問の版 version)に回答済みか */
|
|
71
|
-
checkSubmission: (collection: string, idToken: string, version?: string) => Promise<CustomerCall<Readonly<{
|
|
72
|
-
submitted: boolean;
|
|
73
|
-
}>>>;
|
|
74
|
-
};
|
|
75
|
-
/** 顧客の API の呼び出し */
|
|
76
|
-
export type CustomersClient = ReturnType<typeof createCustomersClient>;
|
|
77
|
-
/** 本人のレコードの1件(id、本人が見られる項目、_meta の version は更新の版の条件) */
|
|
78
|
-
export type SelfItem = Readonly<{
|
|
79
|
-
id: string;
|
|
80
|
-
_meta: Readonly<{
|
|
81
|
-
created_at: string;
|
|
82
|
-
updated_at: string;
|
|
83
|
-
version: number;
|
|
84
|
-
}>;
|
|
85
|
-
}> & Readonly<Record<string, unknown>>;
|
|
86
|
-
/** 本人のレコードの一覧の1ページ(next は次のページの cursor、最後のページは null) */
|
|
87
|
-
export type SelfPage = Readonly<{
|
|
88
|
-
items: readonly SelfItem[];
|
|
89
|
-
next: string | null;
|
|
90
|
-
}>;
|
|
91
|
-
/**
|
|
92
|
-
* 本人のレコードのエンドポイントの結果
|
|
93
|
-
* (業務の失敗は error のコード、invalid_input と save_unmet は issues つき、invalid_state は params.reason)
|
|
94
|
-
*/
|
|
95
|
-
export type SelfCall<T> = Readonly<{
|
|
96
|
-
ok: true;
|
|
97
|
-
value: T;
|
|
98
|
-
}> | (Readonly<{
|
|
99
|
-
ok: false;
|
|
100
|
-
error: SelfApiError;
|
|
101
|
-
issues?: readonly Issue[];
|
|
102
|
-
}> & FailureDetail);
|
|
103
|
-
/**
|
|
104
|
-
* 本人のレコードのエンドポイントの呼び出し(#712、/content/v1/customers/me/<コレクション>)
|
|
105
|
-
* - delivery はインストールのトークンを付けた接続(配信 API の鍵では呼べない)。customerId はサイトが自分で確認した本人
|
|
106
|
-
* - query は配信 API の一覧の文法(filter[key]・order・ids・limit・cursor)で、絞れるのは本人が見られる項目だけ
|
|
107
|
-
*/
|
|
108
|
-
export declare function createSelfClient(delivery: Delivery): {
|
|
109
|
-
/** 本人のレコードの一覧(コレクション type、本人 customerId) */
|
|
110
|
-
list: (collection: string, customerId: string, query?: Readonly<Record<string, string>>) => Promise<SelfCall<Readonly<{
|
|
111
|
-
items: readonly SelfItem[];
|
|
112
|
-
next: string | null;
|
|
113
|
-
}>>>;
|
|
114
|
-
/** 作成(同じ組のレコードがあれば作らずに created: false でそのレコードの id) */
|
|
115
|
-
create: (collection: string, customerId: string, values: Readonly<Record<string, unknown>>) => Promise<SelfCall<Readonly<{
|
|
116
|
-
id: string;
|
|
117
|
-
created: boolean;
|
|
118
|
-
}>>>;
|
|
119
|
-
/** 更新(version は一覧の _meta.version、古ければ version_conflict) */
|
|
120
|
-
update: (collection: string, id: string, customerId: string, version: number, values: Readonly<Record<string, unknown>>) => Promise<SelfCall<Readonly<{
|
|
121
|
-
version: number;
|
|
122
|
-
}>>>;
|
|
123
|
-
/** 削除(ごみ箱へ) */
|
|
124
|
-
delete: (collection: string, id: string, customerId: string) => Promise<SelfCall<Readonly<{
|
|
125
|
-
deleted: true;
|
|
126
|
-
}>>>;
|
|
127
|
-
};
|
|
128
|
-
/** 本人のレコードのエンドポイントの呼び出し */
|
|
129
|
-
export type SelfClient = ReturnType<typeof createSelfClient>;
|
|
130
|
-
/** 権利の時期(今日 today との比較、日付は YYYY-MM-DD で終了日を含む) */
|
|
131
|
-
export type GrantPhase = 'active' | 'upcoming' | 'expired';
|
|
132
|
-
/** 権利の時期 */
|
|
133
|
-
export declare const grantPhase: (e: Pick<CustomerApiGrant, "starts_on" | "ends_on">, today: string) => GrantPhase;
|
|
134
|
-
/**
|
|
135
|
-
* 見せてよいかの判定
|
|
136
|
-
* - reason: signed_out(照合の結果なし)・suspended・closed・no_grant・unavailable(再照合が失敗し猶予もない)
|
|
137
|
-
* - expired は endsOn に最後の終了日、upcoming は startsOn に最初の開始日(SDK の判定の値、線の上の ends_on・starts_on から)
|
|
138
|
-
*/
|
|
139
|
-
export type CustomerAccess = Readonly<{
|
|
140
|
-
ok: true;
|
|
141
|
-
}> | Readonly<{
|
|
142
|
-
ok: false;
|
|
143
|
-
reason: 'signed_out' | 'suspended' | 'closed' | 'no_grant' | 'unavailable';
|
|
144
|
-
}> | Readonly<{
|
|
145
|
-
ok: false;
|
|
146
|
-
reason: 'expired';
|
|
147
|
-
endsOn: string;
|
|
148
|
-
}> | Readonly<{
|
|
149
|
-
ok: false;
|
|
150
|
-
reason: 'upcoming';
|
|
151
|
-
startsOn: string;
|
|
152
|
-
}>;
|
|
153
|
-
/**
|
|
154
|
-
* 顧客だけの項目を見せてよいか
|
|
155
|
-
* - requires: 配信の _meta.requires(undefined は顧客の出し分けのないコレクションで誰でも可、空は有効な権利を1つでも持つ人)
|
|
156
|
-
* - customer: 照合か状態の取得の結果(ログインしていなければ null)
|
|
157
|
-
* - today: 判定の基準の日付(既定は応答の today)
|
|
158
|
-
*/
|
|
159
|
-
export declare function customerAccess(customer: CustomerApiResult | null, requires: readonly string[] | undefined, today?: string | undefined): CustomerAccess;
|
|
160
|
-
/** 最後に成功した照合(result は照合か状態の取得の結果、checkedAt はその時刻のミリ秒。再照合が失敗しても更新しない) */
|
|
161
|
-
export type CustomerSnapshot = Readonly<{
|
|
162
|
-
result: CustomerApiResult;
|
|
163
|
-
checkedAt: number;
|
|
164
|
-
}>;
|
|
165
|
-
/**
|
|
166
|
-
* 再照合の失敗に猶予が効くか(Tunasand に届かないか 5xx だけ)
|
|
167
|
-
* - failure: 顧客の API の呼び出しが投げた例外か、業務の失敗の結果({ ok: false }、明示の拒否なので効かない)
|
|
168
|
-
* - 届かない: fetch の TypeError と時間切れ(TimeoutError)
|
|
169
|
-
*/
|
|
170
|
-
export declare function isTransientFailure(failure: unknown): boolean;
|
|
171
|
-
/** 猶予の期限のミリ秒(最後に成功した照合の時刻に応答の grace_sec を足す、grace_sec は0から86400に収める) */
|
|
172
|
-
export declare const graceDeadline: (snapshot: CustomerSnapshot) => number;
|
|
173
|
-
/**
|
|
174
|
-
* 再照合が失敗したときの顧客だけの項目の判定
|
|
175
|
-
* - 猶予の間(isTransientFailure で now が graceDeadline より前)は最後の結果で判定し、権利の expires_at は now で効かせる
|
|
176
|
-
* - それ以外は unavailable(requires が undefined の型は誰でも可)
|
|
177
|
-
*/
|
|
178
|
-
export declare function graceAccess(last: CustomerSnapshot, failure: unknown, requires: readonly string[] | undefined, now?: number): CustomerAccess;
|
|
179
|
-
/** 見せてよくなければアクセス権の項目(keys、grantedKeysOf の値)を除いた1件 */
|
|
180
|
-
export declare function visibleItem<T extends Readonly<Record<string, unknown>>>(item: T, access: CustomerAccess, keys: readonly string[]): T;
|
|
181
|
-
/** 顧客のイベントの Webhook の本文(json の形式、type はイベントの名前、created_at はイベントの日時) */
|
|
182
|
-
export type CustomerEvent = Readonly<{
|
|
183
|
-
version: typeof WEBHOOK_VERSION;
|
|
184
|
-
id: string;
|
|
185
|
-
type: (typeof CUSTOMER_EVENTS)[keyof typeof CUSTOMER_EVENTS];
|
|
186
|
-
created_at: string;
|
|
187
|
-
data: CustomerEventData;
|
|
188
|
-
}>;
|
|
189
|
-
/** 本文が顧客のイベントか(署名の検証の後に使う) */
|
|
190
|
-
export declare function isCustomerEvent(body: unknown): body is CustomerEvent;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { collectionOf, coverPosition, coverStart, createClock, cropRect, croppedHotspot, IMAGE_TYPE, isDateOnly, mediaSchema, objectPosition, pagePathOf, parseModel, parseScreens, publicPathOf, stillOf, typesSourceOf, VIDEO_TYPE } from '../../model/src/index.js';
|
|
2
|
-
export type { Asset, AssetRef, Clock, Collection, ContentModel, Crop, CropRect, DateString, FieldDef, Hotspot, LocalImage, Media, PageDef, PageRecord, ScreenSettings } from '../../model/src/index.js';
|
|
3
|
-
export { CONFIG_FORMAT } from '../../cms-contract/src/transfer.js';
|
|
4
|
-
export type { ConfigBundle } from '../../cms-contract/src/transfer.js';
|
|
5
|
-
export { DEFAULT_SCHEMA, DEFAULT_SCREENS } from '../../platform/src/defaultModel.js';
|