@keystrokehq/segment 0.0.15 → 0.0.16-integration-id-canonicalization.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/README.md +52 -173
- package/dist/{client.mjs → client-DQfeZzLR.mjs} +28 -3
- package/dist/credential-sets/index.d.mts +2 -0
- package/dist/credential-sets/index.mjs +3 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +5 -1
- package/dist/operations/index.d.mts +2 -0
- package/dist/operations/index.mjs +3 -0
- package/dist/schemas/index.mjs +1 -1
- package/dist/{integration-CliT2xe3.mjs → segment.credential-set-BTTrkHO7.mjs} +16 -9
- package/dist/{integration-DWeMeBqQ.d.mts → segment.credential-set-BgROtI_9.d.mts} +28 -27
- package/dist/{triggers.d.mts → triggers/index.d.mts} +72 -6
- package/dist/{triggers.mjs → triggers/index.mjs} +186 -7
- package/dist/workspace-list-spaces.operation-DKWX3vl5.mjs +5200 -0
- package/dist/workspace-list-spaces.operation-QbDIgfRG.d.mts +6548 -0
- package/package.json +14 -126
- package/dist/_official/index.d.mts +0 -2
- package/dist/_official/index.mjs +0 -3
- package/dist/_runtime/index.d.mts +0 -1
- package/dist/_runtime/index.mjs +0 -1
- package/dist/audiences.d.mts +0 -193
- package/dist/audiences.mjs +0 -205
- package/dist/client.d.mts +0 -90
- package/dist/computed-traits.d.mts +0 -148
- package/dist/computed-traits.mjs +0 -149
- package/dist/connection.d.mts +0 -2
- package/dist/connection.mjs +0 -3
- package/dist/crud-DGM2Ekdr.mjs +0 -140
- package/dist/deletion-suppression.d.mts +0 -135
- package/dist/deletion-suppression.mjs +0 -103
- package/dist/delivery-overview.d.mts +0 -56
- package/dist/delivery-overview.mjs +0 -54
- package/dist/destination-filters.d.mts +0 -134
- package/dist/destination-filters.mjs +0 -115
- package/dist/destinations.d.mts +0 -318
- package/dist/destinations.mjs +0 -257
- package/dist/edge-functions.d.mts +0 -112
- package/dist/edge-functions.mjs +0 -72
- package/dist/errors-4FGnrowW.mjs +0 -27
- package/dist/events-catalog.d.mts +0 -77
- package/dist/events-catalog.mjs +0 -65
- package/dist/events.d.mts +0 -167
- package/dist/events.mjs +0 -134
- package/dist/factory-Dqb49Dfj.mjs +0 -8
- package/dist/functions.d.mts +0 -236
- package/dist/functions.mjs +0 -180
- package/dist/iam-groups.d.mts +0 -184
- package/dist/iam-groups.mjs +0 -144
- package/dist/iam-users.d.mts +0 -138
- package/dist/iam-users.mjs +0 -91
- package/dist/labels.d.mts +0 -66
- package/dist/labels.mjs +0 -58
- package/dist/monitoring.d.mts +0 -126
- package/dist/monitoring.mjs +0 -88
- package/dist/profiles-sync.d.mts +0 -82
- package/dist/profiles-sync.mjs +0 -89
- package/dist/profiles.d.mts +0 -130
- package/dist/profiles.mjs +0 -137
- package/dist/reverse-etl.d.mts +0 -315
- package/dist/reverse-etl.mjs +0 -228
- package/dist/roles.d.mts +0 -36
- package/dist/roles.mjs +0 -25
- package/dist/sources.d.mts +0 -383
- package/dist/sources.mjs +0 -259
- package/dist/tracking-plans.d.mts +0 -229
- package/dist/tracking-plans.mjs +0 -160
- package/dist/tracking.d.mts +0 -410
- package/dist/tracking.mjs +0 -255
- package/dist/transformations.d.mts +0 -132
- package/dist/transformations.mjs +0 -83
- package/dist/usage.d.mts +0 -47
- package/dist/usage.mjs +0 -55
- package/dist/verification.d.mts +0 -17
- package/dist/verification.mjs +0 -51
- package/dist/warehouses.d.mts +0 -219
- package/dist/warehouses.mjs +0 -176
- package/dist/workspaces.d.mts +0 -61
- package/dist/workspaces.mjs +0 -67
- /package/dist/{common-CdGiJbjq.mjs → common-DUU0airJ.mjs} +0 -0
package/dist/iam-users.mjs
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { createSegmentClient } from "./client.mjs";
|
|
2
|
-
import { a as segmentLooseObjectSchema, n as segmentIdSchema } from "./common-CdGiJbjq.mjs";
|
|
3
|
-
import { t as segmentOperation } from "./factory-Dqb49Dfj.mjs";
|
|
4
|
-
import { n as crudList, r as crudMutate, t as crudGet } from "./crud-DGM2Ekdr.mjs";
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
|
|
7
|
-
//#region src/iam-users.ts
|
|
8
|
-
/**
|
|
9
|
-
* segment/iam-users.ts — IAM users + invites + permissions. 6 actions
|
|
10
|
-
* (PLAN § 6.14).
|
|
11
|
-
*/
|
|
12
|
-
const iamUserSchema = segmentLooseObjectSchema({
|
|
13
|
-
id: segmentIdSchema,
|
|
14
|
-
email: z.string().optional(),
|
|
15
|
-
name: z.string().optional()
|
|
16
|
-
});
|
|
17
|
-
const iamInviteSchema = segmentLooseObjectSchema({
|
|
18
|
-
id: segmentIdSchema,
|
|
19
|
-
email: z.string().optional(),
|
|
20
|
-
status: z.string().optional(),
|
|
21
|
-
createdAt: z.string().optional()
|
|
22
|
-
});
|
|
23
|
-
const permissionSchema = segmentLooseObjectSchema({
|
|
24
|
-
roleId: segmentIdSchema,
|
|
25
|
-
resources: z.array(z.record(z.string(), z.unknown())).optional()
|
|
26
|
-
});
|
|
27
|
-
const listUsers = crudList({
|
|
28
|
-
id: "segment.iam.users.list",
|
|
29
|
-
name: "List IAM users",
|
|
30
|
-
description: "List IAM users in the workspace.",
|
|
31
|
-
path: "/users",
|
|
32
|
-
itemsKey: "users",
|
|
33
|
-
item: iamUserSchema
|
|
34
|
-
});
|
|
35
|
-
const getUser = crudGet({
|
|
36
|
-
id: "segment.iam.users.get",
|
|
37
|
-
name: "Get IAM user",
|
|
38
|
-
description: "Fetch an IAM user by id.",
|
|
39
|
-
path: "/users/{id}",
|
|
40
|
-
output: iamUserSchema,
|
|
41
|
-
unwrapKey: "user"
|
|
42
|
-
});
|
|
43
|
-
const inviteUser = crudMutate({
|
|
44
|
-
id: "segment.iam.users.invite",
|
|
45
|
-
name: "Invite user",
|
|
46
|
-
description: "Invite a user to the workspace.",
|
|
47
|
-
method: "POST",
|
|
48
|
-
path: "/invites",
|
|
49
|
-
bodyShape: {
|
|
50
|
-
email: z.string().min(1),
|
|
51
|
-
permissions: z.array(permissionSchema).optional()
|
|
52
|
-
},
|
|
53
|
-
output: iamInviteSchema,
|
|
54
|
-
unwrapKey: "invite"
|
|
55
|
-
});
|
|
56
|
-
const listInvites = crudList({
|
|
57
|
-
id: "segment.iam.users.listInvites",
|
|
58
|
-
name: "List pending invites",
|
|
59
|
-
description: "List outstanding invitations.",
|
|
60
|
-
path: "/invites",
|
|
61
|
-
itemsKey: "invites",
|
|
62
|
-
item: iamInviteSchema
|
|
63
|
-
});
|
|
64
|
-
const deleteInvite = crudMutate({
|
|
65
|
-
id: "segment.iam.users.deleteInvite",
|
|
66
|
-
name: "Delete invite",
|
|
67
|
-
description: "Delete a pending invitation.",
|
|
68
|
-
method: "DELETE",
|
|
69
|
-
path: "/invites/{id}",
|
|
70
|
-
output: z.object({}).catchall(z.unknown())
|
|
71
|
-
});
|
|
72
|
-
const replaceUserPermissions = segmentOperation({
|
|
73
|
-
id: "segment.iam.users.replacePermissions",
|
|
74
|
-
name: "Replace user permissions",
|
|
75
|
-
description: "Replace the permission set on an IAM user.",
|
|
76
|
-
input: z.object({
|
|
77
|
-
id: segmentIdSchema,
|
|
78
|
-
permissions: z.array(permissionSchema).min(1)
|
|
79
|
-
}),
|
|
80
|
-
output: z.object({ items: z.array(permissionSchema) }),
|
|
81
|
-
needsApproval: true,
|
|
82
|
-
run: async (input, credentials) => {
|
|
83
|
-
return { items: ((await createSegmentClient(credentials).publicApi.request(`/users/${encodeURIComponent(input.id)}/permissions`, {
|
|
84
|
-
method: "PUT",
|
|
85
|
-
body: { permissions: input.permissions }
|
|
86
|
-
})).data?.permissions ?? input.permissions).map((entry) => permissionSchema.parse(entry)) };
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
//#endregion
|
|
91
|
-
export { deleteInvite, getUser, iamInviteSchema, iamUserSchema, inviteUser, listInvites, listUsers, replaceUserPermissions };
|
package/dist/labels.d.mts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
|
|
4
|
-
//#region src/labels.d.ts
|
|
5
|
-
declare const listLabels: _keystrokehq_core0.Operation<z.ZodIntersection<z.ZodObject<{
|
|
6
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
7
|
-
pageToken: z.ZodOptional<z.ZodString>;
|
|
8
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
|
|
9
|
-
items: z.ZodArray<z.ZodObject<{
|
|
10
|
-
key: z.ZodString;
|
|
11
|
-
value: z.ZodString;
|
|
12
|
-
description: z.ZodOptional<z.ZodString>;
|
|
13
|
-
}, z.core.$strip>>;
|
|
14
|
-
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
15
|
-
totalEntries: z.ZodOptional<z.ZodNumber>;
|
|
16
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
17
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
18
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
19
|
-
us: "us";
|
|
20
|
-
eu: "eu";
|
|
21
|
-
}>>;
|
|
22
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
23
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
24
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
25
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
26
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
27
|
-
}, z.core.$strip>>], undefined>;
|
|
28
|
-
declare const createLabel: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
29
|
-
key: z.ZodString;
|
|
30
|
-
value: z.ZodString;
|
|
31
|
-
description: z.ZodOptional<z.ZodString>;
|
|
32
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
-
key: z.ZodString;
|
|
34
|
-
value: z.ZodString;
|
|
35
|
-
description: z.ZodOptional<z.ZodString>;
|
|
36
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
37
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
38
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
39
|
-
us: "us";
|
|
40
|
-
eu: "eu";
|
|
41
|
-
}>>;
|
|
42
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
43
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
44
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
45
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
46
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
47
|
-
}, z.core.$strip>>], undefined>;
|
|
48
|
-
declare const deleteLabel: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
49
|
-
key: z.ZodString;
|
|
50
|
-
value: z.ZodString;
|
|
51
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
-
deleted: z.ZodLiteral<true>;
|
|
53
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
54
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
55
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
56
|
-
us: "us";
|
|
57
|
-
eu: "eu";
|
|
58
|
-
}>>;
|
|
59
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
60
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
61
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
62
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
63
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
64
|
-
}, z.core.$strip>>], undefined>;
|
|
65
|
-
//#endregion
|
|
66
|
-
export { createLabel, deleteLabel, listLabels };
|
package/dist/labels.mjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { createSegmentClient } from "./client.mjs";
|
|
2
|
-
import { r as segmentLabelSchema } from "./common-CdGiJbjq.mjs";
|
|
3
|
-
import { t as segmentOperation } from "./factory-Dqb49Dfj.mjs";
|
|
4
|
-
import { n as crudList } from "./crud-DGM2Ekdr.mjs";
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
|
|
7
|
-
//#region src/labels.ts
|
|
8
|
-
/**
|
|
9
|
-
* segment/labels.ts — workspace labels. 3 actions (PLAN § 6.12). Labels are
|
|
10
|
-
* identified by `(key, value)` compound ids, so delete goes through a
|
|
11
|
-
* composite path rather than the generic {id} form.
|
|
12
|
-
*/
|
|
13
|
-
const listLabels = crudList({
|
|
14
|
-
id: "segment.labels.list",
|
|
15
|
-
name: "List labels",
|
|
16
|
-
description: "List labels defined in the workspace.",
|
|
17
|
-
path: "/labels",
|
|
18
|
-
itemsKey: "labels",
|
|
19
|
-
item: segmentLabelSchema
|
|
20
|
-
});
|
|
21
|
-
const createLabel = segmentOperation({
|
|
22
|
-
id: "segment.labels.create",
|
|
23
|
-
name: "Create label",
|
|
24
|
-
description: "Create a new workspace label (key:value).",
|
|
25
|
-
input: z.object({
|
|
26
|
-
key: z.string().min(1),
|
|
27
|
-
value: z.string().min(1),
|
|
28
|
-
description: z.string().optional()
|
|
29
|
-
}),
|
|
30
|
-
output: segmentLabelSchema,
|
|
31
|
-
needsApproval: true,
|
|
32
|
-
run: async (input, credentials) => {
|
|
33
|
-
const body = await createSegmentClient(credentials).publicApi.request("/labels", {
|
|
34
|
-
method: "POST",
|
|
35
|
-
body: input
|
|
36
|
-
});
|
|
37
|
-
const rec = body;
|
|
38
|
-
return segmentLabelSchema.parse(rec.data?.label ?? body);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
const deleteLabel = segmentOperation({
|
|
42
|
-
id: "segment.labels.delete",
|
|
43
|
-
name: "Delete label",
|
|
44
|
-
description: "Delete a workspace label by (key, value).",
|
|
45
|
-
input: z.object({
|
|
46
|
-
key: z.string().min(1),
|
|
47
|
-
value: z.string().min(1)
|
|
48
|
-
}),
|
|
49
|
-
output: z.object({ deleted: z.literal(true) }),
|
|
50
|
-
needsApproval: true,
|
|
51
|
-
run: async (input, credentials) => {
|
|
52
|
-
await createSegmentClient(credentials).publicApi.request(`/labels/${encodeURIComponent(input.key)}/${encodeURIComponent(input.value)}`, { method: "DELETE" });
|
|
53
|
-
return { deleted: true };
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
//#endregion
|
|
58
|
-
export { createLabel, deleteLabel, listLabels };
|
package/dist/monitoring.d.mts
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
|
|
4
|
-
//#region src/monitoring.d.ts
|
|
5
|
-
declare const monitoringSubscriptionSchema: z.ZodObject<{
|
|
6
|
-
id: z.ZodString;
|
|
7
|
-
eventType: z.ZodOptional<z.ZodString>;
|
|
8
|
-
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
9
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
-
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
11
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
12
|
-
declare const monitoringAlertSchema: z.ZodObject<{
|
|
13
|
-
id: z.ZodString;
|
|
14
|
-
subscriptionId: z.ZodOptional<z.ZodString>;
|
|
15
|
-
firedAt: z.ZodOptional<z.ZodString>;
|
|
16
|
-
severity: z.ZodOptional<z.ZodString>;
|
|
17
|
-
message: z.ZodOptional<z.ZodString>;
|
|
18
|
-
resolvedAt: z.ZodOptional<z.ZodString>;
|
|
19
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
20
|
-
declare const listMonitoringSubscriptions: _keystrokehq_core0.Operation<z.ZodIntersection<z.ZodObject<{
|
|
21
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
22
|
-
pageToken: z.ZodOptional<z.ZodString>;
|
|
23
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
|
|
24
|
-
items: z.ZodArray<z.ZodObject<{
|
|
25
|
-
id: z.ZodString;
|
|
26
|
-
eventType: z.ZodOptional<z.ZodString>;
|
|
27
|
-
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
28
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
29
|
-
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
30
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
31
|
-
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
32
|
-
totalEntries: z.ZodOptional<z.ZodNumber>;
|
|
33
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
34
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
35
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
36
|
-
us: "us";
|
|
37
|
-
eu: "eu";
|
|
38
|
-
}>>;
|
|
39
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
40
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
41
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
42
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
43
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
44
|
-
}, z.core.$strip>>], undefined>;
|
|
45
|
-
declare const createMonitoringSubscription: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
46
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
47
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
48
|
-
id: z.ZodString;
|
|
49
|
-
eventType: z.ZodOptional<z.ZodString>;
|
|
50
|
-
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
51
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
-
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
53
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
54
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
55
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
56
|
-
us: "us";
|
|
57
|
-
eu: "eu";
|
|
58
|
-
}>>;
|
|
59
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
60
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
61
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
62
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
63
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
64
|
-
}, z.core.$strip>>], undefined>;
|
|
65
|
-
declare const updateMonitoringSubscription: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
66
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
67
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
-
id: z.ZodString;
|
|
69
|
-
eventType: z.ZodOptional<z.ZodString>;
|
|
70
|
-
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
71
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
-
filters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
73
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
74
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
75
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
76
|
-
us: "us";
|
|
77
|
-
eu: "eu";
|
|
78
|
-
}>>;
|
|
79
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
80
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
81
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
82
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
83
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
84
|
-
}, z.core.$strip>>], undefined>;
|
|
85
|
-
declare const deleteMonitoringSubscription: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
86
|
-
[x: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
87
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
88
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
89
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
90
|
-
us: "us";
|
|
91
|
-
eu: "eu";
|
|
92
|
-
}>>;
|
|
93
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
94
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
95
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
96
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
97
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
98
|
-
}, z.core.$strip>>], undefined>;
|
|
99
|
-
declare const listMonitoringAlerts: _keystrokehq_core0.Operation<z.ZodIntersection<z.ZodObject<{
|
|
100
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
101
|
-
pageToken: z.ZodOptional<z.ZodString>;
|
|
102
|
-
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
|
|
103
|
-
items: z.ZodArray<z.ZodObject<{
|
|
104
|
-
id: z.ZodString;
|
|
105
|
-
subscriptionId: z.ZodOptional<z.ZodString>;
|
|
106
|
-
firedAt: z.ZodOptional<z.ZodString>;
|
|
107
|
-
severity: z.ZodOptional<z.ZodString>;
|
|
108
|
-
message: z.ZodOptional<z.ZodString>;
|
|
109
|
-
resolvedAt: z.ZodOptional<z.ZodString>;
|
|
110
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
111
|
-
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
112
|
-
totalEntries: z.ZodOptional<z.ZodNumber>;
|
|
113
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
114
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
115
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
116
|
-
us: "us";
|
|
117
|
-
eu: "eu";
|
|
118
|
-
}>>;
|
|
119
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
120
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
121
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
122
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
123
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
124
|
-
}, z.core.$strip>>], undefined>;
|
|
125
|
-
//#endregion
|
|
126
|
-
export { createMonitoringSubscription, deleteMonitoringSubscription, listMonitoringAlerts, listMonitoringSubscriptions, monitoringAlertSchema, monitoringSubscriptionSchema, updateMonitoringSubscription };
|
package/dist/monitoring.mjs
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { a as segmentLooseObjectSchema, n as segmentIdSchema } from "./common-CdGiJbjq.mjs";
|
|
2
|
-
import { n as crudList, r as crudMutate } from "./crud-DGM2Ekdr.mjs";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
|
|
5
|
-
//#region src/monitoring.ts
|
|
6
|
-
/**
|
|
7
|
-
* segment/monitoring.ts — Monitoring subscriptions + alerts. 5 actions
|
|
8
|
-
* (PLAN § 6.9).
|
|
9
|
-
*/
|
|
10
|
-
const monitoringSubscriptionSchema = segmentLooseObjectSchema({
|
|
11
|
-
id: segmentIdSchema,
|
|
12
|
-
eventType: z.string().optional(),
|
|
13
|
-
webhookUrl: z.string().optional(),
|
|
14
|
-
enabled: z.boolean().optional(),
|
|
15
|
-
filters: z.record(z.string(), z.unknown()).optional()
|
|
16
|
-
});
|
|
17
|
-
const monitoringAlertSchema = segmentLooseObjectSchema({
|
|
18
|
-
id: segmentIdSchema,
|
|
19
|
-
subscriptionId: z.string().optional(),
|
|
20
|
-
firedAt: z.string().optional(),
|
|
21
|
-
severity: z.string().optional(),
|
|
22
|
-
message: z.string().optional(),
|
|
23
|
-
resolvedAt: z.string().optional()
|
|
24
|
-
});
|
|
25
|
-
const listMonitoringSubscriptions = crudList({
|
|
26
|
-
id: "segment.monitoring.listSubscriptions",
|
|
27
|
-
name: "List monitoring subscriptions",
|
|
28
|
-
description: "List monitoring subscriptions the workspace has registered.",
|
|
29
|
-
path: "/monitoring/subscriptions",
|
|
30
|
-
itemsKey: "subscriptions",
|
|
31
|
-
item: monitoringSubscriptionSchema
|
|
32
|
-
});
|
|
33
|
-
const createMonitoringSubscription = crudMutate({
|
|
34
|
-
id: "segment.monitoring.createSubscription",
|
|
35
|
-
name: "Create monitoring subscription",
|
|
36
|
-
description: "Create a monitoring subscription to receive alert webhooks.",
|
|
37
|
-
method: "POST",
|
|
38
|
-
path: "/monitoring/subscriptions",
|
|
39
|
-
bodyShape: {
|
|
40
|
-
eventType: z.string().min(1),
|
|
41
|
-
webhookUrl: z.string().url(),
|
|
42
|
-
enabled: z.boolean().optional(),
|
|
43
|
-
filters: z.record(z.string(), z.unknown()).optional()
|
|
44
|
-
},
|
|
45
|
-
output: monitoringSubscriptionSchema,
|
|
46
|
-
unwrapKey: "subscription"
|
|
47
|
-
});
|
|
48
|
-
const updateMonitoringSubscription = crudMutate({
|
|
49
|
-
id: "segment.monitoring.updateSubscription",
|
|
50
|
-
name: "Update monitoring subscription",
|
|
51
|
-
description: "Patch a monitoring subscription.",
|
|
52
|
-
method: "PATCH",
|
|
53
|
-
path: "/monitoring/subscriptions/{id}",
|
|
54
|
-
bodyShape: {
|
|
55
|
-
webhookUrl: z.string().url().optional(),
|
|
56
|
-
enabled: z.boolean().optional(),
|
|
57
|
-
filters: z.record(z.string(), z.unknown()).optional()
|
|
58
|
-
},
|
|
59
|
-
output: monitoringSubscriptionSchema,
|
|
60
|
-
unwrapKey: "subscription"
|
|
61
|
-
});
|
|
62
|
-
const deleteMonitoringSubscription = crudMutate({
|
|
63
|
-
id: "segment.monitoring.deleteSubscription",
|
|
64
|
-
name: "Delete monitoring subscription",
|
|
65
|
-
description: "Delete a monitoring subscription.",
|
|
66
|
-
method: "DELETE",
|
|
67
|
-
path: "/monitoring/subscriptions/{id}",
|
|
68
|
-
output: z.object({}).catchall(z.unknown())
|
|
69
|
-
});
|
|
70
|
-
const listMonitoringAlerts = crudList({
|
|
71
|
-
id: "segment.monitoring.listAlerts",
|
|
72
|
-
name: "List monitoring alerts",
|
|
73
|
-
description: "List active monitoring alerts in the workspace.",
|
|
74
|
-
path: "/monitoring/alerts",
|
|
75
|
-
itemsKey: "alerts",
|
|
76
|
-
item: monitoringAlertSchema,
|
|
77
|
-
extraInput: {
|
|
78
|
-
severity: z.string().optional(),
|
|
79
|
-
status: z.enum([
|
|
80
|
-
"firing",
|
|
81
|
-
"resolved",
|
|
82
|
-
"all"
|
|
83
|
-
]).optional()
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
//#endregion
|
|
88
|
-
export { createMonitoringSubscription, deleteMonitoringSubscription, listMonitoringAlerts, listMonitoringSubscriptions, monitoringAlertSchema, monitoringSubscriptionSchema, updateMonitoringSubscription };
|
package/dist/profiles-sync.d.mts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
|
|
4
|
-
//#region src/profiles-sync.d.ts
|
|
5
|
-
declare const getProfilesSyncConfig: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
6
|
-
spaceId: z.ZodString;
|
|
7
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
-
spaceId: z.ZodOptional<z.ZodString>;
|
|
9
|
-
warehouseId: z.ZodOptional<z.ZodString>;
|
|
10
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
-
schemaName: z.ZodOptional<z.ZodString>;
|
|
12
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
13
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
14
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
15
|
-
us: "us";
|
|
16
|
-
eu: "eu";
|
|
17
|
-
}>>;
|
|
18
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
19
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
20
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
21
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
22
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
23
|
-
}, z.core.$strip>>], undefined>;
|
|
24
|
-
declare const updateProfilesSyncConfig: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
25
|
-
spaceId: z.ZodString;
|
|
26
|
-
warehouseId: z.ZodOptional<z.ZodString>;
|
|
27
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
-
schemaName: z.ZodOptional<z.ZodString>;
|
|
29
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
30
|
-
spaceId: z.ZodOptional<z.ZodString>;
|
|
31
|
-
warehouseId: z.ZodOptional<z.ZodString>;
|
|
32
|
-
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
-
schemaName: z.ZodOptional<z.ZodString>;
|
|
34
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
35
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
36
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
37
|
-
us: "us";
|
|
38
|
-
eu: "eu";
|
|
39
|
-
}>>;
|
|
40
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
41
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
42
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
43
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
44
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
45
|
-
}, z.core.$strip>>], undefined>;
|
|
46
|
-
declare const getProfilesSyncSelectiveSync: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
47
|
-
spaceId: z.ZodString;
|
|
48
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
49
|
-
spaceId: z.ZodOptional<z.ZodString>;
|
|
50
|
-
items: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
51
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
52
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
53
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
54
|
-
us: "us";
|
|
55
|
-
eu: "eu";
|
|
56
|
-
}>>;
|
|
57
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
58
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
59
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
60
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
61
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
62
|
-
}, z.core.$strip>>], undefined>;
|
|
63
|
-
declare const updateProfilesSyncSelectiveSync: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
64
|
-
spaceId: z.ZodString;
|
|
65
|
-
items: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
66
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
67
|
-
spaceId: z.ZodOptional<z.ZodString>;
|
|
68
|
-
items: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
69
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
70
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
71
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
72
|
-
us: "us";
|
|
73
|
-
eu: "eu";
|
|
74
|
-
}>>;
|
|
75
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
76
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
77
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
78
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
79
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
80
|
-
}, z.core.$strip>>], undefined>;
|
|
81
|
-
//#endregion
|
|
82
|
-
export { getProfilesSyncConfig, getProfilesSyncSelectiveSync, updateProfilesSyncConfig, updateProfilesSyncSelectiveSync };
|
package/dist/profiles-sync.mjs
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { createSegmentClient } from "./client.mjs";
|
|
2
|
-
import { a as segmentLooseObjectSchema, n as segmentIdSchema } from "./common-CdGiJbjq.mjs";
|
|
3
|
-
import { t as segmentOperation } from "./factory-Dqb49Dfj.mjs";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
|
|
6
|
-
//#region src/profiles-sync.ts
|
|
7
|
-
/**
|
|
8
|
-
* segment/profiles-sync.ts — Profiles Sync warehouse + selective sync.
|
|
9
|
-
* 4 actions (PLAN § 6.19).
|
|
10
|
-
*/
|
|
11
|
-
const profilesSyncConfigSchema = segmentLooseObjectSchema({
|
|
12
|
-
spaceId: z.string().optional(),
|
|
13
|
-
warehouseId: z.string().optional(),
|
|
14
|
-
enabled: z.boolean().optional(),
|
|
15
|
-
schemaName: z.string().optional()
|
|
16
|
-
});
|
|
17
|
-
const selectiveSyncSchema = segmentLooseObjectSchema({
|
|
18
|
-
spaceId: z.string().optional(),
|
|
19
|
-
items: z.array(z.record(z.string(), z.unknown())).optional()
|
|
20
|
-
});
|
|
21
|
-
const getProfilesSyncConfig = segmentOperation({
|
|
22
|
-
id: "segment.profilesSync.getConfig",
|
|
23
|
-
name: "Get profiles-sync config",
|
|
24
|
-
description: "Read the profiles-sync warehouse config for a space.",
|
|
25
|
-
input: z.object({ spaceId: segmentIdSchema }),
|
|
26
|
-
output: profilesSyncConfigSchema,
|
|
27
|
-
run: async (input, credentials) => {
|
|
28
|
-
const body = await createSegmentClient(credentials).publicApi.request(`/spaces/${encodeURIComponent(input.spaceId)}/profiles-warehouse`);
|
|
29
|
-
const rec = body;
|
|
30
|
-
return profilesSyncConfigSchema.parse(rec.data ?? body);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
const updateProfilesSyncConfig = segmentOperation({
|
|
34
|
-
id: "segment.profilesSync.updateConfig",
|
|
35
|
-
name: "Update profiles-sync config",
|
|
36
|
-
description: "Patch the profiles-sync warehouse config.",
|
|
37
|
-
input: z.object({
|
|
38
|
-
spaceId: segmentIdSchema,
|
|
39
|
-
warehouseId: z.string().optional(),
|
|
40
|
-
enabled: z.boolean().optional(),
|
|
41
|
-
schemaName: z.string().optional()
|
|
42
|
-
}),
|
|
43
|
-
output: profilesSyncConfigSchema,
|
|
44
|
-
needsApproval: true,
|
|
45
|
-
run: async (input, credentials) => {
|
|
46
|
-
const client = createSegmentClient(credentials);
|
|
47
|
-
const { spaceId, ...body } = input;
|
|
48
|
-
const response = await client.publicApi.request(`/spaces/${encodeURIComponent(spaceId)}/profiles-warehouse`, {
|
|
49
|
-
method: "PATCH",
|
|
50
|
-
body
|
|
51
|
-
});
|
|
52
|
-
const rec = response;
|
|
53
|
-
return profilesSyncConfigSchema.parse(rec.data ?? response);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
const getProfilesSyncSelectiveSync = segmentOperation({
|
|
57
|
-
id: "segment.profilesSync.getSelectiveSync",
|
|
58
|
-
name: "Get profiles-sync selective sync",
|
|
59
|
-
description: "Read the profiles-sync selective sync allowlist.",
|
|
60
|
-
input: z.object({ spaceId: segmentIdSchema }),
|
|
61
|
-
output: selectiveSyncSchema,
|
|
62
|
-
run: async (input, credentials) => {
|
|
63
|
-
const body = await createSegmentClient(credentials).publicApi.request(`/spaces/${encodeURIComponent(input.spaceId)}/profiles-warehouse/selective-sync`);
|
|
64
|
-
const rec = body;
|
|
65
|
-
return selectiveSyncSchema.parse(rec.data ?? body);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
const updateProfilesSyncSelectiveSync = segmentOperation({
|
|
69
|
-
id: "segment.profilesSync.updateSelectiveSync",
|
|
70
|
-
name: "Update profiles-sync selective sync",
|
|
71
|
-
description: "Patch the profiles-sync selective sync allowlist.",
|
|
72
|
-
input: z.object({
|
|
73
|
-
spaceId: segmentIdSchema,
|
|
74
|
-
items: z.array(z.record(z.string(), z.unknown()))
|
|
75
|
-
}),
|
|
76
|
-
output: selectiveSyncSchema,
|
|
77
|
-
needsApproval: true,
|
|
78
|
-
run: async (input, credentials) => {
|
|
79
|
-
const response = await createSegmentClient(credentials).publicApi.request(`/spaces/${encodeURIComponent(input.spaceId)}/profiles-warehouse/selective-sync`, {
|
|
80
|
-
method: "PATCH",
|
|
81
|
-
body: { items: input.items }
|
|
82
|
-
});
|
|
83
|
-
const rec = response;
|
|
84
|
-
return selectiveSyncSchema.parse(rec.data ?? response);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
//#endregion
|
|
89
|
-
export { getProfilesSyncConfig, getProfilesSyncSelectiveSync, updateProfilesSyncConfig, updateProfilesSyncSelectiveSync };
|