@paneui/core 0.0.24 → 0.0.26
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/client.d.ts +8 -0
- package/dist/client.js +2 -0
- package/dist/schemas.d.ts +22 -0
- package/dist/schemas.js +22 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -456,6 +456,14 @@ export declare class PaneClient {
|
|
|
456
456
|
upgradePane(paneId: string, opts?: {
|
|
457
457
|
template_version?: number;
|
|
458
458
|
compat?: "strict" | "force";
|
|
459
|
+
template?: {
|
|
460
|
+
source: string;
|
|
461
|
+
type?: string;
|
|
462
|
+
event_schema?: unknown;
|
|
463
|
+
input_schema?: Record<string, unknown>;
|
|
464
|
+
record_schema?: unknown;
|
|
465
|
+
template_record_schema?: unknown;
|
|
466
|
+
};
|
|
459
467
|
}): Promise<UpgradePaneResponse>;
|
|
460
468
|
/**
|
|
461
469
|
* PATCH /v1/panes/:id — in-place edit of instance-level pane fields (#502):
|
package/dist/client.js
CHANGED
|
@@ -626,6 +626,8 @@ export class PaneClient {
|
|
|
626
626
|
body["template_version"] = opts.template_version;
|
|
627
627
|
if (opts.compat !== undefined)
|
|
628
628
|
body["compat"] = opts.compat;
|
|
629
|
+
if (opts.template !== undefined)
|
|
630
|
+
body["template"] = opts.template;
|
|
629
631
|
const r = await this.call("POST", `/v1/panes/${encodeURIComponent(paneId)}/upgrade`, body);
|
|
630
632
|
if (!r.ok)
|
|
631
633
|
this.fail(r);
|
package/dist/schemas.d.ts
CHANGED
|
@@ -122,12 +122,34 @@ export declare const mintParticipantSchema: z.ZodObject<{
|
|
|
122
122
|
kind: z.ZodLiteral<"human">;
|
|
123
123
|
}, z.core.$strip>;
|
|
124
124
|
export type MintParticipantInput = z.infer<typeof mintParticipantSchema>;
|
|
125
|
+
export declare const upgradePaneInlineTemplateSchema: z.ZodObject<{
|
|
126
|
+
source: z.ZodString;
|
|
127
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
"html-inline": "html-inline";
|
|
129
|
+
"html-ref": "html-ref";
|
|
130
|
+
}>>;
|
|
131
|
+
event_schema: z.ZodOptional<z.ZodUnknown>;
|
|
132
|
+
input_schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
133
|
+
record_schema: z.ZodOptional<z.ZodUnknown>;
|
|
134
|
+
template_record_schema: z.ZodOptional<z.ZodUnknown>;
|
|
135
|
+
}, z.core.$strip>;
|
|
125
136
|
export declare const upgradePaneSchema: z.ZodObject<{
|
|
126
137
|
template_version: z.ZodOptional<z.ZodNumber>;
|
|
127
138
|
compat: z.ZodOptional<z.ZodEnum<{
|
|
128
139
|
strict: "strict";
|
|
129
140
|
force: "force";
|
|
130
141
|
}>>;
|
|
142
|
+
template: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
source: z.ZodString;
|
|
144
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
145
|
+
"html-inline": "html-inline";
|
|
146
|
+
"html-ref": "html-ref";
|
|
147
|
+
}>>;
|
|
148
|
+
event_schema: z.ZodOptional<z.ZodUnknown>;
|
|
149
|
+
input_schema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
150
|
+
record_schema: z.ZodOptional<z.ZodUnknown>;
|
|
151
|
+
template_record_schema: z.ZodOptional<z.ZodUnknown>;
|
|
152
|
+
}, z.core.$strip>>;
|
|
131
153
|
}, z.core.$strip>;
|
|
132
154
|
export type UpgradePaneInput = z.infer<typeof upgradePaneSchema>;
|
|
133
155
|
export declare const updatePaneSchema: z.ZodObject<{
|
package/dist/schemas.js
CHANGED
|
@@ -195,9 +195,30 @@ export const mintParticipantSchema = z.object({
|
|
|
195
195
|
// of the current one (events written under the old schema would no longer
|
|
196
196
|
// validate). "force" overrides the gate — used sparingly when the operator
|
|
197
197
|
// knows data loss is acceptable.
|
|
198
|
-
|
|
198
|
+
// Inline upgrade content: new HTML (+ optionally new schemas), appended as a
|
|
199
|
+
// fresh template version that the pane is re-pinned to — all in one atomic
|
|
200
|
+
// /upgrade call, so an inline pane's HTML can be edited in place (same id/URL)
|
|
201
|
+
// without a separate `template version` step. Omitted schemas inherit from the
|
|
202
|
+
// pane's current version, so "just change the HTML" needs only `source`. Mirrors
|
|
203
|
+
// createArtifactVersionSchema, but `type` is optional (defaults to html-inline).
|
|
204
|
+
export const upgradePaneInlineTemplateSchema = z.object({
|
|
205
|
+
source: z.string().min(1),
|
|
206
|
+
type: artifactTypeSchema.optional(),
|
|
207
|
+
event_schema: z.unknown().optional(),
|
|
208
|
+
input_schema: z.record(z.string(), z.unknown()).optional(),
|
|
209
|
+
record_schema: z.unknown().optional(),
|
|
210
|
+
template_record_schema: z.unknown().optional(),
|
|
211
|
+
});
|
|
212
|
+
export const upgradePaneSchema = z
|
|
213
|
+
.object({
|
|
199
214
|
template_version: z.number().int().positive().optional(),
|
|
200
215
|
compat: z.enum(["strict", "force"]).optional(),
|
|
216
|
+
// Inline upgrade — mutually exclusive with template_version (one supplies a
|
|
217
|
+
// brand-new version, the other re-pins to an existing one).
|
|
218
|
+
template: upgradePaneInlineTemplateSchema.optional(),
|
|
219
|
+
})
|
|
220
|
+
.refine((d) => !(d.template && d.template_version !== undefined), {
|
|
221
|
+
message: "`template` (inline upgrade) and `template_version` are mutually exclusive",
|
|
201
222
|
});
|
|
202
223
|
// PATCH /v1/panes/:id — in-place edit of instance-level pane fields (#502).
|
|
203
224
|
// All fields are optional but the body must carry at least one. `ttl` and
|