@domu-ai/kiban-sdk 1.72.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.
@@ -0,0 +1,258 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.CreateBody = exports.createBodyTimeSlotsItemTimeRegExp = exports.PreviewResponse = exports.PreviewBody = exports.previewBodyTimeSlotsItemTimeRegExp = exports.UpdateReviewResponse = exports.UpdateReviewBody = exports.updateReviewBodyNotesMax = exports.UpdateReviewParams = exports.GetReviewStatusResponse = exports.GetReviewStatusBody = exports.GetCallResponse = exports.GetCallParams = exports.GetOutputFieldsResponse = exports.GetInputFieldsResponse = exports.GetAgentsResponse = exports.GetScheduleConfigResponse = exports.GetScheduleConfigParams = exports.GetCampaignsResponse = exports.GetCampaignNamesResponse = exports.GetCampaignNamesBody = void 0;
37
+ /**
38
+ * Generated by orval v8.2.0 🍺
39
+ * Do not edit manually.
40
+ * Kiban Dashboard API
41
+ * Dashboard endpoints for authenticated backoffice operations and campaign management.
42
+ * OpenAPI spec version: 1.0.0
43
+ */
44
+ const zod = __importStar(require("zod"));
45
+ /**
46
+ * Returns a map of campaign ID to campaign name for the specified campaign IDs.
47
+ * @summary Get campaign names by IDs
48
+ */
49
+ exports.GetCampaignNamesBody = zod.object({
50
+ "campaignIds": zod.array(zod.string()).min(1)
51
+ });
52
+ exports.GetCampaignNamesResponse = zod.object({
53
+ "data": zod.record(zod.string(), zod.string().nullable())
54
+ });
55
+ /**
56
+ * Returns a list of campaigns for the authenticated user's organization.
57
+ * @summary List campaigns
58
+ */
59
+ exports.GetCampaignsResponse = zod.object({
60
+ "data": zod.array(zod.object({
61
+ "id": zod.string(),
62
+ "name": zod.string().nullable()
63
+ }))
64
+ });
65
+ /**
66
+ * Returns campaign configuration needed for the schedule builder: timezone, contact hours, phone columns, and target count.
67
+ * @summary Get campaign schedule configuration
68
+ */
69
+ exports.GetScheduleConfigParams = zod.object({
70
+ "campaignId": zod.string()
71
+ });
72
+ exports.GetScheduleConfigResponse = zod.object({
73
+ "data": zod.object({
74
+ "campaign_id": zod.string(),
75
+ "campaign_name": zod.string(),
76
+ "timezone": zod.string().nullable(),
77
+ "phone_columns": zod.array(zod.string()),
78
+ "contact_hours": zod.object({
79
+ "monday": zod.object({
80
+ "minHour": zod.number(),
81
+ "maxHour": zod.number()
82
+ }).optional(),
83
+ "tuesday": zod.object({
84
+ "minHour": zod.number(),
85
+ "maxHour": zod.number()
86
+ }).optional(),
87
+ "wednesday": zod.object({
88
+ "minHour": zod.number(),
89
+ "maxHour": zod.number()
90
+ }).optional(),
91
+ "thursday": zod.object({
92
+ "minHour": zod.number(),
93
+ "maxHour": zod.number()
94
+ }).optional(),
95
+ "friday": zod.object({
96
+ "minHour": zod.number(),
97
+ "maxHour": zod.number()
98
+ }).optional(),
99
+ "saturday": zod.object({
100
+ "minHour": zod.number(),
101
+ "maxHour": zod.number()
102
+ }).optional(),
103
+ "sunday": zod.object({
104
+ "minHour": zod.number(),
105
+ "maxHour": zod.number()
106
+ }).optional()
107
+ }),
108
+ "max_attempts": zod.number(),
109
+ "contact_limit": zod.number().nullable(),
110
+ "allowed_call_holidays": zod.array(zod.string()).nullable(),
111
+ "loaded_target_count": zod.number()
112
+ })
113
+ });
114
+ /**
115
+ * Returns a list of agents for the authenticated user's organization.
116
+ * @summary List agents
117
+ */
118
+ exports.GetAgentsResponse = zod.object({
119
+ "data": zod.array(zod.object({
120
+ "id": zod.string(),
121
+ "name": zod.string().nullable(),
122
+ "campaign_id": zod.string()
123
+ }))
124
+ });
125
+ /**
126
+ * Returns unique input field labels from all campaigns for the authenticated user's organization.
127
+ * @summary List input field keys
128
+ */
129
+ exports.GetInputFieldsResponse = zod.object({
130
+ "data": zod.array(zod.string())
131
+ });
132
+ /**
133
+ * Returns unique output field keys from all calls for the authenticated user's organization.
134
+ * @summary List output field keys
135
+ */
136
+ exports.GetOutputFieldsResponse = zod.object({
137
+ "data": zod.array(zod.string())
138
+ });
139
+ /**
140
+ * Returns full call details including target information and input fields.
141
+ * @summary Get call details by ID
142
+ */
143
+ exports.GetCallParams = zod.object({
144
+ "callId": zod.string()
145
+ });
146
+ exports.GetCallResponse = zod.object({
147
+ "call": zod.unknown().nullish()
148
+ });
149
+ /**
150
+ * Returns the review status (reviewed flag and notes) for the specified call IDs.
151
+ * @summary Get review status for multiple calls
152
+ */
153
+ exports.GetReviewStatusBody = zod.object({
154
+ "callIds": zod.array(zod.string()).min(1)
155
+ });
156
+ exports.GetReviewStatusResponse = zod.object({
157
+ "data": zod.record(zod.string(), zod.object({
158
+ "reviewed": zod.boolean(),
159
+ "notes": zod.string().nullable()
160
+ }))
161
+ });
162
+ /**
163
+ * Updates the reviewed flag and/or notes for a specific call.
164
+ * @summary Update call review status
165
+ */
166
+ exports.UpdateReviewParams = zod.object({
167
+ "callId": zod.string()
168
+ });
169
+ exports.updateReviewBodyNotesMax = 1000;
170
+ exports.UpdateReviewBody = zod.object({
171
+ "reviewed": zod.boolean().optional(),
172
+ "notes": zod.string().max(exports.updateReviewBodyNotesMax).optional()
173
+ });
174
+ exports.UpdateReviewResponse = zod.object({
175
+ "data": zod.object({
176
+ "reviewed": zod.boolean(),
177
+ "notes": zod.string().nullable()
178
+ })
179
+ });
180
+ /**
181
+ * Generates journey JSON from schedule config and validates compliance rules. Returns journey, warnings, target count, and estimated steps without persisting anything.
182
+ * @summary Preview a campaign schedule
183
+ */
184
+ exports.previewBodyTimeSlotsItemTimeRegExp = new RegExp('^([01]\\d|2[0-3]):([0-5]\\d)$');
185
+ exports.PreviewBody = zod.object({
186
+ "campaign_id": zod.string().min(1),
187
+ "name": zod.string().optional(),
188
+ "time_slots": zod.array(zod.object({
189
+ "id": zod.string(),
190
+ "time": zod.string().regex(exports.previewBodyTimeSlotsItemTimeRegExp),
191
+ "days_of_week": zod.array(zod.union([zod.literal(1), zod.literal(2), zod.literal(3), zod.literal(4), zod.literal(5), zod.literal(6), zod.literal(7)])).min(1)
192
+ })).min(1),
193
+ "phone_rotation": zod.object({
194
+ "statuses": zod.array(zod.enum(['primary', 'secondary', 'tertiary', 'quaternary', 'quinary', 'senary', 'septenary'])).min(1),
195
+ "minutes_between": zod.number().min(1)
196
+ })
197
+ });
198
+ exports.PreviewResponse = zod.object({
199
+ "data": zod.object({
200
+ "journey": zod.object({
201
+ "name": zod.string(),
202
+ "steps": zod.array(zod.object({
203
+ "name": zod.string(),
204
+ "type": zod.enum(['call', 'message', 'wait']),
205
+ "params": zod.object({
206
+ "cron": zod.object({
207
+ "year": zod.string(),
208
+ "month": zod.string(),
209
+ "day_of_month": zod.string(),
210
+ "day_of_week": zod.string(),
211
+ "hours": zod.string(),
212
+ "minutes": zod.string()
213
+ }),
214
+ "max_attempts": zod.number(),
215
+ "label": zod.string().optional(),
216
+ "slug": zod.string().optional(),
217
+ "filter": zod.object({
218
+ "phone_number_status": zod.string().optional(),
219
+ "timezone": zod.string().optional()
220
+ }).optional()
221
+ }),
222
+ "condition": zod.object({
223
+ "if": zod.unknown()
224
+ }).optional(),
225
+ "next": zod.string().optional()
226
+ }))
227
+ }),
228
+ "warnings": zod.array(zod.object({
229
+ "type": zod.enum(['outside_contact_hours', 'no_contact_hours', 'holiday_conflict', 'invalid_cron', 'slot_overlap']),
230
+ "message": zod.string(),
231
+ "slot_id": zod.string(),
232
+ "severity": zod.enum(['error', 'warning', 'info']),
233
+ "day": zod.string().optional(),
234
+ "time": zod.string().optional()
235
+ })),
236
+ "target_count": zod.number(),
237
+ "estimated_steps": zod.number()
238
+ })
239
+ });
240
+ /**
241
+ * Creates a journey from schedule config. Validates compliance rules and rejects with 400 if blocking errors exist. Returns 409 if journey name already exists. Optionally activates the journey.
242
+ * @summary Create a campaign schedule
243
+ */
244
+ exports.createBodyTimeSlotsItemTimeRegExp = new RegExp('^([01]\\d|2[0-3]):([0-5]\\d)$');
245
+ exports.CreateBody = zod.object({
246
+ "campaign_id": zod.string().min(1),
247
+ "name": zod.string().optional(),
248
+ "time_slots": zod.array(zod.object({
249
+ "id": zod.string(),
250
+ "time": zod.string().regex(exports.createBodyTimeSlotsItemTimeRegExp),
251
+ "days_of_week": zod.array(zod.union([zod.literal(1), zod.literal(2), zod.literal(3), zod.literal(4), zod.literal(5), zod.literal(6), zod.literal(7)])).min(1)
252
+ })).min(1),
253
+ "phone_rotation": zod.object({
254
+ "statuses": zod.array(zod.enum(['primary', 'secondary', 'tertiary', 'quaternary', 'quinary', 'senary', 'septenary'])).min(1),
255
+ "minutes_between": zod.number().min(1)
256
+ }),
257
+ "activate": zod.boolean().optional()
258
+ });
package/fetcher.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./shared/fetcher";
2
+ export { default } from "./shared/fetcher";
package/fetcher.js ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.default = void 0;
21
+ __exportStar(require("./shared/fetcher"), exports);
22
+ var fetcher_1 = require("./shared/fetcher");
23
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(fetcher_1).default; } });
package/index.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Kiban API SDK entrypoint.
3
+ *
4
+ * Public API functions remain available at root for backwards compatibility.
5
+ * Internal and dashboard SDKs are namespaced exports.
6
+ */
7
+ export * from "./public";
8
+ export * as publicSdk from "./public";
9
+ export * as internalSdk from "./internal";
10
+ export * as dashboardSdk from "./dashboard";
11
+ export { setAuthToken, clearAuthToken, setApiBaseUrl, clearApiBaseUrl, getApiBaseUrl, } from "./shared/fetcher";
package/index.js ADDED
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /**
3
+ * Kiban API SDK entrypoint.
4
+ *
5
+ * Public API functions remain available at root for backwards compatibility.
6
+ * Internal and dashboard SDKs are namespaced exports.
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
20
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
21
+ }) : function(o, v) {
22
+ o["default"] = v;
23
+ });
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ var __importStar = (this && this.__importStar) || (function () {
28
+ var ownKeys = function(o) {
29
+ ownKeys = Object.getOwnPropertyNames || function (o) {
30
+ var ar = [];
31
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
32
+ return ar;
33
+ };
34
+ return ownKeys(o);
35
+ };
36
+ return function (mod) {
37
+ if (mod && mod.__esModule) return mod;
38
+ var result = {};
39
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
40
+ __setModuleDefault(result, mod);
41
+ return result;
42
+ };
43
+ })();
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.getApiBaseUrl = exports.clearApiBaseUrl = exports.setApiBaseUrl = exports.clearAuthToken = exports.setAuthToken = exports.dashboardSdk = exports.internalSdk = exports.publicSdk = void 0;
46
+ __exportStar(require("./public"), exports);
47
+ exports.publicSdk = __importStar(require("./public"));
48
+ exports.internalSdk = __importStar(require("./internal"));
49
+ exports.dashboardSdk = __importStar(require("./dashboard"));
50
+ var fetcher_1 = require("./shared/fetcher");
51
+ Object.defineProperty(exports, "setAuthToken", { enumerable: true, get: function () { return fetcher_1.setAuthToken; } });
52
+ Object.defineProperty(exports, "clearAuthToken", { enumerable: true, get: function () { return fetcher_1.clearAuthToken; } });
53
+ Object.defineProperty(exports, "setApiBaseUrl", { enumerable: true, get: function () { return fetcher_1.setApiBaseUrl; } });
54
+ Object.defineProperty(exports, "clearApiBaseUrl", { enumerable: true, get: function () { return fetcher_1.clearApiBaseUrl; } });
55
+ Object.defineProperty(exports, "getApiBaseUrl", { enumerable: true, get: function () { return fetcher_1.getApiBaseUrl; } });