@keystrokehq/segment 0.0.9 → 0.0.15
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/dist/_official/index.d.mts +1 -1
- package/dist/_official/index.mjs +1 -1
- package/dist/audiences.d.mts +17 -106
- package/dist/audiences.mjs +1 -1
- package/dist/client.d.mts +1 -1
- package/dist/computed-traits.d.mts +13 -80
- package/dist/computed-traits.mjs +1 -1
- package/dist/connection.d.mts +1 -1
- package/dist/connection.mjs +1 -1
- package/dist/{crud-DV9e4Spi.mjs → crud-DGM2Ekdr.mjs} +1 -1
- package/dist/deletion-suppression.d.mts +11 -67
- package/dist/deletion-suppression.mjs +2 -2
- package/dist/delivery-overview.d.mts +5 -28
- package/dist/delivery-overview.mjs +1 -1
- package/dist/destination-filters.d.mts +11 -67
- package/dist/destination-filters.mjs +1 -1
- package/dist/destinations.d.mts +29 -184
- package/dist/destinations.mjs +2 -2
- package/dist/edge-functions.d.mts +11 -67
- package/dist/edge-functions.mjs +2 -2
- package/dist/events-catalog.d.mts +7 -41
- package/dist/events-catalog.mjs +1 -1
- package/dist/factory-Dqb49Dfj.mjs +8 -0
- package/dist/functions.d.mts +26 -137
- package/dist/functions.mjs +2 -2
- package/dist/iam-groups.d.mts +19 -119
- package/dist/iam-groups.mjs +2 -2
- package/dist/iam-users.d.mts +13 -80
- package/dist/iam-users.mjs +2 -2
- package/dist/integration-CliT2xe3.mjs +26 -0
- package/dist/{integration-CeShwMIi.d.mts → integration-DWeMeBqQ.d.mts} +6 -16
- package/dist/labels.d.mts +7 -41
- package/dist/labels.mjs +2 -2
- package/dist/monitoring.d.mts +11 -67
- package/dist/monitoring.mjs +1 -1
- package/dist/profiles-sync.d.mts +9 -54
- package/dist/profiles-sync.mjs +1 -1
- package/dist/profiles.d.mts +13 -80
- package/dist/profiles.mjs +1 -1
- package/dist/reverse-etl.d.mts +25 -158
- package/dist/reverse-etl.mjs +2 -2
- package/dist/roles.d.mts +3 -15
- package/dist/roles.mjs +1 -1
- package/dist/sources.d.mts +33 -210
- package/dist/sources.mjs +2 -2
- package/dist/tracking-plans.d.mts +23 -145
- package/dist/tracking-plans.mjs +2 -2
- package/dist/tracking.d.mts +17 -106
- package/dist/tracking.mjs +1 -1
- package/dist/transformations.d.mts +11 -67
- package/dist/transformations.mjs +1 -1
- package/dist/triggers.d.mts +3 -3
- package/dist/triggers.mjs +3 -53
- package/dist/usage.d.mts +5 -28
- package/dist/usage.mjs +1 -1
- package/dist/warehouses.d.mts +23 -145
- package/dist/warehouses.mjs +2 -2
- package/dist/workspaces.d.mts +7 -41
- package/dist/workspaces.mjs +1 -1
- package/package.json +5 -5
- package/dist/factory-DRwj5eiU.mjs +0 -7
- package/dist/integration-B9FOjHPc.mjs +0 -115
package/dist/workspaces.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
2
1
|
import { z } from "zod";
|
|
3
|
-
import * as
|
|
2
|
+
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
4
3
|
|
|
5
4
|
//#region src/workspaces.d.ts
|
|
6
5
|
declare const getWorkspace: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
@@ -8,18 +7,7 @@ declare const getWorkspace: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.
|
|
|
8
7
|
name: z.ZodOptional<z.ZodString>;
|
|
9
8
|
slug: z.ZodOptional<z.ZodString>;
|
|
10
9
|
region: z.ZodOptional<z.ZodString>;
|
|
11
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
12
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
13
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
14
|
-
us: "us";
|
|
15
|
-
eu: "eu";
|
|
16
|
-
}>>;
|
|
17
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
18
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
19
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
20
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
21
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
22
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
10
|
+
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
23
11
|
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
24
12
|
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
25
13
|
us: "us";
|
|
@@ -30,7 +18,7 @@ declare const getWorkspace: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.
|
|
|
30
18
|
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
31
19
|
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
32
20
|
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
33
|
-
}, z.core.$strip>>
|
|
21
|
+
}, z.core.$strip>>], undefined>;
|
|
34
22
|
declare const listSpaces: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
35
23
|
items: z.ZodArray<z.ZodObject<{
|
|
36
24
|
id: z.ZodString;
|
|
@@ -38,18 +26,7 @@ declare const listSpaces: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$s
|
|
|
38
26
|
slug: z.ZodOptional<z.ZodString>;
|
|
39
27
|
description: z.ZodOptional<z.ZodString>;
|
|
40
28
|
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
41
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
42
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
43
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
44
|
-
us: "us";
|
|
45
|
-
eu: "eu";
|
|
46
|
-
}>>;
|
|
47
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
48
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
49
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
50
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
51
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
52
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
29
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
53
30
|
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
54
31
|
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
55
32
|
us: "us";
|
|
@@ -60,7 +37,7 @@ declare const listSpaces: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$s
|
|
|
60
37
|
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
61
38
|
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
62
39
|
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
63
|
-
}, z.core.$strip>>
|
|
40
|
+
}, z.core.$strip>>], undefined>;
|
|
64
41
|
declare const getSpace: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
65
42
|
spaceId: z.ZodString;
|
|
66
43
|
}, z.core.$strip>, z.ZodObject<{
|
|
@@ -68,18 +45,7 @@ declare const getSpace: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
68
45
|
name: z.ZodOptional<z.ZodString>;
|
|
69
46
|
slug: z.ZodOptional<z.ZodString>;
|
|
70
47
|
description: z.ZodOptional<z.ZodString>;
|
|
71
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"segment", z.ZodObject<{
|
|
72
|
-
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
73
|
-
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
74
|
-
us: "us";
|
|
75
|
-
eu: "eu";
|
|
76
|
-
}>>;
|
|
77
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.ZodOptional<z.ZodString>;
|
|
78
|
-
SEGMENT_WRITE_KEYS_JSON: z.ZodOptional<z.ZodString>;
|
|
79
|
-
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
80
|
-
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
81
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
82
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
48
|
+
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:segment", z.ZodObject<{
|
|
83
49
|
SEGMENT_PUBLIC_API_TOKEN: z.ZodString;
|
|
84
50
|
SEGMENT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
85
51
|
us: "us";
|
|
@@ -90,6 +56,6 @@ declare const getSpace: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
90
56
|
SEGMENT_PROFILE_API_TOKEN: z.ZodOptional<z.ZodString>;
|
|
91
57
|
SEGMENT_PROFILE_SPACE_ID: z.ZodOptional<z.ZodString>;
|
|
92
58
|
SEGMENT_WEBHOOK_SHARED_SECRET: z.ZodOptional<z.ZodString>;
|
|
93
|
-
}, z.core.$strip>>
|
|
59
|
+
}, z.core.$strip>>], undefined>;
|
|
94
60
|
//#endregion
|
|
95
61
|
export { getSpace, getWorkspace, listSpaces };
|
package/dist/workspaces.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createSegmentClient } from "./client.mjs";
|
|
2
2
|
import { a as segmentLooseObjectSchema, n as segmentIdSchema } from "./common-CdGiJbjq.mjs";
|
|
3
|
-
import { t as segmentOperation } from "./factory-
|
|
3
|
+
import { t as segmentOperation } from "./factory-Dqb49Dfj.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/workspaces.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keystrokehq/segment",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -144,20 +144,20 @@
|
|
|
144
144
|
"LICENSE"
|
|
145
145
|
],
|
|
146
146
|
"dependencies": {
|
|
147
|
+
"@keystrokehq/integration-authoring": "^0.0.9",
|
|
147
148
|
"zod": "^4.3.6"
|
|
148
149
|
},
|
|
149
150
|
"peerDependencies": {
|
|
150
|
-
"@keystrokehq/core": ">=0.0.
|
|
151
|
+
"@keystrokehq/core": ">=0.0.13 <0.1.0"
|
|
151
152
|
},
|
|
152
153
|
"devDependencies": {
|
|
153
154
|
"@types/node": "^22.19.11",
|
|
154
155
|
"tsdown": "^0.20.3",
|
|
155
156
|
"typescript": "^5.9.3",
|
|
156
157
|
"vitest": "^4.0.18",
|
|
157
|
-
"@keystrokehq/core": "^0.0.
|
|
158
|
+
"@keystrokehq/core": "^0.0.13",
|
|
158
159
|
"@keystrokehq/test-utils": "0.0.0",
|
|
159
|
-
"@keystrokehq/typescript-config": "0.0.0"
|
|
160
|
-
"@keystrokehq/integration-authoring": "0.0.9"
|
|
160
|
+
"@keystrokehq/typescript-config": "0.0.0"
|
|
161
161
|
},
|
|
162
162
|
"keywords": [
|
|
163
163
|
"segment",
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { CredentialSet, Operation } from "@keystrokehq/core";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region ../../packages/integration-authoring/dist/official/runtime.mjs
|
|
5
|
-
const REGISTRY_KEY = "__ks_official_integration_metadata_registry";
|
|
6
|
-
function getRegistry() {
|
|
7
|
-
const globalStore = globalThis;
|
|
8
|
-
if (!globalStore[REGISTRY_KEY]) globalStore[REGISTRY_KEY] = /* @__PURE__ */ new WeakMap();
|
|
9
|
-
return globalStore[REGISTRY_KEY];
|
|
10
|
-
}
|
|
11
|
-
function registerOfficialOperation(operation, metadata) {
|
|
12
|
-
getRegistry().set(operation, Object.freeze({ ...metadata }));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region ../../packages/integration-authoring/dist/official/index.mjs
|
|
17
|
-
const OFFICIAL_CREDENTIAL_SET_ID_PREFIX = "keystroke:";
|
|
18
|
-
function stripOfficialCredentialSetIdPrefix(id) {
|
|
19
|
-
return id.startsWith(OFFICIAL_CREDENTIAL_SET_ID_PREFIX) ? id.slice(10) : id;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Creates a factory for Keystroke-official integration operations.
|
|
23
|
-
*
|
|
24
|
-
* It keeps the same flat `run(input, credentials)` ergonomics as the generic
|
|
25
|
-
* operation factory, while registering official metadata for builder/runtime
|
|
26
|
-
* operation metadata.
|
|
27
|
-
*/
|
|
28
|
-
function createOfficialOperationFactory(credentialSet) {
|
|
29
|
-
const integrationId = stripOfficialCredentialSetIdPrefix(credentialSet.id);
|
|
30
|
-
return (config) => {
|
|
31
|
-
const wrappedRun = async (input, ctx) => {
|
|
32
|
-
const creds = ctx.credentials[credentialSet.id];
|
|
33
|
-
return config.run(input, creds);
|
|
34
|
-
};
|
|
35
|
-
const operation = new Operation({
|
|
36
|
-
id: config.id,
|
|
37
|
-
name: config.name,
|
|
38
|
-
description: config.description,
|
|
39
|
-
input: config.input,
|
|
40
|
-
output: config.output,
|
|
41
|
-
credentialSets: [credentialSet],
|
|
42
|
-
...config.tags !== void 0 ? { tags: config.tags } : {},
|
|
43
|
-
...config.needsApproval !== void 0 ? { needsApproval: config.needsApproval } : {},
|
|
44
|
-
...config.requiredOAuthScopes !== void 0 ? { requiredOAuthScopes: config.requiredOAuthScopes } : {},
|
|
45
|
-
...config.retries !== void 0 ? { retries: config.retries } : {},
|
|
46
|
-
...config.timeout !== void 0 ? { timeout: config.timeout } : {},
|
|
47
|
-
...config.maxDurationMs !== void 0 ? { maxDurationMs: config.maxDurationMs } : {},
|
|
48
|
-
run: wrappedRun
|
|
49
|
-
});
|
|
50
|
-
registerOfficialOperation(operation, { integrationId });
|
|
51
|
-
return operation;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Creates an official integration bundle from a single config object.
|
|
56
|
-
*
|
|
57
|
-
* - Creates the public `CredentialSet` internally.
|
|
58
|
-
* - Accepts optional `internal` fields for Keystroke-owned platform credentials.
|
|
59
|
-
*/
|
|
60
|
-
function defineOfficialIntegration(config) {
|
|
61
|
-
const internalCredentialSets = config.internal ?? {};
|
|
62
|
-
const allInternalCredentialSets = [
|
|
63
|
-
...internalCredentialSets.providerApp ? [internalCredentialSets.providerApp] : [],
|
|
64
|
-
...internalCredentialSets.providerAppVariants ?? [],
|
|
65
|
-
...internalCredentialSets.webhookVerification ? [internalCredentialSets.webhookVerification] : [],
|
|
66
|
-
...internalCredentialSets.other ?? []
|
|
67
|
-
];
|
|
68
|
-
const credentialSet = new CredentialSet({
|
|
69
|
-
id: config.id,
|
|
70
|
-
name: config.name,
|
|
71
|
-
description: config.description,
|
|
72
|
-
auth: config.auth,
|
|
73
|
-
...config.connections ? { connections: config.connections } : {},
|
|
74
|
-
...config.proxy ? { proxy: config.proxy } : {},
|
|
75
|
-
...config.needsRawSecret === true ? { needsRawSecret: true } : {}
|
|
76
|
-
});
|
|
77
|
-
return Object.freeze({
|
|
78
|
-
integration: {
|
|
79
|
-
id: config.id,
|
|
80
|
-
name: config.name,
|
|
81
|
-
...config.description !== void 0 ? { description: config.description } : {},
|
|
82
|
-
auth: config.auth,
|
|
83
|
-
...config.proxy ? { proxy: config.proxy } : {},
|
|
84
|
-
...config.needsRawSecret === true ? { needsRawSecret: true } : {},
|
|
85
|
-
...config.connections ? { connections: config.connections } : {}
|
|
86
|
-
},
|
|
87
|
-
credentialSet,
|
|
88
|
-
internalCredentialSets,
|
|
89
|
-
allInternalCredentialSets
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/integration.ts
|
|
95
|
-
const segmentRegionSchema = z.enum(["us", "eu"]);
|
|
96
|
-
const segmentAuthSchema = z.object({
|
|
97
|
-
SEGMENT_PUBLIC_API_TOKEN: z.string().min(1),
|
|
98
|
-
SEGMENT_REGION: segmentRegionSchema.default("us"),
|
|
99
|
-
SEGMENT_DEFAULT_WRITE_KEY: z.string().min(1).optional(),
|
|
100
|
-
SEGMENT_WRITE_KEYS_JSON: z.string().optional(),
|
|
101
|
-
SEGMENT_PROFILE_API_TOKEN: z.string().min(1).optional(),
|
|
102
|
-
SEGMENT_PROFILE_SPACE_ID: z.string().min(1).optional(),
|
|
103
|
-
SEGMENT_WEBHOOK_SHARED_SECRET: z.string().min(1).optional()
|
|
104
|
-
});
|
|
105
|
-
const segmentOfficialIntegration = {
|
|
106
|
-
id: "segment",
|
|
107
|
-
name: "Segment",
|
|
108
|
-
description: "Twilio Segment Customer Data Platform — track events, manage sources/destinations/tracking plans/warehouses, audiences, reverse ETL, and monitor delivery from Keystroke workflows.",
|
|
109
|
-
auth: segmentAuthSchema
|
|
110
|
-
};
|
|
111
|
-
const segmentBundle = defineOfficialIntegration(segmentOfficialIntegration);
|
|
112
|
-
const segment = segmentBundle.credentialSet;
|
|
113
|
-
|
|
114
|
-
//#endregion
|
|
115
|
-
export { createOfficialOperationFactory as i, segmentBundle as n, segmentOfficialIntegration as r, segment as t };
|