@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
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type AddressChannel } from './consents.js';
|
|
3
|
+
/** ポートの id */
|
|
4
|
+
export declare const MESSAGE_PORT: "tunasand:message@1";
|
|
5
|
+
/** 受信のイベントの名前 */
|
|
6
|
+
export declare const MESSAGE_RECEIVED = "message.received";
|
|
7
|
+
/** 能力の形(text、image か `<名前空間>.<名前>`) */
|
|
8
|
+
export declare const MESSAGE_CAPABILITY: RegExp;
|
|
9
|
+
/** 上限(1回の送信のメッセージの数、テキストの字数、URL の字数、名前空間つきの本文のバイト数、冪等キーの字数、受信の操作のデータの字数) */
|
|
10
|
+
export declare const MESSAGE_LIMITS: {
|
|
11
|
+
readonly perSend: 5;
|
|
12
|
+
readonly textMaxChars: 5000;
|
|
13
|
+
readonly urlMaxChars: 2000;
|
|
14
|
+
readonly extensionMaxBytes: 30000;
|
|
15
|
+
readonly idempotencyKeyMaxChars: 128;
|
|
16
|
+
readonly actionDataMaxChars: 300;
|
|
17
|
+
readonly eventIdMaxChars: 200;
|
|
18
|
+
readonly addressMaxChars: 254;
|
|
19
|
+
readonly nameMaxChars: 200;
|
|
20
|
+
};
|
|
21
|
+
/** メッセージ(送信と受信で同じ形) */
|
|
22
|
+
export declare const portMessage: z.ZodUnion<readonly [z.ZodObject<{
|
|
23
|
+
kind: z.ZodLiteral<"text">;
|
|
24
|
+
text: z.ZodString;
|
|
25
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
26
|
+
kind: z.ZodLiteral<"image">;
|
|
27
|
+
url: z.ZodString;
|
|
28
|
+
previewUrl: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
30
|
+
kind: z.ZodString;
|
|
31
|
+
}, z.core.$catchall<z.ZodUnknown>>]>;
|
|
32
|
+
/** メッセージ(kind は能力) */
|
|
33
|
+
export type PortMessage = Readonly<{
|
|
34
|
+
kind: 'text';
|
|
35
|
+
text: string;
|
|
36
|
+
}> | Readonly<{
|
|
37
|
+
kind: 'image';
|
|
38
|
+
url: string;
|
|
39
|
+
previewUrl?: string;
|
|
40
|
+
}> | (Readonly<{
|
|
41
|
+
kind: `${string}.${string}`;
|
|
42
|
+
}> & Readonly<Record<string, unknown>>);
|
|
43
|
+
/** アドレスの相手(channel はアドレスのチャネル。形の検査と正規化はコアの同意と抑止の確認が行う) */
|
|
44
|
+
export type MessageAddress = Readonly<{
|
|
45
|
+
channel: AddressChannel;
|
|
46
|
+
address: string;
|
|
47
|
+
}>;
|
|
48
|
+
/** 送信の宛先(エンドユーザーの ID か、アドレス) */
|
|
49
|
+
export type MessageRecipient = Readonly<{
|
|
50
|
+
endUserId: string;
|
|
51
|
+
}> | MessageAddress;
|
|
52
|
+
/** 受信の送り主(アドレスの送り主は表示名を持つことがある) */
|
|
53
|
+
export type MessageSender = Readonly<{
|
|
54
|
+
endUserId: string;
|
|
55
|
+
}> | (MessageAddress & Readonly<{
|
|
56
|
+
name?: string;
|
|
57
|
+
}>);
|
|
58
|
+
/**
|
|
59
|
+
* 送信のリクエスト
|
|
60
|
+
* - to: エンドユーザーの ID か、アドレス。purpose は同意の目的、idempotencyKey は同じ送信の重複を除くキー
|
|
61
|
+
* - channel: 宛先の種類(その種類を consent_channel に宣言したプロバイダーを選ぶ)。省略はアドレスのチャネルか、能力をすべて持つ最初のプロバイダー
|
|
62
|
+
* - channelId: 送るチャネル(プロジェクトのチャネルの id。そのチャネルを持つプロバイダーが送る)。省略はプロバイダーの種類の既定のチャネル
|
|
63
|
+
* - replyTo: 返信する受信の eventId(プロバイダーはスレッドの返信として送る。扱わないチャネルは無視する)
|
|
64
|
+
*/
|
|
65
|
+
export declare const messageSendRequest: z.ZodObject<{
|
|
66
|
+
to: z.ZodUnion<readonly [z.ZodObject<{
|
|
67
|
+
endUserId: z.ZodString;
|
|
68
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
69
|
+
channel: z.ZodEnum<{
|
|
70
|
+
email: "email";
|
|
71
|
+
sms: "sms";
|
|
72
|
+
}>;
|
|
73
|
+
address: z.ZodString;
|
|
74
|
+
}, z.core.$strict>]>;
|
|
75
|
+
channel: z.ZodOptional<z.ZodEnum<{
|
|
76
|
+
email: "email";
|
|
77
|
+
sms: "sms";
|
|
78
|
+
}>>;
|
|
79
|
+
channelId: z.ZodOptional<z.ZodString>;
|
|
80
|
+
purpose: z.ZodString;
|
|
81
|
+
messages: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
82
|
+
kind: z.ZodLiteral<"text">;
|
|
83
|
+
text: z.ZodString;
|
|
84
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
85
|
+
kind: z.ZodLiteral<"image">;
|
|
86
|
+
url: z.ZodString;
|
|
87
|
+
previewUrl: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
|
+
kind: z.ZodString;
|
|
90
|
+
}, z.core.$catchall<z.ZodUnknown>>]>>;
|
|
91
|
+
idempotencyKey: z.ZodString;
|
|
92
|
+
replyTo: z.ZodOptional<z.ZodObject<{
|
|
93
|
+
eventId: z.ZodString;
|
|
94
|
+
}, z.core.$strict>>;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
export type MessageSendRequest = Readonly<{
|
|
97
|
+
to: MessageRecipient;
|
|
98
|
+
channel?: AddressChannel;
|
|
99
|
+
channelId?: string;
|
|
100
|
+
purpose: string;
|
|
101
|
+
messages: readonly PortMessage[];
|
|
102
|
+
idempotencyKey: string;
|
|
103
|
+
replyTo?: Readonly<{
|
|
104
|
+
eventId: string;
|
|
105
|
+
}>;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* 送信しない理由
|
|
109
|
+
* - no_identity: 宛先のチャネルの identity かアドレスがない、blocked: 宛先がチャネルで受け取りを止めた、no_consent: 同意がない、
|
|
110
|
+
* suppressed: 抑止の一覧にある、no_channel: チャネルの指定がなく、プロバイダーの種類の既定のチャネルもない、
|
|
111
|
+
* test_environment: live 以外の環境(送信しない)
|
|
112
|
+
*/
|
|
113
|
+
export declare const MESSAGE_SKIP_REASONS: readonly ["no_identity", "blocked", "no_consent", "suppressed", "no_channel", "test_environment"];
|
|
114
|
+
export type MessageSkipReason = (typeof MESSAGE_SKIP_REASONS)[number];
|
|
115
|
+
/**
|
|
116
|
+
* 拒否の位置(index は何番目のメッセージで、リクエストの全体の誤りは負の値。path はその中の位置)
|
|
117
|
+
* - コアのコード: invalid_input、message_capability_undeclared、message_no_provider、message_address_channel、
|
|
118
|
+
* message_channel_unknown
|
|
119
|
+
* - message_address_channel: アドレスのチャネルがプロバイダーのチャネルと違う
|
|
120
|
+
* - message_channel_unknown: channelId がプロジェクトの送信のできるチャネルでないか、その種類のプロバイダーが能力を持たない
|
|
121
|
+
*/
|
|
122
|
+
export type MessageProblem = Readonly<{
|
|
123
|
+
index: number;
|
|
124
|
+
path: string;
|
|
125
|
+
code: string;
|
|
126
|
+
}>;
|
|
127
|
+
/**
|
|
128
|
+
* 送信の結果(プロバイダーの一時的な失敗は結果にせず例外)
|
|
129
|
+
* - sent: 送った(providerMessageIds はチャネルの側の ID、ないものは空)
|
|
130
|
+
* - skipped: 送らなかった(理由)
|
|
131
|
+
* - rejected: 内容の誤り(位置とコード)
|
|
132
|
+
*/
|
|
133
|
+
export type MessageSendResult = Readonly<{
|
|
134
|
+
status: 'sent';
|
|
135
|
+
provider: string;
|
|
136
|
+
providerMessageIds: readonly string[];
|
|
137
|
+
}> | Readonly<{
|
|
138
|
+
status: 'skipped';
|
|
139
|
+
reason: MessageSkipReason;
|
|
140
|
+
}> | Readonly<{
|
|
141
|
+
status: 'rejected';
|
|
142
|
+
problems: readonly MessageProblem[];
|
|
143
|
+
}>;
|
|
144
|
+
/** プロバイダーの結果(宛先の解決と内容の検査はプロバイダーが行う。コアの理由 no_consent・suppressed・no_channel・test_environment は返さない) */
|
|
145
|
+
export type MessageProviderResult = Exclude<MessageSendResult, Readonly<{
|
|
146
|
+
status: 'sent';
|
|
147
|
+
}>> | Readonly<{
|
|
148
|
+
status: 'sent';
|
|
149
|
+
providerMessageIds: readonly string[];
|
|
150
|
+
}>;
|
|
151
|
+
/** 受信の要素(メッセージか、操作の結果。操作の結果はリッチメニューやボタンのポストバックなど) */
|
|
152
|
+
export type ReceivedItem = PortMessage | Readonly<{
|
|
153
|
+
kind: 'action';
|
|
154
|
+
data: string;
|
|
155
|
+
}>;
|
|
156
|
+
/**
|
|
157
|
+
* 受信のイベント
|
|
158
|
+
* - eventId: チャネルの側のイベントの ID(受け手は redelivery の重複をこの値で除く。送信の replyTo に渡す)、at: 受信の時刻(ISO 8601)
|
|
159
|
+
* - from: 送り主(エンドユーザーか、アドレス)。provider はプロバイダーのアプリの id(コアが付ける)
|
|
160
|
+
* - channelId: 受けたチャネル(プロジェクトのチャネルの id。チャネルを持たないプロバイダーは null。受け手は設定で受けるチャネルを選ぶ)
|
|
161
|
+
*/
|
|
162
|
+
export type MessageReceived = Readonly<{
|
|
163
|
+
provider: string;
|
|
164
|
+
channelId: string | null;
|
|
165
|
+
eventId: string;
|
|
166
|
+
from: MessageSender;
|
|
167
|
+
at: string;
|
|
168
|
+
redelivery: boolean;
|
|
169
|
+
items: readonly ReceivedItem[];
|
|
170
|
+
}>;
|
|
171
|
+
/** プロバイダーが出す受信(provider はコアが付ける。channelId はプロバイダーのチャネルだけ) */
|
|
172
|
+
export type MessageReceivedInput = Omit<MessageReceived, 'provider' | 'channelId'> & Readonly<{
|
|
173
|
+
channelId?: string;
|
|
174
|
+
}>;
|
|
175
|
+
/** 受信の検査 */
|
|
176
|
+
export declare const messageReceivedInput: z.ZodObject<{
|
|
177
|
+
channelId: z.ZodOptional<z.ZodString>;
|
|
178
|
+
eventId: z.ZodString;
|
|
179
|
+
from: z.ZodUnion<readonly [z.ZodObject<{
|
|
180
|
+
endUserId: z.ZodString;
|
|
181
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
182
|
+
channel: z.ZodEnum<{
|
|
183
|
+
email: "email";
|
|
184
|
+
sms: "sms";
|
|
185
|
+
}>;
|
|
186
|
+
address: z.ZodString;
|
|
187
|
+
name: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strict>]>;
|
|
189
|
+
at: z.ZodISODateTime;
|
|
190
|
+
redelivery: z.ZodBoolean;
|
|
191
|
+
items: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodObject<{
|
|
192
|
+
kind: z.ZodLiteral<"text">;
|
|
193
|
+
text: z.ZodString;
|
|
194
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
195
|
+
kind: z.ZodLiteral<"image">;
|
|
196
|
+
url: z.ZodString;
|
|
197
|
+
previewUrl: z.ZodOptional<z.ZodString>;
|
|
198
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
199
|
+
kind: z.ZodString;
|
|
200
|
+
}, z.core.$catchall<z.ZodUnknown>>]>, z.ZodObject<{
|
|
201
|
+
kind: z.ZodLiteral<"action">;
|
|
202
|
+
data: z.ZodString;
|
|
203
|
+
}, z.core.$strict>]>>;
|
|
204
|
+
}, z.core.$strict>;
|
|
205
|
+
/** メッセージの能力(kind)の一覧 */
|
|
206
|
+
export declare const messageKindsOf: (messages: readonly Readonly<{
|
|
207
|
+
kind: string;
|
|
208
|
+
}>[]) => string[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** コレクションごとの行の数(取り出し元ごと。人はコレクション
|
|
1
|
+
/** コレクションごとの行の数(取り出し元ごと。人はコレクション END_USER_MAP_TYPE) */
|
|
2
2
|
export type SourceCounts = Readonly<Record<string, Readonly<Record<string, number>>>>;
|
|
3
3
|
/**
|
|
4
4
|
* 計画の本文(ほかのキーは診断と人が埋めた判断)
|
|
@@ -43,7 +43,7 @@ export declare const inputHashOf: (lines: readonly unknown[]) => Promise<string>
|
|
|
43
43
|
export declare const IMPORT_MAP_STATES: readonly ["active", "pending_second", "deleting", "tombstone"];
|
|
44
44
|
export type ImportMapState = (typeof IMPORT_MAP_STATES)[number];
|
|
45
45
|
/**
|
|
46
|
-
* 接続済みの取り込みの要約(/api/transfer/summary と
|
|
46
|
+
* 接続済みの取り込みの要約(/api/transfer/summary と console の移行の画面、#713)
|
|
47
47
|
* - sources: 取り出し元ごと。collections はコレクションごと、状態ごとの対応表の行の数、runs は完了した取り込みの実行の数、lastCompletedAt は最後の完了
|
|
48
48
|
* - planVersion: 移行の計画の今の版(なしは null)
|
|
49
49
|
* - 元の ID、外部 ID、項目の値を含めない(数と取り出し元の名前とコレクションだけ)
|
|
@@ -64,7 +64,7 @@ export declare const VERIFY_PAGE_MAX = 200;
|
|
|
64
64
|
* - collections: コレクションごと、状態ごとの対応表の行の数(知らない状態も数える。ページによらず全部)
|
|
65
65
|
* - runs: 完了した取り込みの実行(plan は完了のときに結んだ計画、なしは null。ページによらず全部)
|
|
66
66
|
* - missing: このページの有効か2段目待ちの対応表の行で、行(人は人)がない数(コレクションごと)
|
|
67
|
-
* - dangling:
|
|
67
|
+
* - dangling: このページの有効な対応表の行のうち、参照の項目かエンドユーザーへの参照のフィールドの先がない値の位置(id は新しい ID、path は項目の道)
|
|
68
68
|
* - next: 次のページの after(コレクションと新しい ID)、なしは終わり
|
|
69
69
|
*/
|
|
70
70
|
export type TransferCounts = Readonly<{
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { PortId } from './appDependencies.js';
|
|
3
|
+
/** 通知のポート */
|
|
4
|
+
export declare const NOTICES_PORT: PortId;
|
|
5
|
+
/**
|
|
6
|
+
* 通知の1件
|
|
7
|
+
* - collection と record は対象の id、at は日時(UTC の ISO 8601)
|
|
8
|
+
* - by: 差出人(account はアカウントの ID、owners は対象のレコードの持ち主、なしは null)
|
|
9
|
+
* - standing: 対応するまで残る件か(偽は、開いたときに既読になる件)
|
|
10
|
+
*/
|
|
11
|
+
declare const appNotice: z.ZodObject<{
|
|
12
|
+
kind: z.ZodString;
|
|
13
|
+
collection: z.ZodString;
|
|
14
|
+
record: z.ZodString;
|
|
15
|
+
at: z.ZodISODateTime;
|
|
16
|
+
by: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
17
|
+
account: z.ZodString;
|
|
18
|
+
}, z.core.$strip>, z.ZodLiteral<"owners">]>>;
|
|
19
|
+
standing: z.ZodBoolean;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
/** 提供者の応答 */
|
|
22
|
+
export declare const appNotices: z.ZodObject<{
|
|
23
|
+
notices: z.ZodArray<z.ZodObject<{
|
|
24
|
+
kind: z.ZodString;
|
|
25
|
+
collection: z.ZodString;
|
|
26
|
+
record: z.ZodString;
|
|
27
|
+
at: z.ZodISODateTime;
|
|
28
|
+
by: z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
|
29
|
+
account: z.ZodString;
|
|
30
|
+
}, z.core.$strip>, z.ZodLiteral<"owners">]>>;
|
|
31
|
+
standing: z.ZodBoolean;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
}, z.core.$strip>;
|
|
34
|
+
export type AppNotice = Readonly<z.infer<typeof appNotice>>;
|
|
35
|
+
export type AppNotices = Readonly<{
|
|
36
|
+
notices: readonly AppNotice[];
|
|
37
|
+
}>;
|
|
38
|
+
export {};
|