@hitch42/applet 0.1.1-beta.20 → 0.1.1-beta.22
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-DwyWmiaE.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-BWja_v7c.d.ts} +16 -16
- package/dist/generate-DG9vVkBO.js +1 -0
- package/dist/{generate-BLD0DoCk.js → generate-DNgO44RO.js} +32 -37
- 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-Cw-WZ_8v.js → hitch-client-CNN-dU6d.js} +5 -7
- package/dist/{hitch-client-DtyTZzP5.d.ts → hitch-client-k7_jIjPw.d.ts} +5 -7
- package/dist/{hitch-file-url-BPKj9zVG.js → hitch-file-url--AMjDOzP.js} +1 -2
- package/dist/index.d.ts +13 -17
- package/dist/index.js +33 -38
- package/dist/{init-BKUBf6i9.js → init-BD5mC_9L.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-CnB35mjc.d.ts} +1 -3
- package/dist/{markdown-editor-C5mLHGqu.js → markdown-editor-CaUuphfc.js} +3 -5
- package/dist/{markdown-editor-BmEaBzd7.d.ts → markdown-editor-xF3uATBp.d.ts} +1 -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-DRbVhuDm.js → upload-D1mzpsSk.js} +4 -6
- package/dist/{upload-D_kkmne_.d.ts → upload-wp-Ilsv6.d.ts} +6 -10
- 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/email-tracking.md +4 -4
- 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,10 +1,9 @@
|
|
|
1
|
-
import { l as RegisteredContract, u as RegisteredManifest } from "./manifest-
|
|
2
|
-
import { t as NarrowContract } from "./contract-
|
|
3
|
-
import { i as WithBatchRecorder, n as WithRecordCreates, r as WithSingleRecordCreates, t as WithRecordCreateCalls } from "./create-
|
|
4
|
-
import { o as WithFilesUpload } from "./upload-
|
|
5
|
-
import { t as ExactRouterUtils } from "./query-utils-
|
|
1
|
+
import { l as RegisteredContract, u as RegisteredManifest } from "./manifest-CpghlaJc.js";
|
|
2
|
+
import { t as NarrowContract } from "./contract-CUc0B2rl.js";
|
|
3
|
+
import { i as WithBatchRecorder, n as WithRecordCreates, r as WithSingleRecordCreates, t as WithRecordCreateCalls } from "./create-BJqLT8Uq.js";
|
|
4
|
+
import { o as WithFilesUpload } from "./upload-wp-Ilsv6.js";
|
|
5
|
+
import { t as ExactRouterUtils } from "./query-utils-okxIoKM3.js";
|
|
6
6
|
import { ContractRouterClient } from "@orpc/contract";
|
|
7
|
-
//#region src/author/hitch-client.d.ts
|
|
8
7
|
type AuthorContract = NarrowContract<RegisteredContract, RegisteredManifest>;
|
|
9
8
|
type BaseHitchClient = ContractRouterClient<AuthorContract>;
|
|
10
9
|
type AuthorHitchClient = WithRecordCreates<WithBatchRecorder<BaseHitchClient>>;
|
|
@@ -20,5 +19,4 @@ type BatchHitchUtils = AuthorHitchClient extends {
|
|
|
20
19
|
};
|
|
21
20
|
} : BaseHitchUtils : BaseHitchUtils;
|
|
22
21
|
declare const hitch: WithFilesUpload<AuthorHitchUtils>;
|
|
23
|
-
//#endregion
|
|
24
22
|
export { hitch as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/react/hitch-file-url.ts
|
|
2
2
|
const HITCH_FILE_PREFIX = "hitch-file://";
|
|
3
3
|
const DOWNLOAD_URL_TTL_MS = 3e6;
|
|
4
4
|
const downloadUrlCache = /* @__PURE__ */ new Map();
|
|
@@ -21,5 +21,4 @@ function seedDownloadUrl(id, url) {
|
|
|
21
21
|
function invalidateDownloadUrl(id) {
|
|
22
22
|
downloadUrlCache.delete(id);
|
|
23
23
|
}
|
|
24
|
-
//#endregion
|
|
25
24
|
export { seedDownloadUrl as i, cachedDownloadUrl as n, invalidateDownloadUrl as r, HITCH_FILE_PREFIX as t };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
import { a as AppletSourceDefinition, c as RegisteredCatalog, d as RegisteredRouter, f as RegisteredVariableKeys, h as registerHitchContract, i as AppletPackages, l as RegisteredContract, m as RegisteredWorkflows, n as AppletManifest, o as RegisteredAppletSourceDefinition, p as RegisteredVariables, r as AppletManifestObject, s as HitchRegister, t as AppletDefinition, u as RegisteredManifest } from "./manifest-
|
|
2
|
-
import { n as pruneContract, t as NarrowContract } from "./contract-
|
|
3
|
-
import { a as UploadedHitchFile, c as filesContract, i as UploadProgress, n as FilesUpload, r as UploadFileOptions, s as uploadFile, t as FilesClient } from "./upload-
|
|
4
|
-
import { a as EmailTracker, c as HitchEmailMessage, f as ListEmailTrackersOutput, g as emailContract, h as SendHitchEmailInput, i as EmailContract, l as HitchEmailThread, m as ListHitchEmailThreadsInput, n as TelephonyMessageReceivedEvent, o as HitchEmailAddress, p as ListHitchEmailMessagesInput, s as HitchEmailAttachment, t as EmailMessageReceivedEvent, u as HitchMailbox } from "./email-protocol-
|
|
1
|
+
import { a as AppletSourceDefinition, c as RegisteredCatalog, d as RegisteredRouter, f as RegisteredVariableKeys, h as registerHitchContract, i as AppletPackages, l as RegisteredContract, m as RegisteredWorkflows, n as AppletManifest, o as RegisteredAppletSourceDefinition, p as RegisteredVariables, r as AppletManifestObject, s as HitchRegister, t as AppletDefinition, u as RegisteredManifest } from "./manifest-CpghlaJc.js";
|
|
2
|
+
import { n as pruneContract, t as NarrowContract } from "./contract-CUc0B2rl.js";
|
|
3
|
+
import { a as UploadedHitchFile, c as filesContract, i as UploadProgress, n as FilesUpload, r as UploadFileOptions, s as uploadFile, t as FilesClient } from "./upload-wp-Ilsv6.js";
|
|
4
|
+
import { a as EmailTracker, c as HitchEmailMessage, f as ListEmailTrackersOutput, g as emailContract, h as SendHitchEmailInput, i as EmailContract, l as HitchEmailThread, m as ListHitchEmailThreadsInput, n as TelephonyMessageReceivedEvent, o as HitchEmailAddress, p as ListHitchEmailMessagesInput, s as HitchEmailAttachment, t as EmailMessageReceivedEvent, u as HitchMailbox } from "./email-protocol-BWja_v7c.js";
|
|
5
5
|
import { ContractProcedure, Meta, Schema } from "@orpc/contract";
|
|
6
|
-
//#region ../shared/auth/src/workspace.d.mts
|
|
7
6
|
interface HitchConfig {
|
|
8
7
|
sdk: string;
|
|
9
8
|
org: string;
|
|
10
9
|
githubWorkflow?: boolean;
|
|
11
10
|
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/hitch/me.d.ts
|
|
14
11
|
type HitchPerson = {
|
|
15
12
|
id: string;
|
|
16
13
|
firstName: string;
|
|
@@ -38,8 +35,6 @@ type MeContract = {
|
|
|
38
35
|
get: ContractProcedure<Schema<void, void>, Schema<HitchMe, HitchMe>, Record<never, never>, Meta>;
|
|
39
36
|
};
|
|
40
37
|
declare const meContract: MeContract;
|
|
41
|
-
//#endregion
|
|
42
|
-
//#region src/hitch/telephony.d.ts
|
|
43
38
|
type HitchPhoneNumber = {
|
|
44
39
|
id: string;
|
|
45
40
|
e164: string;
|
|
@@ -114,7 +109,10 @@ type SendHitchMessageInput = {
|
|
|
114
109
|
requestId?: string;
|
|
115
110
|
};
|
|
116
111
|
type MessageIdInput = {
|
|
117
|
-
|
|
112
|
+
messageId: string;
|
|
113
|
+
};
|
|
114
|
+
type CallIdInput = {
|
|
115
|
+
callId: string;
|
|
118
116
|
};
|
|
119
117
|
type NumbersOutput = {
|
|
120
118
|
data: HitchPhoneNumber[];
|
|
@@ -129,7 +127,7 @@ type CallsOutput = {
|
|
|
129
127
|
};
|
|
130
128
|
type TelephonyContract = {
|
|
131
129
|
calls: {
|
|
132
|
-
get: ContractProcedure<Schema<
|
|
130
|
+
get: ContractProcedure<Schema<CallIdInput, CallIdInput>, Schema<HitchCall, HitchCall>, Record<never, never>, Meta>;
|
|
133
131
|
list: ContractProcedure<Schema<ListHitchCallsInput, ListHitchCallsInput>, Schema<CallsOutput, CallsOutput>, Record<never, never>, Meta>;
|
|
134
132
|
};
|
|
135
133
|
numbers: {
|
|
@@ -142,10 +140,9 @@ type TelephonyContract = {
|
|
|
142
140
|
};
|
|
143
141
|
};
|
|
144
142
|
declare const telephonyContract: TelephonyContract;
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region src/hitch/teams.d.ts
|
|
147
143
|
type HitchTeam = {
|
|
148
144
|
id: string;
|
|
145
|
+
code: string;
|
|
149
146
|
name: string;
|
|
150
147
|
};
|
|
151
148
|
type HitchTeamMember = {
|
|
@@ -154,9 +151,9 @@ type HitchTeamMember = {
|
|
|
154
151
|
lastName: string;
|
|
155
152
|
email: string;
|
|
156
153
|
};
|
|
157
|
-
type
|
|
154
|
+
type TeamInput = {
|
|
158
155
|
params: {
|
|
159
|
-
|
|
156
|
+
teamCode: string;
|
|
160
157
|
};
|
|
161
158
|
};
|
|
162
159
|
type TeamsOutput = {
|
|
@@ -168,9 +165,8 @@ type TeamMembersOutput = {
|
|
|
168
165
|
type TeamsContract = {
|
|
169
166
|
list: ContractProcedure<Schema<void, void>, Schema<TeamsOutput, TeamsOutput>, Record<never, never>, Meta>;
|
|
170
167
|
members: {
|
|
171
|
-
list: ContractProcedure<Schema<
|
|
168
|
+
list: ContractProcedure<Schema<TeamInput, TeamInput>, Schema<TeamMembersOutput, TeamMembersOutput>, Record<never, never>, Meta>;
|
|
172
169
|
};
|
|
173
170
|
};
|
|
174
171
|
declare const teamsContract: TeamsContract;
|
|
175
|
-
//#endregion
|
|
176
172
|
export { type AppletDefinition, type AppletManifest, type AppletManifestObject, type AppletPackages, type AppletSourceDefinition, type EmailContract, type EmailMessageReceivedEvent, type EmailTracker, type FilesClient, type FilesUpload, type HitchConfig, type HitchEmailAddress, type HitchEmailAttachment, type HitchEmailMessage, type HitchEmailThread, type HitchMailbox, type HitchMe, type HitchMessage, type HitchPhoneNumber, type HitchRegister, type HitchTeam, type HitchTeamMember, type ListEmailTrackersOutput, type ListHitchEmailMessagesInput, type ListHitchEmailThreadsInput, type ListHitchMessagesInput, type NarrowContract, type RegisteredAppletSourceDefinition, type RegisteredCatalog, type RegisteredContract, type RegisteredManifest, type RegisteredRouter, type RegisteredVariableKeys, type RegisteredVariables, type RegisteredWorkflows, type SendHitchEmailInput, type SendHitchMessageInput, type TelephonyContract, type TelephonyMessageReceivedEvent, type UploadFileOptions, type UploadProgress, type UploadedHitchFile, emailContract, filesContract, meContract, pruneContract, registerHitchContract, teamsContract, telephonyContract, uploadFile };
|
package/dist/index.js
CHANGED
|
@@ -1,140 +1,135 @@
|
|
|
1
|
-
import { i as registerHitchContract, t as uploadFile } from "./upload-
|
|
2
|
-
import { t as pruneContract } from "./contract-
|
|
1
|
+
import { i as registerHitchContract, t as uploadFile } from "./upload-D1mzpsSk.js";
|
|
2
|
+
import { t as pruneContract } from "./contract-D9LCNGjD.js";
|
|
3
3
|
import { oc, type } from "@orpc/contract";
|
|
4
|
-
|
|
4
|
+
// src/hitch/email.ts
|
|
5
5
|
function emailContract(appletCode) {
|
|
6
|
-
const path = `/v1/applets/${encodeURIComponent(appletCode)}/email/
|
|
6
|
+
const path = `/resource/v1/applets/${encodeURIComponent(appletCode)}/email/trackers`;
|
|
7
7
|
return {
|
|
8
8
|
mailboxes: { list: oc.route({
|
|
9
9
|
method: "GET",
|
|
10
|
-
path: "/v1/email/mailboxes"
|
|
10
|
+
path: "/resource/v1/email/mailboxes"
|
|
11
11
|
}).input(type()).output(type()) },
|
|
12
12
|
threads: {
|
|
13
13
|
list: oc.route({
|
|
14
14
|
method: "GET",
|
|
15
|
-
path: "/v1/email/threads"
|
|
15
|
+
path: "/resource/v1/email/threads"
|
|
16
16
|
}).input(type()).output(type()),
|
|
17
17
|
get: oc.route({
|
|
18
18
|
method: "GET",
|
|
19
|
-
path: "/v1/email/threads/{
|
|
19
|
+
path: "/resource/v1/email/threads/{threadId}"
|
|
20
20
|
}).input(type()).output(type())
|
|
21
21
|
},
|
|
22
22
|
messages: {
|
|
23
23
|
list: oc.route({
|
|
24
24
|
method: "GET",
|
|
25
|
-
path: "/v1/email/messages"
|
|
25
|
+
path: "/resource/v1/email/messages"
|
|
26
26
|
}).input(type()).output(type()),
|
|
27
27
|
get: oc.route({
|
|
28
28
|
method: "GET",
|
|
29
|
-
path: "/v1/email/messages/{
|
|
29
|
+
path: "/resource/v1/email/messages/{messageId}"
|
|
30
30
|
}).input(type()).output(type()),
|
|
31
31
|
send: oc.route({
|
|
32
32
|
method: "POST",
|
|
33
|
-
path: "/v1/email/messages",
|
|
33
|
+
path: "/resource/v1/email/messages",
|
|
34
34
|
successStatus: 201
|
|
35
35
|
}).input(type()).output(type()),
|
|
36
36
|
raw: oc.route({
|
|
37
37
|
method: "GET",
|
|
38
|
-
path: "/v1/email/messages/{
|
|
38
|
+
path: "/resource/v1/email/messages/{messageId}/raw"
|
|
39
39
|
}).input(type()).output(type())
|
|
40
40
|
},
|
|
41
41
|
attachments: { get: oc.route({
|
|
42
42
|
method: "GET",
|
|
43
|
-
path: "/v1/email/attachments/{
|
|
43
|
+
path: "/resource/v1/email/attachments/{attachmentId}"
|
|
44
44
|
}).input(type()).output(type()) },
|
|
45
45
|
tracking: {
|
|
46
46
|
createPixel: oc.route({
|
|
47
47
|
method: "POST",
|
|
48
|
-
path
|
|
48
|
+
path,
|
|
49
49
|
successStatus: 201
|
|
50
50
|
}).input(type()).output(type()),
|
|
51
51
|
markSent: oc.route({
|
|
52
|
-
method: "
|
|
53
|
-
path: `${path}/{
|
|
52
|
+
method: "PATCH",
|
|
53
|
+
path: `${path}/{trackerId}`
|
|
54
54
|
}).input(type()).output(type()),
|
|
55
55
|
get: oc.route({
|
|
56
56
|
method: "GET",
|
|
57
|
-
path: `${path}/{
|
|
57
|
+
path: `${path}/{trackerId}`
|
|
58
58
|
}).input(type()).output(type()),
|
|
59
59
|
list: oc.route({
|
|
60
60
|
method: "POST",
|
|
61
|
-
path: `${path}/
|
|
61
|
+
path: `${path}/query`
|
|
62
62
|
}).input(type()).output(type())
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
//#region src/hitch/files.ts
|
|
66
|
+
// src/hitch/files.ts
|
|
68
67
|
const filesContract = {
|
|
69
68
|
create: oc.route({
|
|
70
69
|
method: "POST",
|
|
71
|
-
path: "/v1/files",
|
|
70
|
+
path: "/resource/v1/files",
|
|
72
71
|
successStatus: 201,
|
|
73
72
|
inputStructure: "detailed"
|
|
74
73
|
}).input(type()).output(type()),
|
|
75
74
|
confirm: oc.route({
|
|
76
75
|
method: "POST",
|
|
77
|
-
path: "/v1/files/{
|
|
76
|
+
path: "/resource/v1/files/{fileId}/confirm",
|
|
78
77
|
successStatus: 200,
|
|
79
78
|
inputStructure: "detailed"
|
|
80
79
|
}).input(type()).output(type()),
|
|
81
80
|
get: oc.route({
|
|
82
81
|
method: "GET",
|
|
83
|
-
path: "/v1/files/{
|
|
82
|
+
path: "/resource/v1/files/{fileId}",
|
|
84
83
|
inputStructure: "detailed"
|
|
85
84
|
}).input(type()).output(type())
|
|
86
85
|
};
|
|
87
|
-
|
|
88
|
-
//#region src/hitch/me.ts
|
|
86
|
+
// src/hitch/me.ts
|
|
89
87
|
const meContract = { get: oc.route({
|
|
90
88
|
method: "GET",
|
|
91
|
-
path: "/v1
|
|
89
|
+
path: "/me/v1"
|
|
92
90
|
}).input(type()).output(type()) };
|
|
93
|
-
|
|
94
|
-
//#region src/hitch/telephony.ts
|
|
91
|
+
// src/hitch/telephony.ts
|
|
95
92
|
const telephonyContract = {
|
|
96
93
|
calls: {
|
|
97
94
|
get: oc.route({
|
|
98
95
|
method: "GET",
|
|
99
|
-
path: "/v1/telephony/calls/{
|
|
96
|
+
path: "/resource/v1/telephony/calls/{callId}"
|
|
100
97
|
}).input(type()).output(type()),
|
|
101
98
|
list: oc.route({
|
|
102
99
|
method: "GET",
|
|
103
|
-
path: "/v1/telephony/calls"
|
|
100
|
+
path: "/resource/v1/telephony/calls"
|
|
104
101
|
}).input(type()).output(type())
|
|
105
102
|
},
|
|
106
103
|
numbers: { list: oc.route({
|
|
107
104
|
method: "GET",
|
|
108
|
-
path: "/v1/telephony/numbers"
|
|
105
|
+
path: "/resource/v1/telephony/numbers"
|
|
109
106
|
}).input(type()).output(type()) },
|
|
110
107
|
messages: {
|
|
111
108
|
get: oc.route({
|
|
112
109
|
method: "GET",
|
|
113
|
-
path: "/v1/telephony/messages/{
|
|
110
|
+
path: "/resource/v1/telephony/messages/{messageId}"
|
|
114
111
|
}).input(type()).output(type()),
|
|
115
112
|
list: oc.route({
|
|
116
113
|
method: "GET",
|
|
117
|
-
path: "/v1/telephony/messages"
|
|
114
|
+
path: "/resource/v1/telephony/messages"
|
|
118
115
|
}).input(type()).output(type()),
|
|
119
116
|
send: oc.route({
|
|
120
117
|
method: "POST",
|
|
121
|
-
path: "/v1/telephony/messages",
|
|
118
|
+
path: "/resource/v1/telephony/messages",
|
|
122
119
|
successStatus: 201
|
|
123
120
|
}).input(type()).output(type())
|
|
124
121
|
}
|
|
125
122
|
};
|
|
126
|
-
|
|
127
|
-
//#region src/hitch/teams.ts
|
|
123
|
+
// src/hitch/teams.ts
|
|
128
124
|
const teamsContract = {
|
|
129
125
|
list: oc.route({
|
|
130
126
|
method: "GET",
|
|
131
|
-
path: "/v1/teams"
|
|
127
|
+
path: "/resource/v1/teams"
|
|
132
128
|
}).input(type()).output(type()),
|
|
133
129
|
members: { list: oc.route({
|
|
134
130
|
method: "GET",
|
|
135
|
-
path: "/v1/teams/{
|
|
131
|
+
path: "/resource/v1/teams/{teamCode}/members",
|
|
136
132
|
inputStructure: "detailed"
|
|
137
133
|
}).input(type()).output(type()) }
|
|
138
134
|
};
|
|
139
|
-
//#endregion
|
|
140
135
|
export { emailContract, filesContract, meContract, pruneContract, registerHitchContract, teamsContract, telephonyContract, uploadFile };
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { r as
|
|
4
|
-
import {
|
|
5
|
-
import { n as
|
|
1
|
+
import { r as writeGeneratedAgents } from "./generated-agents-BUnJ0FQA.js";
|
|
2
|
+
import { f as resolveAuth, m as resolveInstanceUrl, p as resolveAuthForOrg } from "./store-E5NhITHl.js";
|
|
3
|
+
import { a as findWorkspaceRoot, i as findWorkspaceConfig, o as isRootLayout, r as findParentRoot, s as readWorkspaceConfig } from "./workspace-CtIKSgMD.js";
|
|
4
|
+
import { r as orgUsesHitchGit, t as canCheckHitchGit } from "./auth-DuMRqSGe.js";
|
|
5
|
+
import { n as loadAppletSourceDefinition } from "./load-config-Cffvj-aM.js";
|
|
6
|
+
import { r as runGenerate } from "./generate-DNgO44RO.js";
|
|
7
|
+
import { n as ORG_CODE_PATTERN, t as APPLET_CODE_PATTERN } from "./manifest-patterns-BfxqImlp.js";
|
|
8
|
+
import { l as writeRootSupport, n as loadCliManifest, r as loadPackageManifest, s as writeAppletSupport, t as assertWorkspaceCli, u as writeWorkspaceSupport } from "./project-DZGk765E.js";
|
|
9
|
+
import { n as childApplets } from "./parent-Zx8Eg1Ki.js";
|
|
10
|
+
import { t as migrateIfEnabled } from "./git-migration-CIq-sN61.js";
|
|
6
11
|
import { access, cp, mkdir, readdir, writeFile } from "node:fs/promises";
|
|
7
12
|
import { relative, resolve } from "node:path";
|
|
8
13
|
import { spawn } from "node:child_process";
|
|
9
|
-
|
|
14
|
+
// src/init.ts
|
|
10
15
|
function isMissingFile(error) {
|
|
11
16
|
return error instanceof Error && "code" in error && error.code === "ENOENT";
|
|
12
17
|
}
|
|
@@ -151,10 +156,34 @@ export default {
|
|
|
151
156
|
const nextSteps = [...installResult === "succeeded" ? [] : ["pnpm install"], "pnpm exec applet new <code>"];
|
|
152
157
|
console.log(`Workspace created in ${target}.\n\nNext steps:\n${nextSteps.map((step) => ` ${step}`).join("\n")}`);
|
|
153
158
|
}
|
|
159
|
+
async function bootstrapApplet(root, options) {
|
|
160
|
+
const cli = await loadCliManifest();
|
|
161
|
+
if (cli === void 0) throw new Error("The CLI package manifest is not published.");
|
|
162
|
+
await writeRootSupport(root, await loadAppletSourceDefinition(root), cli);
|
|
163
|
+
if (await installDependencies(root, options.install ?? true) === "failed") throw new Error(`Dependency installation failed in ${root}.`);
|
|
164
|
+
console.log(`Applet files generated in ${root}.`);
|
|
165
|
+
}
|
|
154
166
|
async function runBootstrap(options = {}) {
|
|
155
|
-
const
|
|
167
|
+
const cwd = process.cwd();
|
|
168
|
+
const workspace = findWorkspaceRoot(cwd);
|
|
169
|
+
const parent = workspace === void 0 ? findParentRoot(cwd) : void 0;
|
|
170
|
+
if (parent !== void 0) {
|
|
171
|
+
await writeGeneratedAgents(parent);
|
|
172
|
+
for (const child of await childApplets(parent)) await bootstrapApplet(child, options);
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
const target = workspace ?? cwd;
|
|
156
176
|
const config = readWorkspaceConfig(target);
|
|
157
|
-
if (config === void 0) throw new Error(`Not a Hitch workspace
|
|
177
|
+
if (config === void 0) throw new Error(`Not a Hitch workspace or applet: ${target}.`);
|
|
178
|
+
if (isRootLayout(target)) {
|
|
179
|
+
await bootstrapApplet(target, options);
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const migration = await migrateIfEnabled(cwd, options.message);
|
|
183
|
+
if (migration !== void 0) {
|
|
184
|
+
for (const child of migration.roots) await bootstrapApplet(child, options);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
158
187
|
const cli = await loadCliManifest();
|
|
159
188
|
if (cli === void 0) throw new Error("The CLI package manifest is not published.");
|
|
160
189
|
assertWorkspaceCli(config, cli);
|
|
@@ -176,19 +205,35 @@ async function runBootstrap(options = {}) {
|
|
|
176
205
|
async function runNew(options) {
|
|
177
206
|
if (!APPLET_CODE_PATTERN.test(options.code)) throw new Error(`Invalid applet code "${options.code}".`);
|
|
178
207
|
if (options.clientOnly === true && options.serverOnly === true) throw new Error("Use only one of --client-only or --server-only.");
|
|
179
|
-
const
|
|
208
|
+
const cwd = process.cwd();
|
|
209
|
+
const previousConfig = findWorkspaceConfig(cwd);
|
|
210
|
+
const migration = await migrateIfEnabled(cwd, options.message);
|
|
211
|
+
const workspaceRoot = migration === void 0 ? findWorkspaceRoot(cwd) ?? findParentRoot(cwd) ?? cwd : migration.roots.length === 1 ? migration.roots[0] : migration.root;
|
|
180
212
|
const name = options.code.replaceAll("_", " ").replace(/^./, (character) => character.toUpperCase());
|
|
181
|
-
const
|
|
182
|
-
|
|
213
|
+
const workspaceConfig = readWorkspaceConfig(workspaceRoot);
|
|
214
|
+
const childOrgs = findParentRoot(workspaceRoot) === workspaceRoot ? [...new Set((await childApplets(workspaceRoot)).map((child) => readWorkspaceConfig(child).org))] : [];
|
|
215
|
+
const org = workspaceConfig?.org ?? previousConfig?.org ?? process.env.HITCH_DEFAULT_ORG ?? (childOrgs.length === 1 ? childOrgs[0] : void 0) ?? (await resolveAuth(await resolveInstanceUrl()))?.orgCode;
|
|
216
|
+
if (org === void 0 || !ORG_CODE_PATTERN.test(org)) throw new Error("Set HITCH_DEFAULT_ORG or log in to one organization before applet new.");
|
|
217
|
+
const hitchGit = await canCheckHitchGit() && await orgUsesHitchGit(org);
|
|
218
|
+
if (!hitchGit && cwd !== workspaceRoot) throw new Error(`Not a Hitch workspace root: ${cwd}. Run applet new from the directory that contains hitch.config.ts.`);
|
|
219
|
+
if (!hitchGit && (workspaceConfig === void 0 || isRootLayout(workspaceRoot))) throw new Error("Hitch git is off. Run applet new in a legacy workspace.");
|
|
183
220
|
const cli = await loadCliManifest({ allowDevelopment: true });
|
|
184
|
-
if (cli !== void 0) assertWorkspaceCli(
|
|
185
|
-
const
|
|
221
|
+
if (cli !== void 0 && !hitchGit) assertWorkspaceCli(workspaceConfig, cli);
|
|
222
|
+
const config = workspaceConfig ?? {
|
|
223
|
+
org,
|
|
224
|
+
sdk: `@hitch42/applet@${cli?.version ?? "0.0.0"}`
|
|
225
|
+
};
|
|
226
|
+
const appletTarget = resolve(workspaceRoot, ...hitchGit ? [] : ["applets"], options.code);
|
|
186
227
|
await assertTargetIsAvailable([resolve(appletTarget, "applet.manifest.ts"), resolve(appletTarget, "src")], "an applet");
|
|
187
228
|
const hasClient = options.serverOnly !== true;
|
|
188
229
|
const hasServer = options.clientOnly !== true;
|
|
189
230
|
if (hasClient) await cp(new URL("../scaffold/applet", import.meta.url), appletTarget, { recursive: true });
|
|
190
231
|
await Promise.all([hasClient ? mkdir(resolve(appletTarget, "src/client/routes"), { recursive: true }) : void 0, hasServer ? mkdir(resolve(appletTarget, "src/server"), { recursive: true }) : void 0]);
|
|
191
232
|
const definition = {
|
|
233
|
+
...hitchGit ? {
|
|
234
|
+
org,
|
|
235
|
+
sdk: (cli ?? await loadPackageManifest()).version
|
|
236
|
+
} : {},
|
|
192
237
|
name,
|
|
193
238
|
code: options.code,
|
|
194
239
|
objects: [],
|
|
@@ -199,7 +244,7 @@ async function runNew(options) {
|
|
|
199
244
|
writeFile(resolve(appletTarget, "applet.manifest.ts"), `import type { AppletSourceDefinition } from "@hitch42/applet";
|
|
200
245
|
|
|
201
246
|
export default {
|
|
202
|
-
name: "${name}",
|
|
247
|
+
${hitchGit ? ` org: ${JSON.stringify(org)},\n sdk: ${JSON.stringify(definition.sdk)},\n` : ""} name: "${name}",
|
|
203
248
|
code: "${options.code}",
|
|
204
249
|
objects: [],
|
|
205
250
|
dependencies: {},
|
|
@@ -224,16 +269,23 @@ const router = {
|
|
|
224
269
|
export default { router };
|
|
225
270
|
`) : void 0
|
|
226
271
|
]);
|
|
227
|
-
|
|
228
|
-
|
|
272
|
+
if (hitchGit) {
|
|
273
|
+
if (cli === void 0) await writeAppletSupport(appletTarget, definition);
|
|
274
|
+
else await writeRootSupport(appletTarget, definition, cli);
|
|
275
|
+
if (!await runGit(appletTarget, [
|
|
276
|
+
"init",
|
|
277
|
+
"-b",
|
|
278
|
+
"main"
|
|
279
|
+
])) throw new Error("Could not initialize the applet repo.");
|
|
280
|
+
} else await Promise.all([writeAppletSupport(appletTarget, definition), cli === void 0 ? void 0 : writeWorkspaceSupport(workspaceRoot, config, cli)]);
|
|
281
|
+
const installResult = await installDependencies(hitchGit ? appletTarget : workspaceRoot, options.install ?? true);
|
|
229
282
|
const generateSucceeded = await generateAppletFiles(appletTarget, config.org, installResult);
|
|
230
283
|
const relativeTarget = relative(workspaceRoot, appletTarget);
|
|
231
284
|
const nextSteps = [
|
|
232
|
-
...installResult === "succeeded" ? [`cd ${JSON.stringify(relativeTarget)}`] : ["pnpm install", `cd ${JSON.stringify(relativeTarget)}`],
|
|
285
|
+
...installResult === "succeeded" ? [`cd ${JSON.stringify(relativeTarget)}`] : hitchGit ? [`cd ${JSON.stringify(relativeTarget)}`, "pnpm install"] : ["pnpm install", `cd ${JSON.stringify(relativeTarget)}`],
|
|
233
286
|
...generateSucceeded ? [] : ["pnpm exec applet generate"],
|
|
234
287
|
"pnpm exec vite"
|
|
235
288
|
];
|
|
236
289
|
console.log(`Applet created in ${relativeTarget}.\n\nNext steps:\n${nextSteps.map((step) => ` ${step}`).join("\n")}`);
|
|
237
290
|
}
|
|
238
|
-
//#endregion
|
|
239
291
|
export { runBootstrap, runInit, runNew };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/lazy-client.ts
|
|
2
2
|
function createLazyClientProxy(build) {
|
|
3
3
|
let client;
|
|
4
4
|
const at = (path) => new Proxy(() => void 0, {
|
|
@@ -10,5 +10,4 @@ function createLazyClientProxy(build) {
|
|
|
10
10
|
});
|
|
11
11
|
return at([]);
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
export { createLazyClientProxy as t };
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { n as
|
|
1
|
+
import { c as validateRootManifest, i as findWorkspaceConfig, n as findAppletRoot, o as isRootLayout } from "./workspace-CtIKSgMD.js";
|
|
2
|
+
import { n as ORG_CODE_PATTERN, t as APPLET_CODE_PATTERN } from "./manifest-patterns-BfxqImlp.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import { existsSync } from "node:fs";
|
|
4
|
-
import {
|
|
5
|
+
import { resolve } from "node:path";
|
|
5
6
|
import { loadConfigFromFile } from "vite";
|
|
6
7
|
import { Cron } from "croner";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
// src/workspace.ts
|
|
9
|
+
function resolveWorkspaceOrg(appletRoot) {
|
|
10
|
+
const config = findWorkspaceConfig(appletRoot);
|
|
11
|
+
if (config !== void 0) return config.org;
|
|
12
|
+
throw new Error(`No Hitch workspace found for ${appletRoot}. Expected applet.manifest.ts or hitch.config.ts.`);
|
|
13
|
+
}
|
|
14
|
+
// src/manifest.ts
|
|
12
15
|
const RESERVED_ATTRIBUTE_CODES = /* @__PURE__ */ new Set([
|
|
13
16
|
"id",
|
|
14
17
|
"name",
|
|
@@ -124,6 +127,13 @@ const checkPublicFields = (manifest, context) => {
|
|
|
124
127
|
}));
|
|
125
128
|
};
|
|
126
129
|
const appletManifestSchema = z.strictObject(appletManifestShape).superRefine(checkDuplicateCodes).superRefine(checkPublicFields);
|
|
130
|
+
function appletReleaseManifest(source, org) {
|
|
131
|
+
const { sdk: _sdk, org: _org, dependencies: _dependencies, devDependencies: _devDependencies, ...definition } = source;
|
|
132
|
+
return appletManifestSchema.parse({
|
|
133
|
+
org,
|
|
134
|
+
...definition
|
|
135
|
+
});
|
|
136
|
+
}
|
|
127
137
|
z.strictObject({
|
|
128
138
|
name: appletManifestShape.name,
|
|
129
139
|
code: appletManifestShape.code,
|
|
@@ -202,6 +212,8 @@ const checkSourcePackages = (manifest, context) => {
|
|
|
202
212
|
});
|
|
203
213
|
};
|
|
204
214
|
const appletSourceDefinitionSchema = z.strictObject({
|
|
215
|
+
org: appletManifestShape.org.optional(),
|
|
216
|
+
sdk: z.string().optional(),
|
|
205
217
|
name: appletManifestShape.name,
|
|
206
218
|
code: appletManifestShape.code,
|
|
207
219
|
requiresChangeset: appletManifestShape.requiresChangeset,
|
|
@@ -218,19 +230,9 @@ const appletSourceDefinitionSchema = z.strictObject({
|
|
|
218
230
|
checkSourcePackages(manifest, context);
|
|
219
231
|
checkPublicFields(manifest, context);
|
|
220
232
|
});
|
|
221
|
-
|
|
222
|
-
//#region src/workspace.ts
|
|
223
|
-
function resolveWorkspaceOrg(appletRoot) {
|
|
224
|
-
const appletsDir = dirname(appletRoot);
|
|
225
|
-
if (basename(appletsDir) === "applets") {
|
|
226
|
-
const config = readWorkspaceConfig(dirname(appletsDir));
|
|
227
|
-
if (config !== void 0) return config.org;
|
|
228
|
-
}
|
|
229
|
-
throw new Error(`No Hitch workspace found for ${appletRoot}. An applet must live at <workspace>/applets/<code> with hitch.config.ts in the workspace root.`);
|
|
230
|
-
}
|
|
231
|
-
//#endregion
|
|
232
|
-
//#region src/typegen/load-config.ts
|
|
233
|
+
// src/typegen/load-config.ts
|
|
233
234
|
async function loadAppletSourceDefinition(root) {
|
|
235
|
+
root = findAppletRoot(root) ?? root;
|
|
234
236
|
const path = resolve(root, "applet.manifest.ts");
|
|
235
237
|
if (!existsSync(path)) throw new Error(`No applet manifest found at ${path}.`);
|
|
236
238
|
const loaded = await loadConfigFromFile({
|
|
@@ -238,16 +240,12 @@ async function loadAppletSourceDefinition(root) {
|
|
|
238
240
|
mode: "production"
|
|
239
241
|
}, path, root);
|
|
240
242
|
if (loaded === null) throw new Error(`No applet manifest found at ${path}.`);
|
|
243
|
+
if (isRootLayout(root)) validateRootManifest(loaded.config);
|
|
241
244
|
const parsed = appletSourceDefinitionSchema.safeParse(loaded.config);
|
|
242
245
|
if (!parsed.success) throw new Error(`Invalid applet manifest at ${loaded.path}: ${parsed.error.message}`);
|
|
243
246
|
return parsed.data;
|
|
244
247
|
}
|
|
245
248
|
async function loadAppletConfig(root) {
|
|
246
|
-
|
|
247
|
-
return {
|
|
248
|
-
org: resolveWorkspaceOrg(root),
|
|
249
|
-
...definition
|
|
250
|
-
};
|
|
249
|
+
return appletReleaseManifest(await loadAppletSourceDefinition(root), resolveWorkspaceOrg(root));
|
|
251
250
|
}
|
|
252
|
-
|
|
253
|
-
export { appletMountPath as a, ORG_CODE_PATTERN as c, appletManifestSchema as i, loadAppletSourceDefinition as n, appletSourceDefinitionSchema as o, resolveWorkspaceOrg as r, APPLET_CODE_PATTERN as s, loadAppletConfig as t };
|
|
251
|
+
export { appletSourceDefinitionSchema as a, appletReleaseManifest as i, loadAppletSourceDefinition as n, resolveWorkspaceOrg as o, appletMountPath as r, loadAppletConfig as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { channel } from "node:diagnostics_channel";
|
|
2
|
-
|
|
2
|
+
// src/server/log-context.ts
|
|
3
3
|
const REQUEST_CONTEXT_CHANNEL = "hitch.request.context";
|
|
4
4
|
const APP_CONTEXT_CHANNEL = "hitch.request.app";
|
|
5
5
|
const isUuid = (value) => typeof value === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value);
|
|
@@ -65,5 +65,4 @@ function createNoteLog(initial) {
|
|
|
65
65
|
publishNote(initial.requestId, initial);
|
|
66
66
|
return log;
|
|
67
67
|
}
|
|
68
|
-
//#endregion
|
|
69
68
|
export { errorNote as a, requestIdFrom as c, createNoteLog as i, REQUEST_CONTEXT_CHANNEL as n, isUuid as o, cloudflareRequestFields as r, publishNote as s, APP_CONTEXT_CHANNEL as t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { c as normalizeInstanceUrl, h as revokeOAuthCredentials, m as resolveInstanceUrl, s as deleteCredentials, t as AuthenticationError, u as readCredentialStore } from "./store-E5NhITHl.js";
|
|
2
|
+
import { t as loginWithDevice } from "./device-CZWWckCq.js";
|
|
3
|
+
import { i as findWorkspaceConfig } from "./workspace-CtIKSgMD.js";
|
|
4
|
+
// src/login.ts
|
|
5
|
+
async function runLogin(options) {
|
|
6
|
+
if (process.env.HITCH_API_KEY !== void 0) throw new AuthenticationError("HITCH_API_KEY is set — unset it to manage stored logins.");
|
|
7
|
+
const { me, membership } = await loginWithDevice(await resolveInstanceUrl(), {
|
|
8
|
+
expectedOrg: findWorkspaceConfig(process.cwd())?.org,
|
|
9
|
+
noBrowser: options.noBrowser
|
|
10
|
+
});
|
|
11
|
+
console.log(`Signed in as ${me.person.email} to ${membership.name}.`);
|
|
12
|
+
}
|
|
13
|
+
async function runLogout() {
|
|
14
|
+
if (process.env.HITCH_API_KEY !== void 0) throw new AuthenticationError("HITCH_API_KEY is set — unset it to manage stored logins.");
|
|
15
|
+
const instance = await resolveInstanceUrl();
|
|
16
|
+
const credentials = Object.values((await readCredentialStore()).instances[normalizeInstanceUrl(instance)] ?? {});
|
|
17
|
+
await Promise.all(credentials.filter((item) => item.type === "oauth").map((item) => revokeOAuthCredentials(instance, item)));
|
|
18
|
+
await deleteCredentials(instance);
|
|
19
|
+
console.log(`Logged out of ${instance}.`);
|
|
20
|
+
}
|
|
21
|
+
export { runLogin, runLogout };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { s as readWorkspaceConfig } from "./workspace-CtIKSgMD.js";
|
|
2
|
+
import { n as fetchWithOrgAuth } from "./auth-DuMRqSGe.js";
|
|
3
|
+
import { o as resolveWorkspaceOrg, t as loadAppletConfig } from "./load-config-Cffvj-aM.js";
|
|
4
|
+
import { t as APPLET_CODE_PATTERN } from "./manifest-patterns-BfxqImlp.js";
|
|
4
5
|
import { z } from "zod";
|
|
5
|
-
|
|
6
|
+
// src/logs.ts
|
|
6
7
|
const LOG_LEVELS = [
|
|
7
8
|
"debug",
|
|
8
9
|
"log",
|
|
@@ -128,7 +129,7 @@ async function runLogs(options) {
|
|
|
128
129
|
const startedAt = Date.now();
|
|
129
130
|
const requestLogs = async (from, to) => {
|
|
130
131
|
const response = await fetchWithOrgAuth(org, (instanceUrl, accessToken) => {
|
|
131
|
-
const url = new URL(`/api/v1/applets/${encodeURIComponent(code)}/logs/query`, `${instanceUrl}/`);
|
|
132
|
+
const url = new URL(`/api/manage/v1/applets/${encodeURIComponent(code)}/logs/query`, `${instanceUrl}/`);
|
|
132
133
|
const levelFilter = level === void 0 ? void 0 : { level: { $in: LOG_LEVELS.slice(LOG_LEVELS.indexOf(level)) } };
|
|
133
134
|
return fetch(url, {
|
|
134
135
|
method: "POST",
|
|
@@ -177,5 +178,4 @@ async function runLogs(options) {
|
|
|
177
178
|
lastTimestamp = Math.max(lastTimestamp, ...logs.map(({ timestamp }) => timestamp));
|
|
178
179
|
}
|
|
179
180
|
}
|
|
180
|
-
//#endregion
|
|
181
181
|
export { runLogs };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as AnyWorkflowDefinition } from "./workflow-
|
|
1
|
+
import { t as AnyWorkflowDefinition } from "./workflow-BnBrJIzu.js";
|
|
2
2
|
import { AnyProcedure, AnyRouter, Lazy } from "@orpc/server";
|
|
3
3
|
import { AnyContractRouter } from "@orpc/contract";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
//#region src/hitch/registry.d.ts
|
|
6
5
|
interface HitchRegister {}
|
|
7
6
|
type RegisteredCatalog = HitchRegister extends {
|
|
8
7
|
catalog: infer C;
|
|
@@ -26,8 +25,6 @@ type RegisteredWorkflows = HitchRegister extends {
|
|
|
26
25
|
workflows: infer W extends Record<string, AnyWorkflowDefinition>;
|
|
27
26
|
} ? W : Record<string, AnyWorkflowDefinition>;
|
|
28
27
|
declare function registerHitchContract(contract: AnyContractRouter): void;
|
|
29
|
-
//#endregion
|
|
30
|
-
//#region src/manifest.d.ts
|
|
31
28
|
interface AppletManifest {
|
|
32
29
|
org: string;
|
|
33
30
|
name: string;
|
|
@@ -69,7 +66,10 @@ interface AppletPackages {
|
|
|
69
66
|
dependencies?: Readonly<Record<string, string>>;
|
|
70
67
|
devDependencies?: Readonly<Record<string, string>>;
|
|
71
68
|
}
|
|
72
|
-
type AppletSourceDefinition = AppletDefinition & AppletPackages
|
|
69
|
+
type AppletSourceDefinition = AppletDefinition & AppletPackages & {
|
|
70
|
+
org?: string;
|
|
71
|
+
sdk?: string;
|
|
72
|
+
};
|
|
73
73
|
type RegisteredAppletManifestObject = { [Code in keyof RegisteredCatalog]: Omit<AppletManifestObject, "code" | "readOnly" | "readWrite"> & {
|
|
74
74
|
code: Code;
|
|
75
75
|
readOnly: readonly RegisteredCatalog[Code][];
|
|
@@ -95,6 +95,5 @@ type RegisteredAppletManifest = (RegisteredAppletManifestFields & {
|
|
|
95
95
|
});
|
|
96
96
|
type DistributiveOmit<T, K extends PropertyKey> = T extends unknown ? Omit<T, K> : never;
|
|
97
97
|
type RegisteredAppletDefinition = DistributiveOmit<RegisteredAppletManifest, "org">;
|
|
98
|
-
type RegisteredAppletSourceDefinition = RegisteredAppletDefinition & AppletPackages
|
|
99
|
-
//#endregion
|
|
98
|
+
type RegisteredAppletSourceDefinition = RegisteredAppletDefinition & AppletPackages & Pick<AppletSourceDefinition, "org" | "sdk">;
|
|
100
99
|
export { AppletSourceDefinition as a, RegisteredCatalog as c, RegisteredRouter as d, RegisteredVariableKeys as f, registerHitchContract as h, AppletPackages as i, RegisteredContract as l, RegisteredWorkflows as m, AppletManifest as n, RegisteredAppletSourceDefinition as o, RegisteredVariables as p, AppletManifestObject as r, HitchRegister as s, AppletDefinition as t, RegisteredManifest as u };
|