@checkstack/integration-common 0.4.0 → 0.5.0
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 +51 -0
- package/package.json +4 -4
- package/src/rpc-contract.ts +9 -16
- package/src/schemas.ts +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,56 @@
|
|
|
1
1
|
# @checkstack/integration-common
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- f23f3c9: Sweep every paginated `*-common` contract onto the canonical
|
|
8
|
+
`PaginationInput` / `PaginatedResult` from `@checkstack/common` and
|
|
9
|
+
remove the now-unused legacy exports.
|
|
10
|
+
|
|
11
|
+
**BREAKING CHANGE** - `@checkstack/common` drops the deprecated
|
|
12
|
+
`PaginationInputSchema`, `paginatedOutput`, and `PaginatedResponse`
|
|
13
|
+
symbols. Callers must consume `PaginationInput` (input) and
|
|
14
|
+
`PaginatedResult(itemSchema)` (output) instead. The canonical input is
|
|
15
|
+
`{ limit (1-100, default 20), offset (>= 0, default 0) }`; the
|
|
16
|
+
canonical output envelope is
|
|
17
|
+
`{ items, total, limit, offset }`.
|
|
18
|
+
|
|
19
|
+
**BREAKING CHANGE** - `@checkstack/notification-common` migrates
|
|
20
|
+
`getNotifications` off the legacy `PaginationInputSchema`
|
|
21
|
+
(`{ limit, offset, unreadOnly }` with output `{ notifications, total }`)
|
|
22
|
+
onto `ListNotificationsInputSchema =
|
|
23
|
+
PaginationInput.extend({ unreadOnly })` and
|
|
24
|
+
`PaginatedResult(NotificationSchema)`. The output key changes from
|
|
25
|
+
`notifications` to `items`, and `limit` / `offset` are now echoed on
|
|
26
|
+
the response. The `PaginationInput` type alias previously exported
|
|
27
|
+
from `notification-common` is removed - use `ListNotificationsInput`
|
|
28
|
+
or the canonical `PaginationInput` from `@checkstack/common`.
|
|
29
|
+
|
|
30
|
+
**BREAKING CHANGE** - `@checkstack/integration-common` migrates
|
|
31
|
+
`listSubscriptions` (inline `{ page, pageSize, ... }` -> output
|
|
32
|
+
`{ subscriptions, total }`) and `getDeliveryLogs` (via
|
|
33
|
+
`DeliveryLogQueryInputSchema` `{ subscriptionId?, eventType?, status?,
|
|
34
|
+
page, pageSize }` -> output `{ logs, total }`) onto the canonical
|
|
35
|
+
`PaginationInput.extend({...})` input and
|
|
36
|
+
`PaginatedResult(itemSchema)` output. External callers must switch
|
|
37
|
+
from `{ page, pageSize }` to `{ limit, offset }` and read response
|
|
38
|
+
items from `data.items` (no more `data.subscriptions` / `data.logs`).
|
|
39
|
+
|
|
40
|
+
The matching `*-backend` handlers were updated to consume the new
|
|
41
|
+
input shape (`offset` arithmetic in lieu of `(page - 1) * pageSize`)
|
|
42
|
+
and to echo `limit` / `offset` on the response. The `*-frontend` call
|
|
43
|
+
sites in `NotificationsPage`, `NotificationBell`, `IntegrationsPage`,
|
|
44
|
+
and `DeliveryLogsPage` were updated to send the new input shape and
|
|
45
|
+
read `data.items`.
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- Updated dependencies [f23f3c9]
|
|
50
|
+
- Updated dependencies [f23f3c9]
|
|
51
|
+
- @checkstack/common@0.11.0
|
|
52
|
+
- @checkstack/signal-common@0.2.4
|
|
53
|
+
|
|
3
54
|
## 0.4.0
|
|
4
55
|
|
|
5
56
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@checkstack/integration-common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "Elastic-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@checkstack/common": "0.
|
|
14
|
-
"@checkstack/signal-common": "0.2.
|
|
13
|
+
"@checkstack/common": "0.10.0",
|
|
14
|
+
"@checkstack/signal-common": "0.2.3",
|
|
15
15
|
"@orpc/contract": "^1.13.14",
|
|
16
16
|
"zod": "^4.0.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@checkstack/tsconfig": "0.0.7",
|
|
20
20
|
"typescript": "^5.7.2",
|
|
21
|
-
"@checkstack/scripts": "0.3.
|
|
21
|
+
"@checkstack/scripts": "0.3.2"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"typecheck": "tsgo -b",
|
package/src/rpc-contract.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { integrationAccess } from "./access";
|
|
3
3
|
import { pluginMetadata } from "./plugin-metadata";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createClientDefinition,
|
|
6
|
+
PaginatedResult,
|
|
7
|
+
PaginationInput,
|
|
8
|
+
proc,
|
|
9
|
+
} from "@checkstack/common";
|
|
5
10
|
import {
|
|
6
11
|
WebhookSubscriptionSchema,
|
|
7
12
|
CreateSubscriptionInputSchema,
|
|
@@ -32,20 +37,13 @@ export const integrationContract = {
|
|
|
32
37
|
access: [integrationAccess.manage],
|
|
33
38
|
})
|
|
34
39
|
.input(
|
|
35
|
-
|
|
36
|
-
page: z.number().min(1).default(1),
|
|
37
|
-
pageSize: z.number().min(1).max(100).default(20),
|
|
40
|
+
PaginationInput.extend({
|
|
38
41
|
providerId: z.string().optional(),
|
|
39
42
|
eventType: z.string().optional(),
|
|
40
43
|
enabled: z.boolean().optional(),
|
|
41
44
|
})
|
|
42
45
|
)
|
|
43
|
-
.output(
|
|
44
|
-
z.object({
|
|
45
|
-
subscriptions: z.array(WebhookSubscriptionSchema),
|
|
46
|
-
total: z.number(),
|
|
47
|
-
})
|
|
48
|
-
),
|
|
46
|
+
.output(PaginatedResult(WebhookSubscriptionSchema)),
|
|
49
47
|
|
|
50
48
|
/** Get a single subscription by ID */
|
|
51
49
|
getSubscription: proc({
|
|
@@ -234,12 +232,7 @@ export const integrationContract = {
|
|
|
234
232
|
access: [integrationAccess.manage],
|
|
235
233
|
})
|
|
236
234
|
.input(DeliveryLogQueryInputSchema)
|
|
237
|
-
.output(
|
|
238
|
-
z.object({
|
|
239
|
-
logs: z.array(DeliveryLogSchema),
|
|
240
|
-
total: z.number(),
|
|
241
|
-
})
|
|
242
|
-
),
|
|
235
|
+
.output(PaginatedResult(DeliveryLogSchema)),
|
|
243
236
|
|
|
244
237
|
/** Get a single delivery log entry */
|
|
245
238
|
getDeliveryLog: proc({
|
package/src/schemas.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { PaginationInput } from "@checkstack/common";
|
|
2
3
|
|
|
3
4
|
// =============================================================================
|
|
4
5
|
// Webhook Subscription Schemas
|
|
@@ -95,12 +96,10 @@ export const DeliveryLogSchema = z.object({
|
|
|
95
96
|
export type DeliveryLog = z.infer<typeof DeliveryLogSchema>;
|
|
96
97
|
|
|
97
98
|
/** Input for querying delivery logs */
|
|
98
|
-
export const DeliveryLogQueryInputSchema =
|
|
99
|
+
export const DeliveryLogQueryInputSchema = PaginationInput.extend({
|
|
99
100
|
subscriptionId: z.string().optional(),
|
|
100
101
|
eventType: z.string().optional(),
|
|
101
102
|
status: DeliveryStatusSchema.optional(),
|
|
102
|
-
page: z.number().min(1).default(1),
|
|
103
|
-
pageSize: z.number().min(1).max(100).default(20),
|
|
104
103
|
});
|
|
105
104
|
export type DeliveryLogQueryInput = z.infer<typeof DeliveryLogQueryInputSchema>;
|
|
106
105
|
|