@inneropen/marvin-sdk 4.1.0 → 4.3.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/dist/{HttpClient-B_rEmJuO.d.cts → HttpClient-DXMNOPqu.d.cts} +17 -1
- package/dist/{HttpClient-B_rEmJuO.d.ts → HttpClient-DXMNOPqu.d.ts} +17 -1
- package/dist/{chunk-VS6R3V3K.js → chunk-KXI2FQSO.js} +50 -17
- package/dist/{chunk-DSVYCVQD.js → chunk-LTX3MAUE.js} +25 -0
- package/dist/{index-CX4jvPAA.d.cts → index-BEEbnrXV.d.cts} +481 -43
- package/dist/{index-CX4jvPAA.d.ts → index-BEEbnrXV.d.ts} +481 -43
- package/dist/index.cjs +75 -16
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +4 -2
- package/dist/{marvin-6keK-yvS.d.cts → marvin-CdsjwIyH.d.ts} +64 -35
- package/dist/{marvin-Cndwz82G.d.ts → marvin-gZtGa576.d.cts} +64 -35
- package/dist/platform.cjs +187 -3
- package/dist/platform.d.cts +190 -7
- package/dist/platform.d.ts +190 -7
- package/dist/platform.js +162 -4
- package/dist/publish.cjs +74 -16
- package/dist/publish.d.cts +4 -4
- package/dist/publish.d.ts +4 -4
- package/dist/publish.js +5 -3
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/platform.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpClient } from './HttpClient-
|
|
2
|
-
import {
|
|
1
|
+
import { H as HttpClient, a as BinaryResponse } from './HttpClient-DXMNOPqu.js';
|
|
2
|
+
import { t as components, A as AuthToken } from './index-BEEbnrXV.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Platform API Types
|
|
@@ -14,6 +14,18 @@ import { r as components, A as AuthToken } from './index-CX4jvPAA.js';
|
|
|
14
14
|
type PlatformEntry = components['schemas']['EntryRead'];
|
|
15
15
|
type PlatformEntryCreate = components['schemas']['EntryCreate'];
|
|
16
16
|
type PlatformEntryUpdate = components['schemas']['EntryUpdate'];
|
|
17
|
+
/**
|
|
18
|
+
* Entry counts by status (`GET /api/platform/entries/counts`): every known status, zero-filled,
|
|
19
|
+
* plus `total` — e.g. `{ inbox: 2, draft: 5, needs_review: 1, published: 40, …, total: 48 }`.
|
|
20
|
+
*/
|
|
21
|
+
type PlatformEntryCounts = Record<string, number>;
|
|
22
|
+
/**
|
|
23
|
+
* The dashboard (`GET /api/platform/stats/dashboard`): recent activity and the "needs attention"
|
|
24
|
+
* counts — inbox, drafts, entries needing review, pending AI suggestions, failures in the last 7 days.
|
|
25
|
+
*/
|
|
26
|
+
type PlatformDashboard = components['schemas']['DashboardData'];
|
|
27
|
+
type PlatformAttentionCounts = components['schemas']['AttentionCounts'];
|
|
28
|
+
type PlatformRecentEvent = components['schemas']['RecentEvent'];
|
|
17
29
|
/**
|
|
18
30
|
* Tag (Platform API) — the shared, group-scoped label vocabulary.
|
|
19
31
|
*/
|
|
@@ -51,6 +63,28 @@ interface SmartCollectionRules {
|
|
|
51
63
|
/** how to combine the dimensions above (default "all") */
|
|
52
64
|
match?: 'all' | 'any';
|
|
53
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Smart-collection rule preview: what unsaved rules would select, without saving anything.
|
|
68
|
+
*/
|
|
69
|
+
interface SmartRulesPreviewRequest {
|
|
70
|
+
/** Which kind of item the rules select (default 'entry'). */
|
|
71
|
+
targetType?: 'entry' | 'asset' | 'resource';
|
|
72
|
+
/** The rules, in the same shape as a collection's `smartRules`. */
|
|
73
|
+
smartRules?: SmartCollectionRules | Record<string, unknown> | null;
|
|
74
|
+
/** How many matches to list (default 10, at most 50); `total` counts them all. */
|
|
75
|
+
limit?: number;
|
|
76
|
+
}
|
|
77
|
+
type SmartRulesPreview = components['schemas']['SmartRulesPreview'];
|
|
78
|
+
/**
|
|
79
|
+
* One member of a collection of any target type (`GET /api/platform/collections/{id}/members`).
|
|
80
|
+
*/
|
|
81
|
+
interface CollectionMember {
|
|
82
|
+
id: string;
|
|
83
|
+
/** The entry's title, or the asset's / resource's name. */
|
|
84
|
+
label: string;
|
|
85
|
+
slug: string | null;
|
|
86
|
+
type: 'entry' | 'asset' | 'resource';
|
|
87
|
+
}
|
|
54
88
|
/**
|
|
55
89
|
* Resource (Platform API - full CRUD)
|
|
56
90
|
*/
|
|
@@ -111,6 +145,10 @@ declare class EntriesModule {
|
|
|
111
145
|
* List all entries
|
|
112
146
|
*/
|
|
113
147
|
list(): Promise<PlatformEntry[]>;
|
|
148
|
+
/**
|
|
149
|
+
* Entry counts by status, zero-filled, plus `total` (what the sidebar's inbox badge reads).
|
|
150
|
+
*/
|
|
151
|
+
counts(): Promise<PlatformEntryCounts>;
|
|
114
152
|
/**
|
|
115
153
|
* Get a single entry by ID
|
|
116
154
|
*/
|
|
@@ -141,6 +179,24 @@ declare class EntriesModule {
|
|
|
141
179
|
* Remove entry from a collection
|
|
142
180
|
*/
|
|
143
181
|
removeFromCollection(entryId: string, collectionId: string): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Apply the entry's staged AI suggestion (`suggestionJson`) and clear it — the approval half of
|
|
184
|
+
* AI write-back. Returns the updated entry.
|
|
185
|
+
*/
|
|
186
|
+
applySuggestion(id: string): Promise<PlatformEntry>;
|
|
187
|
+
/**
|
|
188
|
+
* Discard the entry's staged AI suggestion without applying it.
|
|
189
|
+
*/
|
|
190
|
+
rejectSuggestion(id: string): Promise<PlatformEntry>;
|
|
191
|
+
/**
|
|
192
|
+
* Approve an AI-suggested asset on an entry: it becomes a normal attached asset (and reaches
|
|
193
|
+
* published output).
|
|
194
|
+
*/
|
|
195
|
+
approveSuggestedAsset(entryId: string, assetId: string): Promise<PlatformEntry>;
|
|
196
|
+
/**
|
|
197
|
+
* Reject an AI-suggested asset: unlink it, and delete the asset if nothing else uses it.
|
|
198
|
+
*/
|
|
199
|
+
rejectSuggestedAsset(entryId: string, assetId: string): Promise<PlatformEntry>;
|
|
144
200
|
}
|
|
145
201
|
|
|
146
202
|
/**
|
|
@@ -170,6 +226,17 @@ declare class CollectionsModule {
|
|
|
170
226
|
* server keeps membership in sync. Pass extra fields (description, icon, …) via `extra`.
|
|
171
227
|
*/
|
|
172
228
|
createSmart(name: string, rules: SmartCollectionRules, extra?: Partial<PlatformCollectionCreate>): Promise<PlatformCollection>;
|
|
229
|
+
/**
|
|
230
|
+
* Preview unsaved smart-collection rules: how many items they match (`total`) and the first
|
|
231
|
+
* `limit` of them (default 10, at most 50), evaluated by the same code that materializes
|
|
232
|
+
* membership on save. Saves nothing. Needs EDITOR.
|
|
233
|
+
*/
|
|
234
|
+
preview(request: SmartRulesPreviewRequest): Promise<SmartRulesPreview>;
|
|
235
|
+
/**
|
|
236
|
+
* A collection's members, whatever it groups — entries, assets or resources — as
|
|
237
|
+
* `{id, label, slug, type}`, ordered by label.
|
|
238
|
+
*/
|
|
239
|
+
members(id: string): Promise<CollectionMember[]>;
|
|
173
240
|
/**
|
|
174
241
|
* Update a collection
|
|
175
242
|
*/
|
|
@@ -284,6 +351,14 @@ declare class ResourcesModule {
|
|
|
284
351
|
* Get entries that reference this resource
|
|
285
352
|
*/
|
|
286
353
|
getEntries(id: string): Promise<PlatformEntry[]>;
|
|
354
|
+
/**
|
|
355
|
+
* Apply the resource's staged AI suggestion (`suggestionJson`) and clear it. Needs EDITOR.
|
|
356
|
+
*/
|
|
357
|
+
applySuggestion(id: string): Promise<PlatformResource>;
|
|
358
|
+
/**
|
|
359
|
+
* Discard the resource's staged AI suggestion without applying it. Needs EDITOR.
|
|
360
|
+
*/
|
|
361
|
+
rejectSuggestion(id: string): Promise<PlatformResource>;
|
|
287
362
|
}
|
|
288
363
|
|
|
289
364
|
/**
|
|
@@ -343,7 +418,13 @@ declare class AssetsModule {
|
|
|
343
418
|
*/
|
|
344
419
|
delete(id: string): Promise<void>;
|
|
345
420
|
/**
|
|
346
|
-
*
|
|
421
|
+
* Download an asset's file: its bytes and content type. A redirect to storage is followed.
|
|
422
|
+
*/
|
|
423
|
+
download(id: string): Promise<BinaryResponse>;
|
|
424
|
+
/**
|
|
425
|
+
* Fetch the raw file for an asset.
|
|
426
|
+
* @deprecated Use {@link download}, which is typed. (Before 4.3 this resolved to `undefined` for
|
|
427
|
+
* any file that wasn't JSON; it now returns the same `BinaryResponse` as `download`.)
|
|
347
428
|
*/
|
|
348
429
|
getFile(id: string): Promise<unknown>;
|
|
349
430
|
/**
|
|
@@ -351,6 +432,14 @@ declare class AssetsModule {
|
|
|
351
432
|
* Use this to create download links or fetch the file directly
|
|
352
433
|
*/
|
|
353
434
|
getDownloadUrl(id: string, baseUrl?: string): string;
|
|
435
|
+
/**
|
|
436
|
+
* Apply the asset's staged AI suggestion (`suggestionJson`) and clear it. Needs EDITOR.
|
|
437
|
+
*/
|
|
438
|
+
applySuggestion(id: string): Promise<PlatformAsset>;
|
|
439
|
+
/**
|
|
440
|
+
* Discard the asset's staged AI suggestion without applying it. Needs EDITOR.
|
|
441
|
+
*/
|
|
442
|
+
rejectSuggestion(id: string): Promise<PlatformAsset>;
|
|
354
443
|
}
|
|
355
444
|
|
|
356
445
|
/**
|
|
@@ -542,6 +631,11 @@ declare class WorkspacesModule {
|
|
|
542
631
|
* Get platform-level stats for the current workspace
|
|
543
632
|
*/
|
|
544
633
|
getStats(): Promise<unknown>;
|
|
634
|
+
/**
|
|
635
|
+
* The current workspace's dashboard: recent activity and the "needs attention" counts (inbox,
|
|
636
|
+
* drafts, entries needing review, pending AI suggestions, failures in the last 7 days).
|
|
637
|
+
*/
|
|
638
|
+
getDashboard(): Promise<PlatformDashboard>;
|
|
545
639
|
/**
|
|
546
640
|
* List available workspace backups
|
|
547
641
|
*/
|
|
@@ -2912,7 +3006,32 @@ declare class AutomationsModule {
|
|
|
2912
3006
|
* Routes: /api/incoming-webhooks (CRUD) + /api/incoming-webhooks/{id}/token (mint/revoke).
|
|
2913
3007
|
*/
|
|
2914
3008
|
|
|
2915
|
-
|
|
3009
|
+
/**
|
|
3010
|
+
* How a webhook verifies its sender. Unset = no verification, or the default HMAC check
|
|
3011
|
+
* (`sha256=<hex>` in `X-Signature-256`) once `signingSecretRef` names the workspace secret
|
|
3012
|
+
* holding the sender's key. `signatureScheme` picks a preset (see
|
|
3013
|
+
* {@link IncomingWebhooksModule.signatureSchemes}) or `custom`, described by `signatureConfig`.
|
|
3014
|
+
*/
|
|
3015
|
+
interface IncomingWebhookSignature {
|
|
3016
|
+
/** Slug of the workspace secret holding the sender's signing key. */
|
|
3017
|
+
signingSecretRef?: string | null;
|
|
3018
|
+
/** The header carrying the signature (defaults to X-Signature-256). */
|
|
3019
|
+
signatureHeader?: string | null;
|
|
3020
|
+
/** A core preset, an integration's preset, or `custom`. */
|
|
3021
|
+
signatureScheme?: string | null;
|
|
3022
|
+
/** The URL the sender signs, for schemes that sign the URL (when it differs from the receiver's). */
|
|
3023
|
+
signatureUrl?: string | null;
|
|
3024
|
+
/** The construction for `custom`. */
|
|
3025
|
+
signatureConfig?: Record<string, unknown> | null;
|
|
3026
|
+
}
|
|
3027
|
+
/** A scheme a webhook can verify with: core presets, then integration presets, then `custom`. */
|
|
3028
|
+
interface IncomingWebhookSignatureScheme {
|
|
3029
|
+
name: string;
|
|
3030
|
+
notes: string;
|
|
3031
|
+
/** `core`, or the slug of the integration that contributes it. */
|
|
3032
|
+
source: string;
|
|
3033
|
+
}
|
|
3034
|
+
interface IncomingWebhook extends IncomingWebhookSignature {
|
|
2916
3035
|
id: string;
|
|
2917
3036
|
groupId: string;
|
|
2918
3037
|
name: string;
|
|
@@ -2924,13 +3043,13 @@ interface IncomingWebhook {
|
|
|
2924
3043
|
receivedCount: number;
|
|
2925
3044
|
lastReceivedAt: string | null;
|
|
2926
3045
|
}
|
|
2927
|
-
interface IncomingWebhookCreate {
|
|
3046
|
+
interface IncomingWebhookCreate extends IncomingWebhookSignature {
|
|
2928
3047
|
name: string;
|
|
2929
3048
|
slug?: string;
|
|
2930
3049
|
description?: string;
|
|
2931
3050
|
enabled?: boolean;
|
|
2932
3051
|
}
|
|
2933
|
-
interface IncomingWebhookUpdate {
|
|
3052
|
+
interface IncomingWebhookUpdate extends IncomingWebhookSignature {
|
|
2934
3053
|
name?: string;
|
|
2935
3054
|
description?: string;
|
|
2936
3055
|
enabled?: boolean;
|
|
@@ -2940,6 +3059,8 @@ declare class IncomingWebhooksModule {
|
|
|
2940
3059
|
constructor(http: HttpClient);
|
|
2941
3060
|
/** List the workspace's incoming webhooks. */
|
|
2942
3061
|
list(): Promise<IncomingWebhook[]>;
|
|
3062
|
+
/** The signature schemes a webhook can pick (`signatureScheme`). */
|
|
3063
|
+
signatureSchemes(): Promise<IncomingWebhookSignatureScheme[]>;
|
|
2943
3064
|
get(id: string): Promise<IncomingWebhook>;
|
|
2944
3065
|
/** Create an incoming webhook (no token yet — mint one with {@link mintToken}). */
|
|
2945
3066
|
create(body: IncomingWebhookCreate): Promise<IncomingWebhook>;
|
|
@@ -2951,6 +3072,66 @@ declare class IncomingWebhooksModule {
|
|
|
2951
3072
|
revokeToken(id: string): Promise<IncomingWebhook>;
|
|
2952
3073
|
}
|
|
2953
3074
|
|
|
3075
|
+
/**
|
|
3076
|
+
* Blueprints Module — Platform API
|
|
3077
|
+
*
|
|
3078
|
+
* The catalog of structure a workspace could have — collections, entry types, scheduled tasks and
|
|
3079
|
+
* workflows that core ships and installed integrations contribute — and applying them to the active
|
|
3080
|
+
* workspace. Each catalog entry says whether this workspace can use it (`available`,
|
|
3081
|
+
* `missingRequirements`), already has it (`applied`), or has an older version of it (`outdated`).
|
|
3082
|
+
*
|
|
3083
|
+
* Applying creates what is missing and never overwrites what exists, so a repeat call is a no-op;
|
|
3084
|
+
* the result says what happened. Reads: any member. Apply and update: workspace ADMIN.
|
|
3085
|
+
*
|
|
3086
|
+
* Routes: /api/groups/blueprints (+ /categories, /{slug}, /{slug}/apply, /{slug}/update, /apply).
|
|
3087
|
+
*/
|
|
3088
|
+
|
|
3089
|
+
type Blueprint = components['schemas']['BlueprintRead'];
|
|
3090
|
+
type BlueprintApplyResult = components['schemas']['BlueprintApplyResult'];
|
|
3091
|
+
type BlueprintParameter = components['schemas']['BlueprintParameter'];
|
|
3092
|
+
interface BlueprintListOptions {
|
|
3093
|
+
/** `collection`, `entry_type`, `scheduled_task`, … */
|
|
3094
|
+
kind?: string;
|
|
3095
|
+
category?: string;
|
|
3096
|
+
/** `core`, or a provider slug. */
|
|
3097
|
+
source?: string;
|
|
3098
|
+
/** The connection to check per-integration blueprints against (`applied`). */
|
|
3099
|
+
integrationId?: string;
|
|
3100
|
+
}
|
|
3101
|
+
interface BlueprintApplyOptions {
|
|
3102
|
+
/** Pick the blueprint from this source when several share a slug. */
|
|
3103
|
+
source?: string;
|
|
3104
|
+
/** The connection a per-integration blueprint is applied for. */
|
|
3105
|
+
integrationId?: string;
|
|
3106
|
+
}
|
|
3107
|
+
declare class BlueprintsModule {
|
|
3108
|
+
private http;
|
|
3109
|
+
constructor(http: HttpClient);
|
|
3110
|
+
private query;
|
|
3111
|
+
/** The catalog, annotated with what this workspace can do about each blueprint. */
|
|
3112
|
+
list(options?: BlueprintListOptions): Promise<Blueprint[]>;
|
|
3113
|
+
/** Category names in catalog order: core's first, then each provider's. */
|
|
3114
|
+
categories(): Promise<string[]>;
|
|
3115
|
+
/** One blueprint, including its payload. */
|
|
3116
|
+
get(slug: string, options?: {
|
|
3117
|
+
source?: string;
|
|
3118
|
+
}): Promise<Blueprint>;
|
|
3119
|
+
/**
|
|
3120
|
+
* Create this blueprint's object in the workspace if it isn't there yet. `params` fills the
|
|
3121
|
+
* parameters the blueprint declares, e.g. `{ entry_type: 'post' }`. Needs ADMIN.
|
|
3122
|
+
*/
|
|
3123
|
+
apply(slug: string, params?: Record<string, unknown>, options?: BlueprintApplyOptions): Promise<BlueprintApplyResult>;
|
|
3124
|
+
/**
|
|
3125
|
+
* Apply several blueprints at once; entry types are created before the collections and tasks that
|
|
3126
|
+
* use them, whatever the order here. `params` is keyed by blueprint slug. Needs ADMIN.
|
|
3127
|
+
*/
|
|
3128
|
+
applyMany(slugs: string[], params?: Record<string, Record<string, unknown>>, options?: BlueprintApplyOptions): Promise<BlueprintApplyResult[]>;
|
|
3129
|
+
/** Replace an applied workflow's steps with what its integration declares now. Needs ADMIN. */
|
|
3130
|
+
update(slug: string, params?: Record<string, unknown>, options?: {
|
|
3131
|
+
source?: string;
|
|
3132
|
+
}): Promise<BlueprintApplyResult>;
|
|
3133
|
+
}
|
|
3134
|
+
|
|
2954
3135
|
/**
|
|
2955
3136
|
* Site Module - Platform API
|
|
2956
3137
|
*
|
|
@@ -3024,6 +3205,8 @@ declare class PlatformClient extends HttpClient {
|
|
|
3024
3205
|
ai: AIModule;
|
|
3025
3206
|
automations: AutomationsModule;
|
|
3026
3207
|
incomingWebhooks: IncomingWebhooksModule;
|
|
3208
|
+
/** Blueprint catalog: browse and apply collections, entry types, tasks and workflows */
|
|
3209
|
+
blueprints: BlueprintsModule;
|
|
3027
3210
|
site: SiteModule;
|
|
3028
3211
|
adminUsers: AdminUsersModule;
|
|
3029
3212
|
adminSystem: AdminSystemModule;
|
|
@@ -3055,4 +3238,4 @@ declare class PlatformClient extends HttpClient {
|
|
|
3055
3238
|
*/
|
|
3056
3239
|
declare function createPlatformClient(config?: Partial<PlatformClientConfig>): PlatformClient;
|
|
3057
3240
|
|
|
3058
|
-
export { type AIApprovalMode, type AIChatRequest, type AIChatResult, type AICredentialMode, type AIExecution, type AIExecutionListParams, type AIExecutionStatus, AIExecutionsModule, AIMcpServersModule, type AIModel, type AIModelCreate, type AIModelUpdate, AIModelsModule, AIModule, type AIOperationExecuteRequest, type AIOperationInfo, AIOperationsModule, type AIProvider, type AIProviderCreate, type AIProviderTestResult, type AIProviderType, type AIProviderUpdate, AIProvidersModule, type AIReindexRequest, type AISettings, AISettingsModule, type AISettingsUpdate, type AIToolInfo, type AIToolInvokeRequest, AIToolsModule, APIClientsModule, type AdminAboutInfo, AdminBackupsModule, AdminMaintenanceModule, type AdminPlugin, type AdminPluginProvider, AdminScheduledTasksModule, AdminSystemModule, AdminUsersModule, type AdminWorkspaceMemberCreate, type AdminWorkspaceMemberUpdate, type AdminWorkspaceMembership, AdminWorkspacesModule, type AgentToolInfo, type AlertRouting, type AlertRoutingTarget, type AlertRoutingUpdate, type ApiToken, type ApiTokenCreate, type ApiTokenUpdate, type ApiTokenWithToken, type AppAboutInfo, AppModule, type AppTheme, AssetsModule, AuthModule, type Automation, type AutomationAction, type AutomationActionExecution, type AutomationActionOption, type AutomationCondition, type AutomationConditionField, type AutomationCreate, type AutomationDefinition, type AutomationDryRunOptions, type AutomationDryRunResult, type AutomationDryRunSample, type AutomationExecution, type AutomationExecutionDetail, type AutomationIncomingWebhookOption, type AutomationOptions, type AutomationPlanStep, type AutomationPreviewMatch, type AutomationPreviewResult, type AutomationRunResult, type AutomationSamples, type AutomationTarget, type AutomationTargetOption, type AutomationTrigger, type AutomationUpdate, type AutomationValidateResult, type AutomationValidationIssue, type AutomationWebhookOption, AutomationsModule, CollectionsModule, type EmailEventSubscription, type EmailEventSubscriptionCreate, EmailEventSubscriptionsModule, type EmailInvitationRequest, type EmailSettings, type EmailSettingsUpdate, type EmailSuccess, type EmailTemplateCreate$1 as EmailTemplateCreate, type EmailTemplateRead, type EmailTemplateSummary, type EmailTemplateUpdate, EmailTemplatesClient, type EmailTest, EntriesModule, EntryTypesModule, type EventLogEntry, EventLogModule, type EventLogQueryParams, type EventLogSummary, type EventOption, type EventVariable, EventsModule, FormsModule, type IncomingWebhook, type IncomingWebhookCreate, type IncomingWebhookUpdate, IncomingWebhooksModule, type Integration, type IntegrationActionResult, type IntegrationAttention, type IntegrationCheckResult, type IntegrationCreate, type IntegrationErrorOverrides, type IntegrationEventSubscription, type IntegrationEventSubscriptionCreate, type IntegrationEventSubscriptionUpdate, type IntegrationOption, type IntegrationPluginInfo, type IntegrationProviderAction, type IntegrationProviderCredential, type IntegrationProviderEvent, type IntegrationProviderInfo, type IntegrationResolveResult, type IntegrationUpdate, IntegrationsModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, type LoginInfo, type MaintenanceStorageDetails, type MaintenanceSummary, type McpServer, type McpServerCreate, type McpServerTestResult, type McpServerToolInfo, type McpServerUpdate, type McpTransport, type PasswordChange, type PasswordResetTokenRequest, type PasswordResetTokenResponse, type PlatformAPIClient, type PlatformAPIClientCreate, type PlatformAPIClientUpdate, type PlatformAPIClientWithToken, type PlatformAsset, type PlatformAssetUpdate, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformEntry, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformForm, type PlatformFormCreate, type PlatformFormSubmission, type PlatformFormUpdate, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformTag, type PlatformTagCreate, type PlatformTagUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, type RecipientType, ResourcesModule, type ScheduledTask, type ScheduledTaskCreate, type ScheduledTaskExecutionLog, type ScheduledTaskUpdate, ScheduledTasksModule, type SiteBuildStatus, SiteModule, type SiteRebuildPending, type SiteRebuildRequested, type SiteRebuildSent, type SiteRebuildStatus, type SiteRebuildTarget, type SmartCollectionRules, type StartupInfo, type SystemStatistics, TagsModule, type TaskTypeInfo, type TestEmailRequest, ThemeModule, type UnlockUserRequest, type User, type UserCreate, UserModule, type UserPagination, type UserProfile, type UserProfileUpdate, type UserSummary, type UserUpdate, type Webhook, type WebhookCreate, type WebhookMethod, type WebhookPagination, type WebhookUpdate, WebhooksModule, type Workspace, type WorkspaceActivationRequest, type WorkspaceCreate, WorkspaceMembersModule, type WorkspacePagination, type WorkspacePreferences, type WorkspacePreferencesUpdate, type WorkspaceUpdate, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient, createPlatformConfigFromEnv };
|
|
3241
|
+
export { type AIApprovalMode, type AIChatRequest, type AIChatResult, type AICredentialMode, type AIExecution, type AIExecutionListParams, type AIExecutionStatus, AIExecutionsModule, AIMcpServersModule, type AIModel, type AIModelCreate, type AIModelUpdate, AIModelsModule, AIModule, type AIOperationExecuteRequest, type AIOperationInfo, AIOperationsModule, type AIProvider, type AIProviderCreate, type AIProviderTestResult, type AIProviderType, type AIProviderUpdate, AIProvidersModule, type AIReindexRequest, type AISettings, AISettingsModule, type AISettingsUpdate, type AIToolInfo, type AIToolInvokeRequest, AIToolsModule, APIClientsModule, type AdminAboutInfo, AdminBackupsModule, AdminMaintenanceModule, type AdminPlugin, type AdminPluginProvider, AdminScheduledTasksModule, AdminSystemModule, AdminUsersModule, type AdminWorkspaceMemberCreate, type AdminWorkspaceMemberUpdate, type AdminWorkspaceMembership, AdminWorkspacesModule, type AgentToolInfo, type AlertRouting, type AlertRoutingTarget, type AlertRoutingUpdate, type ApiToken, type ApiTokenCreate, type ApiTokenUpdate, type ApiTokenWithToken, type AppAboutInfo, AppModule, type AppTheme, AssetsModule, AuthModule, type Automation, type AutomationAction, type AutomationActionExecution, type AutomationActionOption, type AutomationCondition, type AutomationConditionField, type AutomationCreate, type AutomationDefinition, type AutomationDryRunOptions, type AutomationDryRunResult, type AutomationDryRunSample, type AutomationExecution, type AutomationExecutionDetail, type AutomationIncomingWebhookOption, type AutomationOptions, type AutomationPlanStep, type AutomationPreviewMatch, type AutomationPreviewResult, type AutomationRunResult, type AutomationSamples, type AutomationTarget, type AutomationTargetOption, type AutomationTrigger, type AutomationUpdate, type AutomationValidateResult, type AutomationValidationIssue, type AutomationWebhookOption, AutomationsModule, type Blueprint, type BlueprintApplyOptions, type BlueprintApplyResult, type BlueprintListOptions, type BlueprintParameter, BlueprintsModule, type CollectionMember, CollectionsModule, type EmailEventSubscription, type EmailEventSubscriptionCreate, EmailEventSubscriptionsModule, type EmailInvitationRequest, type EmailSettings, type EmailSettingsUpdate, type EmailSuccess, type EmailTemplateCreate$1 as EmailTemplateCreate, type EmailTemplateRead, type EmailTemplateSummary, type EmailTemplateUpdate, EmailTemplatesClient, type EmailTest, EntriesModule, EntryTypesModule, type EventLogEntry, EventLogModule, type EventLogQueryParams, type EventLogSummary, type EventOption, type EventVariable, EventsModule, FormsModule, type IncomingWebhook, type IncomingWebhookCreate, type IncomingWebhookSignature, type IncomingWebhookSignatureScheme, type IncomingWebhookUpdate, IncomingWebhooksModule, type Integration, type IntegrationActionResult, type IntegrationAttention, type IntegrationCheckResult, type IntegrationCreate, type IntegrationErrorOverrides, type IntegrationEventSubscription, type IntegrationEventSubscriptionCreate, type IntegrationEventSubscriptionUpdate, type IntegrationOption, type IntegrationPluginInfo, type IntegrationProviderAction, type IntegrationProviderCredential, type IntegrationProviderEvent, type IntegrationProviderInfo, type IntegrationResolveResult, type IntegrationUpdate, IntegrationsModule, type InviteTokenCreate, type InviteTokenPagination, type InviteTokenSummary, InvitesModule, type LoginInfo, type MaintenanceStorageDetails, type MaintenanceSummary, type McpServer, type McpServerCreate, type McpServerTestResult, type McpServerToolInfo, type McpServerUpdate, type McpTransport, type PasswordChange, type PasswordResetTokenRequest, type PasswordResetTokenResponse, type PlatformAPIClient, type PlatformAPIClientCreate, type PlatformAPIClientUpdate, type PlatformAPIClientWithToken, type PlatformAsset, type PlatformAssetUpdate, type PlatformAttentionCounts, PlatformClient, type PlatformClientConfig, type PlatformCollection, type PlatformCollectionCreate, type PlatformCollectionUpdate, type PlatformDashboard, type PlatformEntry, type PlatformEntryCounts, type PlatformEntryCreate, type PlatformEntryType, type PlatformEntryUpdate, type PlatformForm, type PlatformFormCreate, type PlatformFormSubmission, type PlatformFormUpdate, type PlatformRecentEvent, type PlatformResource, type PlatformResourceCreate, type PlatformResourceUpdate, type PlatformTag, type PlatformTagCreate, type PlatformTagUpdate, type PlatformWorkspaceMember, type PlatformWorkspaceMemberCreate, type PlatformWorkspaceMemberUpdate, type RecipientType, ResourcesModule, type ScheduledTask, type ScheduledTaskCreate, type ScheduledTaskExecutionLog, type ScheduledTaskUpdate, ScheduledTasksModule, type SiteBuildStatus, SiteModule, type SiteRebuildPending, type SiteRebuildRequested, type SiteRebuildSent, type SiteRebuildStatus, type SiteRebuildTarget, type SmartCollectionRules, type SmartRulesPreview, type SmartRulesPreviewRequest, type StartupInfo, type SystemStatistics, TagsModule, type TaskTypeInfo, type TestEmailRequest, ThemeModule, type UnlockUserRequest, type User, type UserCreate, UserModule, type UserPagination, type UserProfile, type UserProfileUpdate, type UserSummary, type UserUpdate, type Webhook, type WebhookCreate, type WebhookMethod, type WebhookPagination, type WebhookUpdate, WebhooksModule, type Workspace, type WorkspaceActivationRequest, type WorkspaceCreate, WorkspaceMembersModule, type WorkspacePagination, type WorkspacePreferences, type WorkspacePreferencesUpdate, type WorkspaceUpdate, type WorkspaceWithMembership, WorkspacesModule, createPlatformClient, createPlatformConfigFromEnv };
|
package/dist/platform.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
MarvinValidationError,
|
|
4
4
|
SessionAuth,
|
|
5
5
|
init_core
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-LTX3MAUE.js";
|
|
7
7
|
|
|
8
8
|
// src/platform/client.ts
|
|
9
9
|
init_core();
|
|
@@ -20,6 +20,12 @@ var EntriesModule = class {
|
|
|
20
20
|
async list() {
|
|
21
21
|
return this.http.get("/api/platform/entries");
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* Entry counts by status, zero-filled, plus `total` (what the sidebar's inbox badge reads).
|
|
25
|
+
*/
|
|
26
|
+
async counts() {
|
|
27
|
+
return this.http.get("/api/platform/entries/counts");
|
|
28
|
+
}
|
|
23
29
|
/**
|
|
24
30
|
* Get a single entry by ID
|
|
25
31
|
*/
|
|
@@ -73,6 +79,38 @@ var EntriesModule = class {
|
|
|
73
79
|
const validCollectionId = this.http.validatePathParam(collectionId, "collection ID");
|
|
74
80
|
return this.http.delete(`/api/platform/entries/${validEntryId}/collections/${validCollectionId}`);
|
|
75
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Apply the entry's staged AI suggestion (`suggestionJson`) and clear it — the approval half of
|
|
84
|
+
* AI write-back. Returns the updated entry.
|
|
85
|
+
*/
|
|
86
|
+
async applySuggestion(id) {
|
|
87
|
+
const validId = this.http.validatePathParam(id, "entry ID");
|
|
88
|
+
return this.http.post(`/api/platform/entries/${validId}/apply-suggestion`, {});
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Discard the entry's staged AI suggestion without applying it.
|
|
92
|
+
*/
|
|
93
|
+
async rejectSuggestion(id) {
|
|
94
|
+
const validId = this.http.validatePathParam(id, "entry ID");
|
|
95
|
+
return this.http.post(`/api/platform/entries/${validId}/reject-suggestion`, {});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Approve an AI-suggested asset on an entry: it becomes a normal attached asset (and reaches
|
|
99
|
+
* published output).
|
|
100
|
+
*/
|
|
101
|
+
async approveSuggestedAsset(entryId, assetId) {
|
|
102
|
+
const e = this.http.validatePathParam(entryId, "entry ID");
|
|
103
|
+
const a = this.http.validatePathParam(assetId, "asset ID");
|
|
104
|
+
return this.http.post(`/api/platform/entries/${e}/suggested-assets/${a}/approve`, {});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Reject an AI-suggested asset: unlink it, and delete the asset if nothing else uses it.
|
|
108
|
+
*/
|
|
109
|
+
async rejectSuggestedAsset(entryId, assetId) {
|
|
110
|
+
const e = this.http.validatePathParam(entryId, "entry ID");
|
|
111
|
+
const a = this.http.validatePathParam(assetId, "asset ID");
|
|
112
|
+
return this.http.post(`/api/platform/entries/${e}/suggested-assets/${a}/reject`, {});
|
|
113
|
+
}
|
|
76
114
|
};
|
|
77
115
|
|
|
78
116
|
// src/platform/collections.ts
|
|
@@ -113,6 +151,22 @@ var CollectionsModule = class {
|
|
|
113
151
|
smartRules: rules
|
|
114
152
|
});
|
|
115
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Preview unsaved smart-collection rules: how many items they match (`total`) and the first
|
|
156
|
+
* `limit` of them (default 10, at most 50), evaluated by the same code that materializes
|
|
157
|
+
* membership on save. Saves nothing. Needs EDITOR.
|
|
158
|
+
*/
|
|
159
|
+
async preview(request) {
|
|
160
|
+
return this.http.post("/api/platform/collections/preview", request);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* A collection's members, whatever it groups — entries, assets or resources — as
|
|
164
|
+
* `{id, label, slug, type}`, ordered by label.
|
|
165
|
+
*/
|
|
166
|
+
async members(id) {
|
|
167
|
+
const validId = this.http.validatePathParam(id, "collection ID");
|
|
168
|
+
return this.http.get(`/api/platform/collections/${validId}/members`);
|
|
169
|
+
}
|
|
116
170
|
/**
|
|
117
171
|
* Update a collection
|
|
118
172
|
*/
|
|
@@ -286,6 +340,20 @@ var ResourcesModule = class {
|
|
|
286
340
|
async getEntries(id) {
|
|
287
341
|
return this.http.get(`/api/platform/resources/${id}/entries`);
|
|
288
342
|
}
|
|
343
|
+
/**
|
|
344
|
+
* Apply the resource's staged AI suggestion (`suggestionJson`) and clear it. Needs EDITOR.
|
|
345
|
+
*/
|
|
346
|
+
async applySuggestion(id) {
|
|
347
|
+
const validId = this.http.validatePathParam(id, "resource ID");
|
|
348
|
+
return this.http.post(`/api/platform/resources/${validId}/apply-suggestion`, {});
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Discard the resource's staged AI suggestion without applying it. Needs EDITOR.
|
|
352
|
+
*/
|
|
353
|
+
async rejectSuggestion(id) {
|
|
354
|
+
const validId = this.http.validatePathParam(id, "resource ID");
|
|
355
|
+
return this.http.post(`/api/platform/resources/${validId}/reject-suggestion`, {});
|
|
356
|
+
}
|
|
289
357
|
};
|
|
290
358
|
|
|
291
359
|
// src/platform/assets.ts
|
|
@@ -401,11 +469,19 @@ var AssetsModule = class {
|
|
|
401
469
|
return this.http.delete(`/api/platform/assets/${validId}`);
|
|
402
470
|
}
|
|
403
471
|
/**
|
|
404
|
-
*
|
|
472
|
+
* Download an asset's file: its bytes and content type. A redirect to storage is followed.
|
|
405
473
|
*/
|
|
406
|
-
async
|
|
474
|
+
async download(id) {
|
|
407
475
|
const validId = this.http.validatePathParam(id, "asset ID");
|
|
408
|
-
return this.http.
|
|
476
|
+
return this.http.getBinary(`/api/platform/assets/${validId}/file`);
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Fetch the raw file for an asset.
|
|
480
|
+
* @deprecated Use {@link download}, which is typed. (Before 4.3 this resolved to `undefined` for
|
|
481
|
+
* any file that wasn't JSON; it now returns the same `BinaryResponse` as `download`.)
|
|
482
|
+
*/
|
|
483
|
+
async getFile(id) {
|
|
484
|
+
return this.download(id);
|
|
409
485
|
}
|
|
410
486
|
/**
|
|
411
487
|
* Get download URL for an asset file
|
|
@@ -416,6 +492,20 @@ var AssetsModule = class {
|
|
|
416
492
|
const base = baseUrl || (typeof window !== "undefined" && window.location ? window.location.origin : "");
|
|
417
493
|
return `${base}/api/platform/assets/${validId}/file`;
|
|
418
494
|
}
|
|
495
|
+
/**
|
|
496
|
+
* Apply the asset's staged AI suggestion (`suggestionJson`) and clear it. Needs EDITOR.
|
|
497
|
+
*/
|
|
498
|
+
async applySuggestion(id) {
|
|
499
|
+
const validId = this.http.validatePathParam(id, "asset ID");
|
|
500
|
+
return this.http.post(`/api/platform/assets/${validId}/apply-suggestion`, {});
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Discard the asset's staged AI suggestion without applying it. Needs EDITOR.
|
|
504
|
+
*/
|
|
505
|
+
async rejectSuggestion(id) {
|
|
506
|
+
const validId = this.http.validatePathParam(id, "asset ID");
|
|
507
|
+
return this.http.post(`/api/platform/assets/${validId}/reject-suggestion`, {});
|
|
508
|
+
}
|
|
419
509
|
};
|
|
420
510
|
|
|
421
511
|
// src/platform/apiClients.ts
|
|
@@ -666,6 +756,13 @@ var WorkspacesModule = class {
|
|
|
666
756
|
async getStats() {
|
|
667
757
|
return this.http.get("/api/platform/stats");
|
|
668
758
|
}
|
|
759
|
+
/**
|
|
760
|
+
* The current workspace's dashboard: recent activity and the "needs attention" counts (inbox,
|
|
761
|
+
* drafts, entries needing review, pending AI suggestions, failures in the last 7 days).
|
|
762
|
+
*/
|
|
763
|
+
async getDashboard() {
|
|
764
|
+
return this.http.get("/api/platform/stats/dashboard");
|
|
765
|
+
}
|
|
669
766
|
/**
|
|
670
767
|
* List available workspace backups
|
|
671
768
|
*/
|
|
@@ -2364,6 +2461,10 @@ var IncomingWebhooksModule = class {
|
|
|
2364
2461
|
async list() {
|
|
2365
2462
|
return this.http.get("/api/incoming-webhooks");
|
|
2366
2463
|
}
|
|
2464
|
+
/** The signature schemes a webhook can pick (`signatureScheme`). */
|
|
2465
|
+
async signatureSchemes() {
|
|
2466
|
+
return this.http.get("/api/incoming-webhooks/signature-schemes");
|
|
2467
|
+
}
|
|
2367
2468
|
async get(id) {
|
|
2368
2469
|
const validId = this.http.validatePathParam(id, "incoming webhook id");
|
|
2369
2470
|
return this.http.get(`/api/incoming-webhooks/${validId}`);
|
|
@@ -2392,6 +2493,59 @@ var IncomingWebhooksModule = class {
|
|
|
2392
2493
|
}
|
|
2393
2494
|
};
|
|
2394
2495
|
|
|
2496
|
+
// src/platform/blueprints.ts
|
|
2497
|
+
var BASE2 = "/api/groups/blueprints";
|
|
2498
|
+
var BlueprintsModule = class {
|
|
2499
|
+
constructor(http) {
|
|
2500
|
+
this.http = http;
|
|
2501
|
+
}
|
|
2502
|
+
http;
|
|
2503
|
+
query(options = {}) {
|
|
2504
|
+
return this.http.buildQueryString({ source: options.source, integration_id: options.integrationId });
|
|
2505
|
+
}
|
|
2506
|
+
/** The catalog, annotated with what this workspace can do about each blueprint. */
|
|
2507
|
+
async list(options = {}) {
|
|
2508
|
+
return this.http.get(BASE2, {
|
|
2509
|
+
kind: options.kind,
|
|
2510
|
+
category: options.category,
|
|
2511
|
+
source: options.source,
|
|
2512
|
+
integration_id: options.integrationId
|
|
2513
|
+
});
|
|
2514
|
+
}
|
|
2515
|
+
/** Category names in catalog order: core's first, then each provider's. */
|
|
2516
|
+
async categories() {
|
|
2517
|
+
return this.http.get(`${BASE2}/categories`);
|
|
2518
|
+
}
|
|
2519
|
+
/** One blueprint, including its payload. */
|
|
2520
|
+
async get(slug, options = {}) {
|
|
2521
|
+
const validSlug = this.http.validatePathParam(slug, "blueprint slug");
|
|
2522
|
+
return this.http.get(`${BASE2}/${validSlug}`, { source: options.source });
|
|
2523
|
+
}
|
|
2524
|
+
/**
|
|
2525
|
+
* Create this blueprint's object in the workspace if it isn't there yet. `params` fills the
|
|
2526
|
+
* parameters the blueprint declares, e.g. `{ entry_type: 'post' }`. Needs ADMIN.
|
|
2527
|
+
*/
|
|
2528
|
+
async apply(slug, params, options = {}) {
|
|
2529
|
+
const validSlug = this.http.validatePathParam(slug, "blueprint slug");
|
|
2530
|
+
return this.http.post(`${BASE2}/${validSlug}/apply${this.query(options)}`, params);
|
|
2531
|
+
}
|
|
2532
|
+
/**
|
|
2533
|
+
* Apply several blueprints at once; entry types are created before the collections and tasks that
|
|
2534
|
+
* use them, whatever the order here. `params` is keyed by blueprint slug. Needs ADMIN.
|
|
2535
|
+
*/
|
|
2536
|
+
async applyMany(slugs, params, options = {}) {
|
|
2537
|
+
return this.http.post(`${BASE2}/apply${this.query(options)}`, {
|
|
2538
|
+
slugs,
|
|
2539
|
+
...params ? { params } : {}
|
|
2540
|
+
});
|
|
2541
|
+
}
|
|
2542
|
+
/** Replace an applied workflow's steps with what its integration declares now. Needs ADMIN. */
|
|
2543
|
+
async update(slug, params, options = {}) {
|
|
2544
|
+
const validSlug = this.http.validatePathParam(slug, "blueprint slug");
|
|
2545
|
+
return this.http.post(`${BASE2}/${validSlug}/update${this.query(options)}`, params);
|
|
2546
|
+
}
|
|
2547
|
+
};
|
|
2548
|
+
|
|
2395
2549
|
// src/platform/site.ts
|
|
2396
2550
|
var REBUILD = "/api/platform/site/rebuild";
|
|
2397
2551
|
var SiteModule = class {
|
|
@@ -2458,6 +2612,8 @@ var PlatformClient = class extends HttpClient {
|
|
|
2458
2612
|
automations;
|
|
2459
2613
|
// Incoming (ingress) webhooks — tokened endpoints that drop events on the bus.
|
|
2460
2614
|
incomingWebhooks;
|
|
2615
|
+
/** Blueprint catalog: browse and apply collections, entry types, tasks and workflows */
|
|
2616
|
+
blueprints;
|
|
2461
2617
|
// Site — request a rebuild of the workspace's static site and read its status.
|
|
2462
2618
|
site;
|
|
2463
2619
|
// Admin modules
|
|
@@ -2502,6 +2658,7 @@ var PlatformClient = class extends HttpClient {
|
|
|
2502
2658
|
this.ai = new AIModule(this);
|
|
2503
2659
|
this.automations = new AutomationsModule(this);
|
|
2504
2660
|
this.incomingWebhooks = new IncomingWebhooksModule(this);
|
|
2661
|
+
this.blueprints = new BlueprintsModule(this);
|
|
2505
2662
|
this.site = new SiteModule(this);
|
|
2506
2663
|
this.adminUsers = new AdminUsersModule(this);
|
|
2507
2664
|
this.adminSystem = new AdminSystemModule(this);
|
|
@@ -2536,6 +2693,7 @@ export {
|
|
|
2536
2693
|
AssetsModule,
|
|
2537
2694
|
AuthModule,
|
|
2538
2695
|
AutomationsModule,
|
|
2696
|
+
BlueprintsModule,
|
|
2539
2697
|
CollectionsModule,
|
|
2540
2698
|
EmailEventSubscriptionsModule,
|
|
2541
2699
|
EmailTemplatesClient,
|