@tunasand/sdk 0.8.0 → 0.12.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 +137 -0
- package/README.md +165 -144
- package/dist/analytics.js +183 -109
- package/dist/app.js +276 -166
- package/dist/apps-BysPfMuR.js +408 -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-C2Bl-OAF.js +80 -0
- package/dist/bridge.js +1 -13
- package/dist/build-file-DNi0PHC5.js +31 -0
- package/dist/cli.js +6212 -8
- 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-26aglrg6.js +282 -0
- package/dist/{declared-DuNMsdXw.js → declared-CE4a61qb.js} +35 -35
- package/dist/delivery.js +121 -114
- package/dist/dev-operations-Tutwi1On.js +46 -0
- package/dist/dev.js +9 -16
- package/dist/embeds-DY6O5TrJ.js +29 -0
- package/dist/end-users.d.ts +1 -0
- package/dist/end-users.js +189 -0
- package/dist/endUsers-DODfjnv1.js +77 -0
- package/dist/{errorLabels-BgtQ_zUn.js → errorLabels-BK1NJ6Wz.js} +374 -238
- package/dist/i18n.js +4 -4
- package/dist/ids-DmtIoqBX.js +109 -0
- package/dist/integrations.js +95 -24
- package/dist/{ja-Du6ooL6i.js → ja-B3lAaOhZ.js} +91 -45
- package/dist/{ja-CeHU0EaY.js → ja-axQPxMJ-.js} +3 -3
- package/dist/operations-CIB99rIY.js +95 -0
- package/dist/operations.d.ts +1 -0
- package/dist/operations.js +1 -0
- package/dist/{page-Bzrj24sJ.js → page-yo1cw1kW.js} +1 -1
- package/dist/paymentPort-p1jV44Zz.js +203 -0
- package/dist/preview.js +8 -1
- package/dist/{profile-1em_lcxq.js → profile-DBsXLvvI.js} +48 -48
- package/dist/rich-text.js +16 -16
- package/dist/{schema-WnobuwLg.js → schema-Bs_BUUNv.js} +526 -265
- package/dist/schema.js +66 -88
- package/dist/types/access/src/handoff.d.ts +19 -14
- 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/oidc.d.ts +12 -2
- 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/contract/src/api/define.d.ts +165 -0
- package/dist/types/contract/src/apiKeys.d.ts +6 -2
- package/dist/types/contract/src/app.d.ts +32 -7
- package/dist/types/contract/src/appChannels.d.ts +152 -0
- package/dist/types/contract/src/appDefinition.d.ts +11 -5
- package/dist/types/contract/src/appDependencies.d.ts +107 -24
- package/dist/types/contract/src/appIdentities.d.ts +21 -0
- package/dist/types/contract/src/appInbound.d.ts +53 -0
- package/dist/types/contract/src/appMail.d.ts +106 -0
- package/dist/types/contract/src/appSecrets.d.ts +63 -0
- package/dist/types/contract/src/appServer.d.ts +460 -45
- package/dist/types/contract/src/approvals.d.ts +1 -1
- package/dist/types/contract/src/apps.d.ts +126 -60
- package/dist/types/contract/src/auditActions.d.ts +2 -2
- package/dist/types/contract/src/auditLabels.d.ts +120 -15
- package/dist/types/contract/src/authorize.d.ts +42 -14
- package/dist/types/contract/src/bridge.d.ts +35 -36
- package/dist/types/contract/src/consents.d.ts +29 -27
- package/dist/types/contract/src/deletion.d.ts +18 -0
- package/dist/types/contract/src/embeds.d.ts +26 -90
- package/dist/types/contract/src/{customerLabels.d.ts → endUserLabels.d.ts} +6 -9
- package/dist/types/contract/src/endUsers.d.ts +244 -0
- package/dist/types/contract/src/errorLabels.d.ts +67 -37
- package/dist/types/contract/src/errorLabelsEn.d.ts +50 -33
- package/dist/types/contract/src/errors.d.ts +28 -16
- package/dist/types/contract/src/eventSchemas.d.ts +70 -0
- package/dist/types/contract/src/eventTraces.d.ts +41 -0
- package/dist/types/contract/src/failureStatus.d.ts +14 -22
- package/dist/types/contract/src/fieldAccess.d.ts +8 -8
- package/dist/types/contract/src/formLabels.d.ts +3 -0
- package/dist/types/contract/src/forms.d.ts +4 -0
- 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 +44 -19
- package/dist/types/contract/src/identifiers.d.ts +45 -17
- package/dist/types/contract/src/ids.d.ts +18 -10
- package/dist/types/contract/src/import.d.ts +17 -16
- package/dist/types/contract/src/index.d.ts +57 -29
- package/dist/types/contract/src/integrationGraph.d.ts +83 -0
- package/dist/types/contract/src/issueLabels.d.ts +121 -81
- package/dist/types/contract/src/issueLabelsEn.d.ts +61 -41
- package/dist/types/contract/src/manage.d.ts +16 -7
- package/dist/types/contract/src/manageLabels.d.ts +2 -0
- package/dist/types/contract/src/manifestText.d.ts +66 -0
- package/dist/types/contract/src/messagePort.d.ts +208 -0
- package/dist/types/contract/src/migration.d.ts +2 -2
- package/dist/types/contract/src/notices.d.ts +37 -0
- package/dist/types/contract/src/operationEffects.d.ts +39 -0
- package/dist/types/contract/src/operatorOperations.d.ts +104 -110
- package/dist/types/contract/src/outbound.d.ts +29 -0
- package/dist/types/contract/src/paths.d.ts +13 -0
- package/dist/types/contract/src/paymentPort.d.ts +129 -0
- package/dist/types/contract/src/pending.d.ts +2 -0
- package/dist/types/contract/src/permissions.d.ts +7 -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 +127 -56
- package/dist/types/contract/src/readPages.d.ts +92 -0
- package/dist/types/contract/src/recordLabels.d.ts +6 -0
- package/dist/types/contract/src/roles.d.ts +7 -4
- 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/contract/src/settingProblems.d.ts +18 -1
- package/dist/types/contract/src/settings.d.ts +5 -7
- package/dist/types/contract/src/siteDeclaration.d.ts +7 -7
- package/dist/types/contract/src/siteIndex.d.ts +76 -0
- package/dist/types/contract/src/transfer.d.ts +1 -1
- package/dist/types/contract/src/trial.d.ts +4 -1
- package/dist/types/contract/src/versions.d.ts +1 -3
- package/dist/types/contract/src/viewEvent.d.ts +0 -9
- package/dist/types/contract/src/webhooks.d.ts +24 -3
- package/dist/types/contract/src/workflow.d.ts +16 -19
- package/dist/types/contract/src/workspaceItems.d.ts +23 -7
- package/dist/types/contract/src/workspacePaths.d.ts +1 -1
- package/dist/types/rich-text/src/html.d.ts +1 -1
- package/dist/types/rich-text/src/index.d.ts +8 -7
- package/dist/types/rich-text/src/labels/en.d.ts +1 -1
- package/dist/types/rich-text/src/labels/ja.d.ts +2 -2
- package/dist/types/rich-text/src/library.d.ts +1 -1
- package/dist/types/rich-text/src/media.d.ts +2 -0
- package/dist/types/rich-text/src/normalize.d.ts +1 -1
- package/dist/types/rich-text/src/problems.d.ts +5 -5
- package/dist/types/rich-text/src/profile.d.ts +10 -10
- package/dist/types/rich-text/src/render.d.ts +1 -1
- package/dist/types/rich-text/src/schema.d.ts +2 -2
- package/dist/types/rich-text/src/standard.d.ts +4 -4
- package/dist/types/rich-text/src/types.d.ts +2 -2
- package/dist/types/schema/src/audience.d.ts +1 -3
- package/dist/types/schema/src/capabilities.d.ts +18 -27
- package/dist/types/schema/src/changes.d.ts +3 -1
- package/dist/types/schema/src/collection.d.ts +142 -111
- package/dist/types/schema/src/defaultSchema.d.ts +8 -2
- package/dist/types/schema/src/fieldIds.d.ts +18 -0
- package/dist/types/schema/src/file.d.ts +24 -11
- 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/schema/src/imageMetadata.d.ts +9 -0
- package/dist/types/schema/src/index.d.ts +19 -10
- package/dist/types/schema/src/indexes.d.ts +11 -0
- package/dist/types/schema/src/input.d.ts +1 -1
- package/dist/types/schema/src/integrity.d.ts +8 -7
- package/dist/types/schema/src/kinds.d.ts +26 -0
- package/dist/types/schema/src/labels/en.d.ts +89 -46
- package/dist/types/schema/src/labels/ja.d.ts +92 -46
- package/dist/types/schema/src/mediaUrl.d.ts +26 -33
- package/dist/types/schema/src/page.d.ts +4 -4
- package/dist/types/schema/src/problems.d.ts +85 -42
- package/dist/types/schema/src/refs.d.ts +0 -9
- package/dist/types/schema/src/schema.d.ts +17 -12
- package/dist/types/schema/src/selfOps.d.ts +20 -19
- package/dist/types/schema/src/traits.d.ts +28 -0
- package/dist/types/schema/src/typesSource.d.ts +1 -1
- package/dist/types/schema/src/values.d.ts +5 -2
- package/dist/types/schema/src/widening.d.ts +3 -0
- package/dist/types/sdk/src/analytics.d.ts +2 -1
- package/dist/types/sdk/src/app.d.ts +43 -14
- 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 +2 -4
- package/dist/types/sdk/src/code.d.ts +61 -0
- package/dist/types/sdk/src/delegation.d.ts +13 -3
- package/dist/types/sdk/src/delivery/changes.d.ts +4 -4
- package/dist/types/sdk/src/delivery/client.d.ts +33 -22
- package/dist/types/sdk/src/delivery/fields.d.ts +3 -3
- package/dist/types/sdk/src/delivery/index.d.ts +3 -3
- package/dist/types/sdk/src/delivery/media.d.ts +5 -8
- package/dist/types/sdk/src/delivery/query.d.ts +15 -11
- package/dist/types/sdk/src/delivery/schema.d.ts +1 -1
- package/dist/types/sdk/src/delivery/values.d.ts +10 -14
- package/dist/types/sdk/src/delivery.d.ts +2 -2
- 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 +187 -0
- package/dist/types/sdk/src/i18n.d.ts +2 -2
- package/dist/types/sdk/src/integrations.d.ts +14 -21
- 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 -2
- package/dist/types/sdk/src/schema.d.ts +1 -1
- 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/types.d.ts +1 -1
- package/dist/{types-B77qvqPJ.js → types-CYnY-63C.js} +5 -6
- package/dist/types.js +1 -1
- package/dist/{typesSource-CWybQYus.js → typesSource-BTA9-rcB.js} +17 -15
- package/package.json +32 -6
- package/dist/apps-BxnJ1RlU.js +0 -435
- package/dist/bridge-DtHw9hS6.js +0 -74
- package/dist/collection-BEOxeISR.js +0 -189
- package/dist/customers-DTbL0qn6.js +0 -86
- package/dist/customers.d.ts +0 -1
- package/dist/customers.js +0 -185
- package/dist/embeds-B5V54Zur.js +0 -34
- package/dist/ids--RF7hGyC.js +0 -36
- package/dist/src-sazhzYui.js +0 -71
- package/dist/types/contract/src/customers.d.ts +0 -266
- package/dist/types/schema/src/legacy.d.ts +0 -2
- package/dist/types/schema/src/media.d.ts +0 -5
- package/dist/types/sdk/src/customers.d.ts +0 -184
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import { c as DECLARED_COLLECTION_KINDS, n as RESERVED_FIELD_KEYS, o as AGGREGATE_BUCKETS, r as fieldDefSchema, s as AGGREGATE_OPS, t as COLLECTION_SLUG_PATTERN } from "./schema-Bs_BUUNv.js";
|
|
2
|
+
import { s as ADDRESS_CHANNELS } from "./endUsers-DODfjnv1.js";
|
|
3
|
+
import { n as infraIdOfUuid, t as SECRET_TOKEN_PREFIXES } from "./ids-DmtIoqBX.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
// ../contract/src/messagePort.ts
|
|
6
|
+
/** ポートの id */
|
|
7
|
+
const MESSAGE_PORT = "tunasand:message@1";
|
|
8
|
+
/** 受信のイベントの名前 */
|
|
9
|
+
const MESSAGE_RECEIVED = "message.received";
|
|
10
|
+
/** 能力の形(text、image か `<名前空間>.<名前>`) */
|
|
11
|
+
const MESSAGE_CAPABILITY = /^(text|image|[a-z][a-z0-9_]{0,31}\.[a-z][a-z0-9_]{0,31})$/;
|
|
12
|
+
/** 上限(1回の送信のメッセージの数、テキストの字数、URL の字数、名前空間つきの本文のバイト数、冪等キーの字数、受信の操作のデータの字数) */
|
|
13
|
+
const MESSAGE_LIMITS = {
|
|
14
|
+
perSend: 5,
|
|
15
|
+
textMaxChars: 5e3,
|
|
16
|
+
urlMaxChars: 2e3,
|
|
17
|
+
extensionMaxBytes: 3e4,
|
|
18
|
+
idempotencyKeyMaxChars: 128,
|
|
19
|
+
actionDataMaxChars: 300,
|
|
20
|
+
eventIdMaxChars: 200,
|
|
21
|
+
addressMaxChars: 254,
|
|
22
|
+
nameMaxChars: 200
|
|
23
|
+
};
|
|
24
|
+
const httpsUrl = z.string().max(MESSAGE_LIMITS.urlMaxChars).regex(/^https:\/\/\S+$/);
|
|
25
|
+
const byteLength = (value) => new TextEncoder().encode(JSON.stringify(value)).length;
|
|
26
|
+
/** 名前空間つきの能力のメッセージ(中身の検査はプロバイダー) */
|
|
27
|
+
const extensionMessage = z.object({ kind: z.string().regex(MESSAGE_CAPABILITY).refine((k) => k.includes("."), { message: "message_kind" }) }).catchall(z.unknown()).refine((m) => byteLength(m) <= MESSAGE_LIMITS.extensionMaxBytes, { message: "message_too_large" });
|
|
28
|
+
/** メッセージ(送信と受信で同じ形) */
|
|
29
|
+
const portMessage = z.union([
|
|
30
|
+
z.strictObject({
|
|
31
|
+
kind: z.literal("text"),
|
|
32
|
+
text: z.string().trim().min(1).max(MESSAGE_LIMITS.textMaxChars)
|
|
33
|
+
}),
|
|
34
|
+
z.strictObject({
|
|
35
|
+
kind: z.literal("image"),
|
|
36
|
+
url: httpsUrl,
|
|
37
|
+
previewUrl: httpsUrl.optional()
|
|
38
|
+
}),
|
|
39
|
+
extensionMessage
|
|
40
|
+
]);
|
|
41
|
+
const endUserTarget = z.strictObject({ endUserId: z.string().min(1).max(64) });
|
|
42
|
+
const addressTarget = z.strictObject({
|
|
43
|
+
channel: z.enum(ADDRESS_CHANNELS),
|
|
44
|
+
address: z.string().trim().min(1).max(MESSAGE_LIMITS.addressMaxChars)
|
|
45
|
+
});
|
|
46
|
+
z.strictObject({
|
|
47
|
+
to: z.union([endUserTarget, addressTarget]),
|
|
48
|
+
channel: z.enum(ADDRESS_CHANNELS).optional(),
|
|
49
|
+
channelId: z.string().min(1).max(64).optional(),
|
|
50
|
+
purpose: z.string().min(1).max(64),
|
|
51
|
+
messages: z.array(portMessage).min(1).max(MESSAGE_LIMITS.perSend),
|
|
52
|
+
idempotencyKey: z.string().min(1).max(MESSAGE_LIMITS.idempotencyKeyMaxChars),
|
|
53
|
+
replyTo: z.strictObject({ eventId: z.string().min(1).max(MESSAGE_LIMITS.eventIdMaxChars) }).optional()
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* 送信しない理由
|
|
57
|
+
* - no_identity: 宛先のチャネルの identity かアドレスがない、blocked: 宛先がチャネルで受け取りを止めた、no_consent: 同意がない、
|
|
58
|
+
* suppressed: 抑止の一覧にある、no_channel: チャネルの指定がなく、プロバイダーの種類の既定のチャネルもない、
|
|
59
|
+
* test_environment: live 以外の環境(送信しない)
|
|
60
|
+
*/
|
|
61
|
+
const MESSAGE_SKIP_REASONS = [
|
|
62
|
+
"no_identity",
|
|
63
|
+
"blocked",
|
|
64
|
+
"no_consent",
|
|
65
|
+
"suppressed",
|
|
66
|
+
"no_channel",
|
|
67
|
+
"test_environment"
|
|
68
|
+
];
|
|
69
|
+
z.strictObject({
|
|
70
|
+
channelId: z.string().min(1).max(64).optional(),
|
|
71
|
+
eventId: z.string().min(1).max(MESSAGE_LIMITS.eventIdMaxChars),
|
|
72
|
+
from: z.union([endUserTarget, addressTarget.extend({ name: z.string().max(MESSAGE_LIMITS.nameMaxChars).optional() })]),
|
|
73
|
+
at: z.iso.datetime(),
|
|
74
|
+
redelivery: z.boolean(),
|
|
75
|
+
items: z.array(z.union([portMessage, z.strictObject({
|
|
76
|
+
kind: z.literal("action"),
|
|
77
|
+
data: z.string().max(MESSAGE_LIMITS.actionDataMaxChars)
|
|
78
|
+
})])).min(1).max(MESSAGE_LIMITS.perSend)
|
|
79
|
+
});
|
|
80
|
+
// ../contract/src/appDependencies.ts
|
|
81
|
+
/** コードを持つアプリのうち、登録簿の ID が migration で決まっていて、ほかのアプリの依存先になるもの */
|
|
82
|
+
const BUNDLED_APP_IDS = { content: infraIdOfUuid("b5b1ff53-7997-52f1-9ae1-4c7f46e40996") };
|
|
83
|
+
/** 宣言の上限(計画のノードの数は一括の大きさを抑えるため。全部か無しなので分けられない) */
|
|
84
|
+
const APP_DEPENDENCY_LIMITS = {
|
|
85
|
+
entriesMax: 100,
|
|
86
|
+
textMax: 500,
|
|
87
|
+
planNodesMax: 20
|
|
88
|
+
};
|
|
89
|
+
[...RESERVED_FIELD_KEYS];
|
|
90
|
+
const PORT_ID = /^[a-z][a-z0-9-]{0,31}:[a-z][a-z0-9_-]{0,63}@[1-9]\d{0,3}$/;
|
|
91
|
+
/** ポートの能力の形(text、image か `<名前空間>.<名前>`) */
|
|
92
|
+
const portCapability = z.string().regex(MESSAGE_CAPABILITY);
|
|
93
|
+
const settingKey = z.string().regex(/^[a-z][a-zA-Z0-9_]{0,63}(\.[a-z][a-zA-Z0-9_]{0,63}){0,3}$/);
|
|
94
|
+
const settingValue = z.union([
|
|
95
|
+
z.boolean(),
|
|
96
|
+
z.string().max(APP_DEPENDENCY_LIMITS.textMax),
|
|
97
|
+
z.number(),
|
|
98
|
+
z.array(z.string().max(APP_DEPENDENCY_LIMITS.textMax)).max(APP_DEPENDENCY_LIMITS.entriesMax)
|
|
99
|
+
]);
|
|
100
|
+
const list = (item) => z.array(item).max(APP_DEPENDENCY_LIMITS.entriesMax);
|
|
101
|
+
const label = z.string().trim().min(1).max(80);
|
|
102
|
+
const yen = z.number().int().nonnegative();
|
|
103
|
+
const dependencySchema = z.strictObject({
|
|
104
|
+
app: z.string().min(1).max(64),
|
|
105
|
+
kind: z.enum(["required", "optional"]),
|
|
106
|
+
major: z.number().int().positive(),
|
|
107
|
+
min_version: z.number().int().positive().optional(),
|
|
108
|
+
defaults: z.record(settingKey, settingValue).optional(),
|
|
109
|
+
expose: list(settingKey).optional()
|
|
110
|
+
});
|
|
111
|
+
const rowFieldSchema = z.strictObject({
|
|
112
|
+
key: z.string().regex(/^[a-z][a-zA-Z0-9_]{0,63}$/),
|
|
113
|
+
label,
|
|
114
|
+
type: z.enum(["text", "long_text"]),
|
|
115
|
+
required: z.boolean().optional()
|
|
116
|
+
});
|
|
117
|
+
const settingSchema = z.strictObject({
|
|
118
|
+
key: settingKey,
|
|
119
|
+
label,
|
|
120
|
+
type: z.enum([
|
|
121
|
+
"boolean",
|
|
122
|
+
"text",
|
|
123
|
+
"number",
|
|
124
|
+
"select",
|
|
125
|
+
"collection",
|
|
126
|
+
"collections",
|
|
127
|
+
"channels",
|
|
128
|
+
"accounts",
|
|
129
|
+
"repeater"
|
|
130
|
+
]),
|
|
131
|
+
options: list(z.string().min(1).max(80)).min(1).optional(),
|
|
132
|
+
fields: z.array(rowFieldSchema).min(1).max(20).optional(),
|
|
133
|
+
default: settingValue.optional(),
|
|
134
|
+
requires: z.string().min(1).max(64).optional(),
|
|
135
|
+
min: z.number().optional(),
|
|
136
|
+
unit: z.string().min(1).max(20).optional()
|
|
137
|
+
}).refine((s) => s.type === "select" === (s.options !== void 0), { path: ["options"] }).refine((s) => s.type === "repeater" === (s.fields !== void 0), { path: ["fields"] }).refine((s) => new Set(s.fields?.map((f) => f.key)).size === (s.fields?.length ?? 0), { path: ["fields"] }).refine((s) => s.default === void 0 || (s.type === "select" ? s.options?.includes(String(s.default)) : s.type === "collections" || s.type === "channels" || s.type === "accounts" ? Array.isArray(s.default) : typeof s.default === (s.type === "text" || s.type === "collection" ? "string" : s.type)), { path: ["default"] });
|
|
138
|
+
const uniqueSchema = z.strictObject({
|
|
139
|
+
key: z.string().min(1).max(64),
|
|
140
|
+
fields: z.array(z.string().min(1)).min(1).max(3),
|
|
141
|
+
exact: z.boolean().optional()
|
|
142
|
+
});
|
|
143
|
+
const fieldKey = z.string().min(1).max(64);
|
|
144
|
+
const collectionSchema = z.strictObject({
|
|
145
|
+
name: z.string().max(64).regex(COLLECTION_SLUG_PATTERN),
|
|
146
|
+
label,
|
|
147
|
+
existing: z.literal(true).optional(),
|
|
148
|
+
internal: z.boolean().optional(),
|
|
149
|
+
private: z.boolean().optional(),
|
|
150
|
+
fields: list(fieldDefSchema),
|
|
151
|
+
unique: list(uniqueSchema).optional(),
|
|
152
|
+
kind: z.enum(DECLARED_COLLECTION_KINDS).optional(),
|
|
153
|
+
time: fieldKey.optional(),
|
|
154
|
+
dimensions: list(fieldKey).optional(),
|
|
155
|
+
subject: fieldKey.optional(),
|
|
156
|
+
bucket: z.enum(AGGREGATE_BUCKETS).optional(),
|
|
157
|
+
measures: list(z.strictObject({
|
|
158
|
+
field: fieldKey,
|
|
159
|
+
op: z.enum(AGGREGATE_OPS)
|
|
160
|
+
})).optional(),
|
|
161
|
+
retention_days: z.number().int().positive().optional()
|
|
162
|
+
});
|
|
163
|
+
z.object({
|
|
164
|
+
major: z.number().int().positive().optional(),
|
|
165
|
+
requires: list(dependencySchema).optional(),
|
|
166
|
+
uses: list(z.strictObject({
|
|
167
|
+
port: z.string().regex(PORT_ID),
|
|
168
|
+
required: z.boolean(),
|
|
169
|
+
capabilities: list(portCapability).optional()
|
|
170
|
+
})).optional(),
|
|
171
|
+
provides: list(z.strictObject({
|
|
172
|
+
port: z.string().regex(PORT_ID),
|
|
173
|
+
route: z.string().startsWith("/api/").max(2048).optional(),
|
|
174
|
+
capabilities: list(portCapability).optional(),
|
|
175
|
+
consent_channel: z.enum(ADDRESS_CHANNELS).optional()
|
|
176
|
+
})).optional(),
|
|
177
|
+
collections: list(collectionSchema).optional(),
|
|
178
|
+
settings: list(settingSchema).optional(),
|
|
179
|
+
price: z.strictObject({
|
|
180
|
+
setup: yen.optional(),
|
|
181
|
+
monthly: yen.optional(),
|
|
182
|
+
usage: z.string().trim().min(1).max(APP_DEPENDENCY_LIMITS.textMax).optional(),
|
|
183
|
+
currency: z.literal("JPY")
|
|
184
|
+
}).optional()
|
|
185
|
+
});
|
|
186
|
+
// ../contract/src/authorize.ts
|
|
187
|
+
/** 判定の操作(コレクションの操作とエンドユーザーの操作) */
|
|
188
|
+
const OPERATIONS = [
|
|
189
|
+
"read",
|
|
190
|
+
"read_drafts",
|
|
191
|
+
"read_entitled",
|
|
192
|
+
"create",
|
|
193
|
+
"update",
|
|
194
|
+
"publish",
|
|
195
|
+
"delete",
|
|
196
|
+
"submit",
|
|
197
|
+
"verify",
|
|
198
|
+
"read_state",
|
|
199
|
+
"link",
|
|
200
|
+
"ensure",
|
|
201
|
+
"issue_token",
|
|
202
|
+
"refresh_token",
|
|
203
|
+
"migrate_links",
|
|
204
|
+
"read_identities",
|
|
205
|
+
"write_entitlements",
|
|
206
|
+
"update_status",
|
|
207
|
+
"read_display_name",
|
|
208
|
+
"read_consents",
|
|
209
|
+
"check_consent",
|
|
210
|
+
"write_consents",
|
|
211
|
+
"write_suppression",
|
|
212
|
+
"purchase",
|
|
213
|
+
"read_self",
|
|
214
|
+
"create_self",
|
|
215
|
+
"update_self",
|
|
216
|
+
"delete_self"
|
|
217
|
+
];
|
|
218
|
+
// ../contract/src/identifiers.ts
|
|
219
|
+
/** 操作の履歴の主体の種類(アカウント・運営者・インストール・アカウントの代わり・人の代わり・コア) */
|
|
220
|
+
const ACTOR_KINDS = [
|
|
221
|
+
"account",
|
|
222
|
+
"operator",
|
|
223
|
+
"installation",
|
|
224
|
+
"on_behalf_of_account",
|
|
225
|
+
"on_behalf_of_end_user",
|
|
226
|
+
"system"
|
|
227
|
+
];
|
|
228
|
+
SECRET_TOKEN_PREFIXES.endUserRefreshToken;
|
|
229
|
+
/**
|
|
230
|
+
* インストールのトークンの形(GitHub App の形: アプリの鍵で署名したアプリの JWT と交換する)
|
|
231
|
+
* - JWS のコンパクトな形。発行と検証はどちらも Tunasand だけで、署名の鍵は SECRETS_KEY からプロジェクトごとに HKDF で導く
|
|
232
|
+
* - アプリの JWT: ES256 か RS256、iss はアプリの ID、aud はプロジェクトの配信の基点、exp − iat は appJwtMaxSec 秒まで
|
|
233
|
+
* - 時計のずれ: iat の未来と exp の過去を skewSec 秒まで許す
|
|
234
|
+
*/
|
|
235
|
+
const INSTALLATION_TOKEN = {
|
|
236
|
+
typ: "tunasand-installation+jwt",
|
|
237
|
+
alg: "HS256",
|
|
238
|
+
ttlSec: 3600,
|
|
239
|
+
appJwtMaxSec: 600,
|
|
240
|
+
skewSec: 60
|
|
241
|
+
};
|
|
242
|
+
// ../contract/src/permissions.ts
|
|
243
|
+
/** 操作 */
|
|
244
|
+
const ACTIONS = [
|
|
245
|
+
"read",
|
|
246
|
+
"create",
|
|
247
|
+
"update",
|
|
248
|
+
"publish",
|
|
249
|
+
"delete"
|
|
250
|
+
];
|
|
251
|
+
// ../contract/src/settings.ts
|
|
252
|
+
const PREFIX$1 = "settings:";
|
|
253
|
+
/** 権限の表での設定の領域の id */
|
|
254
|
+
const settingsTarget = (area) => `${PREFIX$1}${area}`;
|
|
255
|
+
Object.fromEntries(ACTIONS.map((a) => [a, "all"]));
|
|
256
|
+
/** 管理の領域 admin を扱えるかの可否の ID(/api/me の can。操作の宣言の ID と重ならない専用の ID) */
|
|
257
|
+
const ADMIN_AREA_OPERATION = "area.admin";
|
|
258
|
+
// ../contract/src/manage.ts
|
|
259
|
+
const PREFIX = "manage:";
|
|
260
|
+
/** 権限の表での管理の権限の id */
|
|
261
|
+
const manageTarget = (check) => `${PREFIX}${check}`;
|
|
262
|
+
manageTarget("request_production");
|
|
263
|
+
// ../contract/src/readPages.ts
|
|
264
|
+
/**
|
|
265
|
+
* 資源の集合ごとの件数の上限(作成で超える分を拒み、一覧は上限内の全件を1ページで返す。上限は1ページの件数の最大以下)
|
|
266
|
+
* - 一覧の宣言の boundedList はこのキーを必須にする。キーのない一覧は索引と keyset で読む(docs/specs/http-api.md の「一覧」)
|
|
267
|
+
* - コードとアプリの宣言から導く一覧は、宣言の数の想定の上限(超えた分は次のページ)
|
|
268
|
+
*/
|
|
269
|
+
const COLLECTION_SIZE_LIMITS = {
|
|
270
|
+
/** 保存したビュー(コレクションごとの、個人とチームのビューの合計) */
|
|
271
|
+
views: 50,
|
|
272
|
+
/** プロジェクトのチャネル(動いているチャネルの全部の種類の合計) */
|
|
273
|
+
channels: 50,
|
|
274
|
+
/** プロジェクトのロール */
|
|
275
|
+
roles: 50,
|
|
276
|
+
/** 保留中の招待 */
|
|
277
|
+
invitations: 100,
|
|
278
|
+
/** 運営者のサポートのアクセスの付与(取り消していないもの) */
|
|
279
|
+
supportAccess: 20,
|
|
280
|
+
/** 運営者 */
|
|
281
|
+
operators: 50,
|
|
282
|
+
/** プロジェクトのアプリのインストール(サイトとデプロイを含む) */
|
|
283
|
+
installations: 100,
|
|
284
|
+
/** 登録したアプリ(基盤の全体) */
|
|
285
|
+
apps: 100,
|
|
286
|
+
/** コードのアプリ(標準アプリとその候補) */
|
|
287
|
+
codeApps: 50,
|
|
288
|
+
/** インストールしたアプリの埋め込みの宣言(場所ごと) */
|
|
289
|
+
embeds: 100,
|
|
290
|
+
/** アプリが宣言する秘密値(インストールごと、アプリの宣言の上限と同じ) */
|
|
291
|
+
installationSecrets: 20,
|
|
292
|
+
/** ジョブの宣言 */
|
|
293
|
+
jobs: 50,
|
|
294
|
+
/** ロールの表の対象(コレクションとアプリ) */
|
|
295
|
+
permissionTargets: 100,
|
|
296
|
+
/** 通知の1つの提供元の件数 */
|
|
297
|
+
notices: 100,
|
|
298
|
+
/** Webhook */
|
|
299
|
+
webhooks: 50,
|
|
300
|
+
/** 外部の関数 */
|
|
301
|
+
functions: 50,
|
|
302
|
+
/** 外部の画面 */
|
|
303
|
+
screens: 50,
|
|
304
|
+
/** 読み取りのトークン */
|
|
305
|
+
readTokens: 50,
|
|
306
|
+
/** API キー */
|
|
307
|
+
apiKeys: 50,
|
|
308
|
+
/** 送信のドメイン */
|
|
309
|
+
mailDomains: 10,
|
|
310
|
+
/** MCP の接続(プロジェクトの全アカウントの合計) */
|
|
311
|
+
mcpConnections: 100,
|
|
312
|
+
/** プロジェクトの環境 */
|
|
313
|
+
environments: 20,
|
|
314
|
+
/** 定期の書き出し(対象ごと。daily の30日と monthly の365日の保持の期間で決まる、terraform/main.tf のライフサイクル) */
|
|
315
|
+
backups: 50,
|
|
316
|
+
/** 組織のメンバー(招待中を含む。正は platform で、platform の一覧にページ送りがない) */
|
|
317
|
+
organizationMembers: 100,
|
|
318
|
+
/** 記事の作成の絵のタッチ(標準アプリ writing) */
|
|
319
|
+
artStyles: 50,
|
|
320
|
+
/** エンドユーザーのチャネルのブロック(人ごと。プロジェクトのチャネルと、宛先の email と sms) */
|
|
321
|
+
consentChannels: 60,
|
|
322
|
+
/** 閲覧数の順位の件数(標準アプリ content-views の順位の limit の最大) */
|
|
323
|
+
rankingRecords: 100
|
|
324
|
+
};
|
|
325
|
+
COLLECTION_SIZE_LIMITS.installationSecrets;
|
|
326
|
+
// ../contract/src/appChannels.ts
|
|
327
|
+
/** チャネルの能力(送信、受信、決済) */
|
|
328
|
+
const CHANNEL_CAPABILITIES = [
|
|
329
|
+
"send",
|
|
330
|
+
"receive",
|
|
331
|
+
"payment"
|
|
332
|
+
];
|
|
333
|
+
/** チャネルのアドレスの形(registered_domain: プロジェクトの登録したドメインの上のローカル部) */
|
|
334
|
+
const CHANNEL_ADDRESS_KINDS = ["registered_domain"];
|
|
335
|
+
/** 宣言の上限(種類の数、見出しの字数、種類ごとの設定の数、設定の形の正規表現の字数) */
|
|
336
|
+
const APP_CHANNEL_KIND_LIMITS = {
|
|
337
|
+
kindsMax: 10,
|
|
338
|
+
labelMaxChars: 80,
|
|
339
|
+
settingsMax: 30,
|
|
340
|
+
patternMaxChars: 500
|
|
341
|
+
};
|
|
342
|
+
/** 設定の形の正規表現(宣言の pattern の全体の一致。誤った宣言は null) */
|
|
343
|
+
function channelSettingPattern(pattern) {
|
|
344
|
+
try {
|
|
345
|
+
return new RegExp(`^(?:${pattern})$`, "u");
|
|
346
|
+
} catch {
|
|
347
|
+
return null;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
/** チャネルの値の上限(名前の字数、文字の設定の値の字数、アドレスのローカル部の字数、外部のキーの字数) */
|
|
351
|
+
const APP_CHANNEL_LIMITS = {
|
|
352
|
+
nameMaxChars: 80,
|
|
353
|
+
textSettingMaxChars: 2e3,
|
|
354
|
+
localMaxChars: 64,
|
|
355
|
+
externalKeyMaxChars: 255
|
|
356
|
+
};
|
|
357
|
+
/** 外部のアカウントのモード(live は本番のアカウント、sandbox は live 以外の環境が繋ぐサンドボックスのアカウント) */
|
|
358
|
+
const CHANNEL_MODES = ["live", "sandbox"];
|
|
359
|
+
/** アプリの MCP のツールとプロンプトの名前の接頭辞(名前空間の `.` と `-` を `_` にする。クライアントのツールの名前は英数字、`_`、`-` だけを受ける) */
|
|
360
|
+
const appToolPrefixOf = (namespace) => `${namespace.replace(/[.-]/g, "_")}_`;
|
|
361
|
+
/**
|
|
362
|
+
* アプリの鍵の用途(登録する公開鍵の JWK の use)
|
|
363
|
+
* - runtime: アプリの JWT をインストールのトークンに交換する鍵(サイトの実行時に持つ。use なしか sig)
|
|
364
|
+
* - deploy: ホスティングするサイトへのアップロードだけに使う鍵(サイトの実行時に持たせない。交換には使えない)
|
|
365
|
+
*/
|
|
366
|
+
const APP_KEY_USES = {
|
|
367
|
+
runtime: "sig",
|
|
368
|
+
deploy: "tunasand-deploy"
|
|
369
|
+
};
|
|
370
|
+
new Set(OPERATIONS);
|
|
371
|
+
settingsTarget("data"), settingsTarget("end_users"), manageTarget("schema");
|
|
372
|
+
/** マニフェストの項目(登録はこれ以外の項目を拒否する) */
|
|
373
|
+
const APP_MANIFEST_KEYS = [
|
|
374
|
+
"manifest_version",
|
|
375
|
+
"label",
|
|
376
|
+
"kind",
|
|
377
|
+
"description",
|
|
378
|
+
"targets",
|
|
379
|
+
"audit_actions",
|
|
380
|
+
"messages",
|
|
381
|
+
"problems",
|
|
382
|
+
"en",
|
|
383
|
+
"permissions",
|
|
384
|
+
"connections",
|
|
385
|
+
"emits",
|
|
386
|
+
"capabilities",
|
|
387
|
+
"destinations",
|
|
388
|
+
"outbound",
|
|
389
|
+
"secrets",
|
|
390
|
+
"operator_secrets",
|
|
391
|
+
"channel_kinds",
|
|
392
|
+
"events",
|
|
393
|
+
"mail",
|
|
394
|
+
"ui",
|
|
395
|
+
"tools",
|
|
396
|
+
"own_site",
|
|
397
|
+
"hosting",
|
|
398
|
+
"deletion_url",
|
|
399
|
+
"major",
|
|
400
|
+
"requires",
|
|
401
|
+
"uses",
|
|
402
|
+
"provides",
|
|
403
|
+
"collections",
|
|
404
|
+
"settings",
|
|
405
|
+
"price"
|
|
406
|
+
];
|
|
407
|
+
new Set(APP_MANIFEST_KEYS);
|
|
408
|
+
export { MESSAGE_RECEIVED as _, APP_CHANNEL_LIMITS as a, CHANNEL_MODES as c, ADMIN_AREA_OPERATION as d, ACTOR_KINDS as f, MESSAGE_PORT as g, MESSAGE_LIMITS as h, APP_CHANNEL_KIND_LIMITS as i, channelSettingPattern as l, BUNDLED_APP_IDS as m, APP_MANIFEST_KEYS as n, CHANNEL_ADDRESS_KINDS as o, INSTALLATION_TOKEN as p, appToolPrefixOf as r, CHANNEL_CAPABILITIES as s, APP_KEY_USES as t, COLLECTION_SIZE_LIMITS as u, MESSAGE_SKIP_REASONS as v };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types/sdk/src/astro-image.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/astro-image.ts
|
|
2
|
+
const DROPPED = [
|
|
3
|
+
"src",
|
|
4
|
+
"format",
|
|
5
|
+
"quality",
|
|
6
|
+
"densities",
|
|
7
|
+
"widths",
|
|
8
|
+
"formats",
|
|
9
|
+
"layout",
|
|
10
|
+
"fit",
|
|
11
|
+
"position",
|
|
12
|
+
"priority",
|
|
13
|
+
"inferSize",
|
|
14
|
+
"background",
|
|
15
|
+
"kernel"
|
|
16
|
+
];
|
|
17
|
+
const service = {
|
|
18
|
+
getURL: ({ src }) => typeof src === "string" ? src : src.src,
|
|
19
|
+
getHTMLAttributes: (options) => {
|
|
20
|
+
const { src, width, height } = options;
|
|
21
|
+
const natural = typeof src === "string" ? null : src;
|
|
22
|
+
return {
|
|
23
|
+
...Object.fromEntries(Object.entries(options).filter(([k]) => !DROPPED.includes(k))),
|
|
24
|
+
width: width ?? (natural && (height ? Math.round(height * natural.width / natural.height) : natural.width)) ?? void 0,
|
|
25
|
+
height: height ?? (natural && (width ? Math.round(width * natural.height / natural.width) : natural.height)) ?? void 0,
|
|
26
|
+
loading: options.loading ?? "lazy",
|
|
27
|
+
decoding: options.decoding ?? "async"
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
/** 画像の変換の経路(持たない) */
|
|
32
|
+
const GET = () => new Response(null, { status: 404 });
|
|
33
|
+
export { GET, service as default };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { n as defineCode } from "./code-N8pBUDbq.js";
|
|
2
|
+
import { i as withOperations, t as operations } from "./operations-CIB99rIY.js";
|
|
3
|
+
// src/astro-response.ts
|
|
4
|
+
/** 終わりまで受ける本文の上限(これを超えるものは流したまま) */
|
|
5
|
+
const BUFFERED_MAX = 10485760;
|
|
6
|
+
/** 保存を許す応答か(s-maxage の明示があり、保存を拒む指定と Set-Cookie がない、200の応答) */
|
|
7
|
+
function isStorable(method, { status, headers }) {
|
|
8
|
+
if (method !== "GET" || status !== 200 || headers.has("set-cookie")) return false;
|
|
9
|
+
const directives = (headers.get("cache-control") ?? "").toLowerCase().split(",").map((d) => d.trim());
|
|
10
|
+
if (directives.some((d) => /^(?:no-store|no-cache|private)(?:=|$)/.test(d))) return false;
|
|
11
|
+
return directives.some((d) => /^s-maxage="?0*[1-9]\d*"?$/.test(d));
|
|
12
|
+
}
|
|
13
|
+
/** 長さを宣言した応答 */
|
|
14
|
+
async function withLength(method, response, max = BUFFERED_MAX) {
|
|
15
|
+
if (!response.body || response.headers.has("content-length") || !isStorable(method, response)) return response;
|
|
16
|
+
const { status, statusText, headers } = response;
|
|
17
|
+
const reader = response.body.getReader();
|
|
18
|
+
const chunks = [];
|
|
19
|
+
let length = 0;
|
|
20
|
+
for (;;) {
|
|
21
|
+
const { done, value } = await reader.read();
|
|
22
|
+
if (done) break;
|
|
23
|
+
chunks.push(value);
|
|
24
|
+
length += value.byteLength;
|
|
25
|
+
if (length <= max) continue;
|
|
26
|
+
const body = new ReadableStream({
|
|
27
|
+
async pull(controller) {
|
|
28
|
+
const first = chunks.shift();
|
|
29
|
+
if (first) return controller.enqueue(first);
|
|
30
|
+
const next = await reader.read();
|
|
31
|
+
if (next.done) controller.close();
|
|
32
|
+
else controller.enqueue(next.value);
|
|
33
|
+
},
|
|
34
|
+
cancel: (reason) => reader.cancel(reason)
|
|
35
|
+
}, { highWaterMark: 0 });
|
|
36
|
+
return new Response(body, {
|
|
37
|
+
status,
|
|
38
|
+
statusText,
|
|
39
|
+
headers
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const body = new Uint8Array(length);
|
|
43
|
+
let at = 0;
|
|
44
|
+
for (const chunk of chunks) {
|
|
45
|
+
body.set(chunk, at);
|
|
46
|
+
at += chunk.byteLength;
|
|
47
|
+
}
|
|
48
|
+
const declared = new Headers(headers);
|
|
49
|
+
declared.set("content-length", String(length));
|
|
50
|
+
return new Response(body, {
|
|
51
|
+
status,
|
|
52
|
+
statusText,
|
|
53
|
+
headers: declared
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
// src/astro-server.ts
|
|
57
|
+
/** 配信する静的ファイルの操作の名前 */
|
|
58
|
+
const STATIC_FILE_OPERATION = "files.static";
|
|
59
|
+
/** 事前に描画した失敗のページ(読めなければ、本文のない応答) */
|
|
60
|
+
async function errorPageOf(url) {
|
|
61
|
+
const path = new URL(url).pathname.replace(/(?:\/index)?\.html$/, "") || "/";
|
|
62
|
+
return operations().open(STATIC_FILE_OPERATION, { path }).then((r) => r.ok ? r : Promise.reject(/* @__PURE__ */ new Error("error_page")));
|
|
63
|
+
}
|
|
64
|
+
/** 末尾のスラッシュだけが違う、事前に描画したページの場所 */
|
|
65
|
+
function prerenderedPathOf(app, request) {
|
|
66
|
+
const url = new URL(request.url);
|
|
67
|
+
if (!["GET", "HEAD"].includes(request.method) || url.pathname.length < 2 || !url.pathname.endsWith("/")) return null;
|
|
68
|
+
url.pathname = url.pathname.replace(/\/+$/, "");
|
|
69
|
+
if (url.pathname.startsWith("//") || app.match(new Request(url))) return null;
|
|
70
|
+
return app.match(new Request(url), true) ? url.pathname + url.search : null;
|
|
71
|
+
}
|
|
72
|
+
/** 入口 */
|
|
73
|
+
function siteCode(app, handlers = {}) {
|
|
74
|
+
return defineCode(withOperations({
|
|
75
|
+
request: async ({ request }) => {
|
|
76
|
+
if (!app.match(request)) {
|
|
77
|
+
const location = prerenderedPathOf(app, request);
|
|
78
|
+
if (location !== null) return new Response(null, {
|
|
79
|
+
status: 308,
|
|
80
|
+
headers: { location }
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const rendered = await app.render(request, { prerenderedErrorPageFetch: errorPageOf });
|
|
84
|
+
const cookies = [...app.setCookieHeaders(rendered)];
|
|
85
|
+
const headers = new Headers(rendered.headers);
|
|
86
|
+
for (const cookie of cookies) headers.append("set-cookie", cookie);
|
|
87
|
+
const { status, statusText, body } = rendered;
|
|
88
|
+
return withLength(request.method, new Response(body, {
|
|
89
|
+
status,
|
|
90
|
+
statusText,
|
|
91
|
+
headers
|
|
92
|
+
}));
|
|
93
|
+
},
|
|
94
|
+
event: handlers.event ?? null,
|
|
95
|
+
check: handlers.check ?? null,
|
|
96
|
+
schedule: handlers.schedule ?? null
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
export { siteCode as n, STATIC_FILE_OPERATION as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types/sdk/src/astro-server.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as STATIC_FILE_OPERATION, n as siteCode } from "./astro-server-Bwau8F6d.js";
|
package/dist/astro.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './types/sdk/src/astro.js';
|