@entrolytics/api-client 3.0.1 → 3.0.2
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 +2 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/edge-helpers.d.ts.map +1 -1
- package/dist/endpoints/admin.d.ts.map +1 -1
- package/dist/endpoints/auth.d.ts.map +1 -1
- package/dist/endpoints/billing.d.ts.map +1 -1
- package/dist/endpoints/boards.d.ts.map +1 -1
- package/dist/endpoints/config.d.ts.map +1 -1
- package/dist/endpoints/events.d.ts.map +1 -1
- package/dist/endpoints/index.d.ts.map +1 -1
- package/dist/endpoints/integrations.d.ts.map +1 -1
- package/dist/endpoints/links.d.ts.map +1 -1
- package/dist/endpoints/me.d.ts.map +1 -1
- package/dist/endpoints/orgs.d.ts.map +1 -1
- package/dist/endpoints/pixels.d.ts.map +1 -1
- package/dist/endpoints/reports.d.ts.map +1 -1
- package/dist/endpoints/segments.d.ts.map +1 -1
- package/dist/endpoints/sessions.d.ts.map +1 -1
- package/dist/endpoints/users.d.ts.map +1 -1
- package/dist/endpoints/webhooks.d.ts.map +1 -1
- package/dist/endpoints/websites.d.ts.map +1 -1
- package/dist/index.cjs +61 -82
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -43
- package/dist/index.js.map +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +20 -17
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { API_ENDPOINTS, API_ROUTES, API_ROUTES as API_ROUTES$1, BILLING_ERRORS, CLI_CONFIG, CLI_TOKEN_STATUS, DEFAULT_API_HOST, DEPLOYMENT_ENV_VARS, DEPLOYMENT_SOURCES, ENV_VAR_NAMES, ERROR_MESSAGES, EVENT_TYPES, FORM_EVENT_TYPES, FORM_FIELD_TYPES, FRAMEWORK_PACKAGES, FRAMEWORK_PATTERNS, HTTP_STATUS, NAVIGATION_TYPES, ONBOARDING_STEPS, PLANS, PLAN_FEATURES, RATE_LIMITS, SDK_EVENT_TYPES, SUCCESS_MESSAGES, USAGE_THRESHOLDS, USER_ROLES, VITAL_RATINGS, VITAL_THRESHOLDS, VITAL_TYPES, detectDeploymentContext, getApiRoute, getEnvVarNames, getFrameworkPackage, getPlan, getPlanLimit, getVitalRating, isPlanFeatureEnabled, isUsageCritical, isUsageWarning, isValidFramework } from "@entrolytics/shared";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/client.ts
|
|
4
4
|
function isRecord(value) {
|
|
5
5
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
6
6
|
}
|
|
@@ -170,8 +170,7 @@ var ApiClient = class {
|
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
172
|
|
|
173
|
-
|
|
174
|
-
//#region src/endpoints/admin.ts
|
|
173
|
+
// src/endpoints/admin.ts
|
|
175
174
|
function createAdminEndpoints(client) {
|
|
176
175
|
return {
|
|
177
176
|
/**
|
|
@@ -205,8 +204,7 @@ function createAdminEndpoints(client) {
|
|
|
205
204
|
};
|
|
206
205
|
}
|
|
207
206
|
|
|
208
|
-
|
|
209
|
-
//#region src/endpoints/auth.ts
|
|
207
|
+
// src/endpoints/auth.ts
|
|
210
208
|
function createAuthEndpoints(client) {
|
|
211
209
|
return {
|
|
212
210
|
/**
|
|
@@ -238,8 +236,7 @@ function createAuthEndpoints(client) {
|
|
|
238
236
|
};
|
|
239
237
|
}
|
|
240
238
|
|
|
241
|
-
|
|
242
|
-
//#region src/endpoints/billing.ts
|
|
239
|
+
// src/endpoints/billing.ts
|
|
243
240
|
function createBillingEndpoints(client) {
|
|
244
241
|
return {
|
|
245
242
|
/**
|
|
@@ -275,8 +272,7 @@ function createBillingEndpoints(client) {
|
|
|
275
272
|
};
|
|
276
273
|
}
|
|
277
274
|
|
|
278
|
-
|
|
279
|
-
//#region src/endpoints/boards.ts
|
|
275
|
+
// src/endpoints/boards.ts
|
|
280
276
|
function createBoardsEndpoints(client) {
|
|
281
277
|
return {
|
|
282
278
|
/**
|
|
@@ -342,8 +338,7 @@ function createBoardsEndpoints(client) {
|
|
|
342
338
|
};
|
|
343
339
|
}
|
|
344
340
|
|
|
345
|
-
|
|
346
|
-
//#region src/endpoints/config.ts
|
|
341
|
+
// src/endpoints/config.ts
|
|
347
342
|
function createConfigEndpoints(client) {
|
|
348
343
|
return {
|
|
349
344
|
/**
|
|
@@ -352,8 +347,7 @@ function createConfigEndpoints(client) {
|
|
|
352
347
|
get: () => client.get("/config") };
|
|
353
348
|
}
|
|
354
349
|
|
|
355
|
-
|
|
356
|
-
//#region src/endpoints/events.ts
|
|
350
|
+
// src/endpoints/events.ts
|
|
357
351
|
function generateUuid() {
|
|
358
352
|
if (typeof globalThis.crypto !== "undefined" && typeof globalThis.crypto.randomUUID === "function") return globalThis.crypto.randomUUID();
|
|
359
353
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
@@ -418,7 +412,7 @@ function createEventsEndpoints(client) {
|
|
|
418
412
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
419
413
|
sessionId: generateUuid(),
|
|
420
414
|
visitorId: generateUuid(),
|
|
421
|
-
url: "https://entrolytics.
|
|
415
|
+
url: "https://entrolytics.dev/test-event",
|
|
422
416
|
eventType: "custom_event",
|
|
423
417
|
eventName: "cli_test_event",
|
|
424
418
|
properties: {
|
|
@@ -430,8 +424,7 @@ function createEventsEndpoints(client) {
|
|
|
430
424
|
};
|
|
431
425
|
}
|
|
432
426
|
|
|
433
|
-
|
|
434
|
-
//#region src/endpoints/integrations.ts
|
|
427
|
+
// src/endpoints/integrations.ts
|
|
435
428
|
function createIntegrationsEndpoints(client) {
|
|
436
429
|
return {
|
|
437
430
|
/**
|
|
@@ -440,8 +433,7 @@ function createIntegrationsEndpoints(client) {
|
|
|
440
433
|
wordpress: (params) => client.post("/integrations/wordpress", params.data) };
|
|
441
434
|
}
|
|
442
435
|
|
|
443
|
-
|
|
444
|
-
//#region src/endpoints/links.ts
|
|
436
|
+
// src/endpoints/links.ts
|
|
445
437
|
function createLinksEndpoints(client) {
|
|
446
438
|
return {
|
|
447
439
|
/**
|
|
@@ -489,8 +481,7 @@ function createLinksEndpoints(client) {
|
|
|
489
481
|
};
|
|
490
482
|
}
|
|
491
483
|
|
|
492
|
-
|
|
493
|
-
//#region src/endpoints/me.ts
|
|
484
|
+
// src/endpoints/me.ts
|
|
494
485
|
function createMeEndpoints(client) {
|
|
495
486
|
return {
|
|
496
487
|
/**
|
|
@@ -520,8 +511,7 @@ function createMeEndpoints(client) {
|
|
|
520
511
|
};
|
|
521
512
|
}
|
|
522
513
|
|
|
523
|
-
|
|
524
|
-
//#region src/endpoints/orgs.ts
|
|
514
|
+
// src/endpoints/orgs.ts
|
|
525
515
|
function createOrgsEndpoints(client) {
|
|
526
516
|
return {
|
|
527
517
|
/**
|
|
@@ -605,8 +595,7 @@ function createOrgsEndpoints(client) {
|
|
|
605
595
|
};
|
|
606
596
|
}
|
|
607
597
|
|
|
608
|
-
|
|
609
|
-
//#region src/endpoints/pixels.ts
|
|
598
|
+
// src/endpoints/pixels.ts
|
|
610
599
|
function createPixelsEndpoints(client) {
|
|
611
600
|
return {
|
|
612
601
|
/**
|
|
@@ -648,8 +637,7 @@ function createPixelsEndpoints(client) {
|
|
|
648
637
|
};
|
|
649
638
|
}
|
|
650
639
|
|
|
651
|
-
|
|
652
|
-
//#region src/endpoints/reports.ts
|
|
640
|
+
// src/endpoints/reports.ts
|
|
653
641
|
function createReportsEndpoints(client) {
|
|
654
642
|
return {
|
|
655
643
|
/**
|
|
@@ -812,8 +800,7 @@ function createReportsEndpoints(client) {
|
|
|
812
800
|
};
|
|
813
801
|
}
|
|
814
802
|
|
|
815
|
-
|
|
816
|
-
//#region src/endpoints/segments.ts
|
|
803
|
+
// src/endpoints/segments.ts
|
|
817
804
|
function createSegmentsEndpoints(client) {
|
|
818
805
|
return {
|
|
819
806
|
/**
|
|
@@ -849,8 +836,7 @@ function createSegmentsEndpoints(client) {
|
|
|
849
836
|
};
|
|
850
837
|
}
|
|
851
838
|
|
|
852
|
-
|
|
853
|
-
//#region src/endpoints/sessions.ts
|
|
839
|
+
// src/endpoints/sessions.ts
|
|
854
840
|
function createSessionsEndpoints(client) {
|
|
855
841
|
return {
|
|
856
842
|
/**
|
|
@@ -892,8 +878,7 @@ function createSessionsEndpoints(client) {
|
|
|
892
878
|
};
|
|
893
879
|
}
|
|
894
880
|
|
|
895
|
-
|
|
896
|
-
//#region src/endpoints/users.ts
|
|
881
|
+
// src/endpoints/users.ts
|
|
897
882
|
function createUsersEndpoints(client) {
|
|
898
883
|
return {
|
|
899
884
|
/**
|
|
@@ -941,8 +926,7 @@ function createUsersEndpoints(client) {
|
|
|
941
926
|
};
|
|
942
927
|
}
|
|
943
928
|
|
|
944
|
-
|
|
945
|
-
//#region src/endpoints/webhooks.ts
|
|
929
|
+
// src/endpoints/webhooks.ts
|
|
946
930
|
function createWebhooksEndpoints(client) {
|
|
947
931
|
return {
|
|
948
932
|
/**
|
|
@@ -951,8 +935,7 @@ function createWebhooksEndpoints(client) {
|
|
|
951
935
|
clerk: (params) => client.post("/webhooks/clerk", params.data) };
|
|
952
936
|
}
|
|
953
937
|
|
|
954
|
-
|
|
955
|
-
//#region src/endpoints/websites.ts
|
|
938
|
+
// src/endpoints/websites.ts
|
|
956
939
|
function createWebsitesEndpoints(client) {
|
|
957
940
|
const toDateRangeQuery = (params) => ({
|
|
958
941
|
startDate: new Date(params.startAt).toISOString(),
|
|
@@ -1312,8 +1295,7 @@ function createWebsitesEndpoints(client) {
|
|
|
1312
1295
|
};
|
|
1313
1296
|
}
|
|
1314
1297
|
|
|
1315
|
-
|
|
1316
|
-
//#region src/runtime.ts
|
|
1298
|
+
// src/runtime.ts
|
|
1317
1299
|
/**
|
|
1318
1300
|
* Detect the current JavaScript runtime environment
|
|
1319
1301
|
*
|
|
@@ -1427,8 +1409,7 @@ function assertRuntime(expected) {
|
|
|
1427
1409
|
if (actual !== expected) throw new Error(`Expected ${expected} runtime, but detected ${actual}. This code requires ${expected} runtime to function correctly.`);
|
|
1428
1410
|
}
|
|
1429
1411
|
|
|
1430
|
-
|
|
1431
|
-
//#region src/edge-helpers.ts
|
|
1412
|
+
// src/edge-helpers.ts
|
|
1432
1413
|
/**
|
|
1433
1414
|
* Edge runtime helper utilities
|
|
1434
1415
|
*
|
|
@@ -1643,8 +1624,7 @@ function getClientIp(request) {
|
|
|
1643
1624
|
return headers.get("x-forwarded-for")?.split(",")[0]?.trim() || headers.get("x-real-ip") || headers.get("cf-connecting-ip") || headers.get("x-vercel-forwarded-for") || void 0;
|
|
1644
1625
|
}
|
|
1645
1626
|
|
|
1646
|
-
|
|
1647
|
-
//#region src/index.ts
|
|
1627
|
+
// src/index.ts
|
|
1648
1628
|
/**
|
|
1649
1629
|
* Create an Entrolytics API client.
|
|
1650
1630
|
*
|
|
@@ -1703,6 +1683,5 @@ function getClient(config) {
|
|
|
1703
1683
|
};
|
|
1704
1684
|
}
|
|
1705
1685
|
|
|
1706
|
-
//#endregion
|
|
1707
1686
|
export { API_ENDPOINTS, API_ROUTES, ApiClient, BILLING_ERRORS, CLI_CONFIG, CLI_TOKEN_STATUS, DEFAULT_API_HOST, DEPLOYMENT_ENV_VARS, DEPLOYMENT_SOURCES, ENV_VAR_NAMES, ERROR_MESSAGES, EVENT_TYPES, FORM_EVENT_TYPES, FORM_FIELD_TYPES, FRAMEWORK_PACKAGES, FRAMEWORK_PATTERNS, HTTP_STATUS, NAVIGATION_TYPES, ONBOARDING_STEPS, PLANS, PLAN_FEATURES, RATE_LIMITS, SDK_EVENT_TYPES, SUCCESS_MESSAGES, USAGE_THRESHOLDS, USER_ROLES, VITAL_RATINGS, VITAL_THRESHOLDS, VITAL_TYPES, assertRuntime, createAdminEndpoints, createAuthEndpoints, createBillingEndpoints, createBoardsEndpoints, createConfigEndpoints, createEdgeFetch, createEventsEndpoints, createIntegrationsEndpoints, createLinksEndpoints, createMeEndpoints, createOrgsEndpoints, createPixelsEndpoints, createReportsEndpoints, createSegmentsEndpoints, createSessionsEndpoints, createUsersEndpoints, createWebhooksEndpoints, createWebsitesEndpoints, getClient as default, getClient, detectDeploymentContext, detectRuntime, getApiRoute, getClientIp, getEdgeEnv, getEnvVarNames, getFrameworkPackage, getGeoFromRequest, getPlan, getPlanLimit, getRegionInfo, getRuntimeCapabilities, getVitalRating, isEdgeRuntime, isNodeRuntime, isPlanFeatureEnabled, isUsageCritical, isUsageWarning, isValidFramework, requireEdgeEnv };
|
|
1708
1687
|
//# sourceMappingURL=index.js.map
|