@keystrokehq/segment 0.0.9 → 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/segment.credential-set-BTTrkHO7.mjs +33 -0
- package/dist/{integration-CeShwMIi.d.mts → segment.credential-set-BgROtI_9.d.mts} +28 -37
- package/dist/{triggers.d.mts → triggers/index.d.mts} +72 -6
- package/dist/{triggers.mjs → triggers/index.mjs} +136 -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 +11 -123
- 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 -282
- package/dist/audiences.mjs +0 -205
- package/dist/client.d.mts +0 -90
- package/dist/computed-traits.d.mts +0 -215
- package/dist/computed-traits.mjs +0 -149
- package/dist/connection.d.mts +0 -2
- package/dist/connection.mjs +0 -3
- package/dist/crud-DV9e4Spi.mjs +0 -140
- package/dist/deletion-suppression.d.mts +0 -191
- package/dist/deletion-suppression.mjs +0 -103
- package/dist/delivery-overview.d.mts +0 -79
- package/dist/delivery-overview.mjs +0 -54
- package/dist/destination-filters.d.mts +0 -190
- package/dist/destination-filters.mjs +0 -115
- package/dist/destinations.d.mts +0 -473
- package/dist/destinations.mjs +0 -257
- package/dist/edge-functions.d.mts +0 -168
- package/dist/edge-functions.mjs +0 -72
- package/dist/errors-4FGnrowW.mjs +0 -27
- package/dist/events-catalog.d.mts +0 -111
- package/dist/events-catalog.mjs +0 -65
- package/dist/events.d.mts +0 -167
- package/dist/events.mjs +0 -134
- package/dist/factory-DRwj5eiU.mjs +0 -7
- package/dist/functions.d.mts +0 -347
- package/dist/functions.mjs +0 -180
- package/dist/iam-groups.d.mts +0 -284
- package/dist/iam-groups.mjs +0 -144
- package/dist/iam-users.d.mts +0 -205
- package/dist/iam-users.mjs +0 -91
- package/dist/integration-B9FOjHPc.mjs +0 -115
- package/dist/labels.d.mts +0 -100
- package/dist/labels.mjs +0 -58
- package/dist/monitoring.d.mts +0 -182
- package/dist/monitoring.mjs +0 -88
- package/dist/profiles-sync.d.mts +0 -127
- package/dist/profiles-sync.mjs +0 -89
- package/dist/profiles.d.mts +0 -197
- package/dist/profiles.mjs +0 -137
- package/dist/reverse-etl.d.mts +0 -448
- package/dist/reverse-etl.mjs +0 -228
- package/dist/roles.d.mts +0 -48
- package/dist/roles.mjs +0 -25
- package/dist/sources.d.mts +0 -560
- package/dist/sources.mjs +0 -259
- package/dist/tracking-plans.d.mts +0 -351
- package/dist/tracking-plans.mjs +0 -160
- package/dist/tracking.d.mts +0 -499
- package/dist/tracking.mjs +0 -255
- package/dist/transformations.d.mts +0 -188
- package/dist/transformations.mjs +0 -83
- package/dist/usage.d.mts +0 -70
- 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 -341
- package/dist/warehouses.mjs +0 -176
- package/dist/workspaces.d.mts +0 -95
- package/dist/workspaces.mjs +0 -67
- /package/dist/{common-CdGiJbjq.mjs → common-DUU0airJ.mjs} +0 -0
package/dist/workspaces.mjs
DELETED
|
@@ -1,67 +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-DRwj5eiU.mjs";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
|
|
6
|
-
//#region src/workspaces.ts
|
|
7
|
-
/**
|
|
8
|
-
* segment/workspaces.ts
|
|
9
|
-
*
|
|
10
|
-
* Public API workspace + Engage space metadata. Spaces are Segment's Engage
|
|
11
|
-
* tenants — `spaceId` is required on every audience/computed-trait/profile
|
|
12
|
-
* action.
|
|
13
|
-
*/
|
|
14
|
-
const workspaceSchema = segmentLooseObjectSchema({
|
|
15
|
-
id: segmentIdSchema,
|
|
16
|
-
name: z.string().optional(),
|
|
17
|
-
slug: z.string().optional(),
|
|
18
|
-
region: z.string().optional()
|
|
19
|
-
});
|
|
20
|
-
const spaceSchema = segmentLooseObjectSchema({
|
|
21
|
-
id: segmentIdSchema,
|
|
22
|
-
name: z.string().optional(),
|
|
23
|
-
slug: z.string().optional(),
|
|
24
|
-
description: z.string().optional()
|
|
25
|
-
});
|
|
26
|
-
const spacesEnvelopeSchema = z.object({ data: z.object({ spaces: z.array(spaceSchema) }) });
|
|
27
|
-
const getWorkspace = segmentOperation({
|
|
28
|
-
id: "segment.workspace.get",
|
|
29
|
-
name: "Get workspace",
|
|
30
|
-
description: "Fetch metadata about the authenticated Segment workspace.",
|
|
31
|
-
input: z.object({}),
|
|
32
|
-
output: workspaceSchema,
|
|
33
|
-
run: async (_input, credentials) => {
|
|
34
|
-
const body = await createSegmentClient(credentials).publicApi.request("/");
|
|
35
|
-
const record = body.data?.workspace ?? body;
|
|
36
|
-
return workspaceSchema.parse(record);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const listSpaces = segmentOperation({
|
|
40
|
-
id: "segment.workspace.listSpaces",
|
|
41
|
-
name: "List spaces",
|
|
42
|
-
description: "List Engage / Unify spaces in the workspace.",
|
|
43
|
-
input: z.object({}),
|
|
44
|
-
output: z.object({ items: z.array(spaceSchema) }),
|
|
45
|
-
run: async (_input, credentials) => {
|
|
46
|
-
const body = await createSegmentClient(credentials).publicApi.request("/spaces");
|
|
47
|
-
const parsed = spacesEnvelopeSchema.safeParse(body);
|
|
48
|
-
if (parsed.success) return { items: parsed.data.data.spaces };
|
|
49
|
-
const flat = z.object({ spaces: z.array(spaceSchema) }).safeParse(body);
|
|
50
|
-
return { items: flat.success ? flat.data.spaces : [] };
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const getSpace = segmentOperation({
|
|
54
|
-
id: "segment.workspace.getSpace",
|
|
55
|
-
name: "Get space",
|
|
56
|
-
description: "Fetch metadata about a single Engage / Unify space.",
|
|
57
|
-
input: z.object({ spaceId: segmentIdSchema }),
|
|
58
|
-
output: spaceSchema,
|
|
59
|
-
run: async (input, credentials) => {
|
|
60
|
-
const body = await createSegmentClient(credentials).publicApi.request(`/spaces/${encodeURIComponent(input.spaceId)}`);
|
|
61
|
-
const record = body.data?.space ?? body;
|
|
62
|
-
return spaceSchema.parse(record);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
//#endregion
|
|
67
|
-
export { getSpace, getWorkspace, listSpaces };
|
|
File without changes
|