@krak-stack/registry 0.2.0 → 0.2.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.
- package/CHANGELOG.md +12 -0
- package/dist/components/ui/app-brand.js +17 -17
- package/dist/components/ui/code-block.js +6 -6
- package/dist/components/ui/color-picker.js +26 -28
- package/dist/components/ui/copy-button.js +4 -4
- package/dist/components/ui/data-table.js +441 -442
- package/dist/components/ui/editing-locale-switcher.js +10 -10
- package/dist/components/ui/effect-form.js +185 -186
- package/dist/components/ui/error-component.js +6 -6
- package/dist/components/ui/file-picker.js +2 -2
- package/dist/components/ui/form.d.ts +5 -5
- package/dist/components/ui/form.js +138 -139
- package/dist/components/ui/google-map.js +2 -2
- package/dist/components/ui/icon-input.js +47 -50
- package/dist/components/ui/krakstack-provider.js +2 -2
- package/dist/components/ui/locale-switcher.js +4 -4
- package/dist/components/ui/pagination.js +2 -2
- package/dist/components/ui/search-menu.js +2 -2
- package/dist/components/ui/sidebar-layout.js +67 -72
- package/dist/components/ui/theme-switcher.js +6 -6
- package/dist/components/ui/virtualized-combobox.js +33 -36
- package/dist/lib/docs.js +166 -171
- package/dist/lib/docs.server.js +18 -40
- package/dist/lib/documentation-toolkit.js +19 -41
- package/dist/lib/httpapi-adapter.js +2 -2
- package/dist/lib/httpapi-cli.js +7 -7
- package/dist/lib/query.js +11 -11
- package/dist/lib/seo.js +2 -2
- package/dist/lib/webfetch-toolkit.js +6 -6
- package/dist/oxlint/anti-slop/index.js +2 -2
- package/dist/services/agent/client/index.js +153 -155
- package/dist/services/agent/index.js +2 -2
- package/dist/services/agent/schema.js +5 -5
- package/dist/services/events/browser.js +6 -6
- package/dist/services/events/client/audit-log-table.js +445 -446
- package/dist/services/events/index.js +59 -59
- package/dist/services/events/migrations.js +2 -2
- package/dist/services/events/record.js +2 -2
- package/dist/services/events/schema.js +39 -39
- package/dist/services/file-extraction/index.js +4 -4
- package/dist/services/file-extraction/schema.js +2 -2
- package/dist/services/health/index.js +9 -9
- package/dist/services/notification/channels/ses/index.js +2 -2
- package/dist/services/notification/channels/ses/schema.js +2 -2
- package/dist/services/notification/client/index.js +5 -5
- package/dist/services/notification/index.js +2 -2
- package/dist/services/notification/persistence/drizzle.js +2 -2
- package/dist/services/notification/persistence/index.js +15 -15
- package/dist/services/notification/persistence/schema.js +12 -12
- package/dist/services/notification/public.js +7 -7
- package/dist/services/notification/schema.js +2 -2
- package/dist/services/opentelemetry/api.js +2 -2
- package/dist/services/opentelemetry/browser.js +7 -7
- package/dist/services/opentelemetry/web-vitals.js +2 -2
- package/dist/services/s3/index.js +2 -2
- package/dist/services/s3/schema.js +2 -2
- package/dist/services/speech/schema.js +9 -9
- package/dist/services/webhooks/client/delivery-table.js +479 -480
- package/dist/services/webhooks/http-client.js +5 -5
- package/dist/services/webhooks/index.js +34 -34
- package/dist/services/webhooks/migrations.js +5 -5
- package/dist/services/webhooks/schema.js +20 -20
- package/dist/services/webhooks/url.js +5 -5
- package/package.json +1 -1
|
@@ -33,11 +33,11 @@ var isLoopbackWebhookUrl = (url) => ["http:", "https:"].includes(url.protocol) &
|
|
|
33
33
|
var isPublicWebhookDestination = Effect.fn("Webhooks.isPublicDestination")(function* (url) {
|
|
34
34
|
if (!isPublicWebhookUrl(url))
|
|
35
35
|
return false;
|
|
36
|
-
const
|
|
37
|
-
if (Result.isSuccess(NetAddress.ipFromString(
|
|
36
|
+
const hostname = url.hostname.replace(/^\[|\]$/g, "");
|
|
37
|
+
if (Result.isSuccess(NetAddress.ipFromString(hostname)))
|
|
38
38
|
return true;
|
|
39
39
|
const dns = yield* Dns.Dns;
|
|
40
|
-
return yield* dns.lookup(
|
|
40
|
+
return yield* dns.lookup(hostname).pipe(Effect.map((addresses) => addresses.every((address) => isPublicIpAddress(NetAddress.formatIp(address)))), Effect.orElseSucceed(() => false));
|
|
41
41
|
});
|
|
42
42
|
var isAllowedWebhookDestination = Effect.fn("Webhooks.isAllowedDestination")(function* (url) {
|
|
43
43
|
if ((yield* WebhookAllowLoopback) && isLoopbackWebhookUrl(url))
|
|
@@ -63,7 +63,7 @@ var layer = Layer.effect(HttpClient.HttpClient, Effect.gen(function* () {
|
|
|
63
63
|
})));
|
|
64
64
|
})).pipe(Layer.provide(FetchHttpClient.layer));
|
|
65
65
|
export {
|
|
66
|
-
|
|
66
|
+
isAllowedWebhookDestination,
|
|
67
67
|
isPublicWebhookDestination,
|
|
68
|
-
|
|
68
|
+
layer
|
|
69
69
|
};
|
|
@@ -120,11 +120,11 @@ import { FetchHttpClient, HttpClient, HttpClientError } from "effect/http";
|
|
|
120
120
|
var isPublicWebhookDestination = Effect2.fn("Webhooks.isPublicDestination")(function* (url) {
|
|
121
121
|
if (!isPublicWebhookUrl(url))
|
|
122
122
|
return false;
|
|
123
|
-
const
|
|
124
|
-
if (Result.isSuccess(NetAddress.ipFromString(
|
|
123
|
+
const hostname = url.hostname.replace(/^\[|\]$/g, "");
|
|
124
|
+
if (Result.isSuccess(NetAddress.ipFromString(hostname)))
|
|
125
125
|
return true;
|
|
126
126
|
const dns = yield* Dns.Dns;
|
|
127
|
-
return yield* dns.lookup(
|
|
127
|
+
return yield* dns.lookup(hostname).pipe(Effect2.map((addresses) => addresses.every((address) => isPublicIpAddress(NetAddress.formatIp(address)))), Effect2.orElseSucceed(() => false));
|
|
128
128
|
});
|
|
129
129
|
var isAllowedWebhookDestination = Effect2.fn("Webhooks.isAllowedDestination")(function* (url) {
|
|
130
130
|
if ((yield* WebhookAllowLoopback) && isLoopbackWebhookUrl(url))
|
|
@@ -562,8 +562,8 @@ var processDelivery = Effect5.fn("Webhooks.processDelivery")(function* (input) {
|
|
|
562
562
|
return null;
|
|
563
563
|
const endpoint = found.value;
|
|
564
564
|
if (!endpoint.enabled || delivery.retries >= maxDeliveryAttempts) {
|
|
565
|
-
const
|
|
566
|
-
yield* sql`UPDATE webhook_deliveries SET status = 'failed', error = ${
|
|
565
|
+
const error = !endpoint.enabled ? "Webhook endpoint is disabled" : delivery.error ?? "Delivery attempt limit reached";
|
|
566
|
+
yield* sql`UPDATE webhook_deliveries SET status = 'failed', error = ${error}, completed_at = now(), updated_at = now() WHERE id = ${input.id}`;
|
|
567
567
|
return null;
|
|
568
568
|
}
|
|
569
569
|
const body = yield* Schema4.encodeEffect(Schema4.fromJsonString(Schema4.Json))({
|
|
@@ -581,7 +581,7 @@ var processDelivery = Effect5.fn("Webhooks.processDelivery")(function* (input) {
|
|
|
581
581
|
"webhook-id": delivery.id,
|
|
582
582
|
"webhook-timestamp": timestamp,
|
|
583
583
|
"webhook-signature": signature
|
|
584
|
-
}), HttpClientRequest.bodyText(body, "application/json"))).pipe(Effect5.map((response) => response.status >= 200 && response.status < 300 ? null : `HTTP ${response.status}`), Effect5.timeout("30 seconds"), Effect5.catch((
|
|
584
|
+
}), HttpClientRequest.bodyText(body, "application/json"))).pipe(Effect5.map((response) => response.status >= 200 && response.status < 300 ? null : `HTTP ${response.status}`), Effect5.timeout("30 seconds"), Effect5.catch((error) => Effect5.succeed(error._tag === "TimeoutError" ? "Request timed out after 30 seconds" : error.reason._tag === "TransportError" && error.reason.description === "Webhook destination is not public" ? "Webhook destination is not public" : error.reason._tag === "InvalidUrlError" ? "Invalid webhook URL" : "Webhook network request failed")), Effect5.scoped) : "Webhook destination is not public";
|
|
585
585
|
if (error === null) {
|
|
586
586
|
yield* sql`UPDATE webhook_deliveries SET status = 'success', error = NULL, completed_at = now(), updated_at = now() WHERE id = ${input.id}`;
|
|
587
587
|
return null;
|
|
@@ -593,8 +593,8 @@ var processDelivery = Effect5.fn("Webhooks.processDelivery")(function* (input) {
|
|
|
593
593
|
const step = yield* Schedule.toStep(retrySchedule);
|
|
594
594
|
let duration = Duration.zero;
|
|
595
595
|
for (let attempt = 0;attempt <= delivery.retries; attempt++) {
|
|
596
|
-
const [,
|
|
597
|
-
duration =
|
|
596
|
+
const [, delay] = yield* step(DateTime3.toEpochMillis(now), undefined).pipe(Effect5.orDie);
|
|
597
|
+
duration = delay;
|
|
598
598
|
}
|
|
599
599
|
const delay = Duration.toMillis(duration);
|
|
600
600
|
yield* sql`UPDATE webhook_deliveries SET retries = retries + 1, error = ${error}, retry_at = now() + ${delay} * interval '1 millisecond', updated_at = now() WHERE id = ${input.id}`;
|
|
@@ -842,31 +842,31 @@ class Webhooks extends Context3.Service()("krakstack/webhooks/Webhooks", {
|
|
|
842
842
|
static layer = this.layerWithoutMigrations.pipe(Layer4.provide(layer), Layer4.provide(webhookMigrationsLayer));
|
|
843
843
|
}
|
|
844
844
|
export {
|
|
845
|
-
|
|
846
|
-
webhookColumns,
|
|
847
|
-
deliveryColumns,
|
|
848
|
-
WebhooksReceiver,
|
|
849
|
-
Webhooks,
|
|
850
|
-
WebhookVerificationError,
|
|
851
|
-
WebhookStatisticsRequest,
|
|
852
|
-
WebhookStatisticsInterval,
|
|
853
|
-
WebhookStatistics,
|
|
854
|
-
WebhookScope,
|
|
855
|
-
WebhookRequest,
|
|
856
|
-
WebhookReceiptConflict,
|
|
857
|
-
WebhookPayload,
|
|
858
|
-
WebhookName,
|
|
859
|
-
WebhookEventCount,
|
|
860
|
-
WebhookError,
|
|
861
|
-
WebhookDeliverySortId,
|
|
862
|
-
WebhookDeliveryCounts,
|
|
863
|
-
WebhookDeliveryBucket,
|
|
864
|
-
WebhookDelivery,
|
|
865
|
-
WebhookDeliveriesQuery,
|
|
866
|
-
WebhookDeliveries,
|
|
867
|
-
WebhookAllowLoopback,
|
|
868
|
-
Webhook,
|
|
869
|
-
PublishWebhook,
|
|
845
|
+
DeliverWebhookV1,
|
|
870
846
|
ListWebhookDeliveries,
|
|
871
|
-
|
|
847
|
+
PublishWebhook,
|
|
848
|
+
Webhook,
|
|
849
|
+
WebhookAllowLoopback,
|
|
850
|
+
WebhookDeliveries,
|
|
851
|
+
WebhookDeliveriesQuery,
|
|
852
|
+
WebhookDelivery,
|
|
853
|
+
WebhookDeliveryBucket,
|
|
854
|
+
WebhookDeliveryCounts,
|
|
855
|
+
WebhookDeliverySortId,
|
|
856
|
+
WebhookError,
|
|
857
|
+
WebhookEventCount,
|
|
858
|
+
WebhookName,
|
|
859
|
+
WebhookPayload,
|
|
860
|
+
WebhookReceiptConflict,
|
|
861
|
+
WebhookRequest,
|
|
862
|
+
WebhookScope,
|
|
863
|
+
WebhookStatistics,
|
|
864
|
+
WebhookStatisticsInterval,
|
|
865
|
+
WebhookStatisticsRequest,
|
|
866
|
+
WebhookVerificationError,
|
|
867
|
+
Webhooks,
|
|
868
|
+
WebhooksReceiver,
|
|
869
|
+
deliveryColumns,
|
|
870
|
+
webhookColumns,
|
|
871
|
+
webhookPayloadSchema
|
|
872
872
|
};
|
|
@@ -54,10 +54,10 @@ var migrateWebhookReceiver = Migrator.make({})({
|
|
|
54
54
|
});
|
|
55
55
|
var webhookReceiverMigrationsLayer = Layer.effectDiscard(migrateWebhookReceiver);
|
|
56
56
|
export {
|
|
57
|
-
|
|
58
|
-
webhookReceiverMigrations,
|
|
59
|
-
webhookMigrationsLayer,
|
|
60
|
-
webhookMigrations,
|
|
57
|
+
migrateWebhookReceiver,
|
|
61
58
|
migrateWebhooks,
|
|
62
|
-
|
|
59
|
+
webhookMigrations,
|
|
60
|
+
webhookMigrationsLayer,
|
|
61
|
+
webhookReceiverMigrations,
|
|
62
|
+
webhookReceiverMigrationsLayer
|
|
63
63
|
};
|
|
@@ -329,25 +329,25 @@ class WebhookError extends Schema2.TaggedError()("WebhookError", {
|
|
|
329
329
|
}) {
|
|
330
330
|
}
|
|
331
331
|
export {
|
|
332
|
-
|
|
333
|
-
webhookColumns,
|
|
334
|
-
deliveryColumns,
|
|
335
|
-
WebhookStatisticsRequest,
|
|
336
|
-
WebhookStatisticsInterval,
|
|
337
|
-
WebhookStatistics,
|
|
338
|
-
WebhookScope,
|
|
339
|
-
WebhookRequest,
|
|
340
|
-
WebhookPayload,
|
|
341
|
-
WebhookName,
|
|
342
|
-
WebhookEventCount,
|
|
343
|
-
WebhookError,
|
|
344
|
-
WebhookDeliverySortId,
|
|
345
|
-
WebhookDeliveryCounts,
|
|
346
|
-
WebhookDeliveryBucket,
|
|
347
|
-
WebhookDelivery,
|
|
348
|
-
WebhookDeliveriesQuery,
|
|
349
|
-
WebhookDeliveries,
|
|
350
|
-
Webhook,
|
|
332
|
+
ListWebhookDeliveries,
|
|
351
333
|
PublishWebhook,
|
|
352
|
-
|
|
334
|
+
Webhook,
|
|
335
|
+
WebhookDeliveries,
|
|
336
|
+
WebhookDeliveriesQuery,
|
|
337
|
+
WebhookDelivery,
|
|
338
|
+
WebhookDeliveryBucket,
|
|
339
|
+
WebhookDeliveryCounts,
|
|
340
|
+
WebhookDeliverySortId,
|
|
341
|
+
WebhookError,
|
|
342
|
+
WebhookEventCount,
|
|
343
|
+
WebhookName,
|
|
344
|
+
WebhookPayload,
|
|
345
|
+
WebhookRequest,
|
|
346
|
+
WebhookScope,
|
|
347
|
+
WebhookStatistics,
|
|
348
|
+
WebhookStatisticsInterval,
|
|
349
|
+
WebhookStatisticsRequest,
|
|
350
|
+
deliveryColumns,
|
|
351
|
+
webhookColumns,
|
|
352
|
+
webhookPayloadSchema
|
|
353
353
|
};
|
|
@@ -39,10 +39,10 @@ var WebhookAllowLoopback = Context.Reference("Webhooks/AllowLoopback", {
|
|
|
39
39
|
});
|
|
40
40
|
var isLoopbackWebhookUrl = (url) => ["http:", "https:"].includes(url.protocol) && !url.username && !url.password && ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);
|
|
41
41
|
export {
|
|
42
|
-
|
|
43
|
-
isPublicWebhookUrl,
|
|
44
|
-
isPublicIpAddress,
|
|
45
|
-
isLoopbackWebhookUrl,
|
|
42
|
+
WebhookAllowLoopback,
|
|
46
43
|
isAllowedWebhookUrlString,
|
|
47
|
-
|
|
44
|
+
isLoopbackWebhookUrl,
|
|
45
|
+
isPublicIpAddress,
|
|
46
|
+
isPublicWebhookUrl,
|
|
47
|
+
isPublicWebhookUrlString
|
|
48
48
|
};
|