vibeusage 0.3.0 → 0.3.2

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.
Files changed (127) hide show
  1. package/README.md +19 -11
  2. package/README.zh-CN.md +10 -8
  3. package/node_modules/@insforge/sdk/LICENSE +201 -201
  4. package/node_modules/@insforge/sdk/README.md +326 -259
  5. package/node_modules/@insforge/sdk/dist/index.d.mts +377 -182
  6. package/node_modules/@insforge/sdk/dist/index.d.ts +377 -182
  7. package/node_modules/@insforge/sdk/dist/index.js +1172 -677
  8. package/node_modules/@insforge/sdk/dist/index.js.map +1 -1
  9. package/node_modules/@insforge/sdk/dist/index.mjs +1171 -677
  10. package/node_modules/@insforge/sdk/dist/index.mjs.map +1 -1
  11. package/node_modules/@insforge/sdk/package.json +68 -68
  12. package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.d.ts +1120 -43
  13. package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.d.ts.map +1 -1
  14. package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.js +179 -5
  15. package/node_modules/@insforge/shared-schemas/dist/ai-api.schema.js.map +1 -1
  16. package/node_modules/@insforge/shared-schemas/dist/ai.schema.d.ts +25 -25
  17. package/node_modules/@insforge/shared-schemas/dist/ai.schema.d.ts.map +1 -1
  18. package/node_modules/@insforge/shared-schemas/dist/ai.schema.js +2 -2
  19. package/node_modules/@insforge/shared-schemas/dist/ai.schema.js.map +1 -1
  20. package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.d.ts +197 -51
  21. package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.d.ts.map +1 -1
  22. package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.js +87 -23
  23. package/node_modules/@insforge/shared-schemas/dist/auth-api.schema.js.map +1 -1
  24. package/node_modules/@insforge/shared-schemas/dist/auth.schema.d.ts +32 -3
  25. package/node_modules/@insforge/shared-schemas/dist/auth.schema.d.ts.map +1 -1
  26. package/node_modules/@insforge/shared-schemas/dist/auth.schema.js +21 -3
  27. package/node_modules/@insforge/shared-schemas/dist/auth.schema.js.map +1 -1
  28. package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.d.ts +380 -0
  29. package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.d.ts.map +1 -1
  30. package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.js +74 -0
  31. package/node_modules/@insforge/shared-schemas/dist/cloud-events.schema.js.map +1 -1
  32. package/node_modules/@insforge/shared-schemas/dist/database-api.schema.d.ts +13 -13
  33. package/node_modules/@insforge/shared-schemas/dist/database-api.schema.js +1 -1
  34. package/node_modules/@insforge/shared-schemas/dist/database-api.schema.js.map +1 -1
  35. package/node_modules/@insforge/shared-schemas/dist/deployments-api.schema.d.ts +735 -0
  36. package/node_modules/@insforge/shared-schemas/dist/deployments-api.schema.d.ts.map +1 -0
  37. package/node_modules/@insforge/shared-schemas/dist/deployments-api.schema.js +209 -0
  38. package/node_modules/@insforge/shared-schemas/dist/deployments-api.schema.js.map +1 -0
  39. package/node_modules/@insforge/shared-schemas/dist/deployments.schema.d.ts +37 -0
  40. package/node_modules/@insforge/shared-schemas/dist/deployments.schema.d.ts.map +1 -0
  41. package/node_modules/@insforge/shared-schemas/dist/deployments.schema.js +25 -0
  42. package/node_modules/@insforge/shared-schemas/dist/deployments.schema.js.map +1 -0
  43. package/node_modules/@insforge/shared-schemas/dist/docs.schema.d.ts +5 -1
  44. package/node_modules/@insforge/shared-schemas/dist/docs.schema.d.ts.map +1 -1
  45. package/node_modules/@insforge/shared-schemas/dist/docs.schema.js +34 -4
  46. package/node_modules/@insforge/shared-schemas/dist/docs.schema.js.map +1 -1
  47. package/node_modules/@insforge/shared-schemas/dist/email-api.schema.js +1 -1
  48. package/node_modules/@insforge/shared-schemas/dist/email-api.schema.js.map +1 -1
  49. package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.d.ts +186 -6
  50. package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.d.ts.map +1 -1
  51. package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.js +21 -2
  52. package/node_modules/@insforge/shared-schemas/dist/functions-api.schema.js.map +1 -1
  53. package/node_modules/@insforge/shared-schemas/dist/functions.schema.d.ts +5 -5
  54. package/node_modules/@insforge/shared-schemas/dist/functions.schema.js +1 -1
  55. package/node_modules/@insforge/shared-schemas/dist/functions.schema.js.map +1 -1
  56. package/node_modules/@insforge/shared-schemas/dist/index.d.ts +24 -18
  57. package/node_modules/@insforge/shared-schemas/dist/index.d.ts.map +1 -1
  58. package/node_modules/@insforge/shared-schemas/dist/index.js +24 -18
  59. package/node_modules/@insforge/shared-schemas/dist/index.js.map +1 -1
  60. package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.js +1 -1
  61. package/node_modules/@insforge/shared-schemas/dist/logs-api.schema.js.map +1 -1
  62. package/node_modules/@insforge/shared-schemas/dist/logs.schema.d.ts +43 -0
  63. package/node_modules/@insforge/shared-schemas/dist/logs.schema.d.ts.map +1 -1
  64. package/node_modules/@insforge/shared-schemas/dist/logs.schema.js +11 -0
  65. package/node_modules/@insforge/shared-schemas/dist/logs.schema.js.map +1 -1
  66. package/node_modules/@insforge/shared-schemas/dist/metadata.schema.d.ts +229 -172
  67. package/node_modules/@insforge/shared-schemas/dist/metadata.schema.d.ts.map +1 -1
  68. package/node_modules/@insforge/shared-schemas/dist/metadata.schema.js +27 -7
  69. package/node_modules/@insforge/shared-schemas/dist/metadata.schema.js.map +1 -1
  70. package/node_modules/@insforge/shared-schemas/dist/rate-limit-api.schema.d.ts +51 -0
  71. package/node_modules/@insforge/shared-schemas/dist/rate-limit-api.schema.d.ts.map +1 -0
  72. package/node_modules/@insforge/shared-schemas/dist/rate-limit-api.schema.js +31 -0
  73. package/node_modules/@insforge/shared-schemas/dist/rate-limit-api.schema.js.map +1 -0
  74. package/node_modules/@insforge/shared-schemas/dist/rate-limit.schema.d.ts +31 -0
  75. package/node_modules/@insforge/shared-schemas/dist/rate-limit.schema.d.ts.map +1 -0
  76. package/node_modules/@insforge/shared-schemas/dist/rate-limit.schema.js +12 -0
  77. package/node_modules/@insforge/shared-schemas/dist/rate-limit.schema.js.map +1 -0
  78. package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.d.ts +39 -20
  79. package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.d.ts.map +1 -1
  80. package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.js +5 -1
  81. package/node_modules/@insforge/shared-schemas/dist/realtime-api.schema.js.map +1 -1
  82. package/node_modules/@insforge/shared-schemas/dist/realtime.schema.d.ts +12 -4
  83. package/node_modules/@insforge/shared-schemas/dist/realtime.schema.d.ts.map +1 -1
  84. package/node_modules/@insforge/shared-schemas/dist/realtime.schema.js +6 -0
  85. package/node_modules/@insforge/shared-schemas/dist/realtime.schema.js.map +1 -1
  86. package/node_modules/@insforge/shared-schemas/dist/schedules-api.schema.d.ts +287 -0
  87. package/node_modules/@insforge/shared-schemas/dist/schedules-api.schema.d.ts.map +1 -0
  88. package/node_modules/@insforge/shared-schemas/dist/schedules-api.schema.js +81 -0
  89. package/node_modules/@insforge/shared-schemas/dist/schedules-api.schema.js.map +1 -0
  90. package/node_modules/@insforge/shared-schemas/dist/schedules.schema.d.ts +77 -0
  91. package/node_modules/@insforge/shared-schemas/dist/schedules.schema.d.ts.map +1 -0
  92. package/node_modules/@insforge/shared-schemas/dist/schedules.schema.js +36 -0
  93. package/node_modules/@insforge/shared-schemas/dist/schedules.schema.js.map +1 -0
  94. package/node_modules/@insforge/shared-schemas/dist/secrets-api.schema.d.ts +113 -0
  95. package/node_modules/@insforge/shared-schemas/dist/secrets-api.schema.d.ts.map +1 -0
  96. package/node_modules/@insforge/shared-schemas/dist/secrets-api.schema.js +31 -0
  97. package/node_modules/@insforge/shared-schemas/dist/secrets-api.schema.js.map +1 -0
  98. package/node_modules/@insforge/shared-schemas/dist/secrets.schema.d.ts +31 -0
  99. package/node_modules/@insforge/shared-schemas/dist/secrets.schema.d.ts.map +1 -0
  100. package/node_modules/@insforge/shared-schemas/dist/secrets.schema.js +13 -0
  101. package/node_modules/@insforge/shared-schemas/dist/secrets.schema.js.map +1 -0
  102. package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.d.ts +27 -2
  103. package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.d.ts.map +1 -1
  104. package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.js +9 -1
  105. package/node_modules/@insforge/shared-schemas/dist/storage-api.schema.js.map +1 -1
  106. package/node_modules/@insforge/shared-schemas/dist/storage.schema.d.ts +17 -0
  107. package/node_modules/@insforge/shared-schemas/dist/storage.schema.d.ts.map +1 -1
  108. package/node_modules/@insforge/shared-schemas/dist/storage.schema.js +6 -0
  109. package/node_modules/@insforge/shared-schemas/dist/storage.schema.js.map +1 -1
  110. package/node_modules/@insforge/shared-schemas/package.json +2 -1
  111. package/package.json +2 -2
  112. package/src/commands/status.js +22 -5
  113. package/src/commands/sync.js +100 -197
  114. package/src/commands/uninstall.js +0 -11
  115. package/src/lib/diagnostics.js +34 -9
  116. package/src/lib/doctor.js +24 -15
  117. package/src/lib/insforge-client.js +13 -9
  118. package/src/lib/integrations/context.js +0 -6
  119. package/src/lib/integrations/index.js +0 -2
  120. package/src/lib/openclaw-session-plugin.js +48 -138
  121. package/src/lib/openclaw-usage-ledger.js +237 -0
  122. package/src/lib/opencode-sqlite.js +113 -0
  123. package/src/lib/opencode-usage-audit.js +3 -2
  124. package/src/lib/rollout.js +229 -153
  125. package/src/lib/vibeusage-api.js +2 -2
  126. package/src/lib/integrations/openclaw-legacy.js +0 -123
  127. package/src/lib/openclaw-hook.js +0 -420
