post-engineer-mcp 1.52.671 → 1.53.662
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/README.md +1 -2
- package/dist/account-shapes.d.ts +2 -0
- package/dist/account-shapes.js +0 -12
- package/dist/account-shapes.js.map +1 -1
- package/dist/action-tool.d.ts +0 -15
- package/dist/action-tool.js +0 -15
- package/dist/action-tool.js.map +1 -1
- package/dist/analytics.js +0 -39
- package/dist/analytics.js.map +1 -1
- package/dist/client-base-url.d.ts +2 -0
- package/dist/client-base-url.js +23 -0
- package/dist/client-base-url.js.map +1 -0
- package/dist/client-batch.js.map +1 -1
- package/dist/client-billing.js +0 -11
- package/dist/client-billing.js.map +1 -1
- package/dist/client-experiments.js +0 -9
- package/dist/client-experiments.js.map +1 -1
- package/dist/client-posts.js +0 -7
- package/dist/client-posts.js.map +1 -1
- package/dist/client-prompts.js +0 -2
- package/dist/client-prompts.js.map +1 -1
- package/dist/client-publish-existing.js +0 -13
- package/dist/client-publish-existing.js.map +1 -1
- package/dist/client-publish-uploaded.d.ts +0 -5
- package/dist/client-publish-uploaded.js +0 -48
- package/dist/client-publish-uploaded.js.map +1 -1
- package/dist/client-publishing-accounts.js +0 -7
- package/dist/client-publishing-accounts.js.map +1 -1
- package/dist/client-telegram.d.ts +4 -0
- package/dist/client-telegram.js +13 -0
- package/dist/client-telegram.js.map +1 -0
- package/dist/client-tool-config.js +0 -7
- package/dist/client-tool-config.js.map +1 -1
- package/dist/client-types.d.ts +11 -87
- package/dist/client-user-media.d.ts +0 -28
- package/dist/client-user-media.js +0 -42
- package/dist/client-user-media.js.map +1 -1
- package/dist/client-video-task.js +0 -5
- package/dist/client-video-task.js.map +1 -1
- package/dist/client.js +6 -119
- package/dist/client.js.map +1 -1
- package/dist/cloned-voice-client.d.ts +0 -8
- package/dist/cloned-voice-client.js +0 -49
- package/dist/cloned-voice-client.js.map +1 -1
- package/dist/cloned-voice-tools.d.ts +0 -5
- package/dist/cloned-voice-tools.js +0 -7
- package/dist/cloned-voice-tools.js.map +1 -1
- package/dist/connect-account.d.ts +14 -0
- package/dist/connect-account.js +47 -26
- package/dist/connect-account.js.map +1 -1
- package/dist/contract-response.js +0 -12
- package/dist/contract-response.js.map +1 -1
- package/dist/contracts/accounts.d.ts +114 -11
- package/dist/contracts/accounts.js +32 -56
- package/dist/contracts/accounts.js.map +1 -1
- package/dist/contracts/billing.d.ts +0 -14
- package/dist/contracts/billing.js +0 -26
- package/dist/contracts/billing.js.map +1 -1
- package/dist/contracts/endpoint.d.ts +0 -11
- package/dist/contracts/endpoint.js +0 -4
- package/dist/contracts/endpoint.js.map +1 -1
- package/dist/contracts/experiments.d.ts +0 -20
- package/dist/contracts/experiments.js +0 -34
- package/dist/contracts/experiments.js.map +1 -1
- package/dist/contracts/media.d.ts +0 -19
- package/dist/contracts/media.js +0 -58
- package/dist/contracts/media.js.map +1 -1
- package/dist/contracts/metrics.d.ts +6 -15
- package/dist/contracts/metrics.js +0 -74
- package/dist/contracts/metrics.js.map +1 -1
- package/dist/contracts/personas.d.ts +98 -19
- package/dist/contracts/personas.js +24 -93
- package/dist/contracts/personas.js.map +1 -1
- package/dist/contracts/posts.d.ts +9 -11
- package/dist/contracts/posts.js +1 -17
- package/dist/contracts/posts.js.map +1 -1
- package/dist/contracts/prompts.d.ts +0 -11
- package/dist/contracts/prompts.js +0 -15
- package/dist/contracts/prompts.js.map +1 -1
- package/dist/contracts/providers.d.ts +4 -17
- package/dist/contracts/providers.js +5 -30
- package/dist/contracts/providers.js.map +1 -1
- package/dist/contracts/schedule-warnings.d.ts +2 -0
- package/dist/contracts/schedule-warnings.js +0 -3
- package/dist/contracts/schedule-warnings.js.map +1 -1
- package/dist/contracts/schedule.d.ts +7 -14
- package/dist/contracts/schedule.js +1 -46
- package/dist/contracts/schedule.js.map +1 -1
- package/dist/contracts/tool-config.d.ts +0 -11
- package/dist/contracts/tool-config.js +0 -26
- package/dist/contracts/tool-config.js.map +1 -1
- package/dist/contracts/upload-types.d.ts +0 -3
- package/dist/contracts/upload-types.js +0 -10
- package/dist/contracts/upload-types.js.map +1 -1
- package/dist/contracts/video-tasks.d.ts +0 -23
- package/dist/contracts/video-tasks.js +0 -42
- package/dist/contracts/video-tasks.js.map +1 -1
- package/dist/contracts/videos.d.ts +40 -38
- package/dist/contracts/videos.js +3 -137
- package/dist/contracts/videos.js.map +1 -1
- package/dist/contracts/voices.d.ts +0 -24
- package/dist/contracts/voices.js +0 -34
- package/dist/contracts/voices.js.map +1 -1
- package/dist/direct-publish-form.js +0 -15
- package/dist/direct-publish-form.js.map +1 -1
- package/dist/direct-publish-narrowing.js +0 -5
- package/dist/direct-publish-narrowing.js.map +1 -1
- package/dist/errors.d.ts +0 -35
- package/dist/errors.js +0 -48
- package/dist/errors.js.map +1 -1
- package/dist/generate-video.d.ts +48 -4
- package/dist/generate-video.js +2 -6
- package/dist/generate-video.js.map +1 -1
- package/dist/http-auth.d.ts +0 -1
- package/dist/http-auth.js +0 -37
- package/dist/http-auth.js.map +1 -1
- package/dist/http-rate-limit.d.ts +0 -1
- package/dist/http-rate-limit.js +0 -18
- package/dist/http-rate-limit.js.map +1 -1
- package/dist/http-transport.js +0 -95
- package/dist/http-transport.js.map +1 -1
- package/dist/http-web.js +0 -16
- package/dist/http-web.js.map +1 -1
- package/dist/image-guards.d.ts +0 -4
- package/dist/image-guards.js +0 -11
- package/dist/image-guards.js.map +1 -1
- package/dist/index.js +0 -20
- package/dist/index.js.map +1 -1
- package/dist/intent-accounts.js +1 -6
- package/dist/intent-accounts.js.map +1 -1
- package/dist/intent-content.js +0 -7
- package/dist/intent-content.js.map +1 -1
- package/dist/intent-library.js +0 -4
- package/dist/intent-library.js.map +1 -1
- package/dist/intent-personas.js +0 -10
- package/dist/intent-personas.js.map +1 -1
- package/dist/intent-tool-config.js +0 -5
- package/dist/intent-tool-config.js.map +1 -1
- package/dist/intent-video.js +0 -5
- package/dist/intent-video.js.map +1 -1
- package/dist/intent-voices.js +0 -6
- package/dist/intent-voices.js.map +1 -1
- package/dist/language.d.ts +0 -8
- package/dist/language.js +0 -11
- package/dist/language.js.map +1 -1
- package/dist/limits.d.ts +1 -79
- package/dist/limits.js +1 -79
- package/dist/limits.js.map +1 -1
- package/dist/music-mood-field.js +0 -25
- package/dist/music-mood-field.js.map +1 -1
- package/dist/persona-avatar.d.ts +0 -13
- package/dist/persona-avatar.js +0 -40
- package/dist/persona-avatar.js.map +1 -1
- package/dist/persona-create.d.ts +96 -0
- package/dist/persona-create.js +39 -0
- package/dist/persona-create.js.map +1 -0
- package/dist/persona-cta-shape.d.ts +16 -0
- package/dist/persona-cta-shape.js +45 -0
- package/dist/persona-cta-shape.js.map +1 -0
- package/dist/persona-delete.js +0 -1
- package/dist/persona-delete.js.map +1 -1
- package/dist/persona-update.d.ts +26 -0
- package/dist/persona-update.js +2 -6
- package/dist/persona-update.js.map +1 -1
- package/dist/progress-poll-hint.d.ts +0 -6
- package/dist/progress-poll-hint.js +0 -15
- package/dist/progress-poll-hint.js.map +1 -1
- package/dist/prompts.js +0 -12
- package/dist/prompts.js.map +1 -1
- package/dist/public-ip.js +25 -58
- package/dist/public-ip.js.map +1 -1
- package/dist/publish-direct-shape.d.ts +2 -0
- package/dist/publish-direct-shape.js +0 -4
- package/dist/publish-direct-shape.js.map +1 -1
- package/dist/publish-existing-shape.d.ts +0 -7
- package/dist/publish-existing-shape.js +0 -26
- package/dist/publish-existing-shape.js.map +1 -1
- package/dist/publish-notices.js +0 -2
- package/dist/publish-notices.js.map +1 -1
- package/dist/publish-uploaded-shape.d.ts +2 -0
- package/dist/publish-uploaded-shape.js +0 -7
- package/dist/publish-uploaded-shape.js.map +1 -1
- package/dist/recipe-session.d.ts +0 -4
- package/dist/recipe-session.js +0 -17
- package/dist/recipe-session.js.map +1 -1
- package/dist/refs.d.ts +0 -11
- package/dist/refs.js +1 -15
- package/dist/refs.js.map +1 -1
- package/dist/remote-shapes.d.ts +52 -2
- package/dist/remote-shapes.js +2 -16
- package/dist/remote-shapes.js.map +1 -1
- package/dist/require-api-key.js +0 -2
- package/dist/require-api-key.js.map +1 -1
- package/dist/require-publishing-accounts.js +0 -7
- package/dist/require-publishing-accounts.js.map +1 -1
- package/dist/require-title.js +0 -4
- package/dist/require-title.js.map +1 -1
- package/dist/schedule-shapes.js +0 -19
- package/dist/schedule-shapes.js.map +1 -1
- package/dist/script-segments.d.ts +1 -5
- package/dist/script-segments.js +1 -54
- package/dist/script-segments.js.map +1 -1
- package/dist/secret-redaction.js +0 -4
- package/dist/secret-redaction.js.map +1 -1
- package/dist/segment-media.js +0 -22
- package/dist/segment-media.js.map +1 -1
- package/dist/segment-text.js +0 -18
- package/dist/segment-text.js.map +1 -1
- package/dist/single-video-shape.d.ts +35 -1
- package/dist/single-video-shape.js +7 -18
- package/dist/single-video-shape.js.map +1 -1
- package/dist/slot-detail-present.d.ts +67 -0
- package/dist/slot-detail-present.js +47 -0
- package/dist/slot-detail-present.js.map +1 -0
- package/dist/tool-annotations.js.map +1 -1
- package/dist/tools-batch.d.ts +51 -3
- package/dist/tools-batch.js +0 -17
- package/dist/tools-batch.js.map +1 -1
- package/dist/tools-call.d.ts +0 -1
- package/dist/tools-call.js +0 -1
- package/dist/tools-call.js.map +1 -1
- package/dist/tools-experiments.d.ts +6 -3
- package/dist/tools-experiments.js +1 -31
- package/dist/tools-experiments.js.map +1 -1
- package/dist/tools-list-stats.d.ts +0 -4
- package/dist/tools-list-stats.js +0 -5
- package/dist/tools-list-stats.js.map +1 -1
- package/dist/tools-pinterest.js +0 -10
- package/dist/tools-pinterest.js.map +1 -1
- package/dist/tools-posts.d.ts +2 -0
- package/dist/tools-posts.js +0 -9
- package/dist/tools-posts.js.map +1 -1
- package/dist/tools-prompts.js +0 -23
- package/dist/tools-prompts.js.map +1 -1
- package/dist/tools-publish-existing.js +0 -17
- package/dist/tools-publish-existing.js.map +1 -1
- package/dist/tools-publish-uploaded.js +0 -8
- package/dist/tools-publish-uploaded.js.map +1 -1
- package/dist/tools-publishing-accounts.js +1 -11
- package/dist/tools-publishing-accounts.js.map +1 -1
- package/dist/tools-single-video.d.ts +2 -4
- package/dist/tools-single-video.js +2 -55
- package/dist/tools-single-video.js.map +1 -1
- package/dist/tools-tool-config.js +0 -13
- package/dist/tools-tool-config.js.map +1 -1
- package/dist/tools-user-media.js +0 -5
- package/dist/tools-user-media.js.map +1 -1
- package/dist/tools.d.ts +2 -76
- package/dist/tools.js +5 -131
- package/dist/tools.js.map +1 -1
- package/dist/video-task-tools.d.ts +0 -2
- package/dist/video-task-tools.js +0 -43
- package/dist/video-task-tools.js.map +1 -1
- package/dist/video-type.d.ts +0 -10
- package/dist/video-type.js +0 -17
- package/dist/video-type.js.map +1 -1
- package/dist/voice-filters.d.ts +0 -27
- package/dist/voice-filters.js +0 -62
- package/dist/voice-filters.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
// GENERATED from shared/contracts — do not edit.
|
|
2
2
|
// Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
|
|
3
|
-
//---------------
|
|
4
|
-
// providers — THE list of social networks Post Engineer publishes to.
|
|
5
|
-
//
|
|
6
|
-
// Every provider list in the web app, the MCP server and the OpenAPI
|
|
7
|
-
// generator derives from SOCIAL_PROVIDERS. Never type the list again
|
|
8
|
-
// anywhere else: a hand copy drifts the moment a network is added (each
|
|
9
|
-
// of fanvue, 3speak and rumble needed edits in about 25 copies, and the
|
|
10
|
-
// MCP accounts (action: connect) list silently missed pinterest).
|
|
11
|
-
//
|
|
12
|
-
// The subsets below are facts of their own (how a network connects), so
|
|
13
|
-
// they name their members and are checked against SOCIAL_PROVIDERS at
|
|
14
|
-
// compile time by `satisfies`.
|
|
15
|
-
//
|
|
16
|
-
// This file has no imports, so the OpenAPI generator (plain Node .mjs)
|
|
17
|
-
// can import it directly too: Node strips the types.
|
|
18
|
-
//---------------
|
|
19
3
|
export const SOCIAL_PROVIDERS = [
|
|
20
4
|
'youtube',
|
|
21
5
|
'instagram',
|
|
@@ -27,34 +11,24 @@ export const SOCIAL_PROVIDERS = [
|
|
|
27
11
|
'3speak',
|
|
28
12
|
'rumble',
|
|
29
13
|
'fanvue',
|
|
14
|
+
'telegram',
|
|
30
15
|
];
|
|
31
16
|
export function isSocialProvider(value) {
|
|
32
17
|
return typeof value === 'string' && SOCIAL_PROVIDERS.includes(value);
|
|
33
18
|
}
|
|
34
|
-
|
|
35
|
-
* app password, Hive posting key, Rumble access token), not OAuth. */
|
|
36
|
-
export const DIRECT_CONNECT_PROVIDERS = ['bluesky', '3speak', 'rumble'];
|
|
19
|
+
export const DIRECT_CONNECT_PROVIDERS = ['bluesky', '3speak', 'rumble', 'telegram'];
|
|
37
20
|
export const OAUTH_CONNECT_PROVIDERS = SOCIAL_PROVIDERS.filter((provider) => !DIRECT_CONNECT_PROVIDERS.includes(provider));
|
|
38
21
|
export function isOAuthConnectProvider(value) {
|
|
39
22
|
return typeof value === 'string' && OAUTH_CONNECT_PROVIDERS.includes(value);
|
|
40
23
|
}
|
|
41
|
-
|
|
42
|
-
* video. YouTube, Rumble and 3Speak are video-only platforms; Fanvue's
|
|
43
|
-
* vault upload is wired for video only. */
|
|
44
|
-
export const IMAGE_PROVIDERS = ['instagram', 'bluesky', 'linkedin', 'threads', 'facebook', 'pinterest'];
|
|
24
|
+
export const IMAGE_PROVIDERS = ['instagram', 'bluesky', 'linkedin', 'threads', 'facebook', 'pinterest', 'telegram'];
|
|
45
25
|
export function isImageProvider(value) {
|
|
46
26
|
return typeof value === 'string' && IMAGE_PROVIDERS.includes(value);
|
|
47
27
|
}
|
|
48
|
-
/** Networks whose publish takes a title and a description instead of a
|
|
49
|
-
* caption. Every other network takes a caption (Pinterest also takes an
|
|
50
|
-
* optional pin title next to it). */
|
|
51
28
|
export const TITLE_PROVIDERS = ['youtube', 'rumble', 'fanvue'];
|
|
52
29
|
export function isTitleProvider(value) {
|
|
53
30
|
return typeof value === 'string' && TITLE_PROVIDERS.includes(value);
|
|
54
31
|
}
|
|
55
|
-
/** The multipart field each network's account ids arrive under in
|
|
56
|
-
* POST /api/upload-content. The web handlers read it, and the web
|
|
57
|
-
* publish paths and the MCP direct publish write it. */
|
|
58
32
|
export const PUBLISH_ACCOUNT_FIELDS = {
|
|
59
33
|
youtube: 'accountIds',
|
|
60
34
|
instagram: 'igAccountIds',
|
|
@@ -66,8 +40,8 @@ export const PUBLISH_ACCOUNT_FIELDS = {
|
|
|
66
40
|
'3speak': 'threespeakAccountIds',
|
|
67
41
|
rumble: 'rumbleAccountIds',
|
|
68
42
|
fanvue: 'fanvueAccountIds',
|
|
43
|
+
telegram: 'telegramAccountIds',
|
|
69
44
|
};
|
|
70
|
-
/** The account-id column of each network in public.schedules. */
|
|
71
45
|
export const SCHEDULE_ACCOUNT_COLUMNS = {
|
|
72
46
|
youtube: 'youtube_account_ids',
|
|
73
47
|
instagram: 'instagram_account_ids',
|
|
@@ -79,5 +53,6 @@ export const SCHEDULE_ACCOUNT_COLUMNS = {
|
|
|
79
53
|
'3speak': 'threespeak_account_ids',
|
|
80
54
|
rumble: 'rumble_account_ids',
|
|
81
55
|
fanvue: 'fanvue_account_ids',
|
|
56
|
+
telegram: 'telegram_account_ids',
|
|
82
57
|
};
|
|
83
58
|
//# sourceMappingURL=providers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../../src/contracts/providers.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"providers.js","sourceRoot":"","sources":["../../src/contracts/providers.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,SAAS;IACT,WAAW;IACX,SAAS;IACT,UAAU;IACV,SAAS;IACT,UAAU;IACV,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,UAAU;CACF,CAAC;AAGX,MA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,SAAS,EAAE,qBAAqB;IAChC,QAAQ,EAAE,sBAAsB;IAChC,MAAM,EAAE,kBAAkB;IAC1B,MAAM,EAAE,kBAAkB;IAC1B,QAAQ,EAAE,oBAAoB;CAC/B,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,OAAO,EAAE,qBAAqB;IAC9B,SAAS,EAAE,uBAAuB;IAClC,OAAO,EAAE,qBAAqB;IAC9B,QAAQ,EAAE,sBAAsB;IAChC,OAAO,EAAE,qBAAqB;IAC9B,QAAQ,EAAE,sBAAsB;IAChC,SAAS,EAAE,uBAAuB;IAClC,QAAQ,EAAE,wBAAwB;IAClC,MAAM,EAAE,oBAAoB;IAC5B,MAAM,EAAE,oBAAoB;IAC5B,QAAQ,EAAE,sBAAsB;CACiB,CAAC"}
|
|
@@ -20,6 +20,7 @@ export declare const AccountNeedsReconnectWarningSchema: z.ZodObject<{
|
|
|
20
20
|
"3speak": "3speak";
|
|
21
21
|
rumble: "rumble";
|
|
22
22
|
fanvue: "fanvue";
|
|
23
|
+
telegram: "telegram";
|
|
23
24
|
}>;
|
|
24
25
|
accountId: z.ZodString;
|
|
25
26
|
}, z.core.$strip>>;
|
|
@@ -42,6 +43,7 @@ export declare const ScheduleWarningSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
42
43
|
"3speak": "3speak";
|
|
43
44
|
rumble: "rumble";
|
|
44
45
|
fanvue: "fanvue";
|
|
46
|
+
telegram: "telegram";
|
|
45
47
|
}>;
|
|
46
48
|
accountId: z.ZodString;
|
|
47
49
|
}, z.core.$strip>>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
// GENERATED from shared/contracts — do not edit.
|
|
2
2
|
// Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
|
|
3
|
-
// Schedule warning objects (never a bare string). `voice_fallback_applied`
|
|
4
|
-
// names the voice the route swapped in. `account_needs_reconnect` names
|
|
5
|
-
// the accounts whose stored login is already dead.
|
|
6
3
|
import { z } from 'zod';
|
|
7
4
|
import { SOCIAL_PROVIDERS } from './providers.js';
|
|
8
5
|
export const VOICE_FALLBACK_WARNING_CODE = 'voice_fallback_applied';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-warnings.js","sourceRoot":"","sources":["../../src/contracts/schedule-warnings.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"schedule-warnings.js","sourceRoot":"","sources":["../../src/contracts/schedule-warnings.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD,MAAM,CAAC,MAAM,2BAA2B,GAAG,wBAAwB,CAAC;AACpE,MAAM,CAAC,MAAM,oCAAoC,GAAG,yBAAyB,CAAC;AAE9E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC;IAC5C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,CAAC,MAAM,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,oCAAoC,CAAC;IACrD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACzB,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;QAClC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC7B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CACX,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAChE,0BAA0B;IAC1B,kCAAkC;CACnC,CAAC,CAAC"}
|
|
@@ -7,10 +7,6 @@ export interface EndpointDefinition<Body extends z.ZodType | undefined, Query ex
|
|
|
7
7
|
query?: Query;
|
|
8
8
|
response: Response;
|
|
9
9
|
}
|
|
10
|
-
/** Define one endpoint contract. The literal path is preserved in the type
|
|
11
|
-
* so ParamsOf can read its `:param` segments. `Body`/`Query` default to
|
|
12
|
-
* `undefined` so an omitted optional schema stays `undefined` (not the
|
|
13
|
-
* bare `ZodType`) in the returned definition. */
|
|
14
10
|
export declare function defineEndpoint<Body extends z.ZodType | undefined = undefined, Query extends z.ZodType | undefined = undefined, Response extends z.ZodType = z.ZodType, Path extends string = string>(config: {
|
|
15
11
|
method: EndpointMethod;
|
|
16
12
|
path: Path;
|
|
@@ -18,32 +14,24 @@ export declare function defineEndpoint<Body extends z.ZodType | undefined = unde
|
|
|
18
14
|
query?: Query;
|
|
19
15
|
response: Response;
|
|
20
16
|
}): EndpointDefinition<Body, Query, Response, Path>;
|
|
21
|
-
/** Request body input type (`z.input` of the `body` schema). Indexed
|
|
22
|
-
* access is used (not infer) so an optional `body?` property keeps its
|
|
23
|
-
* schema type instead of widening to `unknown`. */
|
|
24
17
|
export type BodyOf<Endpoint extends {
|
|
25
18
|
body?: z.ZodType | undefined;
|
|
26
19
|
}> = [
|
|
27
20
|
Exclude<Endpoint['body'], undefined>
|
|
28
21
|
] extends [never] ? never : Exclude<Endpoint['body'], undefined> extends z.ZodType ? z.input<Exclude<Endpoint['body'], undefined>> : never;
|
|
29
|
-
/** Query input type (`z.input` of the `query` schema). */
|
|
30
22
|
export type QueryOf<Endpoint extends {
|
|
31
23
|
query?: z.ZodType | undefined;
|
|
32
24
|
}> = [
|
|
33
25
|
Exclude<Endpoint['query'], undefined>
|
|
34
26
|
] extends [never] ? never : Exclude<Endpoint['query'], undefined> extends z.ZodType ? z.input<Exclude<Endpoint['query'], undefined>> : never;
|
|
35
|
-
/** Response output type (`z.output` of the `response` schema). */
|
|
36
27
|
export type ResponseOf<Endpoint extends {
|
|
37
28
|
response: z.ZodType;
|
|
38
29
|
}> = Endpoint['response'] extends z.ZodType ? z.output<Endpoint['response']> : never;
|
|
39
|
-
/** Path params from a path template: each `:name` segment becomes a
|
|
40
|
-
* `string` field. A path without segments is an empty record. */
|
|
41
30
|
export type ParamsOf<Path extends string> = Path extends `${string}:${infer Rest}` ? Rest extends `${infer Name}/${infer After}` ? {
|
|
42
31
|
[Key in Name]: string;
|
|
43
32
|
} & ParamsOf<`/${After}`> : {
|
|
44
33
|
[Key in Rest]: string;
|
|
45
34
|
} : Record<never, never>;
|
|
46
|
-
/** A row of the schedules table, as GET /api/schedule returns it. */
|
|
47
35
|
export declare const ScheduleRowSchema: z.ZodObject<{
|
|
48
36
|
id: z.ZodString;
|
|
49
37
|
persona_id: z.ZodNullable<z.ZodString>;
|
|
@@ -59,6 +47,7 @@ export declare const ScheduleRowSchema: z.ZodObject<{
|
|
|
59
47
|
threespeak_account_ids: z.ZodArray<z.ZodString>;
|
|
60
48
|
rumble_account_ids: z.ZodArray<z.ZodString>;
|
|
61
49
|
fanvue_account_ids: z.ZodArray<z.ZodString>;
|
|
50
|
+
telegram_account_ids: z.ZodArray<z.ZodString>;
|
|
62
51
|
days_of_week: z.ZodNullable<z.ZodArray<z.ZodNumber>>;
|
|
63
52
|
start_hour: z.ZodNullable<z.ZodNumber>;
|
|
64
53
|
end_hour: z.ZodNullable<z.ZodNumber>;
|
|
@@ -88,6 +77,7 @@ export declare const ListSchedulesResponseSchema: z.ZodObject<{
|
|
|
88
77
|
threespeak_account_ids: z.ZodArray<z.ZodString>;
|
|
89
78
|
rumble_account_ids: z.ZodArray<z.ZodString>;
|
|
90
79
|
fanvue_account_ids: z.ZodArray<z.ZodString>;
|
|
80
|
+
telegram_account_ids: z.ZodArray<z.ZodString>;
|
|
91
81
|
days_of_week: z.ZodNullable<z.ZodArray<z.ZodNumber>>;
|
|
92
82
|
start_hour: z.ZodNullable<z.ZodNumber>;
|
|
93
83
|
end_hour: z.ZodNullable<z.ZodNumber>;
|
|
@@ -158,9 +148,7 @@ export type RangeParseResult = {
|
|
|
158
148
|
message: string;
|
|
159
149
|
};
|
|
160
150
|
export declare function parseStatusRange(params: URLSearchParams): RangeParseResult;
|
|
161
|
-
/** Mirrors apps/web/lib/timezone.ts hasExplicitOffset (Z or ±hh:mm / ±hhmm). */
|
|
162
151
|
export declare function hasExplicitOffset(value: string): boolean;
|
|
163
|
-
/** A presented slot: the row fields plus the enrichment spread over them. */
|
|
164
152
|
export declare const StatusSlotSchema: z.ZodObject<{
|
|
165
153
|
id: z.ZodString;
|
|
166
154
|
slot_at: z.ZodString;
|
|
@@ -347,6 +335,7 @@ export declare const GetSlotResponseSchema: z.ZodObject<{
|
|
|
347
335
|
"3speak": "3speak";
|
|
348
336
|
rumble: "rumble";
|
|
349
337
|
fanvue: "fanvue";
|
|
338
|
+
telegram: "telegram";
|
|
350
339
|
}>;
|
|
351
340
|
url: z.ZodString;
|
|
352
341
|
}, z.core.$strip>>;
|
|
@@ -388,6 +377,7 @@ export declare const GetSlotResponseSchema: z.ZodObject<{
|
|
|
388
377
|
threespeakAccountIds: z.ZodArray<z.ZodString>;
|
|
389
378
|
rumbleAccountIds: z.ZodArray<z.ZodString>;
|
|
390
379
|
fanvueAccountIds: z.ZodArray<z.ZodString>;
|
|
380
|
+
telegramAccountIds: z.ZodArray<z.ZodString>;
|
|
391
381
|
timezone: z.ZodString;
|
|
392
382
|
publishMode: z.ZodEnum<{
|
|
393
383
|
scheduled: "scheduled";
|
|
@@ -439,6 +429,7 @@ export declare const listSchedules: EndpointDefinition<undefined, undefined, z.Z
|
|
|
439
429
|
threespeak_account_ids: z.ZodArray<z.ZodString>;
|
|
440
430
|
rumble_account_ids: z.ZodArray<z.ZodString>;
|
|
441
431
|
fanvue_account_ids: z.ZodArray<z.ZodString>;
|
|
432
|
+
telegram_account_ids: z.ZodArray<z.ZodString>;
|
|
442
433
|
days_of_week: z.ZodNullable<z.ZodArray<z.ZodNumber>>;
|
|
443
434
|
start_hour: z.ZodNullable<z.ZodNumber>;
|
|
444
435
|
end_hour: z.ZodNullable<z.ZodNumber>;
|
|
@@ -618,6 +609,7 @@ export declare const getSlot: EndpointDefinition<undefined, undefined, z.ZodObje
|
|
|
618
609
|
"3speak": "3speak";
|
|
619
610
|
rumble: "rumble";
|
|
620
611
|
fanvue: "fanvue";
|
|
612
|
+
telegram: "telegram";
|
|
621
613
|
}>;
|
|
622
614
|
url: z.ZodString;
|
|
623
615
|
}, z.core.$strip>>;
|
|
@@ -659,6 +651,7 @@ export declare const getSlot: EndpointDefinition<undefined, undefined, z.ZodObje
|
|
|
659
651
|
threespeakAccountIds: z.ZodArray<z.ZodString>;
|
|
660
652
|
rumbleAccountIds: z.ZodArray<z.ZodString>;
|
|
661
653
|
fanvueAccountIds: z.ZodArray<z.ZodString>;
|
|
654
|
+
telegramAccountIds: z.ZodArray<z.ZodString>;
|
|
662
655
|
timezone: z.ZodString;
|
|
663
656
|
publishMode: z.ZodEnum<{
|
|
664
657
|
scheduled: "scheduled";
|
|
@@ -1,38 +1,10 @@
|
|
|
1
1
|
// GENERATED from shared/contracts — do not edit.
|
|
2
2
|
// Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
|
|
3
|
-
// Schedule contract: the single source of truth for the schedule reads and
|
|
4
|
-
// slot mutations (GET/DELETE /api/schedule, GET /api/schedule/status,
|
|
5
|
-
// GET/PATCH/DELETE /api/schedule/slots/[slotId]). Both apps generate a copy
|
|
6
|
-
// of this file (see scripts/sync-contracts.mjs); never edit a generated
|
|
7
|
-
// copy by hand.
|
|
8
|
-
//
|
|
9
|
-
// Shapes mirror the routes, not a cleaned-up ideal:
|
|
10
|
-
// - GET /api/schedule returns the raw Supabase rows, so the schedule row
|
|
11
|
-
// keeps its snake_case keys and DB nullability (persona_id is nullable
|
|
12
|
-
// for faceless schedules, migration 012; publish_mode is pinned to the
|
|
13
|
-
// 'scheduled'/'asap' CHECK of migration 015).
|
|
14
|
-
// - GET /api/schedule/status returns the presented slots: the snake_case
|
|
15
|
-
// row fields (RESULT_SELECT) plus the camelCase enrichment
|
|
16
|
-
// (apps/web/lib/schedule-slot-presentation.ts) and the publish rows
|
|
17
|
-
// (apps/web/lib/publish-user-notice.ts). `status` is the PRESENTED
|
|
18
|
-
// status: pending shows as 'awaiting', a failed slot with published
|
|
19
|
-
// outcomes shows as 'completed'.
|
|
20
|
-
// - PATCH /api/schedule/slots/[slotId] does not use readBody (its coded
|
|
21
|
-
// error envelope would change), so the body schema below mirrors the
|
|
22
|
-
// route's messages and the equivalence test pins them; the 3h/30d
|
|
23
|
-
// window rule stays server-side (apps/web/lib/schedule-window.ts).
|
|
24
|
-
// `success` is a literal `true`: the routes never return success:false
|
|
25
|
-
// with a 200.
|
|
26
3
|
import { z } from 'zod';
|
|
27
|
-
/** Define one endpoint contract. The literal path is preserved in the type
|
|
28
|
-
* so ParamsOf can read its `:param` segments. `Body`/`Query` default to
|
|
29
|
-
* `undefined` so an omitted optional schema stays `undefined` (not the
|
|
30
|
-
* bare `ZodType`) in the returned definition. */
|
|
31
4
|
export function defineEndpoint(config) {
|
|
32
5
|
return config;
|
|
33
6
|
}
|
|
34
7
|
import { PublishProviderFailureSchema, PublishUserNoticeSchema, SlotDetailSchema, } from './posts.js';
|
|
35
|
-
/** A row of the schedules table, as GET /api/schedule returns it. */
|
|
36
8
|
export const ScheduleRowSchema = z.object({
|
|
37
9
|
id: z.string(),
|
|
38
10
|
persona_id: z.string().nullable(),
|
|
@@ -48,6 +20,7 @@ export const ScheduleRowSchema = z.object({
|
|
|
48
20
|
threespeak_account_ids: z.array(z.string()),
|
|
49
21
|
rumble_account_ids: z.array(z.string()),
|
|
50
22
|
fanvue_account_ids: z.array(z.string()),
|
|
23
|
+
telegram_account_ids: z.array(z.string()),
|
|
51
24
|
days_of_week: z.array(z.number()).nullable(),
|
|
52
25
|
start_hour: z.number().nullable(),
|
|
53
26
|
end_hour: z.number().nullable(),
|
|
@@ -61,10 +34,6 @@ export const ListSchedulesResponseSchema = z.object({
|
|
|
61
34
|
success: z.literal(true),
|
|
62
35
|
schedules: z.array(ScheduleRowSchema),
|
|
63
36
|
});
|
|
64
|
-
//---------------
|
|
65
|
-
// DELETE /api/schedule?id= — the id check, as a parser so the MCP side
|
|
66
|
-
// can pin it. The route returns the same 400 message as before.
|
|
67
|
-
//---------------
|
|
68
37
|
export function parseCancelScheduleQuery(params) {
|
|
69
38
|
const id = params.get('id');
|
|
70
39
|
if (!id) {
|
|
@@ -91,10 +60,6 @@ export const CancelScheduleResponseSchema = z.object({
|
|
|
91
60
|
refunds: z.array(CancelRefundSchema),
|
|
92
61
|
batchDiscountWithheld: z.number(),
|
|
93
62
|
});
|
|
94
|
-
//---------------
|
|
95
|
-
// GET /api/schedule/status — the limit and range parsers, moved verbatim
|
|
96
|
-
// from apps/web/app/api/schedule/status/route.ts and range.ts.
|
|
97
|
-
//---------------
|
|
98
63
|
export const STATUS_LIMIT_DEFAULT = 10;
|
|
99
64
|
export const STATUS_LIMIT_MAX = 500;
|
|
100
65
|
export function parseStatusLimit(value) {
|
|
@@ -149,11 +114,9 @@ export function parseStatusRange(params) {
|
|
|
149
114
|
}
|
|
150
115
|
return { kind: 'range', from: fromDate.toISOString(), to: toDate.toISOString() };
|
|
151
116
|
}
|
|
152
|
-
/** Mirrors apps/web/lib/timezone.ts hasExplicitOffset (Z or ±hh:mm / ±hhmm). */
|
|
153
117
|
export function hasExplicitOffset(value) {
|
|
154
118
|
return /(?:Z|[+-]\d{2}:?\d{2})$/.test(value.trim());
|
|
155
119
|
}
|
|
156
|
-
/** A presented slot: the row fields plus the enrichment spread over them. */
|
|
157
120
|
export const StatusSlotSchema = z.object({
|
|
158
121
|
id: z.string(),
|
|
159
122
|
slot_at: z.string(),
|
|
@@ -191,17 +154,9 @@ export const ListPostsInRangeResponseSchema = z.object({
|
|
|
191
154
|
slots: z.array(StatusSlotSchema),
|
|
192
155
|
truncated: z.boolean(),
|
|
193
156
|
});
|
|
194
|
-
//---------------
|
|
195
|
-
// GET /api/schedule/slots/[slotId] — the same detail as GET /api/posts/[id]
|
|
196
|
-
// returns for a slot, without the `kind` wrapper the posts route adds.
|
|
197
|
-
//---------------
|
|
198
157
|
export const GetSlotResponseSchema = SlotDetailSchema.extend({
|
|
199
158
|
success: z.literal(true),
|
|
200
159
|
});
|
|
201
|
-
//---------------
|
|
202
|
-
// PATCH /api/schedule/slots/[slotId] — mirrors the route's validation
|
|
203
|
-
// messages; the 3h/30d window rule stays server-side.
|
|
204
|
-
//---------------
|
|
205
160
|
function nonBlank(message) {
|
|
206
161
|
return z.string().min(1, message).refine((value) => value.trim().length > 0, message);
|
|
207
162
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/contracts/schedule.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/contracts/schedule.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,MAAM,UAAU,cAAc,CAK5B,MAMD;IACC,OAAO,MAAM,CAAC;AAChB,CAAC;AAyBD,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACd,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,mBAAmB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,M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,CAAC;AAEH,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;IAC5C,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,6BAA6B;IACnC,IAAI,EAAE,oBAAoB;IAC1B,QAAQ,EAAE,wBAAwB;CACnC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC;IACvC,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,6BAA6B;IACnC,QAAQ,EAAE,wBAAwB;CACnC,CAAC,CAAC"}
|
|
@@ -7,10 +7,6 @@ export interface EndpointDefinition<Body extends z.ZodType | undefined, Query ex
|
|
|
7
7
|
query?: Query;
|
|
8
8
|
response: Response;
|
|
9
9
|
}
|
|
10
|
-
/** Define one endpoint contract. The literal path is preserved in the type
|
|
11
|
-
* so ParamsOf can read its `:param` segments. `Body`/`Query` default to
|
|
12
|
-
* `undefined` so an omitted optional schema stays `undefined` (not the
|
|
13
|
-
* bare `ZodType`) in the returned definition. */
|
|
14
10
|
export declare function defineEndpoint<Body extends z.ZodType | undefined = undefined, Query extends z.ZodType | undefined = undefined, Response extends z.ZodType = z.ZodType, Path extends string = string>(config: {
|
|
15
11
|
method: EndpointMethod;
|
|
16
12
|
path: Path;
|
|
@@ -18,26 +14,19 @@ export declare function defineEndpoint<Body extends z.ZodType | undefined = unde
|
|
|
18
14
|
query?: Query;
|
|
19
15
|
response: Response;
|
|
20
16
|
}): EndpointDefinition<Body, Query, Response, Path>;
|
|
21
|
-
/** Request body input type (`z.input` of the `body` schema). Indexed
|
|
22
|
-
* access is used (not infer) so an optional `body?` property keeps its
|
|
23
|
-
* schema type instead of widening to `unknown`. */
|
|
24
17
|
export type BodyOf<Endpoint extends {
|
|
25
18
|
body?: z.ZodType | undefined;
|
|
26
19
|
}> = [
|
|
27
20
|
Exclude<Endpoint['body'], undefined>
|
|
28
21
|
] extends [never] ? never : Exclude<Endpoint['body'], undefined> extends z.ZodType ? z.input<Exclude<Endpoint['body'], undefined>> : never;
|
|
29
|
-
/** Query input type (`z.input` of the `query` schema). */
|
|
30
22
|
export type QueryOf<Endpoint extends {
|
|
31
23
|
query?: z.ZodType | undefined;
|
|
32
24
|
}> = [
|
|
33
25
|
Exclude<Endpoint['query'], undefined>
|
|
34
26
|
] extends [never] ? never : Exclude<Endpoint['query'], undefined> extends z.ZodType ? z.input<Exclude<Endpoint['query'], undefined>> : never;
|
|
35
|
-
/** Response output type (`z.output` of the `response` schema). */
|
|
36
27
|
export type ResponseOf<Endpoint extends {
|
|
37
28
|
response: z.ZodType;
|
|
38
29
|
}> = Endpoint['response'] extends z.ZodType ? z.output<Endpoint['response']> : never;
|
|
39
|
-
/** Path params from a path template: each `:name` segment becomes a
|
|
40
|
-
* `string` field. A path without segments is an empty record. */
|
|
41
30
|
export type ParamsOf<Path extends string> = Path extends `${string}:${infer Rest}` ? Rest extends `${infer Name}/${infer After}` ? {
|
|
42
31
|
[Key in Name]: string;
|
|
43
32
|
} & ParamsOf<`/${After}`> : {
|
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
// GENERATED from shared/contracts — do not edit.
|
|
2
2
|
// Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
/** Define one endpoint contract. The literal path is preserved in the type
|
|
5
|
-
* so ParamsOf can read its `:param` segments. `Body`/`Query` default to
|
|
6
|
-
* `undefined` so an omitted optional schema stays `undefined` (not the
|
|
7
|
-
* bare `ZodType`) in the returned definition. */
|
|
8
4
|
export function defineEndpoint(config) {
|
|
9
5
|
return config;
|
|
10
6
|
}
|
|
11
|
-
//---------------
|
|
12
|
-
// Tool Config (issue #669): per-user research/stock tool configuration.
|
|
13
|
-
// The single source of truth for the GET/PUT /api/tool-config exchange.
|
|
14
|
-
// The route re-validates strictly (lib/tool-config.ts): a key is only
|
|
15
|
-
// accepted for the tool/source it belongs to, and nothing is truncated,
|
|
16
|
-
// coerced, or dropped. These schemas describe the exchange shape only.
|
|
17
|
-
//---------------
|
|
18
7
|
export const ToolConfigSearchToolSchema = z.enum(['tavily', 'exa']);
|
|
19
8
|
export const ToolConfigStockSourceSchema = z.enum(['pexels', 'pixabay', 'coverr']);
|
|
20
9
|
export const ToolConfigKeyNamesSchema = z.enum(['tavily', 'exa', 'pexels', 'pixabay', 'coverr']);
|
|
21
|
-
// Keys are optional per name: only the configured tools carry one. The
|
|
22
|
-
// 512-character cap is the lib's validation bound, pinned here too. Strict:
|
|
23
|
-
// an unknown key name fails fast instead of being stripped silently —
|
|
24
|
-
// a typo'd key would otherwise vanish while the save reports success.
|
|
25
10
|
export const ToolConfigKeysSchema = z
|
|
26
11
|
.object({
|
|
27
12
|
tavily: z.string().min(1).max(512).optional(),
|
|
@@ -31,17 +16,11 @@ export const ToolConfigKeysSchema = z
|
|
|
31
16
|
coverr: z.string().min(1).max(512).optional(),
|
|
32
17
|
})
|
|
33
18
|
.strict();
|
|
34
|
-
// Replace-whole save: every field is required, so a partial write can
|
|
35
|
-
// never leave a stale key behind for a tool the user just removed.
|
|
36
19
|
export const SaveToolConfigBodySchema = z.object({
|
|
37
20
|
searchTool: ToolConfigSearchToolSchema.nullable(),
|
|
38
21
|
stockSources: z.array(ToolConfigStockSourceSchema),
|
|
39
22
|
keys: ToolConfigKeysSchema,
|
|
40
23
|
});
|
|
41
|
-
// GET returns presence only — never a key value. The keys are stored
|
|
42
|
-
// encrypted as the vault of record; what a later session needs to know is
|
|
43
|
-
// which tools are configured, and the agent calls those APIs with the keys
|
|
44
|
-
// from its own environment.
|
|
45
24
|
export const GetToolConfigResponseSchema = z.object({
|
|
46
25
|
success: z.literal(true),
|
|
47
26
|
configured: z.boolean(),
|
|
@@ -62,8 +41,6 @@ export const GetToolConfigResponseSchema = z.object({
|
|
|
62
41
|
coverr: z.string().nullable(),
|
|
63
42
|
}),
|
|
64
43
|
});
|
|
65
|
-
// PUT returns presence only: each key as present + its last 4 characters,
|
|
66
|
-
// never a key value.
|
|
67
44
|
export const SaveToolConfigResponseSchema = z.object({
|
|
68
45
|
success: z.literal(true),
|
|
69
46
|
configured: z.literal(true),
|
|
@@ -84,9 +61,6 @@ export const SaveToolConfigResponseSchema = z.object({
|
|
|
84
61
|
coverr: z.string().nullable(),
|
|
85
62
|
}),
|
|
86
63
|
});
|
|
87
|
-
//---------------
|
|
88
|
-
// Endpoints.
|
|
89
|
-
//---------------
|
|
90
64
|
export const getToolConfig = defineEndpoint({
|
|
91
65
|
method: 'GET',
|
|
92
66
|
path: '/api/tool-config',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-config.js","sourceRoot":"","sources":["../../src/contracts/tool-config.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-config.js","sourceRoot":"","sources":["../../src/contracts/tool-config.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAiBxB,MAAM,UAAU,cAAc,CAK5B,MAMD;IACC,OAAO,MAAM,CAAC;AAChB,CAAC;AA0BD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;AAGpE,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGnF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAEjG,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CA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AE;QAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC9B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC9B,CAAC;CACH,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,aAAa,GAAG,cAAc,CAAC;IAC1C,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,kBAAkB;IACxB,QAAQ,EAAE,2BAA2B;CACtC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC;IAC3C,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,kBAAkB;IACxB,IAAI,EAAE,wBAAwB;IAC9B,QAAQ,EAAE,4BAA4B;CACvC,CAAC,CAAC"}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
/** Signed video uploads (issue #561): the 2GB ceiling, same as upload-content. */
|
|
2
1
|
export declare const VIDEO_UPLOAD_CONTENT_TYPES: readonly ["video/mp4", "video/quicktime"];
|
|
3
2
|
export type VideoUploadContentType = (typeof VIDEO_UPLOAD_CONTENT_TYPES)[number];
|
|
4
3
|
export declare const MAX_VIDEO_UPLOAD_BYTES: number;
|
|
5
|
-
/** A signed upload may also carry an image (JPEG/PNG) for the image
|
|
6
|
-
* networks (IMAGE_PROVIDERS), capped like an inline image. */
|
|
7
4
|
export declare const IMAGE_UPLOAD_CONTENT_TYPES: readonly ["image/jpeg", "image/png"];
|
|
8
5
|
export type ImageUploadContentType = (typeof IMAGE_UPLOAD_CONTENT_TYPES)[number];
|
|
9
6
|
export declare const MAX_IMAGE_UPLOAD_BYTES: number;
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
// GENERATED from shared/contracts — do not edit.
|
|
2
2
|
// Run `node scripts/sync-contracts.mjs` from the repo root to regenerate.
|
|
3
|
-
//---------------
|
|
4
|
-
// upload-types — what a signed upload (POST /api/videos/upload-url) may
|
|
5
|
-
// carry: a video (MP4/MOV, 2GB) or, for the image networks, an image
|
|
6
|
-
// (JPEG/PNG, 8 MB; the same cap as an inline image and every image
|
|
7
|
-
// handler). No imports, so the OpenAPI generator (plain Node) imports it
|
|
8
|
-
// directly; videos.ts re-exports it for the endpoint contracts.
|
|
9
|
-
//---------------
|
|
10
|
-
/** Signed video uploads (issue #561): the 2GB ceiling, same as upload-content. */
|
|
11
3
|
export const VIDEO_UPLOAD_CONTENT_TYPES = ['video/mp4', 'video/quicktime'];
|
|
12
4
|
export const MAX_VIDEO_UPLOAD_BYTES = 2 * 1024 * 1024 * 1024;
|
|
13
|
-
/** A signed upload may also carry an image (JPEG/PNG) for the image
|
|
14
|
-
* networks (IMAGE_PROVIDERS), capped like an inline image. */
|
|
15
5
|
export const IMAGE_UPLOAD_CONTENT_TYPES = ['image/jpeg', 'image/png'];
|
|
16
6
|
export const MAX_IMAGE_UPLOAD_BYTES = 8 * 1024 * 1024;
|
|
17
7
|
export const UPLOAD_CONTENT_TYPES = [...VIDEO_UPLOAD_CONTENT_TYPES, ...IMAGE_UPLOAD_CONTENT_TYPES];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-types.js","sourceRoot":"","sources":["../../src/contracts/upload-types.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"upload-types.js","sourceRoot":"","sources":["../../src/contracts/upload-types.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAU,CAAC;AAEpF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAC7D,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,YAAY,EAAE,WAAW,CAAU,CAAC;AAE/E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AACtD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAG,0BAA0B,EAAE,GAAG,0BAA0B,CAAU,CAAC;AAE5G,MAAM,CAAC,MAAM,2BAA2B,GAAG,0EAA0E,CAAC;AAEtH,MAAM,UAAU,wBAAwB,CAAC,KAAc;IACrD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,0BAAgD,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACxG,CAAC"}
|
|
@@ -7,10 +7,6 @@ export interface EndpointDefinition<Body extends z.ZodType | undefined, Query ex
|
|
|
7
7
|
query?: Query;
|
|
8
8
|
response: Response;
|
|
9
9
|
}
|
|
10
|
-
/** Define one endpoint contract. The literal path is preserved in the type
|
|
11
|
-
* so ParamsOf can read its `:param` segments. `Body`/`Query` default to
|
|
12
|
-
* `undefined` so an omitted optional schema stays `undefined` (not the
|
|
13
|
-
* bare `ZodType`) in the returned definition. */
|
|
14
10
|
export declare function defineEndpoint<Body extends z.ZodType | undefined = undefined, Query extends z.ZodType | undefined = undefined, Response extends z.ZodType = z.ZodType, Path extends string = string>(config: {
|
|
15
11
|
method: EndpointMethod;
|
|
16
12
|
path: Path;
|
|
@@ -18,39 +14,27 @@ export declare function defineEndpoint<Body extends z.ZodType | undefined = unde
|
|
|
18
14
|
query?: Query;
|
|
19
15
|
response: Response;
|
|
20
16
|
}): EndpointDefinition<Body, Query, Response, Path>;
|
|
21
|
-
/** Request body input type (`z.input` of the `body` schema). Indexed
|
|
22
|
-
* access is used (not infer) so an optional `body?` property keeps its
|
|
23
|
-
* schema type instead of widening to `unknown`. */
|
|
24
17
|
export type BodyOf<Endpoint extends {
|
|
25
18
|
body?: z.ZodType | undefined;
|
|
26
19
|
}> = [
|
|
27
20
|
Exclude<Endpoint['body'], undefined>
|
|
28
21
|
] extends [never] ? never : Exclude<Endpoint['body'], undefined> extends z.ZodType ? z.input<Exclude<Endpoint['body'], undefined>> : never;
|
|
29
|
-
/** Query input type (`z.input` of the `query` schema). */
|
|
30
22
|
export type QueryOf<Endpoint extends {
|
|
31
23
|
query?: z.ZodType | undefined;
|
|
32
24
|
}> = [
|
|
33
25
|
Exclude<Endpoint['query'], undefined>
|
|
34
26
|
] extends [never] ? never : Exclude<Endpoint['query'], undefined> extends z.ZodType ? z.input<Exclude<Endpoint['query'], undefined>> : never;
|
|
35
|
-
/** Response output type (`z.output` of the `response` schema). */
|
|
36
27
|
export type ResponseOf<Endpoint extends {
|
|
37
28
|
response: z.ZodType;
|
|
38
29
|
}> = Endpoint['response'] extends z.ZodType ? z.output<Endpoint['response']> : never;
|
|
39
|
-
/** Path params from a path template: each `:name` segment becomes a
|
|
40
|
-
* `string` field. A path without segments is an empty record. */
|
|
41
30
|
export type ParamsOf<Path extends string> = Path extends `${string}:${infer Rest}` ? Rest extends `${infer Name}/${infer After}` ? {
|
|
42
31
|
[Key in Name]: string;
|
|
43
32
|
} & ParamsOf<`/${After}`> : {
|
|
44
33
|
[Key in Rest]: string;
|
|
45
34
|
} : Record<never, never>;
|
|
46
|
-
/** Generation-history paging defaults (also the MCP client's fail-fast bound). */
|
|
47
35
|
export declare const VIDEO_GENERATIONS_DEFAULT_LIMIT = 50;
|
|
48
36
|
export declare const VIDEO_GENERATIONS_MAX_LIMIT = 200;
|
|
49
37
|
export declare function parseGenerationsLimit(value: string | null): number;
|
|
50
|
-
/** One video_generations row, camelCase. No errorMessage: the raw
|
|
51
|
-
* engine/upstream text may contain paths or upstream bodies and is kept
|
|
52
|
-
* server-side (DB) for support only — the UI renders the categorized
|
|
53
|
-
* errorCode. */
|
|
54
38
|
export declare const VideoGenerationRowSchema: z.ZodObject<{
|
|
55
39
|
id: z.ZodString;
|
|
56
40
|
generationId: z.ZodString;
|
|
@@ -64,8 +48,6 @@ export declare const VideoGenerationRowSchema: z.ZodObject<{
|
|
|
64
48
|
completedAt: z.ZodNullable<z.ZodString>;
|
|
65
49
|
}, z.core.$strip>;
|
|
66
50
|
export type VideoGenerationRow = z.infer<typeof VideoGenerationRowSchema>;
|
|
67
|
-
/** Raw paging params as the MCP sends them (strings in the query). Plain
|
|
68
|
-
* object, not strict: the route ignores unknown query params. */
|
|
69
51
|
export declare const ListVideoGenerationsQuerySchema: z.ZodObject<{
|
|
70
52
|
limit: z.ZodOptional<z.ZodString>;
|
|
71
53
|
}, z.core.$strip>;
|
|
@@ -99,11 +81,6 @@ export declare const GetVideoGenerationResponseSchema: z.ZodObject<{
|
|
|
99
81
|
completedAt: z.ZodNullable<z.ZodString>;
|
|
100
82
|
}, z.core.$strip>;
|
|
101
83
|
}, z.core.$strip>;
|
|
102
|
-
/** The engine task record as the MCP wait tool reads it. `state` is the
|
|
103
|
-
* numeric progress state (-1 failed, 1 complete, 3 queued, 4 processing);
|
|
104
|
-
* `stage` is the engine's current step (null once finished); `error`
|
|
105
|
-
* carries the engine failure reason; `postUrl` is the slot detail link
|
|
106
|
-
* the web route attaches (null for direct generations). */
|
|
107
84
|
export declare const VideoTaskProgressBodySchema: z.ZodObject<{
|
|
108
85
|
task_id: z.ZodString;
|
|
109
86
|
state: z.ZodOptional<z.ZodNumber>;
|