@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,266 +0,0 @@
|
|
|
1
|
-
import { type ConsentPurpose } from './consents.js';
|
|
2
|
-
/** 顧客の設定の表 settings のキー、設定の領域の id */
|
|
3
|
-
export declare const CUSTOMERS_SETTINGS_KEY = "customers";
|
|
4
|
-
/** 顧客の API の鍵の権限とロールの権限の対象(コレクションの id と重ならない) */
|
|
5
|
-
export declare const CUSTOMERS_KEY_TARGET = "@customers";
|
|
6
|
-
/** 人の状態(有効・停止・退会)。見られるかはアクセス権が決め、状態は停止と退会で照合と配信のエンドポイントを閉じる */
|
|
7
|
-
export declare const CUSTOMER_STATUSES: readonly ["active", "suspended", "closed"];
|
|
8
|
-
/** 顧客の状態 */
|
|
9
|
-
export type CustomerStatus = (typeof CUSTOMER_STATUSES)[number];
|
|
10
|
-
/** 顧客の状態か */
|
|
11
|
-
export declare const isCustomerStatus: (v: unknown) => v is CustomerStatus;
|
|
12
|
-
/** 権利の出どころ(manual は手動、import は取り込み、installation はインストール) */
|
|
13
|
-
export declare const GRANT_SOURCES: readonly ["manual", "import", "installation"];
|
|
14
|
-
/** 権利の出どころ */
|
|
15
|
-
export type GrantSource = (typeof GRANT_SOURCES)[number];
|
|
16
|
-
/** ID トークンの署名の方式(HS256 などの共有の鍵の方式は受け付けない) */
|
|
17
|
-
export declare const CUSTOMER_ID_TOKEN_ALGORITHMS: readonly ["ES256", "RS256"];
|
|
18
|
-
/** ID トークンの署名の方式 */
|
|
19
|
-
export type CustomerIdTokenAlgorithm = (typeof CUSTOMER_ID_TOKEN_ALGORITHMS)[number];
|
|
20
|
-
/**
|
|
21
|
-
* 本人の証明の発行者(汎用の OIDC)
|
|
22
|
-
* - id: 設定の中で一意(英小文字・数字・ハイフン)、label: 表示名
|
|
23
|
-
* - issuer・audience: ID トークンの iss と aud、jwksUrl: 公開鍵の一覧の URL
|
|
24
|
-
*/
|
|
25
|
-
export type CustomerProvider = Readonly<{
|
|
26
|
-
id: string;
|
|
27
|
-
label: string;
|
|
28
|
-
issuer: string;
|
|
29
|
-
audience: string;
|
|
30
|
-
jwksUrl: string;
|
|
31
|
-
algorithms: readonly CustomerIdTokenAlgorithm[];
|
|
32
|
-
}>;
|
|
33
|
-
/** LINE ログインの発行者の既定の値(audience はチャネルの ID) */
|
|
34
|
-
export declare const LINE_PROVIDER: {
|
|
35
|
-
readonly id: "line";
|
|
36
|
-
readonly label: "LINE";
|
|
37
|
-
readonly issuer: "https://access.line.me";
|
|
38
|
-
readonly jwksUrl: "https://api.line.me/oauth2/v2.1/certs";
|
|
39
|
-
readonly algorithms: readonly ["ES256"];
|
|
40
|
-
};
|
|
41
|
-
/** LINE ログインのチャネルの発行者 */
|
|
42
|
-
export declare const lineProvider: (channelId: string) => CustomerProvider;
|
|
43
|
-
/** Tunasand のドメイン(鍵の取得先に使えない、その下のホストも) */
|
|
44
|
-
export declare const OWN_DOMAINS: readonly ["tunasand.jp", "tunasand.app", "tunasand.site", "tunasandbox.app"];
|
|
45
|
-
/** 顧客の設定の値の範囲(graceSec は SDK の障害の間の猶予の秒、closedRetentionDays は退会の保持の日数) */
|
|
46
|
-
export declare const CUSTOMERS_LIMITS: {
|
|
47
|
-
readonly graceSec: {
|
|
48
|
-
readonly min: 0;
|
|
49
|
-
readonly max: 86400;
|
|
50
|
-
readonly initial: 0;
|
|
51
|
-
};
|
|
52
|
-
readonly closedRetentionDays: {
|
|
53
|
-
readonly min: 1;
|
|
54
|
-
readonly max: 3650;
|
|
55
|
-
readonly initial: 30;
|
|
56
|
-
};
|
|
57
|
-
readonly providers: {
|
|
58
|
-
readonly max: 10;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
/** 期間の月の値の範囲 */
|
|
62
|
-
export declare const GRANT_MONTHS: {
|
|
63
|
-
readonly min: 1;
|
|
64
|
-
readonly max: 1200;
|
|
65
|
-
};
|
|
66
|
-
/** 期間の月として使える値か(範囲の中の整数) */
|
|
67
|
-
export declare const isGrantMonths: (value: unknown) => value is number;
|
|
68
|
-
/** 期間の月からの終了日(開始日 startsOn の months か月後の前日、対応する日がない月はその月の末日) */
|
|
69
|
-
export declare function endsOnAfterMonths(startsOn: string, months: number): string;
|
|
70
|
-
/**
|
|
71
|
-
* 付与の終了日(endsOn は指定で、undefined は省略、null は無期限。months は対象の期間の月で、宣言がないか値が空なら null)
|
|
72
|
-
* - 決まらない(省略で期間の月がない)ときは undefined で、呼び出し元は終了日の指定を求める
|
|
73
|
-
*/
|
|
74
|
-
export declare const grantEndsOn: (startsOn: string, endsOn: string | null | undefined, months: unknown) => string | null | undefined;
|
|
75
|
-
/** 招待のリンクのコードの置き場所 */
|
|
76
|
-
export declare const INVITE_CODE_PLACEHOLDER = "{code}";
|
|
77
|
-
/**
|
|
78
|
-
* 顧客の設定
|
|
79
|
-
* - enabled: 顧客の機能の有効、profileCollection: プロフィールにするコレクションの id(そのコレクションは一意の顧客への参照の項目を1つ持つ)
|
|
80
|
-
* - inviteUrl: 紐付けの招待のリンク({code} を含む https の URL、なしはコードだけ)
|
|
81
|
-
* - providers: 本人の証明の発行者
|
|
82
|
-
* - closedRetentionDays: 退会(closed)から削除までの日数(保持の間はスタッフが戻せる、毎日の処理 customer-deletions が削除)
|
|
83
|
-
* - consentPurposes: プロジェクトが宣言する同意の目的(固定の service・marketing に足す、consents.ts)
|
|
84
|
-
*/
|
|
85
|
-
/** ログインした人がだれでも読める顧客の設定の要約(有効か、発行者の id と表示名。管理画面の表示の切り替え) */
|
|
86
|
-
export type CustomersConfig = Readonly<{
|
|
87
|
-
enabled: boolean;
|
|
88
|
-
providers: readonly Readonly<{
|
|
89
|
-
id: string;
|
|
90
|
-
label: string;
|
|
91
|
-
}>[];
|
|
92
|
-
}>;
|
|
93
|
-
/** 顧客の設定の要約 */
|
|
94
|
-
export declare const customersConfigOf: (s: Pick<CustomersSettings, "enabled" | "providers">) => CustomersConfig;
|
|
95
|
-
export type CustomersSettings = Readonly<{
|
|
96
|
-
enabled: boolean;
|
|
97
|
-
profileCollection?: string;
|
|
98
|
-
inviteUrl?: string;
|
|
99
|
-
graceSec: number;
|
|
100
|
-
closedRetentionDays: number;
|
|
101
|
-
providers: readonly CustomerProvider[];
|
|
102
|
-
consentPurposes?: readonly ConsentPurpose[];
|
|
103
|
-
}>;
|
|
104
|
-
/** 保存のない顧客の設定 */
|
|
105
|
-
export declare const DEFAULT_CUSTOMERS_SETTINGS: CustomersSettings;
|
|
106
|
-
/** 顧客の設定の問題の文 */
|
|
107
|
-
export declare const CUSTOMERS_SETTINGS_ISSUES: {
|
|
108
|
-
readonly shape: "顧客の設定の形が不正";
|
|
109
|
-
readonly enabled: "有効は真偽";
|
|
110
|
-
readonly profileCollection: "プロフィールのコレクションはコレクションの id";
|
|
111
|
-
readonly graceSec: `\u7336\u4E88\u306F${number}\u304B\u3089${number}\u306E\u6574\u6570\uFF08\u79D2\uFF09`;
|
|
112
|
-
readonly closedRetentionDays: `\u9000\u4F1A\u306E\u4FDD\u6301\u306F${number}\u304B\u3089${number}\u306E\u6574\u6570\uFF08\u65E5\uFF09`;
|
|
113
|
-
readonly inviteUrl: `\u62DB\u5F85\u306E\u30EA\u30F3\u30AF\u306F ${string} \u3092\u542B\u3080 https \u306E URL`;
|
|
114
|
-
readonly providers: `\u767A\u884C\u8005\u306F${number}\u4EF6\u307E\u3067`;
|
|
115
|
-
readonly consentPurposes: `\u540C\u610F\u306E\u76EE\u7684\u306F${number}\u4EF6\u307E\u3067\u3067\u3001key \u306F\u82F1\u5C0F\u6587\u5B57\u3067\u59CB\u307E\u308B\u82F1\u5C0F\u6587\u5B57\u30FB\u6570\u5B57\u30FB_ \u306E32\u6587\u5B57\u307E\u3067\uFF08service \u3068 marketing \u3068\u91CD\u306A\u3089\u306A\u3044\uFF09\u3001\u8868\u793A\u540D\u306F\u7A7A\u3067\u306A\u3044\u6587\u5B57`;
|
|
116
|
-
readonly providerId: "発行者の id は英小文字・数字・ハイフンで、設定の中で一意";
|
|
117
|
-
readonly providerText: "発行者の表示名、iss、aud は空でない文字";
|
|
118
|
-
readonly issuer: "発行者の iss は https の URL";
|
|
119
|
-
readonly algorithms: `\u7F72\u540D\u306E\u65B9\u5F0F\u306F ${string} \u304B\u30891\u3064\u4EE5\u4E0A`;
|
|
120
|
-
readonly jwksHttps: "公開鍵の取得先は https の URL";
|
|
121
|
-
readonly jwksIp: "公開鍵の取得先のホストに IP アドレスは使えない";
|
|
122
|
-
readonly jwksOwn: "公開鍵の取得先に Tunasand のドメインは使えない";
|
|
123
|
-
};
|
|
124
|
-
/** 顧客の設定の問題(path は設定のキー、message は CUSTOMERS_SETTINGS_ISSUES の文) */
|
|
125
|
-
export type CustomersSettingsProblem = Readonly<{
|
|
126
|
-
path: string;
|
|
127
|
-
message: string;
|
|
128
|
-
}>;
|
|
129
|
-
/** 顧客の設定の検査(省いたキーは既定の値、問題があれば problems) */
|
|
130
|
-
export declare function parseCustomersSettings(input: unknown): Readonly<{
|
|
131
|
-
value: CustomersSettings;
|
|
132
|
-
}> | Readonly<{
|
|
133
|
-
problems: readonly CustomersSettingsProblem[];
|
|
134
|
-
}>;
|
|
135
|
-
/** 顧客のイベントの名前(Webhook) */
|
|
136
|
-
export declare const CUSTOMER_EVENTS: {
|
|
137
|
-
readonly statusChanged: "customer.status_changed";
|
|
138
|
-
readonly deleted: "customer.deleted";
|
|
139
|
-
};
|
|
140
|
-
/** 顧客のイベントの値(Webhook の本文の data、snake_case)。from・to は前後の状態で、作成の前と削除の後は null */
|
|
141
|
-
export type CustomerEventData = Readonly<{
|
|
142
|
-
customer_id: string;
|
|
143
|
-
from: CustomerStatus | null;
|
|
144
|
-
to: CustomerStatus | null;
|
|
145
|
-
}>;
|
|
146
|
-
/**
|
|
147
|
-
* 顧客の API の権利(公開の JSON は snake_case。日付は導入先のタイムゾーンの YYYY-MM-DD、ends_on は含む、null は終わりなし)
|
|
148
|
-
* - collection・record: 権利の対象のコレクションとレコードの id とスラッグ(突き合わせは id で)
|
|
149
|
-
* - expires_at: 終了日の翌日の0時(導入先のタイムゾーン、ISO 8601)、終わりなしは null
|
|
150
|
-
*/
|
|
151
|
-
export type CustomerApiGrant = Readonly<{
|
|
152
|
-
collection: Readonly<{
|
|
153
|
-
id: string;
|
|
154
|
-
slug: string;
|
|
155
|
-
}>;
|
|
156
|
-
record: Readonly<{
|
|
157
|
-
id: string;
|
|
158
|
-
slug: string;
|
|
159
|
-
}>;
|
|
160
|
-
starts_on: string;
|
|
161
|
-
ends_on: string | null;
|
|
162
|
-
expires_at?: string | null;
|
|
163
|
-
}>;
|
|
164
|
-
/**
|
|
165
|
-
* 顧客の API の応答(照合・状態の取得・紐付け)
|
|
166
|
-
* - customer.version: 状態の版(状態を変えるたびに1上がる)
|
|
167
|
-
* - grants: 顧客の状態が active のときだけ、期限切れと開始前も含むすべて(停止と退会は空)
|
|
168
|
-
* - today: 導入先のタイムゾーンの今日(権利の判定の基準)、grace_sec: SDK の障害の間の猶予(秒)
|
|
169
|
-
*/
|
|
170
|
-
export type CustomerApiResult = Readonly<{
|
|
171
|
-
customer: Readonly<{
|
|
172
|
-
id: string;
|
|
173
|
-
status: CustomerStatus;
|
|
174
|
-
version?: number;
|
|
175
|
-
}>;
|
|
176
|
-
grants: readonly CustomerApiGrant[];
|
|
177
|
-
today: string;
|
|
178
|
-
grace_sec?: number;
|
|
179
|
-
}>;
|
|
180
|
-
/** 友だち追加の候補の作成の応答(created は今回作ったか、紐付けがあれば false でその顧客) */
|
|
181
|
-
export type CustomerCandidateResult = Readonly<{
|
|
182
|
-
customer: Readonly<{
|
|
183
|
-
id: string;
|
|
184
|
-
status: CustomerStatus;
|
|
185
|
-
}>;
|
|
186
|
-
created: boolean;
|
|
187
|
-
}>;
|
|
188
|
-
/** 顧客の API の業務の失敗のコード(ほかは配信 API の共通のエラー) */
|
|
189
|
-
export declare const CUSTOMER_API_ERRORS: readonly ["invalid_id_token", "customer_not_linked", "customer_pending", "not_found", "already_linked", "invalid_invite"];
|
|
190
|
-
/** 顧客の API の業務の失敗のコード */
|
|
191
|
-
export type CustomerApiError = (typeof CUSTOMER_API_ERRORS)[number];
|
|
192
|
-
/**
|
|
193
|
-
* 本人のレコードのエンドポイント(#712、/customers/me/<コレクション>)の業務の失敗のコード(SDK が線の上のコードのまま値で返す)
|
|
194
|
-
* - not_found: コレクションが操作を受けない・本人がいない・本人のレコードでない、invalid_input: 書けない項目や値の誤り(issues つき)
|
|
195
|
-
* - save_unmet: コレクションの保存の規則を満たさない(issues つき)、version_conflict: 版が古い
|
|
196
|
-
* - invalid_state: params.reason が customer_inactive(本人が停止か退会)か self_limit(顧客ごとのレコードの数の上限)
|
|
197
|
-
* - rate_limited: 人ごとの書き込みかインストールごとの要求の回数の上限
|
|
198
|
-
*/
|
|
199
|
-
export declare const SELF_API_ERRORS: readonly ["not_found", "forbidden", "invalid_input", "save_unmet", "version_conflict", "invalid_state", "rate_limited"];
|
|
200
|
-
/** 本人のレコードのエンドポイントの業務の失敗のコード */
|
|
201
|
-
export type SelfApiError = (typeof SELF_API_ERRORS)[number];
|
|
202
|
-
/** 公開のクライアントの資格の能力(契約だけ、実装は要望の後) */
|
|
203
|
-
export type PublicClientCapability = 'verify_with_proof' | 'refresh_token' | 'customer_delivery';
|
|
204
|
-
/** 管理画面の顧客の紐付け(provider は設定の発行者の id、設定にない発行者は null) */
|
|
205
|
-
export type CustomerIdentityView = Readonly<{
|
|
206
|
-
provider: string | null;
|
|
207
|
-
issuer: string;
|
|
208
|
-
audience: string;
|
|
209
|
-
subject: string;
|
|
210
|
-
createdAt: string;
|
|
211
|
-
state: 'pending' | 'active';
|
|
212
|
-
}>;
|
|
213
|
-
/**
|
|
214
|
-
* 確認待ちの紐付け(管理者の確認の一覧、#698 M3)
|
|
215
|
-
* - grants は人の今と先の権利の数、rows は顧客フィールドでその人を指す行の数(結ぶとその外部 ID のログインで読めるもの)
|
|
216
|
-
* - linked は同じ人に同じ発行者の active の紐付けがある(確認は拒まれる)、profile は人の題(プロフィールのレコード)
|
|
217
|
-
*/
|
|
218
|
-
export type PendingIdentityView = CustomerIdentityView & Readonly<{
|
|
219
|
-
customerId: string;
|
|
220
|
-
customerStatus: CustomerStatus | null;
|
|
221
|
-
grants: number;
|
|
222
|
-
rows: number;
|
|
223
|
-
linked: boolean;
|
|
224
|
-
profile: CustomerProfileView;
|
|
225
|
-
}>;
|
|
226
|
-
/** 管理画面の顧客のプロフィールのレコード(なければ null) */
|
|
227
|
-
export type CustomerProfileView = Readonly<{
|
|
228
|
-
collection: string;
|
|
229
|
-
id: string;
|
|
230
|
-
title: string;
|
|
231
|
-
}> | null;
|
|
232
|
-
/** 管理画面の顧客の一覧の1行 */
|
|
233
|
-
export type CustomerListItem = Readonly<{
|
|
234
|
-
id: string;
|
|
235
|
-
status: CustomerStatus;
|
|
236
|
-
version: number;
|
|
237
|
-
createdAt: string;
|
|
238
|
-
identities: readonly CustomerIdentityView[];
|
|
239
|
-
profile: CustomerProfileView;
|
|
240
|
-
}>;
|
|
241
|
-
/** 管理画面の顧客の権利(installationId は出どころがインストールのときだけ) */
|
|
242
|
-
export type CustomerGrantView = Readonly<{
|
|
243
|
-
id: string;
|
|
244
|
-
targetCollection: string;
|
|
245
|
-
targetId: string;
|
|
246
|
-
startsOn: string;
|
|
247
|
-
endsOn: string | null;
|
|
248
|
-
source: GrantSource;
|
|
249
|
-
installationId: string | null;
|
|
250
|
-
version: number;
|
|
251
|
-
}>;
|
|
252
|
-
/** 管理画面の顧客の詳細(targetCollections は権利の対象にできるコレクション、today は導入先の今日、profileCollection はプロフィールのコレクション) */
|
|
253
|
-
export type CustomerDetail = Readonly<{
|
|
254
|
-
customer: Readonly<{
|
|
255
|
-
id: string;
|
|
256
|
-
status: CustomerStatus;
|
|
257
|
-
version: number;
|
|
258
|
-
createdAt: string;
|
|
259
|
-
}>;
|
|
260
|
-
identities: readonly CustomerIdentityView[];
|
|
261
|
-
grants: readonly CustomerGrantView[];
|
|
262
|
-
targetCollections: readonly string[];
|
|
263
|
-
today: string;
|
|
264
|
-
profile: CustomerProfileView;
|
|
265
|
-
profileCollection: string | null;
|
|
266
|
-
}>;
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
/** 外の画面を表示する位置(置き場所の意味はこのファイルの先頭) */
|
|
2
|
-
export declare const EMBED_PLACEMENTS: readonly ["panel", "page", "action", "dashboard", "field", "settings"];
|
|
3
|
-
/** 外の画面を表示する位置 */
|
|
4
|
-
export type EmbedPlacement = (typeof EMBED_PLACEMENTS)[number];
|
|
5
|
-
/** 外の画面の置き場所に当たるアプリの画面の置き場所(apps.ts のマニフェストと能力の集合の名前) */
|
|
6
|
-
export declare const EMBED_SCREEN_PLACEMENTS: {
|
|
7
|
-
readonly panel: "record.panel";
|
|
8
|
-
readonly page: "page";
|
|
9
|
-
readonly action: "list.action";
|
|
10
|
-
readonly dashboard: "dashboard";
|
|
11
|
-
readonly field: "record.field";
|
|
12
|
-
readonly settings: "settings";
|
|
13
|
-
};
|
|
14
|
-
/** 外の画面の登録の能力の集合(マニフェストの画面と同じ `screen:<置き場所>:<オリジン>` の形、URL がオリジンの形でなければ空) */
|
|
15
|
-
export declare const embedCapabilities: (placement: EmbedPlacement, url: string) => string[];
|
|
16
|
-
/** 外の画面の登録で管理者が選べる能力(旧い形のインストールは同意の画面がないので、選んだ能力をそのインストールの同意に書く) */
|
|
17
|
-
export declare const EMBED_GRANTABLE_CAPABILITIES: readonly ["op:@customers:read_display_name"];
|
|
18
|
-
/** 外の画面の登録で管理者が選べる能力 */
|
|
19
|
-
export type EmbedGrantableCapability = (typeof EMBED_GRANTABLE_CAPABILITIES)[number];
|
|
20
|
-
/** 表示名のエンドポイントの1回の顧客の ID の数の上限 */
|
|
21
|
-
export declare const EMBED_DISPLAY_NAMES_MAX = 100;
|
|
22
|
-
/** 表示名のエンドポイントの応答(顧客の ID から表示名。見ている人かアプリの能力が欠ければ空、プロフィールのない顧客は入れない) */
|
|
23
|
-
export type EmbedDisplayNames = Readonly<{
|
|
24
|
-
names: Readonly<Record<string, string>>;
|
|
25
|
-
}>;
|
|
26
|
-
/** トークンの交換(RFC 8693)の値: 画面のトークンをアカウントの資格の API のトークンに替える */
|
|
27
|
-
export declare const TOKEN_EXCHANGE: {
|
|
28
|
-
readonly grantType: "urn:ietf:params:oauth:grant-type:token-exchange";
|
|
29
|
-
readonly subjectTokenType: "urn:ietf:params:oauth:token-type:jwt";
|
|
30
|
-
readonly issuedTokenType: "urn:ietf:params:oauth:token-type:access_token";
|
|
31
|
-
};
|
|
32
|
-
/** トークンの交換の成功の応答(RFC 8693の形、expires_in は秒) */
|
|
33
|
-
export type TokenExchangeResponse = Readonly<{
|
|
34
|
-
access_token: string;
|
|
35
|
-
issued_token_type: string;
|
|
36
|
-
token_type: 'Bearer';
|
|
37
|
-
expires_in: number;
|
|
38
|
-
}>;
|
|
39
|
-
/** API の依頼のトークンのエンドポイントの応答(token は ACCOUNT_TOKEN の形、expiresIn は秒。host だけが持ち、iframe には渡さない) */
|
|
40
|
-
export type EmbedApiToken = Readonly<{
|
|
41
|
-
token: string;
|
|
42
|
-
expiresIn: number;
|
|
43
|
-
}>;
|
|
44
|
-
/** 画面のトークンのエンドポイントの応答(token は SESSION_TOKEN の形の JWT) */
|
|
45
|
-
export type EmbedSessionToken = Readonly<{
|
|
46
|
-
token: string;
|
|
47
|
-
}>;
|
|
48
|
-
/**
|
|
49
|
-
* 外の画面の登録
|
|
50
|
-
* - collection はコレクションを持つ置き場所のコレクションでほかは null、field は field の項目の key でほかは null
|
|
51
|
-
* - secret は末尾だけを伏せずに返す、previousSecret は鍵の移行の期間の古い鍵の末尾で期間の外は null
|
|
52
|
-
* - capabilities は管理者が選んだ能力(EMBED_GRANTABLE_CAPABILITIES のうち、旧い形のインストールの同意にあるもの)
|
|
53
|
-
* - installationId は登録簿のアプリのインストールがマニフェストの画面から作った行ならその ID(連携のタブでは変えられない、secret は空)、ほかは null
|
|
54
|
-
*/
|
|
55
|
-
export type ExternalScreen = Readonly<{
|
|
56
|
-
id: string;
|
|
57
|
-
installationId: string | null;
|
|
58
|
-
label: string;
|
|
59
|
-
collection: string | null;
|
|
60
|
-
field: string | null;
|
|
61
|
-
url: string;
|
|
62
|
-
placement: EmbedPlacement;
|
|
63
|
-
secret: string;
|
|
64
|
-
previousSecret: string | null;
|
|
65
|
-
enabled: boolean;
|
|
66
|
-
capabilities: readonly EmbedGrantableCapability[];
|
|
67
|
-
}>;
|
|
68
|
-
/** 管理画面に置く外の画面(鍵なし、panel はコレクションを閲覧できるアカウント、page は管理者に返す、field は field の項目の key) */
|
|
69
|
-
export type EmbedEntry = Readonly<{
|
|
70
|
-
id: string;
|
|
71
|
-
label: string;
|
|
72
|
-
url: string;
|
|
73
|
-
placement: EmbedPlacement;
|
|
74
|
-
field?: string;
|
|
75
|
-
}>;
|
|
76
|
-
/**
|
|
77
|
-
* 署名つきの文脈の内容(origin は管理画面のオリジン)
|
|
78
|
-
* - placement: 置き場所(この値がない文脈は panel)
|
|
79
|
-
* - type・id: panel はコレクションとレコードの ID(新規は null)、page はどちらも null
|
|
80
|
-
* - path: page とダイアログの登録の URL の下のパス(先頭の / なし、パスなしの文脈にはない)
|
|
81
|
-
* - dialog: アプリが橋渡しでダイアログとして開いた画面(置き場所とコレクションとレコードは開いた側と同じ)
|
|
82
|
-
* - embed: 登録の ID(インストールの後はインストールの識別子)。受け手は自分の登録の ID と照らし、別の登録の文脈を受けない(この値がない文脈は古い CMS が作ったもの)
|
|
83
|
-
* - ids: action の選んだレコードの ID(EMBED_ACTION_IDS_MAX 件まで)
|
|
84
|
-
* - field: field の項目の key
|
|
85
|
-
*/
|
|
86
|
-
export type EmbedContext = Readonly<{
|
|
87
|
-
project: string;
|
|
88
|
-
embed?: string;
|
|
89
|
-
account: Readonly<{
|
|
90
|
-
id: string;
|
|
91
|
-
role: string;
|
|
92
|
-
}>;
|
|
93
|
-
placement?: EmbedPlacement;
|
|
94
|
-
collection: string | null;
|
|
95
|
-
id: string | null;
|
|
96
|
-
field?: string;
|
|
97
|
-
path?: string;
|
|
98
|
-
dialog?: true;
|
|
99
|
-
ids?: readonly string[];
|
|
100
|
-
origin: string;
|
|
101
|
-
}>;
|
|
102
|
-
/** ダッシュボードの部品の件数と高さの上限(px) */
|
|
103
|
-
export declare const EMBED_DASHBOARD_LIMIT: {
|
|
104
|
-
readonly items: 8;
|
|
105
|
-
readonly heightPx: 800;
|
|
106
|
-
};
|
|
107
|
-
/** まとめての操作に渡すレコードの ID の件数の上限 */
|
|
108
|
-
export declare const EMBED_ACTION_IDS_MAX = 100;
|
|
109
|
-
/** コレクションを持つ置き場所(登録にコレクションが要る) */
|
|
110
|
-
export declare const isTypedPlacement: (p: EmbedPlacement) => boolean;
|
|
111
|
-
/** 全画面の置き場所(管理者だけ、深いリンクのパスを持つ) */
|
|
112
|
-
export declare const isPagePlacement: (p: EmbedPlacement) => boolean;
|
|
113
|
-
/** 文脈の取得の応答(src は文脈を付けた読み込み先、ctx・ctxNext は取り直しで送る値) */
|
|
114
|
-
export type EmbedContextResponse = Readonly<{
|
|
115
|
-
src: string;
|
|
116
|
-
ctx: string;
|
|
117
|
-
ctxNext: string | null;
|
|
118
|
-
}>;
|
|
119
|
-
/**
|
|
120
|
-
* 管理画面の HTML の CSP の frame-src に足す送り元
|
|
121
|
-
* - preview: プロジェクトのプレビューのオリジン(なしは管理画面の /preview)
|
|
122
|
-
* - frames: 登録した外の画面と本文の埋め込みのオリジン
|
|
123
|
-
*/
|
|
124
|
-
export type AdminFrameSources = Readonly<{
|
|
125
|
-
preview: string | null;
|
|
126
|
-
frames: readonly string[];
|
|
127
|
-
}>;
|
|
128
|
-
/** 管理画面の HTML の CSP の送り元の取得の経路(ログインしたアカウント、管理画面の Worker が HTML の応答に CSP を付けるときに呼ぶ) */
|
|
129
|
-
export declare const ADMIN_FRAME_SOURCES_PATH = "/api/embeds/frame-sources";
|
|
130
|
-
/** URL のクエリの名前(署名つきの文脈) */
|
|
131
|
-
export declare const EMBED_CONTEXT_PARAM = "ctx";
|
|
132
|
-
/** URL のクエリの名前(鍵の移行の期間だけ、新しい鍵で封印した文脈) */
|
|
133
|
-
export declare const EMBED_CONTEXT_NEXT_PARAM = "ctx_next";
|
|
134
|
-
/** 文脈の有効期間(秒) */
|
|
135
|
-
export declare const EMBED_CONTEXT_TTL_SEC = 600;
|
|
136
|
-
/** 開いている間に文脈を取り直す間隔(秒、有効期間の半分) */
|
|
137
|
-
export declare const EMBED_CONTEXT_REFRESH_SEC = 300;
|
|
138
|
-
/** postMessage の種類 */
|
|
139
|
-
export declare const EMBED_MESSAGES: {
|
|
140
|
-
readonly ready: "tunasand:ready";
|
|
141
|
-
readonly values: "tunasand:values";
|
|
142
|
-
readonly set: "tunasand:set";
|
|
143
|
-
readonly height: "tunasand:height";
|
|
144
|
-
readonly context: "tunasand:context";
|
|
145
|
-
readonly contextRequest: "tunasand:context_request";
|
|
146
|
-
};
|
|
147
|
-
/** 外の画面と管理画面の間のメッセージ(context の ctx・ctxNext は URL のクエリ ctx・ctx_next と同じ値) */
|
|
148
|
-
export type EmbedMessage = Readonly<{
|
|
149
|
-
type: typeof EMBED_MESSAGES.ready;
|
|
150
|
-
}> | Readonly<{
|
|
151
|
-
type: typeof EMBED_MESSAGES.values;
|
|
152
|
-
values: Readonly<Record<string, unknown>>;
|
|
153
|
-
}> | Readonly<{
|
|
154
|
-
type: typeof EMBED_MESSAGES.set;
|
|
155
|
-
values: Readonly<Record<string, unknown>>;
|
|
156
|
-
}> | Readonly<{
|
|
157
|
-
type: typeof EMBED_MESSAGES.height;
|
|
158
|
-
height: number;
|
|
159
|
-
}> | Readonly<{
|
|
160
|
-
type: typeof EMBED_MESSAGES.context;
|
|
161
|
-
ctx: string;
|
|
162
|
-
ctxNext: string | null;
|
|
163
|
-
}> | Readonly<{
|
|
164
|
-
type: typeof EMBED_MESSAGES.contextRequest;
|
|
165
|
-
}>;
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import type { ManagementOperation, Operation, TenantRole } from './authorize.js';
|
|
2
|
-
import { FAILURE_STATUS } from './failureStatus.js';
|
|
3
|
-
/** 変更の操作で受け付ける本文の大きさ(/api、バイト数、multipart のアップロードは ASSET_SIZE_MAX) */
|
|
4
|
-
export declare const JSON_BODY_MAX: number;
|
|
5
|
-
/** 画面の側だけのコード(通信の失敗と JSON でない応答。HTTP の状態を持たない) */
|
|
6
|
-
declare const NETWORK_ERROR = "network_error";
|
|
7
|
-
/** CMS の API のエラーのコード(状態は failureStatus.ts の表) */
|
|
8
|
-
declare const ERROR_CODES: readonly ["invalid_input", "submit_unmet", "publish_unmet", "save_unmet", "version_required", "file_required", "file_too_large", "unsupported_image", "unsupported_file", "invalid_dimensions", "https_required", "invalid_style", "login_required", "invalid_mcp_token", "mcp_signature_invalid", "invalid_account_token", "preview_token_required", "api_key_required", "invalid_api_key", "invalid_id_token", "invalid_app_token", "account_not_found", "invalid_preview_token", "api_key_forbidden", "mcp_not_allowed", "insufficient_scope", "admin_only", "operator_read_only", "operator_closed", "not_trial", "not_live", "forbidden", "editorial_only", "no_linked_record", "own_only", "not_visible", "published_admin_only", "cannot_remove_self", "cannot_change_owner", "not_found", "customer_not_linked", "customer_pending", "method_not_allowed", "in_use", "duplicate_name", "duplicate_email", "duplicate_id", "duplicate_slug", "version_conflict", "article_editing", "invalid_state", "unpublish_first", "last_admin", "exceeds_own", "reauth_required", "approval_required", "stale", "approval_closed", "already_linked", "invalid_invite", "run_done", "cursor_expired", "body_too_large", "rate_limited", "upstream_failed", "not_configured", "unavailable", "writes_paused", "environment_frozen", "job_failed", "internal_error", "network_error"];
|
|
9
|
-
/** エラーのコード */
|
|
10
|
-
export type ErrorCode = (typeof ERROR_CODES)[number];
|
|
11
|
-
/** やり直せば通りうるエラー(画面はこれだけに再試行のボタンを出す) */
|
|
12
|
-
export declare const RETRYABLE_ERRORS: readonly ["rate_limited", "upstream_failed", "unavailable", "writes_paused", "job_failed", "internal_error", "network_error"];
|
|
13
|
-
/** サーバーが返すエラーのコード */
|
|
14
|
-
type ServerErrorCode = Exclude<ErrorCode, typeof NETWORK_ERROR>;
|
|
15
|
-
/** エラーのコードと HTTP の状態(failureStatus.ts の表の CMS の API の部分) */
|
|
16
|
-
export declare const ERROR_STATUS: { readonly [K in ServerErrorCode]: (typeof FAILURE_STATUS)[K]; };
|
|
17
|
-
/**
|
|
18
|
-
* コアの操作や表示の対象(not_found・own_only などの params.target)
|
|
19
|
-
* - コレクションの対象: コレクションの id、表示名はスキーマ
|
|
20
|
-
* - モジュールの対象: ModuleManifest の targets
|
|
21
|
-
*/
|
|
22
|
-
export type ErrorTarget = 'request' | 'role' | 'media' | 'record' | 'asset' | 'mcp' | 'version' | 'profile' | 'portrait' | 'extension' | 'account' | 'comment' | 'view' | 'webhook' | 'external_function' | 'external_screen' | 'api_key' | 'preview' | 'trash' | 'customer' | 'customer_identity' | 'customer_grant' | 'app' | 'installation' | 'invitation' | 'environment';
|
|
23
|
-
/** 状態の不一致の理由(invalid_state) */
|
|
24
|
-
export type InvalidStateReason = 'not_draft' | 'no_draft' | 'not_in_review' | 'request_handled' | 'deleted' | 'not_deleted' | 'schema_confirm' | 'no_publishing' | 'no_review' | 'not_published' | 'collection_rows' | 'restore_conflict' | 'collection_exists' | 'collection_missing' | 'not_restorable' | 'installation_state' | 'required_module' | 'app_installed' | 'app_dependencies' | 'app_reinstalled' | 'app_managed' | 'request_key_reused' | 'no_tenant' | 'schema_changed' | 'site_deploy' | 'site_stopped_by_check' | 'customer_inactive' | 'self_limit' | 'already_live' | 'target_live' | 'target_synthetic' | 'no_changes' | 'schema_values' | 'environment_limit' | 'environment_busy' | 'unregistered_table' | 'not_frozen' | 'approval_running';
|
|
25
|
-
/**
|
|
26
|
-
* 権限の拒否で足りないもの(403 forbidden の params.required)
|
|
27
|
-
* - operation: 拒んだ操作(Operation か、プロジェクトの管理の操作 ManagementOperation)
|
|
28
|
-
* - roles: その操作を持つロール(ロールで決まる操作だけ。管理の操作はテナントのロール)
|
|
29
|
-
* - capability: 足りない能力(アプリ・インストールの能力の文字列、例 `op:<コレクション>:read_customers`)
|
|
30
|
-
*/
|
|
31
|
-
export type ErrorRequired = Readonly<{
|
|
32
|
-
operation: Operation | ManagementOperation;
|
|
33
|
-
roles?: readonly (string | TenantRole)[];
|
|
34
|
-
capability?: string;
|
|
35
|
-
}>;
|
|
36
|
-
/** エラーの補足の値(コードごとに使用する項目だけ) */
|
|
37
|
-
export type ErrorParams = {
|
|
38
|
-
/**
|
|
39
|
-
* 対象: not_found・own_only・forbidden・not_visible・no_linked_record・editorial_only・api_key_forbidden
|
|
40
|
-
* - 文字列: モジュールの対象・コレクションの id
|
|
41
|
-
*/
|
|
42
|
-
target?: ErrorTarget | (string & {});
|
|
43
|
-
/** 件数: in_use */
|
|
44
|
-
count?: number;
|
|
45
|
-
/** 使用先: in_use */
|
|
46
|
-
by?: 'uses' | 'places' | 'outputs' | 'record' | 'writers' | 'customers' | 'accounts' | 'module';
|
|
47
|
-
/**
|
|
48
|
-
* 理由: invalid_state(InvalidStateReason)、already_linked(identity は相手の ID、customer は顧客)
|
|
49
|
-
* - invalid_invite: not_found・expired・used
|
|
50
|
-
*/
|
|
51
|
-
reason?: InvalidStateReason | 'identity' | 'customer' | 'not_found' | 'expired' | 'used';
|
|
52
|
-
/** 取得の対象: upstream_failed */
|
|
53
|
-
resource?: 'page' | 'image' | 'webhook' | 'source' | 'file' | 'hosting';
|
|
54
|
-
/**
|
|
55
|
-
* 名前
|
|
56
|
-
* - no_linked_record: 結び付くコレクションの表示名、account_not_found: メールアドレス
|
|
57
|
-
* - not_configured: 設定の名前、job_failed: 失敗の理由、in_use の record: 参照するコレクションと項目、
|
|
58
|
-
* in_use の module: 参照するモジュールの表の表示名
|
|
59
|
-
* - invalid_state の restore_conflict: 戻すレコードとぶつかるレコードの表示名
|
|
60
|
-
*/
|
|
61
|
-
name?: string;
|
|
62
|
-
/** 権限の拒否で足りないもの: forbidden */
|
|
63
|
-
required?: ErrorRequired;
|
|
64
|
-
/** MCP の接続に足りない範囲: insufficient_scope(MCP の Worker が403の WWW-Authenticate の scope に写す) */
|
|
65
|
-
scope?: string;
|
|
66
|
-
};
|
|
67
|
-
/**
|
|
68
|
-
* エラーの応答の本文
|
|
69
|
-
* - message: 英語の定型の文(画面は code と params で引く)、requestId: 相関の ID(すべてのエラー)
|
|
70
|
-
* - login: ログインなしのとき、CMS 自身が受け持つログインの入り口
|
|
71
|
-
* - capability: アプリの主体の閲覧の拒否で、足りない能力(顧客だけの項目を持つコレクションの `op:<コレクション>:read_customers`)
|
|
72
|
-
*/
|
|
73
|
-
/** 検査の結果の重さ(error は保存・提出・取り込みを止め、warning は止めない) */
|
|
74
|
-
export declare const ISSUE_SEVERITIES: readonly ["error", "warning"];
|
|
75
|
-
export type IssueSeverity = (typeof ISSUE_SEVERITIES)[number];
|
|
76
|
-
/**
|
|
77
|
-
* 検査の結果の1件(エラーの応答の issues と、検査が目的の操作の200の issues で同じ形、path は項目の key をドットで連結)
|
|
78
|
-
* - code: 検査の問題のコード(コンテンツスキーマ、本文、編集)、入力の形の誤りは zod の issue の code、ほかは invalid
|
|
79
|
-
* - message: 英語の既定の文、params: 差し込み(画面は code と params を文言の表で引く)
|
|
80
|
-
*/
|
|
81
|
-
export type Issue = {
|
|
82
|
-
path: string;
|
|
83
|
-
code: string;
|
|
84
|
-
message: string;
|
|
85
|
-
params?: Readonly<Record<string, string | number>>;
|
|
86
|
-
severity: IssueSeverity;
|
|
87
|
-
};
|
|
88
|
-
/** 検査の結果を作るときの形(code と severity は省けて、応答の手前で決まる) */
|
|
89
|
-
export type IssueInput = Readonly<{
|
|
90
|
-
path: string;
|
|
91
|
-
message: string;
|
|
92
|
-
code?: string;
|
|
93
|
-
params?: Issue['params'];
|
|
94
|
-
severity?: IssueSeverity;
|
|
95
|
-
}>;
|
|
96
|
-
export type ErrorBody = {
|
|
97
|
-
code: ErrorCode;
|
|
98
|
-
message: string;
|
|
99
|
-
params?: ErrorParams;
|
|
100
|
-
issues?: Issue[];
|
|
101
|
-
login?: string;
|
|
102
|
-
requestId: string;
|
|
103
|
-
capability?: string;
|
|
104
|
-
};
|
|
105
|
-
export {};
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/** ID の種類 */
|
|
2
|
-
export declare const ID_KINDS: readonly ["app", "installation", "customer", "event"];
|
|
3
|
-
export type IdKind = (typeof ID_KINDS)[number];
|
|
4
|
-
/** UUID v7 の形(小文字の16進とハイフン) */
|
|
5
|
-
export declare const UUID_V7: RegExp;
|
|
6
|
-
/** 種類の ID の形か(作るのはサーバーで、どの種類も UUID v7) */
|
|
7
|
-
export declare const isIdOf: (_kind: IdKind, value: string) => boolean;
|
|
8
|
-
/**
|
|
9
|
-
* 時刻とバイト列から組む UUID v7(同じ入力には同じ値)
|
|
10
|
-
* - ms: 時刻(ミリ秒、48ビット)
|
|
11
|
-
* - random: 乱数の部分(頭の10バイトを使う。10バイトより短ければ例外)
|
|
12
|
-
*/
|
|
13
|
-
export declare function uuidV7From(ms: number, random: Uint8Array): string;
|
|
14
|
-
/**
|
|
15
|
-
* 秘密の値の接頭辞(#683。値から種類が分かり、漏れの検出に使える)
|
|
16
|
-
* - server: 配信 API のサーバーの鍵、personalToken: 個人のトークン、publicClient: 公開のクライアントの識別子
|
|
17
|
-
* - webhook: Webhook と外部関数の署名の鍵(Standard Webhooks)
|
|
18
|
-
* - 顧客の更新の資格は CUSTOMER_TOKEN の refreshPrefix
|
|
19
|
-
*/
|
|
20
|
-
export declare const SECRET_PREFIXES: {
|
|
21
|
-
readonly server: "tunasand_sk_";
|
|
22
|
-
readonly personalToken: "tunasand_pat_";
|
|
23
|
-
readonly publicClient: "tunasand_pk_";
|
|
24
|
-
readonly webhook: "whsec_";
|
|
25
|
-
};
|
|
26
|
-
/** アプリが持つコレクションの id の区切り(`<名前空間>__<名前>`) */
|
|
27
|
-
export declare const APP_COLLECTION_SEPARATOR = "__";
|
|
28
|
-
/** コレクションの名前空間の形(登録のときに決め、アプリの識別子に結び付けて変えない。アプリを消しても再利用しない) */
|
|
29
|
-
export declare const APP_NAMESPACE_PATTERN: RegExp;
|
|
30
|
-
/** アプリが持つコレクションの名前空間(アプリが持つコレクションでなければ null) */
|
|
31
|
-
export declare function appNamespaceOf(collectionId: string): string | null;
|
|
32
|
-
/** 操作の履歴の主体の種類(アカウント・運営者・インストール・アカウントの代わり・人の代わり・コア) */
|
|
33
|
-
export declare const ACTOR_KINDS: readonly ["account", "operator", "installation", "on_behalf_of_account", "on_behalf_of_customer", "system"];
|
|
34
|
-
/** 操作の履歴の主体の種類 */
|
|
35
|
-
export type ActorKind = (typeof ACTOR_KINDS)[number];
|
|
36
|
-
/** 操作の履歴の経路(管理画面、MCP、配信 API の鍵、アプリのアカウントの資格) */
|
|
37
|
-
export declare const AUDIT_VIAS: readonly ["cms", "mcp", "api", "app"];
|
|
38
|
-
/** 操作の履歴の経路 */
|
|
39
|
-
export type AuditVia = (typeof AUDIT_VIAS)[number];
|
|
40
|
-
/** 経路から決まる主体の種類(運営者は経路で分からないので、ログインの種類で上書きする) */
|
|
41
|
-
export declare const ACTOR_KIND_OF_VIA: {
|
|
42
|
-
readonly cms: "account";
|
|
43
|
-
readonly mcp: "on_behalf_of_account";
|
|
44
|
-
readonly api: "installation";
|
|
45
|
-
readonly app: "on_behalf_of_account";
|
|
46
|
-
};
|
|
47
|
-
/** 項目の種類「顧客への参照」の名前(値は顧客の ID の文字列) */
|
|
48
|
-
export declare const CUSTOMER_REFERENCE_FIELD = "customer";
|
|
49
|
-
/**
|
|
50
|
-
* 顧客のトークンの形(実装は要望の後、形だけを固定)
|
|
51
|
-
* - JWS のコンパクトな形。発行と検証はどちらも Tunasand だけで、署名の鍵は SECRETS_KEY からプロジェクトごとに HKDF で導く
|
|
52
|
-
* - 更新の資格は refreshPrefix で始まる不透明な値(保存はハッシュだけ、使うたびに作り直す)
|
|
53
|
-
*/
|
|
54
|
-
export declare const CUSTOMER_TOKEN: {
|
|
55
|
-
readonly typ: "tunasand-member+jwt";
|
|
56
|
-
readonly alg: "HS256";
|
|
57
|
-
readonly ttlSec: 600;
|
|
58
|
-
readonly refreshPrefix: "tunasand_rt_";
|
|
59
|
-
readonly absoluteSec: number;
|
|
60
|
-
};
|
|
61
|
-
/** 顧客のトークンのクレーム(iss はプロジェクトの CMS のホストの URL、aud はチャネル = インストールの ID、sv は顧客の状態の版、時刻は秒) */
|
|
62
|
-
export type CustomerTokenClaims = Readonly<{
|
|
63
|
-
iss: string;
|
|
64
|
-
sub: string;
|
|
65
|
-
aud: string;
|
|
66
|
-
iat: number;
|
|
67
|
-
exp: number;
|
|
68
|
-
jti: string;
|
|
69
|
-
sv: number;
|
|
70
|
-
}>;
|
|
71
|
-
/**
|
|
72
|
-
* インストールのトークンの形(GitHub App の形: アプリの鍵で署名したアプリの JWT と交換する)
|
|
73
|
-
* - JWS のコンパクトな形。発行と検証はどちらも Tunasand だけで、署名の鍵は SECRETS_KEY からプロジェクトごとに HKDF で導く
|
|
74
|
-
* - アプリの JWT: ES256 か RS256、iss はアプリの ID、aud はプロジェクトの配信の基点、exp − iat は appJwtMaxSec 秒まで
|
|
75
|
-
* - 時計のずれ: iat の未来と exp の過去を skewSec 秒まで許す
|
|
76
|
-
*/
|
|
77
|
-
export declare const INSTALLATION_TOKEN: {
|
|
78
|
-
readonly typ: "tunasand-installation+jwt";
|
|
79
|
-
readonly alg: "HS256";
|
|
80
|
-
readonly ttlSec: 3600;
|
|
81
|
-
readonly appJwtMaxSec: 600;
|
|
82
|
-
readonly skewSec: 60;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* アカウントの資格の API のトークンの形(アプリのサーバーが画面のトークンをトークンの交換で替えたもの)
|
|
86
|
-
* - JWS のコンパクトな形。発行と検証はどちらも Tunasand だけで、署名の鍵は SECRETS_KEY からプロジェクトごとに HKDF で導く
|
|
87
|
-
* - 主体は人 ∩ インストールの能力。更新の資格はなく、続けるときは新しい画面のトークンで替え直す
|
|
88
|
-
*/
|
|
89
|
-
export declare const ACCOUNT_TOKEN: {
|
|
90
|
-
readonly typ: "tunasand-account+jwt";
|
|
91
|
-
readonly alg: "HS256";
|
|
92
|
-
readonly ttlSec: 600;
|
|
93
|
-
};
|
|
94
|
-
/** アカウントの資格の API のトークンのクレーム(iss は発行した環境の CMS の URL、sub はアカウントの ID、aud はクライアントの ID、env は発行した環境の ID、時刻は秒) */
|
|
95
|
-
export type AccountTokenClaims = Readonly<{
|
|
96
|
-
iss: string;
|
|
97
|
-
sub: string;
|
|
98
|
-
aud: string;
|
|
99
|
-
env: string;
|
|
100
|
-
iat: number;
|
|
101
|
-
exp: number;
|
|
102
|
-
jti: string;
|
|
103
|
-
}>;
|
|
104
|
-
/**
|
|
105
|
-
* インストールのトークンのクレーム(iss はプロジェクトの配信の基点、sub はインストールの ID、aud はアプリの ID、ver はインストールのバージョン、時刻は秒)
|
|
106
|
-
* - env は発行した環境の ID。署名の鍵はプロジェクトの単位で、環境のコピーでインストールの ID もコピーされるので、環境はこのクレームで縛る
|
|
107
|
-
*/
|
|
108
|
-
export type InstallationTokenClaims = Readonly<{
|
|
109
|
-
iss: string;
|
|
110
|
-
sub: string;
|
|
111
|
-
aud: string;
|
|
112
|
-
env: string;
|
|
113
|
-
iat: number;
|
|
114
|
-
exp: number;
|
|
115
|
-
jti: string;
|
|
116
|
-
ver: number | null;
|
|
117
|
-
}>;
|