@@ -0,0 +1,287 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Schema for creating a new schedule.
4
+ * All fields required except headers and body.
5
+ */
6
+ export declare const createScheduleRequestSchema: z.ZodObject<{
7
+ name: z.ZodString;
8
+ cronSchedule: z.ZodEffects<z.ZodString, string, string>;
9
+ functionUrl: z.ZodString;
10
+ httpMethod: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
11
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
12
+ body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ name: string;
15
+ cronSchedule: string;
16
+ functionUrl: string;
17
+ httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
18
+ headers?: Record<string, string> | undefined;
19
+ body?: Record<string, unknown> | undefined;
20
+ }, {
21
+ name: string;
22
+ cronSchedule: string;
23
+ functionUrl: string;
24
+ httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
25
+ headers?: Record<string, string> | undefined;
26
+ body?: Record<string, unknown> | undefined;
27
+ }>;
28
+ /**
29
+ * Schema for updating an existing schedule.
30
+ * All fields optional - supports partial updates including toggling isActive.
31
+ */
32
+ export declare const updateScheduleRequestSchema: z.ZodObject<{
33
+ name: z.ZodOptional<z.ZodString>;
34
+ cronSchedule: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
35
+ functionUrl: z.ZodOptional<z.ZodString>;
36
+ httpMethod: z.ZodOptional<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>>;
37
+ headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
38
+ body: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
39
+ isActive: z.ZodOptional<z.ZodBoolean>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ name?: string | undefined;
42
+ isActive?: boolean | undefined;
43
+ headers?: Record<string, string> | undefined;
44
+ body?: Record<string, unknown> | undefined;
45
+ cronSchedule?: string | undefined;
46
+ functionUrl?: string | undefined;
47
+ httpMethod?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
48
+ }, {
49
+ name?: string | undefined;
50
+ isActive?: boolean | undefined;
51
+ headers?: Record<string, string> | undefined;
52
+ body?: Record<string, unknown> | undefined;
53
+ cronSchedule?: string | undefined;
54
+ functionUrl?: string | undefined;
55
+ httpMethod?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
56
+ }>;
57
+ /**
58
+ * Schema for the response when listing all schedules.
59
+ */
60
+ export declare const listSchedulesResponseSchema: z.ZodArray<z.ZodObject<{
61
+ id: z.ZodString;
62
+ name: z.ZodString;
63
+ cronSchedule: z.ZodString;
64
+ functionUrl: z.ZodString;
65
+ httpMethod: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
66
+ headers: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
67
+ body: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
68
+ cronJobId: z.ZodNullable<z.ZodString>;
69
+ lastExecutedAt: z.ZodNullable<z.ZodString>;
70
+ isActive: z.ZodDefault<z.ZodBoolean>;
71
+ nextRun: z.ZodNullable<z.ZodString>;
72
+ createdAt: z.ZodString;
73
+ updatedAt: z.ZodString;
74
+ }, "strip", z.ZodTypeAny, {
75
+ id: string;
76
+ createdAt: string;
77
+ name: string;
78
+ updatedAt: string;
79
+ isActive: boolean;
80
+ headers: Record<string, string> | null;
81
+ body: string | Record<string, unknown> | null;
82
+ cronSchedule: string;
83
+ functionUrl: string;
84
+ httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
85
+ cronJobId: string | null;
86
+ lastExecutedAt: string | null;
87
+ nextRun: string | null;
88
+ }, {
89
+ id: string;
90
+ createdAt: string;
91
+ name: string;
92
+ updatedAt: string;
93
+ headers: Record<string, string> | null;
94
+ body: string | Record<string, unknown> | null;
95
+ cronSchedule: string;
96
+ functionUrl: string;
97
+ httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
98
+ cronJobId: string | null;
99
+ lastExecutedAt: string | null;
100
+ nextRun: string | null;
101
+ isActive?: boolean | undefined;
102
+ }>, "many">;
103
+ /**
104
+ * Schema for the response when getting a single schedule.
105
+ */
106
+ export declare const getScheduleResponseSchema: z.ZodObject<{
107
+ id: z.ZodString;
108
+ name: z.ZodString;
109
+ cronSchedule: z.ZodString;
110
+ functionUrl: z.ZodString;
111
+ httpMethod: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
112
+ headers: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
113
+ body: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
114
+ cronJobId: z.ZodNullable<z.ZodString>;
115
+ lastExecutedAt: z.ZodNullable<z.ZodString>;
116
+ isActive: z.ZodDefault<z.ZodBoolean>;
117
+ nextRun: z.ZodNullable<z.ZodString>;
118
+ createdAt: z.ZodString;
119
+ updatedAt: z.ZodString;
120
+ }, "strip", z.ZodTypeAny, {
121
+ id: string;
122
+ createdAt: string;
123
+ name: string;
124
+ updatedAt: string;
125
+ isActive: boolean;
126
+ headers: Record<string, string> | null;
127
+ body: string | Record<string, unknown> | null;
128
+ cronSchedule: string;
129
+ functionUrl: string;
130
+ httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
131
+ cronJobId: string | null;
132
+ lastExecutedAt: string | null;
133
+ nextRun: string | null;
134
+ }, {
135
+ id: string;
136
+ createdAt: string;
137
+ name: string;
138
+ updatedAt: string;
139
+ headers: Record<string, string> | null;
140
+ body: string | Record<string, unknown> | null;
141
+ cronSchedule: string;
142
+ functionUrl: string;
143
+ httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
144
+ cronJobId: string | null;
145
+ lastExecutedAt: string | null;
146
+ nextRun: string | null;
147
+ isActive?: boolean | undefined;
148
+ }>;
149
+ /**
150
+ * Schema for a single execution log in the response.
151
+ */
152
+ export declare const executionLogResponseSchema: z.ZodObject<{
153
+ id: z.ZodString;
154
+ scheduleId: z.ZodString;
155
+ executedAt: z.ZodString;
156
+ statusCode: z.ZodNumber;
157
+ success: z.ZodBoolean;
158
+ durationMs: z.ZodNumber;
159
+ message: z.ZodNullable<z.ZodString>;
160
+ }, "strip", z.ZodTypeAny, {
161
+ message: string | null;
162
+ id: string;
163
+ statusCode: number;
164
+ success: boolean;
165
+ scheduleId: string;
166
+ executedAt: string;
167
+ durationMs: number;
168
+ }, {
169
+ message: string | null;
170
+ id: string;
171
+ statusCode: number;
172
+ success: boolean;
173
+ scheduleId: string;
174
+ executedAt: string;
175
+ durationMs: number;
176
+ }>;
177
+ /**
178
+ * Schema for the response when listing execution logs with pagination.
179
+ */
180
+ export declare const listExecutionLogsResponseSchema: z.ZodObject<{
181
+ logs: z.ZodArray<z.ZodObject<{
182
+ id: z.ZodString;
183
+ scheduleId: z.ZodString;
184
+ executedAt: z.ZodString;
185
+ statusCode: z.ZodNumber;
186
+ success: z.ZodBoolean;
187
+ durationMs: z.ZodNumber;
188
+ message: z.ZodNullable<z.ZodString>;
189
+ }, "strip", z.ZodTypeAny, {
190
+ message: string | null;
191
+ id: string;
192
+ statusCode: number;
193
+ success: boolean;
194
+ scheduleId: string;
195
+ executedAt: string;
196
+ durationMs: number;
197
+ }, {
198
+ message: string | null;
199
+ id: string;
200
+ statusCode: number;
201
+ success: boolean;
202
+ scheduleId: string;
203
+ executedAt: string;
204
+ durationMs: number;
205
+ }>, "many">;
206
+ totalCount: z.ZodNumber;
207
+ limit: z.ZodNumber;
208
+ offset: z.ZodNumber;
209
+ }, "strip", z.ZodTypeAny, {
210
+ limit: number;
211
+ offset: number;
212
+ logs: {
213
+ message: string | null;
214
+ id: string;
215
+ statusCode: number;
216
+ success: boolean;
217
+ scheduleId: string;
218
+ executedAt: string;
219
+ durationMs: number;
220
+ }[];
221
+ totalCount: number;
222
+ }, {
223
+ limit: number;
224
+ offset: number;
225
+ logs: {
226
+ message: string | null;
227
+ id: string;
228
+ statusCode: number;
229
+ success: boolean;
230
+ scheduleId: string;
231
+ executedAt: string;
232
+ durationMs: number;
233
+ }[];
234
+ totalCount: number;
235
+ }>;
236
+ /**
237
+ * Schema for the response of a successful create operation.
238
+ */
239
+ export declare const createScheduleResponseSchema: z.ZodObject<{
240
+ id: z.ZodString;
241
+ cronJobId: z.ZodString;
242
+ message: z.ZodString;
243
+ }, "strip", z.ZodTypeAny, {
244
+ message: string;
245
+ id: string;
246
+ cronJobId: string;
247
+ }, {
248
+ message: string;
249
+ id: string;
250
+ cronJobId: string;
251
+ }>;
252
+ /**
253
+ * Schema for the response of a successful update operation.
254
+ */
255
+ export declare const updateScheduleResponseSchema: z.ZodObject<{
256
+ id: z.ZodString;
257
+ cronJobId: z.ZodOptional<z.ZodString>;
258
+ message: z.ZodString;
259
+ }, "strip", z.ZodTypeAny, {
260
+ message: string;
261
+ id: string;
262
+ cronJobId?: string | undefined;
263
+ }, {
264
+ message: string;
265
+ id: string;
266
+ cronJobId?: string | undefined;
267
+ }>;
268
+ /**
269
+ * Schema for the response of a successful delete operation.
270
+ */
271
+ export declare const deleteScheduleResponseSchema: z.ZodObject<{
272
+ message: z.ZodString;
273
+ }, "strip", z.ZodTypeAny, {
274
+ message: string;
275
+ }, {
276
+ message: string;
277
+ }>;
278
+ export type CreateScheduleRequest = z.infer<typeof createScheduleRequestSchema>;
279
+ export type UpdateScheduleRequest = z.infer<typeof updateScheduleRequestSchema>;
280
+ export type CreateScheduleResponse = z.infer<typeof createScheduleResponseSchema>;
281
+ export type UpdateScheduleResponse = z.infer<typeof updateScheduleResponseSchema>;
282
+ export type ListSchedulesResponse = z.infer<typeof listSchedulesResponseSchema>;
283
+ export type GetScheduleResponse = z.infer<typeof getScheduleResponseSchema>;
284
+ export type ExecutionLogResponse = z.infer<typeof executionLogResponseSchema>;
285
+ export type ListExecutionLogsResponse = z.infer<typeof listExecutionLogsResponseSchema>;
286
+ export type DeleteScheduleResponse = z.infer<typeof deleteScheduleResponseSchema>;
287
+ //# sourceMappingURL=schedules-api.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedules-api.schema.d.ts","sourceRoot":"","sources":["../src/schedules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AC;AAChF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,81 @@
1
+ import { z } from 'zod';
2
+ import { scheduleSchema, scheduleLogSchema } from './schedules.schema.js';
3
+ const cronScheduleSchema = z.string().refine((value) => {
4
+ const parts = value.split(' ');
5
+ return parts.length === 5 || parts.length === 6;
6
+ }, { message: 'Invalid cron schedule format. Use 5 or 6 parts (e.g., "* * * * *").' });
7
+ /**
8
+ * Schema for creating a new schedule.
9
+ * All fields required except headers and body.
10
+ */
11
+ export const createScheduleRequestSchema = z.object({
12
+ name: z.string().min(3, 'Schedule name must be at least 3 characters long'),
13
+ cronSchedule: cronScheduleSchema,
14
+ functionUrl: z.string().url('The function URL must be a valid URL.'),
15
+ httpMethod: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']),
16
+ headers: z
17
+ .record(z.string())
18
+ .optional()
19
+ .describe('Header values can reference secrets using ${{secrets.KEY_NAME}} syntax.'),
20
+ body: z.record(z.unknown()).optional().describe('The JSON body to send with the request.'),
21
+ });
22
+ /**
23
+ * Schema for updating an existing schedule.
24
+ * All fields optional - supports partial updates including toggling isActive.
25
+ */
26
+ export const updateScheduleRequestSchema = z.object({
27
+ name: z.string().min(3, 'Schedule name must be at least 3 characters long').optional(),
28
+ cronSchedule: cronScheduleSchema.optional(),
29
+ functionUrl: z.string().url('The function URL must be a valid URL.').optional(),
30
+ httpMethod: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']).optional(),
31
+ headers: z
32
+ .record(z.string())
33
+ .optional()
34
+ .describe('Header values can reference secrets using ${{secrets.KEY_NAME}} syntax.'),
35
+ body: z.record(z.unknown()).optional().describe('The JSON body to send with the request.'),
36
+ isActive: z.boolean().optional().describe('Enable or disable the schedule.'),
37
+ });
38
+ /**
39
+ * Schema for the response when listing all schedules.
40
+ */
41
+ export const listSchedulesResponseSchema = z.array(scheduleSchema);
42
+ /**
43
+ * Schema for the response when getting a single schedule.
44
+ */
45
+ export const getScheduleResponseSchema = scheduleSchema;
46
+ /**
47
+ * Schema for a single execution log in the response.
48
+ */
49
+ export const executionLogResponseSchema = scheduleLogSchema;
50
+ /**
51
+ * Schema for the response when listing execution logs with pagination.
52
+ */
53
+ export const listExecutionLogsResponseSchema = z.object({
54
+ logs: z.array(executionLogResponseSchema),
55
+ totalCount: z.number().int().nonnegative(),
56
+ limit: z.number().int().positive(),
57
+ offset: z.number().int().nonnegative(),
58
+ });
59
+ /**
60
+ * Schema for the response of a successful create operation.
61
+ */
62
+ export const createScheduleResponseSchema = z.object({
63
+ id: z.string().uuid(),
64
+ cronJobId: z.string(),
65
+ message: z.string(),
66
+ });
67
+ /**
68
+ * Schema for the response of a successful update operation.
69
+ */
70
+ export const updateScheduleResponseSchema = z.object({
71
+ id: z.string().uuid(),
72
+ cronJobId: z.string().optional(),
73
+ message: z.string(),
74
+ });
75
+ /**
76
+ * Schema for the response of a successful delete operation.
77
+ */
78
+ export const deleteScheduleResponseSchema = z.object({
79
+ message: z.string(),
80
+ });
81
+ //# sourceMappingURL=schedules-api.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedules-api.schema.js","sourceRoot":"","sources":["../src/schedules-api.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1E,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CAC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S,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC"}
@@ -0,0 +1,77 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Represents a single schedule record as stored in the database and
4
+ * used internally within the application.
5
+ * Properties are camelCased to align with TypeScript conventions.
6
+ */
7
+ export declare const scheduleSchema: z.ZodObject<{
8
+ id: z.ZodString;
9
+ name: z.ZodString;
10
+ cronSchedule: z.ZodString;
11
+ functionUrl: z.ZodString;
12
+ httpMethod: z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>;
13
+ headers: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodString>>;
14
+ body: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
15
+ cronJobId: z.ZodNullable<z.ZodString>;
16
+ lastExecutedAt: z.ZodNullable<z.ZodString>;
17
+ isActive: z.ZodDefault<z.ZodBoolean>;
18
+ nextRun: z.ZodNullable<z.ZodString>;
19
+ createdAt: z.ZodString;
20
+ updatedAt: z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ id: string;
23
+ createdAt: string;
24
+ name: string;
25
+ updatedAt: string;
26
+ isActive: boolean;
27
+ headers: Record<string, string> | null;
28
+ body: string | Record<string, unknown> | null;
29
+ cronSchedule: string;
30
+ functionUrl: string;
31
+ httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
32
+ cronJobId: string | null;
33
+ lastExecutedAt: string | null;
34
+ nextRun: string | null;
35
+ }, {
36
+ id: string;
37
+ createdAt: string;
38
+ name: string;
39
+ updatedAt: string;
40
+ headers: Record<string, string> | null;
41
+ body: string | Record<string, unknown> | null;
42
+ cronSchedule: string;
43
+ functionUrl: string;
44
+ httpMethod: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
45
+ cronJobId: string | null;
46
+ lastExecutedAt: string | null;
47
+ nextRun: string | null;
48
+ isActive?: boolean | undefined;
49
+ }>;
50
+ export declare const scheduleLogSchema: z.ZodObject<{
51
+ id: z.ZodString;
52
+ scheduleId: z.ZodString;
53
+ executedAt: z.ZodString;
54
+ statusCode: z.ZodNumber;
55
+ success: z.ZodBoolean;
56
+ durationMs: z.ZodNumber;
57
+ message: z.ZodNullable<z.ZodString>;
58
+ }, "strip", z.ZodTypeAny, {
59
+ message: string | null;
60
+ id: string;
61
+ statusCode: number;
62
+ success: boolean;
63
+ scheduleId: string;
64
+ executedAt: string;
65
+ durationMs: number;
66
+ }, {
67
+ message: string | null;
68
+ id: string;
69
+ statusCode: number;
70
+ success: boolean;
71
+ scheduleId: string;
72
+ executedAt: string;
73
+ durationMs: number;
74
+ }>;
75
+ export type ScheduleSchema = z.infer<typeof scheduleSchema>;
76
+ export type ScheduleLogSchema = z.infer<typeof scheduleLogSchema>;
77
+ //# sourceMappingURL=schedules.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedules.schema.d.ts","sourceRoot":"","sources":["../src/schedules.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBzB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;EAQ5B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC5D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Represents a single schedule record as stored in the database and
4
+ * used internally within the application.
5
+ * Properties are camelCased to align with TypeScript conventions.
6
+ */
7
+ export const scheduleSchema = z.object({
8
+ id: z.string().uuid(),
9
+ name: z.string(),
10
+ cronSchedule: z.string(),
11
+ functionUrl: z.string().url(),
12
+ httpMethod: z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']),
13
+ // Optional HTTP headers to include when invoking the scheduled function
14
+ headers: z.record(z.string()).nullable(),
15
+ // Body payload for the scheduled invocation. Can be a JSON object or a raw string.
16
+ body: z.union([z.string(), z.record(z.unknown())]).nullable(),
17
+ // cron_job_id is a BIGINT in postgres, which node-pg returns as a string.
18
+ cronJobId: z.string().nullable(),
19
+ lastExecutedAt: z.string().datetime().nullable(),
20
+ // Whether the cron job is currently active (has a scheduled cron job)
21
+ isActive: z.boolean().default(true),
22
+ // Next scheduled run time in ISO format (nullable if cron expression invalid)
23
+ nextRun: z.string().datetime().nullable(),
24
+ createdAt: z.string().datetime(),
25
+ updatedAt: z.string().datetime(),
26
+ });
27
+ export const scheduleLogSchema = z.object({
28
+ id: z.string().uuid(),
29
+ scheduleId: z.string().uuid(),
30
+ executedAt: z.string().datetime(),
31
+ statusCode: z.number().int(),
32
+ success: z.boolean(),
33
+ durationMs: z.number().int(),
34
+ message: z.string().nullable(),
35
+ });
36
+ //# sourceMappingURL=schedules.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedules.schema.js","sourceRoot":"","sources":["../src/schedules.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,K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CAAC;IACxC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IACrB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC7B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC5B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC/B,CAAC,CAAC"}
@@ -0,0 +1,113 @@
1
+ import { z } from 'zod';
2
+ export declare const listSecretsResponseSchema: z.ZodObject<{
3
+ secrets: z.ZodArray<z.ZodObject<{
4
+ id: z.ZodString;
5
+ key: z.ZodString;
6
+ isActive: z.ZodBoolean;
7
+ isReserved: z.ZodBoolean;
8
+ lastUsedAt: z.ZodNullable<z.ZodString>;
9
+ expiresAt: z.ZodNullable<z.ZodString>;
10
+ createdAt: z.ZodString;
11
+ updatedAt: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ id: string;
14
+ createdAt: string;
15
+ updatedAt: string;
16
+ key: string;
17
+ expiresAt: string | null;
18
+ isActive: boolean;
19
+ isReserved: boolean;
20
+ lastUsedAt: string | null;
21
+ }, {
22
+ id: string;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ key: string;
26
+ expiresAt: string | null;
27
+ isActive: boolean;
28
+ isReserved: boolean;
29
+ lastUsedAt: string | null;
30
+ }>, "many">;
31
+ }, "strip", z.ZodTypeAny, {
32
+ secrets: {
33
+ id: string;
34
+ createdAt: string;
35
+ updatedAt: string;
36
+ key: string;
37
+ expiresAt: string | null;
38
+ isActive: boolean;
39
+ isReserved: boolean;
40
+ lastUsedAt: string | null;
41
+ }[];
42
+ }, {
43
+ secrets: {
44
+ id: string;
45
+ createdAt: string;
46
+ updatedAt: string;
47
+ key: string;
48
+ expiresAt: string | null;
49
+ isActive: boolean;
50
+ isReserved: boolean;
51
+ lastUsedAt: string | null;
52
+ }[];
53
+ }>;
54
+ export declare const getSecretValueResponseSchema: z.ZodObject<{
55
+ key: z.ZodString;
56
+ value: z.ZodString;
57
+ }, "strip", z.ZodTypeAny, {
58
+ value: string;
59
+ key: string;
60
+ }, {
61
+ value: string;
62
+ key: string;
63
+ }>;
64
+ export declare const createSecretRequestSchema: z.ZodObject<{
65
+ key: z.ZodString;
66
+ value: z.ZodString;
67
+ }, "strip", z.ZodTypeAny, {
68
+ value: string;
69
+ key: string;
70
+ }, {
71
+ value: string;
72
+ key: string;
73
+ }>;
74
+ export declare const createSecretResponseSchema: z.ZodObject<{
75
+ success: z.ZodLiteral<true>;
76
+ message: z.ZodString;
77
+ id: z.ZodString;
78
+ }, "strip", z.ZodTypeAny, {
79
+ message: string;
80
+ id: string;
81
+ success: true;
82
+ }, {
83
+ message: string;
84
+ id: string;
85
+ success: true;
86
+ }>;
87
+ export declare const updateSecretResponseSchema: z.ZodObject<{
88
+ success: z.ZodLiteral<true>;
89
+ message: z.ZodString;
90
+ }, "strip", z.ZodTypeAny, {
91
+ message: string;
92
+ success: true;
93
+ }, {
94
+ message: string;
95
+ success: true;
96
+ }>;
97
+ export declare const deleteSecretResponseSchema: z.ZodObject<{
98
+ success: z.ZodLiteral<true>;
99
+ message: z.ZodString;
100
+ }, "strip", z.ZodTypeAny, {
101
+ message: string;
102
+ success: true;
103
+ }, {
104
+ message: string;
105
+ success: true;
106
+ }>;
107
+ export type ListSecretsResponse = z.infer<typeof listSecretsResponseSchema>;
108
+ export type GetSecretValueResponse = z.infer<typeof getSecretValueResponseSchema>;
109
+ export type CreateSecretRequest = z.infer<typeof createSecretRequestSchema>;
110
+ export type CreateSecretResponse = z.infer<typeof createSecretResponseSchema>;
111
+ export type UpdateSecretResponse = z.infer<typeof updateSecretResponseSchema>;
112
+ export type DeleteSecretResponse = z.infer<typeof deleteSecretResponseSchema>;
113
+ //# sourceMappingURL=secrets-api.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets-api.schema.d.ts","sourceRoot":"","sources":["../src/secrets-api.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEpC,CAAC;AAGH,eAAO,MAAM,4BAA4B;;;;;;;;;EAGvC,CAAC;AAGH,eAAO,MAAM,yBAAyB;;;;;;;;;EAGpC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;EAIrC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;EAGrC,CAAC;AAGH,eAAO,MAAM,0BAA0B;;;;;;;;;EAGrC,CAAC;AAGH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ import { secretSchema } from './secrets.schema.js';
3
+ // GET /secrets - List all secrets
4
+ export const listSecretsResponseSchema = z.object({
5
+ secrets: z.array(secretSchema),
6
+ });
7
+ // GET /secrets/:key - Get secret value
8
+ export const getSecretValueResponseSchema = z.object({
9
+ key: z.string(),
10
+ value: z.string(),
11
+ });
12
+ // POST /secrets - Create secret (user-facing API)
13
+ export const createSecretRequestSchema = z.object({
14
+ key: z.string().regex(/^[A-Z0-9_]+$/, 'Use uppercase letters, numbers, and underscores only'),
15
+ value: z.string().min(1, 'Value is required'),
16
+ });
17
+ export const createSecretResponseSchema = z.object({
18
+ success: z.literal(true),
19
+ message: z.string(),
20
+ id: z.string(),
21
+ });
22
+ export const updateSecretResponseSchema = z.object({
23
+ success: z.literal(true),
24
+ message: z.string(),
25
+ });
26
+ // DELETE /secrets/:key - Delete secret
27
+ export const deleteSecretResponseSchema = z.object({
28
+ success: z.literal(true),
29
+ message: z.string(),
30
+ });
31
+ //# sourceMappingURL=secrets-api.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets-api.schema.js","sourceRoot":"","sources":["../src/secrets-api.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,kCAAkC;AAClC,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,YAAY,CAAC;CAC/B,CAAC,CAAC;AAEH,uCAAuC;AACvC,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;CAClB,CAAC,CAAC;AAEH,kDAAkD;AAClD,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,sDAAsD,CAAC;IAC7F,KAAK,EAAE,CAAC,CAAC,M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