@hitch42/applet 0.1.1-beta.20 → 0.1.1-beta.21
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/_internal/client.d.ts +0 -2
- package/dist/_internal/client.js +3 -5
- package/dist/_internal/log-context.d.ts +0 -2
- package/dist/_internal/log-context.js +1 -2
- package/dist/_internal/server.d.ts +2 -10
- package/dist/_internal/server.js +9 -14
- package/dist/applet.js +64 -23
- package/dist/auth-DuMRqSGe.js +49 -0
- package/dist/{batch-_ZjAg-Kk.js → batch-CiLZ177G.js} +3 -4
- package/dist/build-C7hi2yg4.js +1 -0
- package/dist/{build-D47vK5aa.js → build-FAQSHJgm.js} +4 -3
- package/dist/{ci-BTFTCBgy.js → ci-oWlUJKm9.js} +5 -6
- package/dist/client/hitch/client.d.ts +1 -1
- package/dist/client/hitch/client.js +1 -2
- package/dist/client/hitch/phone.d.ts +1 -1
- package/dist/client/hitch/phone.js +1 -2
- package/dist/client/hitch.d.ts +2 -2
- package/dist/client/hitch.js +2 -2
- package/dist/client/react/markdown-editor.d.ts +1 -1
- package/dist/client/react/markdown-editor.js +1 -2
- package/dist/client/react/markdown.d.ts +1 -1
- package/dist/client/react/markdown.js +1 -2
- package/dist/client/react.d.ts +2 -2
- package/dist/client/react.js +2 -2
- package/dist/client.d.ts +2 -4
- package/dist/client.js +3 -5
- package/dist/{contract-CJv-n1l3.d.ts → contract-CUc0B2rl.d.ts} +1 -3
- package/dist/{contract-BeKz1Qcs.js → contract-D9LCNGjD.js} +1 -2
- package/dist/{create-C2UrZYSK.d.ts → create-BJqLT8Uq.d.ts} +0 -4
- package/dist/{deploy-BbqyK5Ik.js → deploy-BM55ZoSp.js} +160 -152
- package/dist/{device-BgIfytaR.js → device-CZWWckCq.js} +54 -34
- package/dist/{email-protocol-B9u_dh2p.d.ts → email-protocol-CEqzASSx.d.ts} +0 -6
- package/dist/{generate-BLD0DoCk.js → generate-48pqFh5M.js} +31 -37
- package/dist/generate-BYK4aNud.js +1 -0
- package/dist/generated-agents-BUnJ0FQA.js +215 -0
- package/dist/git-credential-CU7-Erzs.js +24 -0
- package/dist/git-deploy-C12nMNB6.js +290 -0
- package/dist/git-deploy-CNz6mxiF.js +1 -0
- package/dist/git-migration-CIq-sN61.js +629 -0
- package/dist/git-safety-Ck3X7jvA.js +13 -0
- package/dist/{headers-CeRX-Xji.js → headers-BcEMIVCo.js} +1 -2
- package/dist/{hitch-client-DtyTZzP5.d.ts → hitch-client-D33JOEOi.d.ts} +5 -7
- package/dist/{hitch-client-Cw-WZ_8v.js → hitch-client-Dph_kzDd.js} +5 -7
- package/dist/{hitch-file-url-BPKj9zVG.js → hitch-file-url--AMjDOzP.js} +1 -2
- package/dist/index.d.ts +8 -15
- package/dist/index.js +32 -37
- package/dist/{init-BKUBf6i9.js → init-Bb6WT8UB.js} +70 -18
- package/dist/{lazy-client-CwIzYAoE.js → lazy-client--QCL0wiu.js} +1 -2
- package/dist/{load-config-DGALUExv.js → load-config-Cffvj-aM.js} +24 -26
- package/dist/{log-context-DWznGjfz.js → log-context-BepwdjrR.js} +1 -2
- package/dist/login-BWZKo7Ui.js +21 -0
- package/dist/{logs-Cv5z1e2w.js → logs-glCVHI-8.js} +6 -6
- package/dist/{manifest-BBHD_EY9.d.ts → manifest-CpghlaJc.d.ts} +6 -7
- package/dist/manifest-patterns-BfxqImlp.js +4 -0
- package/dist/{markdown-CwlqzBtP.js → markdown-BA_XzFxq.js} +2 -3
- package/dist/{markdown-DSHOQIOb.d.ts → markdown-BXt65dDo.d.ts} +1 -3
- package/dist/{markdown-editor-BmEaBzd7.d.ts → markdown-editor-CB_nWLzj.d.ts} +1 -5
- package/dist/{markdown-editor-C5mLHGqu.js → markdown-editor-CaUuphfc.js} +3 -5
- package/dist/parent-D52Kxp8U.js +1 -0
- package/dist/parent-Zx8Eg1Ki.js +75 -0
- package/dist/{project-CrxdZR0B.js → project-DZGk765E.js} +63 -54
- package/dist/{prompt-ChS-grYO.js → prompt-CW98R-Un.js} +1 -2
- package/dist/{query-cache-CXmAyLv3.js → query-cache-DQJy45RT.js} +1 -2
- package/dist/{query-utils-zz9pVjgp.d.ts → query-utils-okxIoKM3.d.ts} +0 -2
- package/dist/{schedules-Dajgni_z.js → schedules-CSUb84e2.js} +5 -5
- package/dist/server.d.ts +5 -13
- package/dist/server.js +17 -20
- package/dist/source-hash-BbvtRaus.js +107 -0
- package/dist/store-E5NhITHl.js +448 -0
- package/dist/{upload-D_kkmne_.d.ts → upload-DXZyjZSS.d.ts} +6 -10
- package/dist/{upload-DRbVhuDm.js → upload-DtMavo8Q.js} +4 -6
- package/dist/{use-phone-ug4B5gQp.js → use-phone-CB_idmrz.js} +9 -13
- package/dist/{use-phone-M7c_HsB7.d.ts → use-phone-DBAkasPq.d.ts} +0 -4
- package/dist/{variables-B-CLu8cY.js → variables-CgZstC7I.js} +7 -8
- package/dist/vite.d.ts +1 -3
- package/dist/vite.js +41 -50
- package/dist/{workflow-DurM6Fwx.d.ts → workflow-BnBrJIzu.d.ts} +0 -2
- package/dist/{workflow-engine-BOTzURKM.js → workflow-engine-CyyaVENo.js} +2 -4
- package/dist/{workflow-CTo2kZF1.js → workflow-l2SlVePB.js} +2 -4
- package/dist/workspace-CtIKSgMD.js +76 -0
- package/package.json +6 -5
- package/scaffold/.agents/skills/hitch-applets/SKILL.md +27 -9
- package/scaffold/.agents/skills/hitch-applets/references/files.md +2 -2
- package/scaffold/.agents/skills/hitch-applets/references/manifest.md +8 -6
- package/scaffold/.agents/skills/hitch-applets/references/performance.md +2 -2
- package/scaffold/.agents/skills/hitch-applets/references/records.md +8 -8
- package/scaffold/.agents/skills/hitch-cli/SKILL.md +52 -43
- package/scaffold/AGENTS.md +6 -0
- package/dist/auth-D3CrCtZq.js +0 -21
- package/dist/build-JtbY8q2p.js +0 -2
- package/dist/generate-COCRy1Bs.js +0 -2
- package/dist/login-CceGvlMi.js +0 -14
- package/dist/store-B8N_8JIN.js +0 -196
- package/dist/workspace-8yqXsvce.js +0 -31
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { PersistQueryClientOptions } from "@tanstack/react-query-persist-client";
|
|
2
2
|
import { AnyRouter } from "@tanstack/react-router";
|
|
3
|
-
//#region src/internal/client.d.ts
|
|
4
3
|
declare function appletQueryPersistence(appletCode: string): Promise<Omit<PersistQueryClientOptions, "queryClient"> | undefined>;
|
|
5
4
|
declare function mountApplet(router: AnyRouter, appletCode: string): void;
|
|
6
|
-
//#endregion
|
|
7
5
|
export { appletQueryPersistence, mountApplet };
|
package/dist/_internal/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as openCacheDatabase, n as clearAppletQueryCaches, o as sweepExpiredQueryCaches, r as indexedDbPersister, t as cacheTabId } from "../query-cache-
|
|
1
|
+
import { i as openCacheDatabase, n as clearAppletQueryCaches, o as sweepExpiredQueryCaches, r as indexedDbPersister, t as cacheTabId } from "../query-cache-DQJy45RT.js";
|
|
2
2
|
import { QueryClientProvider, useIsRestoring } from "@tanstack/react-query";
|
|
3
3
|
import { PersistQueryClientProvider } from "@tanstack/react-query-persist-client";
|
|
4
4
|
import { RouterProvider } from "@tanstack/react-router";
|
|
@@ -6,7 +6,7 @@ import { createElement, useEffect } from "react";
|
|
|
6
6
|
import { createRoot } from "react-dom/client";
|
|
7
7
|
import { RotateCcw } from "lucide-react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
-
|
|
9
|
+
// src/internal/error-page.tsx
|
|
10
10
|
const STYLES = `
|
|
11
11
|
.hitch-error {
|
|
12
12
|
position: relative;
|
|
@@ -96,8 +96,7 @@ function AppletErrorPage({ error, onReload }) {
|
|
|
96
96
|
})]
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
//#region src/internal/client.ts
|
|
99
|
+
// src/internal/client.ts
|
|
101
100
|
const CACHE_MAX_AGE = 3e5;
|
|
102
101
|
const CACHE_SCOPE_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
103
102
|
async function appletQueryPersistence(appletCode) {
|
|
@@ -168,5 +167,4 @@ function mountApplet(router, appletCode) {
|
|
|
168
167
|
createRoot(root).render(createElement(QueryClientProvider, { client: queryClient }, applet));
|
|
169
168
|
});
|
|
170
169
|
}
|
|
171
|
-
//#endregion
|
|
172
170
|
export { appletQueryPersistence, mountApplet };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/server/log-context.d.ts
|
|
2
1
|
declare const REQUEST_CONTEXT_CHANNEL = "hitch.request.context";
|
|
3
2
|
declare const APP_CONTEXT_CHANNEL = "hitch.request.app";
|
|
4
3
|
declare const isUuid: (value: string | null | undefined) => value is string;
|
|
@@ -28,5 +27,4 @@ type NoteLog = {
|
|
|
28
27
|
declare function createNoteLog(initial: {
|
|
29
28
|
requestId: string;
|
|
30
29
|
} & Record<string, unknown>): NoteLog;
|
|
31
|
-
//#endregion
|
|
32
30
|
export { APP_CONTEXT_CHANNEL, NoteLog, REQUEST_CONTEXT_CHANNEL, cloudflareRequestFields, createNoteLog, errorNote, isUuid, publishNote, requestIdFrom };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { APP_CONTEXT_CHANNEL, REQUEST_CONTEXT_CHANNEL, cloudflareRequestFields, createNoteLog, errorNote, isUuid, publishNote, requestIdFrom };
|
|
1
|
+
export { t as APP_CONTEXT_CHANNEL, n as REQUEST_CONTEXT_CHANNEL, r as cloudflareRequestFields, i as createNoteLog, a as errorNote, o as isUuid, s as publishNote, c as requestIdFrom } from "../log-context-BepwdjrR.js";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as AnyWorkflowDefinition } from "../workflow-
|
|
2
|
-
import { d as ListEmailTrackersInput, n as TelephonyMessageReceivedEvent, r as CreateEmailPixelInput, t as EmailMessageReceivedEvent } from "../email-protocol-
|
|
1
|
+
import { t as AnyWorkflowDefinition } from "../workflow-BnBrJIzu.js";
|
|
2
|
+
import { d as ListEmailTrackersInput, n as TelephonyMessageReceivedEvent, r as CreateEmailPixelInput, t as EmailMessageReceivedEvent } from "../email-protocol-CEqzASSx.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
//#region src/server/entry.d.ts
|
|
5
4
|
declare function createWorkerEntry(server: {
|
|
6
5
|
router: object;
|
|
7
6
|
workflows?: Record<string, AnyWorkflowDefinition>;
|
|
@@ -16,8 +15,6 @@ declare function createWorkerEntry(server: {
|
|
|
16
15
|
}): {
|
|
17
16
|
fetch(request: Request, env?: unknown, ctx?: unknown): Promise<Response>;
|
|
18
17
|
};
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/server/workflow-protocol.d.ts
|
|
21
18
|
type StepJournalEntry = {
|
|
22
19
|
kind: "step";
|
|
23
20
|
id: string;
|
|
@@ -82,8 +79,6 @@ type ErrorOutcome = {
|
|
|
82
79
|
};
|
|
83
80
|
declare const workflowOutcomeSchema: z.ZodType<StepOutcome | SleepOutcome | StepErrorOutcome | DoneOutcome | ErrorOutcome>;
|
|
84
81
|
type WorkflowOutcome = z.infer<typeof workflowOutcomeSchema>;
|
|
85
|
-
//#endregion
|
|
86
|
-
//#region src/server/workflow-engine.d.ts
|
|
87
82
|
type Engine = {
|
|
88
83
|
invoke<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
|
89
84
|
sleepUntil(name: string, until: Date): Promise<void>;
|
|
@@ -91,8 +86,6 @@ type Engine = {
|
|
|
91
86
|
};
|
|
92
87
|
declare class WorkflowFailedError extends Error {}
|
|
93
88
|
declare function runWorkflowJournal(engine: Engine, invoke: (journal: JournalEntry[]) => Promise<WorkflowOutcome>): Promise<unknown>;
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/hitch/email-schemas.d.ts
|
|
96
89
|
declare const createEmailPixelInputSchema: z.ZodType<CreateEmailPixelInput, CreateEmailPixelInput>;
|
|
97
90
|
declare const markEmailTrackerSentBodySchema: z.ZodType<{
|
|
98
91
|
sentAt?: string;
|
|
@@ -100,5 +93,4 @@ declare const markEmailTrackerSentBodySchema: z.ZodType<{
|
|
|
100
93
|
sentAt?: string;
|
|
101
94
|
}>;
|
|
102
95
|
declare const listEmailTrackersInputSchema: z.ZodType<ListEmailTrackersInput, ListEmailTrackersInput>;
|
|
103
|
-
//#endregion
|
|
104
96
|
export { type Engine, type JournalEntry, WorkflowFailedError, type WorkflowInvocationRequest, type WorkflowOutcome, createEmailPixelInputSchema, createWorkerEntry, journalEntrySchema, listEmailTrackersInputSchema, markEmailTrackerSentBodySchema, runWorkflowJournal, workflowInvocationRequestSchema, workflowOutcomeSchema };
|
package/dist/_internal/server.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as HITCH_ORG_CODE_HEADER, d as HITCH_SESSION_HEADER, f as HITCH_USER_HEADER, h as HITCH_WORKFLOW_RUN_HEADER, i as HITCH_ORGANIZATION_HEADER, l as HITCH_SCHEDULE_HEADER, m as HITCH_WORKFLOW_INVOCATION_HEADER, n as HITCH_APPLET_HEADER, o as HITCH_PUBLIC_HEADER, p as HITCH_WORKFLOW_HEADER, r as HITCH_APPLET_TOKEN_HEADER, s as HITCH_RELEASE_HEADER, u as HITCH_SCHEDULE_RUN_HEADER } from "../headers-
|
|
2
|
-
import { a as getRequestContext, o as runWithRequestContext, r as toMilliseconds, t as MAX_DURATION_MS } from "../workflow-
|
|
3
|
-
import { a as errorNote, c as requestIdFrom, i as createNoteLog, r as cloudflareRequestFields, s as publishNote, t as APP_CONTEXT_CHANNEL } from "../log-context-
|
|
4
|
-
import { a as workflowOutcomeSchema, i as workflowInvocationRequestSchema, n as runWorkflowJournal, r as journalEntrySchema, t as WorkflowFailedError } from "../workflow-engine-
|
|
1
|
+
import { a as HITCH_ORG_CODE_HEADER, d as HITCH_SESSION_HEADER, f as HITCH_USER_HEADER, h as HITCH_WORKFLOW_RUN_HEADER, i as HITCH_ORGANIZATION_HEADER, l as HITCH_SCHEDULE_HEADER, m as HITCH_WORKFLOW_INVOCATION_HEADER, n as HITCH_APPLET_HEADER, o as HITCH_PUBLIC_HEADER, p as HITCH_WORKFLOW_HEADER, r as HITCH_APPLET_TOKEN_HEADER, s as HITCH_RELEASE_HEADER, u as HITCH_SCHEDULE_RUN_HEADER } from "../headers-BcEMIVCo.js";
|
|
2
|
+
import { a as getRequestContext, o as runWithRequestContext, r as toMilliseconds, t as MAX_DURATION_MS } from "../workflow-l2SlVePB.js";
|
|
3
|
+
import { a as errorNote, c as requestIdFrom, i as createNoteLog, r as cloudflareRequestFields, s as publishNote, t as APP_CONTEXT_CHANNEL } from "../log-context-BepwdjrR.js";
|
|
4
|
+
import { a as workflowOutcomeSchema, i as workflowInvocationRequestSchema, n as runWorkflowJournal, r as journalEntrySchema, t as WorkflowFailedError } from "../workflow-engine-CyyaVENo.js";
|
|
5
5
|
import { RPCHandler } from "@orpc/server/fetch";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
-
|
|
7
|
+
// src/server/telephony-protocol.ts
|
|
8
8
|
const telephonyMessageReceivedEventSchema = z.object({
|
|
9
9
|
eventId: z.string(),
|
|
10
10
|
type: z.literal("message.received"),
|
|
@@ -12,8 +12,7 @@ const telephonyMessageReceivedEventSchema = z.object({
|
|
|
12
12
|
numberId: z.string(),
|
|
13
13
|
occurredAt: z.iso.datetime()
|
|
14
14
|
});
|
|
15
|
-
|
|
16
|
-
//#region src/server/email-protocol.ts
|
|
15
|
+
// src/server/email-protocol.ts
|
|
17
16
|
const emailMessageReceivedEventSchema = z.object({
|
|
18
17
|
eventId: z.string(),
|
|
19
18
|
type: z.literal("message.received"),
|
|
@@ -22,8 +21,7 @@ const emailMessageReceivedEventSchema = z.object({
|
|
|
22
21
|
threadId: z.string(),
|
|
23
22
|
occurredAt: z.iso.datetime()
|
|
24
23
|
});
|
|
25
|
-
|
|
26
|
-
//#region src/server/workflow-run.ts
|
|
24
|
+
// src/server/workflow-run.ts
|
|
27
25
|
const MAX_RESULT_SIZE = 1048576;
|
|
28
26
|
function errorMessage(error) {
|
|
29
27
|
return (error instanceof Error ? error.message : String(error)).slice(0, 2048);
|
|
@@ -117,8 +115,7 @@ async function runWorkflowInvocation(definition, request) {
|
|
|
117
115
|
}));
|
|
118
116
|
return Promise.race([runPromise, recordedPromise]);
|
|
119
117
|
}
|
|
120
|
-
|
|
121
|
-
//#region src/server/entry.ts
|
|
118
|
+
// src/server/entry.ts
|
|
122
119
|
const WORKFLOW_PATH_PREFIX = "/api/__hitch/workflows/";
|
|
123
120
|
const SERVER_EXPORT_ERROR = "src/server/main.ts must default-export { router, workflows } — change \"export default router\" to \"export default { router }\".";
|
|
124
121
|
function jsonError(status, error) {
|
|
@@ -258,8 +255,7 @@ function createWorkerEntry(server, options) {
|
|
|
258
255
|
}
|
|
259
256
|
} };
|
|
260
257
|
}
|
|
261
|
-
|
|
262
|
-
//#region src/hitch/email-schemas.ts
|
|
258
|
+
// src/hitch/email-schemas.ts
|
|
263
259
|
const emailTagKeySchema = z.string().regex(/^[A-Za-z][A-Za-z0-9_]{0,63}$/);
|
|
264
260
|
const emailTagsSchema = z.record(emailTagKeySchema, z.string().min(1).max(200)).refine((tags) => Object.keys(tags).length <= 10);
|
|
265
261
|
const createEmailPixelInputSchema = z.object({ tags: emailTagsSchema.optional() }).strict();
|
|
@@ -273,5 +269,4 @@ const listEmailTrackersInputSchema = z.object({
|
|
|
273
269
|
cursor: z.uuid().optional(),
|
|
274
270
|
limit: z.number().int().min(1).max(200).optional()
|
|
275
271
|
}).strict();
|
|
276
|
-
//#endregion
|
|
277
272
|
export { WorkflowFailedError, createEmailPixelInputSchema, createWorkerEntry, journalEntrySchema, listEmailTrackersInputSchema, markEmailTrackerSentBodySchema, runWorkflowJournal, workflowInvocationRequestSchema, workflowOutcomeSchema };
|
package/dist/applet.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { parseArgs } from "node:util";
|
|
3
|
-
|
|
3
|
+
// bin/applet.ts
|
|
4
4
|
const usage = `Usage:
|
|
5
5
|
applet login [--no-browser]
|
|
6
|
+
applet logout
|
|
6
7
|
applet init <org> [--no-commit | --no-git] [--no-install]
|
|
7
|
-
applet bootstrap [--no-install]
|
|
8
|
+
applet bootstrap [--no-install] [-m <message>]
|
|
9
|
+
applet parent
|
|
8
10
|
applet new <code> [--client-only | --server-only] [--no-install]
|
|
9
11
|
applet generate
|
|
10
12
|
applet build
|
|
11
|
-
applet
|
|
13
|
+
applet clone <org>/<code> [dir]
|
|
14
|
+
applet deploy [-m <message>] [--dist <folder>]
|
|
15
|
+
applet rollback <release-id>
|
|
12
16
|
applet logs [code] [--since <duration>] [--limit <count>]
|
|
13
17
|
[--search <text>] [--level <level>] [--filter <json>] [--run <id>] [--live]
|
|
14
18
|
applet variables set <KEY> [value] [--secret] [-y | --yes]
|
|
@@ -37,9 +41,13 @@ Schema changesets:
|
|
|
37
41
|
against a pending changeset. The release goes live when the changeset
|
|
38
42
|
applies in Hitch. After it applies, the field uses the live schema.
|
|
39
43
|
|
|
40
|
-
Run applet deploy in the workspace root
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
Run applet deploy in the workspace root or applet folder. Local deploy needs
|
|
45
|
+
one applet per repo. It commits changes with -m and moves main when live.
|
|
46
|
+
Use --message instead of -m, or --dist to upload an existing build.
|
|
47
|
+
In GitHub Actions it skips an applet when neither its folder nor any file
|
|
48
|
+
outside applets/ changed since its current CI release.
|
|
49
|
+
|
|
50
|
+
Run applet clone <org>/<code> [dir] to copy the applet and its git history.
|
|
43
51
|
|
|
44
52
|
Logs options:
|
|
45
53
|
--since <duration> Show logs from this period. Default: 1h. Maximum: 7d.
|
|
@@ -59,21 +67,32 @@ Variables options:
|
|
|
59
67
|
Schedules options:
|
|
60
68
|
-y, --yes Skip the schedule confirmation.
|
|
61
69
|
|
|
62
|
-
Login: applet login selects the organization from hitch.config.ts and shares
|
|
70
|
+
Login: applet login selects the organization from applet.manifest.ts or hitch.config.ts and shares
|
|
63
71
|
credentials with hitch login.
|
|
64
72
|
CI: set HITCH_API_KEY (and HITCH_API_URL for a non-default instance).
|
|
65
73
|
GitHub Actions: generate, build, and deploy use the job's OIDC token instead of
|
|
66
74
|
a key. Grant the job id-token: write.`;
|
|
67
75
|
async function main() {
|
|
76
|
+
if (process.argv[2] === "git-credential") {
|
|
77
|
+
const args = process.argv.slice(3);
|
|
78
|
+
if (args[0] !== "--instance" || args.length !== 3) throw new Error("Use applet git-credential --instance <url> <get|store|erase>.");
|
|
79
|
+
await (await import("./git-credential-CU7-Erzs.js")).runGitCredential(args[2] ?? "", args[1]);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
68
82
|
const { positionals, values } = parseArgs({
|
|
69
83
|
allowPositionals: true,
|
|
70
84
|
options: {
|
|
71
85
|
"client-only": { type: "boolean" },
|
|
86
|
+
dist: { type: "string" },
|
|
72
87
|
filter: { type: "string" },
|
|
73
88
|
run: { type: "string" },
|
|
74
89
|
level: { type: "string" },
|
|
75
90
|
limit: { type: "string" },
|
|
76
91
|
live: { type: "boolean" },
|
|
92
|
+
message: {
|
|
93
|
+
type: "string",
|
|
94
|
+
short: "m"
|
|
95
|
+
},
|
|
77
96
|
"no-browser": { type: "boolean" },
|
|
78
97
|
"no-commit": { type: "boolean" },
|
|
79
98
|
"no-git": { type: "boolean" },
|
|
@@ -89,8 +108,20 @@ async function main() {
|
|
|
89
108
|
},
|
|
90
109
|
strict: true
|
|
91
110
|
});
|
|
111
|
+
if ((positionals.length === 2 || positionals.length === 3) && positionals[0] === "clone" && Object.keys(values).every((key) => key === "message")) {
|
|
112
|
+
await (await import("./git-deploy-CNz6mxiF.js")).runClone(positionals[1], positionals[2], values.message);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (positionals.length === 1 && positionals[0] === "logout" && Object.keys(values).length === 0) {
|
|
116
|
+
await (await import("./login-BWZKo7Ui.js")).runLogout();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
92
119
|
if (positionals.length === 1 && positionals[0] === "login" && Object.keys(values).every((key) => key === "no-browser")) {
|
|
93
|
-
await (await import("./login-
|
|
120
|
+
await (await import("./login-BWZKo7Ui.js")).runLogin({ noBrowser: values["no-browser"] });
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (positionals.length === 1 && positionals[0] === "parent" && Object.keys(values).length === 0) {
|
|
124
|
+
await (await import("./parent-D52Kxp8U.js")).runParent();
|
|
94
125
|
return;
|
|
95
126
|
}
|
|
96
127
|
if (values["no-browser"] !== void 0) throw new Error(usage);
|
|
@@ -98,24 +129,34 @@ async function main() {
|
|
|
98
129
|
const noVariableFlags = values.secret === void 0 && values.yes === void 0;
|
|
99
130
|
const noLogFlags = values.run === void 0 && values.filter === void 0 && values.level === void 0 && values.limit === void 0 && values.live === void 0 && values.search === void 0 && values.since === void 0;
|
|
100
131
|
const noModeFlags = values["client-only"] === void 0 && values["server-only"] === void 0;
|
|
101
|
-
if (positionals.length === 1 && positionals[0] === "bootstrap" && noModeFlags && noGitFlags && noVariableFlags && noLogFlags) {
|
|
102
|
-
await (await import("./init-
|
|
132
|
+
if (positionals.length === 1 && positionals[0] === "bootstrap" && noModeFlags && noGitFlags && noVariableFlags && noLogFlags && values.dist === void 0) {
|
|
133
|
+
await (await import("./init-Bb6WT8UB.js")).runBootstrap({
|
|
134
|
+
message: values.message,
|
|
135
|
+
install: values["no-install"] !== true
|
|
136
|
+
});
|
|
103
137
|
return;
|
|
104
138
|
}
|
|
105
|
-
if (positionals.length === 1 && positionals[0] === "generate" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noVariableFlags && noLogFlags) {
|
|
106
|
-
await (await import("./generate-
|
|
139
|
+
if (positionals.length === 1 && positionals[0] === "generate" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noVariableFlags && noLogFlags && values.message === void 0 && values.dist === void 0) {
|
|
140
|
+
await (await import("./generate-BYK4aNud.js")).runGenerate();
|
|
107
141
|
return;
|
|
108
142
|
}
|
|
109
|
-
if (positionals.length === 1 && positionals[0] === "build" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noVariableFlags && noLogFlags) {
|
|
110
|
-
await (await import("./build-
|
|
143
|
+
if (positionals.length === 1 && positionals[0] === "build" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noVariableFlags && noLogFlags && values.message === void 0 && values.dist === void 0) {
|
|
144
|
+
await (await import("./build-C7hi2yg4.js")).runBuild();
|
|
111
145
|
return;
|
|
112
146
|
}
|
|
113
147
|
if (positionals.length === 1 && positionals[0] === "deploy" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noVariableFlags && noLogFlags) {
|
|
114
|
-
await (await import("./deploy-
|
|
148
|
+
await (await import("./deploy-BM55ZoSp.js")).runDeploy({
|
|
149
|
+
message: values.message,
|
|
150
|
+
dist: values.dist
|
|
151
|
+
});
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (positionals.length === 2 && positionals[0] === "rollback" && values.message === void 0 && values.dist === void 0 && values["no-install"] === void 0 && noModeFlags && noGitFlags && noVariableFlags && noLogFlags) {
|
|
155
|
+
await (await import("./deploy-BM55ZoSp.js")).runRollback(positionals[1]);
|
|
115
156
|
return;
|
|
116
157
|
}
|
|
117
158
|
if (positionals.length === 2 && positionals[0] === "init" && noModeFlags && noVariableFlags && noLogFlags) {
|
|
118
|
-
await (await import("./init-
|
|
159
|
+
await (await import("./init-Bb6WT8UB.js")).runInit(positionals[1], {
|
|
119
160
|
commit: values["no-commit"] !== true,
|
|
120
161
|
git: values["no-git"] !== true,
|
|
121
162
|
install: values["no-install"] !== true
|
|
@@ -123,8 +164,9 @@ async function main() {
|
|
|
123
164
|
return;
|
|
124
165
|
}
|
|
125
166
|
if (positionals.length === 2 && positionals[0] === "new" && noGitFlags && noVariableFlags && noLogFlags) {
|
|
126
|
-
await (await import("./init-
|
|
167
|
+
await (await import("./init-Bb6WT8UB.js")).runNew({
|
|
127
168
|
code: positionals[1],
|
|
169
|
+
message: values.message,
|
|
128
170
|
clientOnly: values["client-only"],
|
|
129
171
|
install: values["no-install"] !== true,
|
|
130
172
|
serverOnly: values["server-only"]
|
|
@@ -132,7 +174,7 @@ async function main() {
|
|
|
132
174
|
return;
|
|
133
175
|
}
|
|
134
176
|
if ((positionals.length === 1 || positionals.length === 2) && positionals[0] === "logs" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noVariableFlags) {
|
|
135
|
-
await (await import("./logs-
|
|
177
|
+
await (await import("./logs-glCVHI-8.js")).runLogs({
|
|
136
178
|
code: positionals[1],
|
|
137
179
|
filter: values.filter,
|
|
138
180
|
run: values.run,
|
|
@@ -145,14 +187,14 @@ async function main() {
|
|
|
145
187
|
return;
|
|
146
188
|
}
|
|
147
189
|
if (positionals.length === 3 && positionals[0] === "schedules" && positionals[1] === "run" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noLogFlags && values.secret === void 0) {
|
|
148
|
-
await (await import("./schedules-
|
|
190
|
+
await (await import("./schedules-CSUb84e2.js")).runSchedule({
|
|
149
191
|
code: positionals[2],
|
|
150
192
|
yes: values.yes
|
|
151
193
|
});
|
|
152
194
|
return;
|
|
153
195
|
}
|
|
154
196
|
if ((positionals.length === 3 || positionals.length === 4) && positionals[0] === "variables" && positionals[1] === "set" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noLogFlags) {
|
|
155
|
-
await (await import("./variables-
|
|
197
|
+
await (await import("./variables-CgZstC7I.js")).runVariablesSet({
|
|
156
198
|
key: positionals[2],
|
|
157
199
|
secret: values.secret,
|
|
158
200
|
value: positionals[3],
|
|
@@ -161,11 +203,11 @@ async function main() {
|
|
|
161
203
|
return;
|
|
162
204
|
}
|
|
163
205
|
if (positionals.length === 2 && positionals[0] === "variables" && positionals[1] === "list" && values["no-install"] === void 0 && noModeFlags && noGitFlags && noVariableFlags && noLogFlags) {
|
|
164
|
-
await (await import("./variables-
|
|
206
|
+
await (await import("./variables-CgZstC7I.js")).runVariablesList();
|
|
165
207
|
return;
|
|
166
208
|
}
|
|
167
209
|
if (positionals.length === 3 && positionals[0] === "variables" && positionals[1] === "delete" && values["no-install"] === void 0 && noModeFlags && noGitFlags && values.secret === void 0 && noLogFlags) {
|
|
168
|
-
await (await import("./variables-
|
|
210
|
+
await (await import("./variables-CgZstC7I.js")).runVariablesDelete({
|
|
169
211
|
key: positionals[2],
|
|
170
212
|
yes: values.yes
|
|
171
213
|
});
|
|
@@ -180,5 +222,4 @@ try {
|
|
|
180
222
|
if (!(error instanceof Error) || error.message !== usage) console.error(`\n${usage}`);
|
|
181
223
|
process.exitCode = 1;
|
|
182
224
|
}
|
|
183
|
-
//#endregion
|
|
184
225
|
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { a as configureKeyring, d as rejectEnvironmentKey, i as bearerToken, l as organizationInstanceUrl, m as resolveInstanceUrl, p as resolveAuthForOrg, r as LoginRequiredError, t as AuthenticationError, u as readCredentialStore } from "./store-E5NhITHl.js";
|
|
2
|
+
import { n as parseMe, t as loginWithDevice } from "./device-CZWWckCq.js";
|
|
3
|
+
import "./workspace-CtIKSgMD.js";
|
|
4
|
+
import { Entry, findCredentials } from "@napi-rs/keyring";
|
|
5
|
+
// src/auth.ts
|
|
6
|
+
configureKeyring(Entry, findCredentials);
|
|
7
|
+
async function fetchWithOrgAuth(orgCode, request) {
|
|
8
|
+
return withOrgAuth(orgCode, async (organizationUrl, accessToken) => {
|
|
9
|
+
const response = await request(organizationUrl, accessToken);
|
|
10
|
+
return {
|
|
11
|
+
response,
|
|
12
|
+
unauthorized: response.status === 401
|
|
13
|
+
};
|
|
14
|
+
}).then(({ response }) => response);
|
|
15
|
+
}
|
|
16
|
+
async function withOrgAuth(orgCode, request) {
|
|
17
|
+
const instanceUrl = await resolveInstanceUrl();
|
|
18
|
+
const organizationUrl = organizationInstanceUrl(instanceUrl, orgCode);
|
|
19
|
+
const auth = await resolveAuthForOrg(instanceUrl, orgCode).catch((error) => {
|
|
20
|
+
if (error instanceof LoginRequiredError && process.stdin.isTTY === true) return void 0;
|
|
21
|
+
throw error;
|
|
22
|
+
});
|
|
23
|
+
if (auth !== void 0) {
|
|
24
|
+
const result = await request(organizationUrl, bearerToken(auth));
|
|
25
|
+
if ("response" in result && result.response instanceof Response) rejectEnvironmentKey(result.response, auth);
|
|
26
|
+
if (!result.unauthorized) return result;
|
|
27
|
+
if (auth.source === "environment") throw new AuthenticationError("HITCH_API_KEY was rejected.");
|
|
28
|
+
}
|
|
29
|
+
if (process.stdin.isTTY !== true) throw new LoginRequiredError();
|
|
30
|
+
await loginWithDevice(instanceUrl, { expectedOrg: orgCode });
|
|
31
|
+
const credentials = await resolveAuthForOrg(instanceUrl, orgCode);
|
|
32
|
+
if (credentials === void 0) throw new Error(`login did not provide credentials for organization "${orgCode}"`);
|
|
33
|
+
return request(organizationUrl, bearerToken(credentials));
|
|
34
|
+
}
|
|
35
|
+
async function orgUsesHitchGit(org) {
|
|
36
|
+
const response = await fetchWithOrgAuth(org, (organizationUrl, token) => fetch(`${organizationUrl}/api/me/v1`, { headers: { Authorization: `Bearer ${token}` } }));
|
|
37
|
+
if (!response.ok) throw new AuthenticationError(`Could not read organization membership (${response.status}).`);
|
|
38
|
+
const membership = parseMe(await response.json()).memberships.find((item) => item.code === org);
|
|
39
|
+
if (membership === void 0) throw new AuthenticationError(`You are not a member of ${org}.`);
|
|
40
|
+
if (typeof membership.gitEnabled !== "boolean") throw new Error("The membership response has no \"gitEnabled\" flag. Update the Hitch server.");
|
|
41
|
+
return membership.gitEnabled;
|
|
42
|
+
}
|
|
43
|
+
async function canCheckHitchGit() {
|
|
44
|
+
if (process.env.GITHUB_ACTIONS === "true") return false;
|
|
45
|
+
if (process.env.HITCH_API_KEY) return true;
|
|
46
|
+
const instance = await resolveInstanceUrl();
|
|
47
|
+
return Object.entries((await readCredentialStore()).instances).some(([url, credentials]) => url === instance && Object.keys(credentials).length > 0);
|
|
48
|
+
}
|
|
49
|
+
export { withOrgAuth as i, fetchWithOrgAuth as n, orgUsesHitchGit as r, canCheckHitchGit as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isContractProcedure } from "@orpc/contract";
|
|
2
|
-
|
|
2
|
+
// src/hitch/batch.ts
|
|
3
3
|
const BATCH_VERBS = [
|
|
4
4
|
"create",
|
|
5
5
|
"update",
|
|
@@ -23,10 +23,10 @@ function withBatchRecorder(target, contract) {
|
|
|
23
23
|
const tx = Object.fromEntries(Object.entries(records).map(([code, procedures]) => [code, Object.fromEntries(BATCH_VERBS.filter((verb) => typeof procedures === "object" && procedures !== null && isContractProcedure(Reflect.get(procedures, verb))).map((verb) => [verb, (procedureInput) => {
|
|
24
24
|
if (!active) throw new Error("The batch was already sent.");
|
|
25
25
|
const body = Reflect.get(procedureInput, "body");
|
|
26
|
-
const
|
|
26
|
+
const record = verb === "update" || verb === "delete" ? Reflect.get(Reflect.get(procedureInput, "params"), "record") : void 0;
|
|
27
27
|
requests.push({
|
|
28
28
|
method: verb === "create" || verb === "updateWhere" ? "POST" : verb === "update" ? "PATCH" : "DELETE",
|
|
29
|
-
path: verb === "create" ? `/v1/${code}` : verb === "updateWhere" ? `/v1/${code}/update` : `/v1/${code}/${String(
|
|
29
|
+
path: verb === "create" ? `/v1/${code}` : verb === "updateWhere" ? `/v1/${code}/bulk-update` : `/v1/${code}/${String(record)}`,
|
|
30
30
|
...verb === "delete" ? {} : { body }
|
|
31
31
|
});
|
|
32
32
|
}]))]));
|
|
@@ -47,5 +47,4 @@ function withBatchRecorder(target, contract) {
|
|
|
47
47
|
};
|
|
48
48
|
} });
|
|
49
49
|
}
|
|
50
|
-
//#endregion
|
|
51
50
|
export { withBatchRecorder as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { i as runBuild } from "./build-FAQSHJgm.js";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as findAppletRoot } from "./workspace-CtIKSgMD.js";
|
|
2
|
+
import { a as prepareAppletProjects, i as prepareAppletProject } from "./project-DZGk765E.js";
|
|
2
3
|
import { rm } from "node:fs/promises";
|
|
3
4
|
import { resolve } from "node:path";
|
|
4
5
|
import { spawn } from "node:child_process";
|
|
5
6
|
import { createInterface } from "node:readline";
|
|
6
|
-
|
|
7
|
+
// src/build.ts
|
|
7
8
|
function isMissingFile(error) {
|
|
8
9
|
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
9
10
|
}
|
|
@@ -31,6 +32,7 @@ async function runPnpm(args, cwd) {
|
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
async function buildApplet(appletRoot, outDir = ".hitch/dist") {
|
|
35
|
+
appletRoot = findAppletRoot(appletRoot) ?? appletRoot;
|
|
34
36
|
await runPnpm(["install"], await prepareAppletProject(appletRoot));
|
|
35
37
|
await buildPreparedApplet(appletRoot, outDir);
|
|
36
38
|
}
|
|
@@ -86,5 +88,4 @@ async function buildPreparedApplet(appletRoot, outDir = ".hitch/dist", logPrefix
|
|
|
86
88
|
async function runBuild() {
|
|
87
89
|
await buildApplet(process.cwd());
|
|
88
90
|
}
|
|
89
|
-
//#endregion
|
|
90
91
|
export { runBuild as i, buildPreparedApplet as n, prepareWorkspaceBuild as r, buildApplet as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { m as resolveInstanceUrl } from "./store-E5NhITHl.js";
|
|
2
|
+
import { o as userAgent } from "./project-DZGk765E.js";
|
|
3
|
+
// src/ci.ts
|
|
4
4
|
function githubActionsContext() {
|
|
5
5
|
const env = process.env;
|
|
6
6
|
if (env.GITHUB_ACTIONS !== "true" || env.HITCH_API_KEY) return void 0;
|
|
@@ -40,7 +40,7 @@ async function loadGitHubActionsBuildInputs(context, requiresChangeset) {
|
|
|
40
40
|
const fetcher = globalThis.fetch;
|
|
41
41
|
const query = requiresChangeset === void 0 ? "" : `?changeset_id=${encodeURIComponent(requiresChangeset)}`;
|
|
42
42
|
const agent = await userAgent();
|
|
43
|
-
const response = await fetchWithGitHubActions(context, (instanceUrl, accessToken) => fetcher(`${instanceUrl}/api/
|
|
43
|
+
const response = await fetchWithGitHubActions(context, (instanceUrl, accessToken) => fetcher(`${instanceUrl}/api/applet/v1/ci/build-inputs${query}`, {
|
|
44
44
|
method: "POST",
|
|
45
45
|
headers: {
|
|
46
46
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -57,7 +57,7 @@ async function loadGitHubActionsBuildInputs(context, requiresChangeset) {
|
|
|
57
57
|
}
|
|
58
58
|
async function loadGitHubActionsSources(context) {
|
|
59
59
|
const fetcher = globalThis.fetch;
|
|
60
|
-
const response = await fetchWithGitHubActions(context, (instanceUrl, accessToken) => fetcher(`${instanceUrl}/api/
|
|
60
|
+
const response = await fetchWithGitHubActions(context, (instanceUrl, accessToken) => fetcher(`${instanceUrl}/api/applet/v1/ci/applets`, { headers: { Authorization: `Bearer ${accessToken}` } }));
|
|
61
61
|
if (!response.ok) throw await hitchResponseError(response, "Failed to load the CI applets");
|
|
62
62
|
const body = await response.json();
|
|
63
63
|
if (body === null || typeof body !== "object" || !("data" in body) || !Array.isArray(body.data)) throw new Error("The CI applets response must contain a data array.");
|
|
@@ -70,5 +70,4 @@ async function loadGitHubActionsSources(context) {
|
|
|
70
70
|
};
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
//#endregion
|
|
74
73
|
export { loadGitHubActionsSources as a, loadGitHubActionsBuildInputs as i, githubActionsContext as n, hitchResponseError as r, fetchWithGitHubActions as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as hitch } from "../../hitch-client-
|
|
1
|
+
import { t as hitch } from "../../hitch-client-D33JOEOi.js";
|
|
2
2
|
export { hitch };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { hitch };
|
|
1
|
+
export { t as hitch } from "../../hitch-client-Dph_kzDd.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as usePhone } from "../../use-phone-
|
|
1
|
+
import { t as usePhone } from "../../use-phone-DBAkasPq.js";
|
|
2
2
|
export { usePhone };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { usePhone };
|
|
1
|
+
export { t as usePhone } from "../../use-phone-CB_idmrz.js";
|
package/dist/client/hitch.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as hitch } from "../hitch-client-
|
|
2
|
-
import { i as createPhone, n as Phone, r as PhoneState, t as usePhone } from "../use-phone-
|
|
1
|
+
import { t as hitch } from "../hitch-client-D33JOEOi.js";
|
|
2
|
+
import { i as createPhone, n as Phone, r as PhoneState, t as usePhone } from "../use-phone-DBAkasPq.js";
|
|
3
3
|
export { type Phone, type PhoneState, createPhone, hitch, usePhone };
|
package/dist/client/hitch.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as hitch } from "../hitch-client-
|
|
2
|
-
import { n as createPhone, t as usePhone } from "../use-phone-
|
|
1
|
+
import { t as hitch } from "../hitch-client-Dph_kzDd.js";
|
|
2
|
+
import { n as createPhone, t as usePhone } from "../use-phone-CB_idmrz.js";
|
|
3
3
|
export { createPhone, hitch, usePhone };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MarkdownEditorProps, r as MarkdownEditorFiles, t as MarkdownEditor } from "../../markdown-editor-
|
|
1
|
+
import { n as MarkdownEditorProps, r as MarkdownEditorFiles, t as MarkdownEditor } from "../../markdown-editor-CB_nWLzj.js";
|
|
2
2
|
export { MarkdownEditor, type MarkdownEditorFiles, MarkdownEditorProps };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { MarkdownEditor };
|
|
1
|
+
export { t as MarkdownEditor } from "../../markdown-editor-CaUuphfc.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as MarkdownFiles, r as MarkdownProps, t as Markdown } from "../../markdown-
|
|
1
|
+
import { n as MarkdownFiles, r as MarkdownProps, t as Markdown } from "../../markdown-BXt65dDo.js";
|
|
2
2
|
export { Markdown, MarkdownFiles, MarkdownProps };
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Markdown };
|
|
1
|
+
export { t as Markdown } from "../../markdown-BA_XzFxq.js";
|
package/dist/client/react.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as MarkdownFiles, r as MarkdownProps, t as Markdown } from "../markdown-
|
|
2
|
-
import { n as MarkdownEditorProps, r as MarkdownEditorFiles, t as MarkdownEditor } from "../markdown-editor-
|
|
1
|
+
import { n as MarkdownFiles, r as MarkdownProps, t as Markdown } from "../markdown-BXt65dDo.js";
|
|
2
|
+
import { n as MarkdownEditorProps, r as MarkdownEditorFiles, t as MarkdownEditor } from "../markdown-editor-CB_nWLzj.js";
|
|
3
3
|
export { Markdown, MarkdownEditor, type MarkdownEditorFiles, type MarkdownEditorProps, type MarkdownFiles, type MarkdownProps };
|
package/dist/client/react.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as Markdown } from "../markdown-
|
|
2
|
-
import { t as MarkdownEditor } from "../markdown-editor-
|
|
1
|
+
import { t as Markdown } from "../markdown-BA_XzFxq.js";
|
|
2
|
+
import { t as MarkdownEditor } from "../markdown-editor-CaUuphfc.js";
|
|
3
3
|
export { Markdown, MarkdownEditor };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { d as RegisteredRouter } from "./manifest-
|
|
2
|
-
import { t as ExactRouterUtils } from "./query-utils-
|
|
1
|
+
import { d as RegisteredRouter } from "./manifest-CpghlaJc.js";
|
|
2
|
+
import { t as ExactRouterUtils } from "./query-utils-okxIoKM3.js";
|
|
3
3
|
import { RouterClient } from "@orpc/server";
|
|
4
|
-
//#region src/author/client.d.ts
|
|
5
4
|
declare const api: ExactRouterUtils<RouterClient<RegisteredRouter>>;
|
|
6
|
-
//#endregion
|
|
7
5
|
export { api };
|
package/dist/client.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as createLazyClientProxy } from "./lazy-client
|
|
1
|
+
import { t as createLazyClientProxy } from "./lazy-client--QCL0wiu.js";
|
|
2
2
|
import { createORPCClient } from "@orpc/client";
|
|
3
3
|
import { createTanstackQueryUtils } from "@orpc/tanstack-query";
|
|
4
4
|
import { RPCLink } from "@orpc/client/fetch";
|
|
5
|
-
|
|
5
|
+
// src/client.ts
|
|
6
6
|
function createClient(...[options]) {
|
|
7
7
|
const clientOptions = options;
|
|
8
8
|
return createLazyClientProxy(() => {
|
|
@@ -14,8 +14,6 @@ function createClient(...[options]) {
|
|
|
14
14
|
}));
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
//#region src/author/client.ts
|
|
17
|
+
// src/author/client.ts
|
|
19
18
|
const api = createTanstackQueryUtils(createClient());
|
|
20
|
-
//#endregion
|
|
21
19
|
export { api };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { n as AppletManifest } from "./manifest-
|
|
1
|
+
import { n as AppletManifest } from "./manifest-CpghlaJc.js";
|
|
2
2
|
import { AnyContractRouter } from "@orpc/contract";
|
|
3
|
-
//#region src/hitch/contract.d.ts
|
|
4
3
|
type ManifestObjectFor<Manifest, Code> = Manifest extends {
|
|
5
4
|
objects: readonly (infer Object)[];
|
|
6
5
|
} ? Object extends {
|
|
@@ -21,5 +20,4 @@ type NarrowContract<Contract, Manifest> = Contract extends {
|
|
|
21
20
|
records: { [Code in keyof Records & ManifestObjectCodes<Manifest>]: NarrowProcedures<Records[Code], ManifestObjectFor<Manifest, Code>>; };
|
|
22
21
|
} : Contract;
|
|
23
22
|
declare function pruneContract<const Contract extends AnyContractRouter, const Manifest extends AppletManifest>(contract: Contract, manifest: Manifest): NarrowContract<Contract, Manifest>;
|
|
24
|
-
//#endregion
|
|
25
23
|
export { pruneContract as n, NarrowContract as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/hitch/contract.ts
|
|
2
2
|
function isObject(value) {
|
|
3
3
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
4
4
|
}
|
|
@@ -24,5 +24,4 @@ function pruneContract(contract, manifest) {
|
|
|
24
24
|
}
|
|
25
25
|
return Object.assign(platform, { records });
|
|
26
26
|
}
|
|
27
|
-
//#endregion
|
|
28
27
|
export { pruneContract as t };
|