saasco-sdk 0.1.8 → 0.1.9
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/index.cjs.js +36 -0
- package/index.esm.js +32 -1
- package/package.json +1 -1
- package/src/lib/types.d.ts +523 -154
package/index.cjs.js
CHANGED
|
@@ -593,6 +593,7 @@ class Saasco {
|
|
|
593
593
|
version: '2',
|
|
594
594
|
sessionId: getSessionId(),
|
|
595
595
|
anonymousId: getAnonymousId(),
|
|
596
|
+
distinctId: userId,
|
|
596
597
|
projectId: this.config.projectId,
|
|
597
598
|
payload: JSON.stringify(Object.assign(Object.assign({}, browserContext), {
|
|
598
599
|
properties: properties || {}
|
|
@@ -858,6 +859,25 @@ const TinybirdJobResponseSchema = zod.z.object({
|
|
|
858
859
|
delete_id: zod.z.string().optional(),
|
|
859
860
|
import_id: zod.z.string().optional()
|
|
860
861
|
});
|
|
862
|
+
const latestEventsRequestSchema = zod.z.object({
|
|
863
|
+
projectId: zod.z.string(),
|
|
864
|
+
limit: zod.z.number().optional(),
|
|
865
|
+
payload: zod.z.boolean().optional()
|
|
866
|
+
});
|
|
867
|
+
const latestEventItemSchema = zod.z.object({
|
|
868
|
+
id: zod.z.string(),
|
|
869
|
+
timestamp: zod.z.string(),
|
|
870
|
+
action: zod.z.string(),
|
|
871
|
+
location: zod.z.string(),
|
|
872
|
+
referrer: zod.z.string(),
|
|
873
|
+
href: zod.z.string(),
|
|
874
|
+
device: zod.z.string(),
|
|
875
|
+
browser: zod.z.string(),
|
|
876
|
+
payload: zod.z.string().optional()
|
|
877
|
+
});
|
|
878
|
+
const latestEventsResponseSchema = tinyBirdBaseSchema.extend({
|
|
879
|
+
data: zod.z.array(latestEventItemSchema)
|
|
880
|
+
});
|
|
861
881
|
const kpisRequestSchema = zod.z.object({
|
|
862
882
|
projectId: zod.z.string(),
|
|
863
883
|
dateTo: zod.z.string().optional(),
|
|
@@ -944,6 +964,7 @@ const analyticsEventSchema = zod.z.object({
|
|
|
944
964
|
projectId: zod.z.string(),
|
|
945
965
|
anonymousId: zod.z.string(),
|
|
946
966
|
sessionId: zod.z.string(),
|
|
967
|
+
distinctId: zod.z.string().optional(),
|
|
947
968
|
version: zod.z.string(),
|
|
948
969
|
action: zod.z.string(),
|
|
949
970
|
payload: zod.z.string()
|
|
@@ -1013,6 +1034,16 @@ const idenfitySchema = zod.z.object({
|
|
|
1013
1034
|
active: zod.z.boolean().optional()
|
|
1014
1035
|
}).optional()
|
|
1015
1036
|
});
|
|
1037
|
+
const latestIdentifiesRequestSchema = zod.z.object({
|
|
1038
|
+
projectId: zod.z.string(),
|
|
1039
|
+
limit: zod.z.number().optional(),
|
|
1040
|
+
fields: zod.z.array(zod.z.string()).optional()
|
|
1041
|
+
});
|
|
1042
|
+
const latestIdentifiesResponseSchema = tinyBirdBaseSchema.extend({
|
|
1043
|
+
data: zod.z.array(zod.z.object({
|
|
1044
|
+
properties: contactPropertiesSchema
|
|
1045
|
+
}))
|
|
1046
|
+
});
|
|
1016
1047
|
|
|
1017
1048
|
exports.Saasco = Saasco;
|
|
1018
1049
|
exports.TinybirdJobResponseSchema = TinybirdJobResponseSchema;
|
|
@@ -1028,6 +1059,11 @@ exports.getAnalyticsUserParamsSchema = getAnalyticsUserParamsSchema;
|
|
|
1028
1059
|
exports.idenfitySchema = idenfitySchema;
|
|
1029
1060
|
exports.kpisRequestSchema = kpisRequestSchema;
|
|
1030
1061
|
exports.kpisResponseSchema = kpisResponseSchema;
|
|
1062
|
+
exports.latestEventItemSchema = latestEventItemSchema;
|
|
1063
|
+
exports.latestEventsRequestSchema = latestEventsRequestSchema;
|
|
1064
|
+
exports.latestEventsResponseSchema = latestEventsResponseSchema;
|
|
1065
|
+
exports.latestIdentifiesRequestSchema = latestIdentifiesRequestSchema;
|
|
1066
|
+
exports.latestIdentifiesResponseSchema = latestIdentifiesResponseSchema;
|
|
1031
1067
|
exports.listUsersParamsSchema = listUsersParamsSchema;
|
|
1032
1068
|
exports.reservedPropertiesSchema = reservedPropertiesSchema;
|
|
1033
1069
|
exports.tbAny = tbAny;
|
package/index.esm.js
CHANGED
|
@@ -589,6 +589,7 @@ class Saasco {
|
|
|
589
589
|
version: '2',
|
|
590
590
|
sessionId: getSessionId(),
|
|
591
591
|
anonymousId: getAnonymousId(),
|
|
592
|
+
distinctId: userId,
|
|
592
593
|
projectId: this.config.projectId,
|
|
593
594
|
payload: JSON.stringify(Object.assign(Object.assign({}, browserContext), {
|
|
594
595
|
properties: properties || {}
|
|
@@ -854,6 +855,25 @@ const TinybirdJobResponseSchema = z.object({
|
|
|
854
855
|
delete_id: z.string().optional(),
|
|
855
856
|
import_id: z.string().optional()
|
|
856
857
|
});
|
|
858
|
+
const latestEventsRequestSchema = z.object({
|
|
859
|
+
projectId: z.string(),
|
|
860
|
+
limit: z.number().optional(),
|
|
861
|
+
payload: z.boolean().optional()
|
|
862
|
+
});
|
|
863
|
+
const latestEventItemSchema = z.object({
|
|
864
|
+
id: z.string(),
|
|
865
|
+
timestamp: z.string(),
|
|
866
|
+
action: z.string(),
|
|
867
|
+
location: z.string(),
|
|
868
|
+
referrer: z.string(),
|
|
869
|
+
href: z.string(),
|
|
870
|
+
device: z.string(),
|
|
871
|
+
browser: z.string(),
|
|
872
|
+
payload: z.string().optional()
|
|
873
|
+
});
|
|
874
|
+
const latestEventsResponseSchema = tinyBirdBaseSchema.extend({
|
|
875
|
+
data: z.array(latestEventItemSchema)
|
|
876
|
+
});
|
|
857
877
|
const kpisRequestSchema = z.object({
|
|
858
878
|
projectId: z.string(),
|
|
859
879
|
dateTo: z.string().optional(),
|
|
@@ -940,6 +960,7 @@ const analyticsEventSchema = z.object({
|
|
|
940
960
|
projectId: z.string(),
|
|
941
961
|
anonymousId: z.string(),
|
|
942
962
|
sessionId: z.string(),
|
|
963
|
+
distinctId: z.string().optional(),
|
|
943
964
|
version: z.string(),
|
|
944
965
|
action: z.string(),
|
|
945
966
|
payload: z.string()
|
|
@@ -1009,5 +1030,15 @@ const idenfitySchema = z.object({
|
|
|
1009
1030
|
active: z.boolean().optional()
|
|
1010
1031
|
}).optional()
|
|
1011
1032
|
});
|
|
1033
|
+
const latestIdentifiesRequestSchema = z.object({
|
|
1034
|
+
projectId: z.string(),
|
|
1035
|
+
limit: z.number().optional(),
|
|
1036
|
+
fields: z.array(z.string()).optional()
|
|
1037
|
+
});
|
|
1038
|
+
const latestIdentifiesResponseSchema = tinyBirdBaseSchema.extend({
|
|
1039
|
+
data: z.array(z.object({
|
|
1040
|
+
properties: contactPropertiesSchema
|
|
1041
|
+
}))
|
|
1042
|
+
});
|
|
1012
1043
|
|
|
1013
|
-
export { Saasco, TinybirdJobResponseSchema, analyticsEventSchema, analyticsUserRawSchema, analyticsUserSchema, baseTopRequestSchema, coerceReservedProperties, contactPropertiesSchema, currentUsersRequestSchema, currentUsersResponseSchema, getAnalyticsUserParamsSchema, idenfitySchema, kpisRequestSchema, kpisResponseSchema, listUsersParamsSchema, reservedPropertiesSchema, tbAny, timezones, tinyBirdBaseSchema, topActionsResponseSchema, topBrowsersResponseSchema, topDevicesResponseSchema, topLocationsResponseSchema, topPagesResponseSchema, topSourcesResponseSchema, topSourcesSchema, userEventsResponseSchema };
|
|
1044
|
+
export { Saasco, TinybirdJobResponseSchema, analyticsEventSchema, analyticsUserRawSchema, analyticsUserSchema, baseTopRequestSchema, coerceReservedProperties, contactPropertiesSchema, currentUsersRequestSchema, currentUsersResponseSchema, getAnalyticsUserParamsSchema, idenfitySchema, kpisRequestSchema, kpisResponseSchema, latestEventItemSchema, latestEventsRequestSchema, latestEventsResponseSchema, latestIdentifiesRequestSchema, latestIdentifiesResponseSchema, listUsersParamsSchema, reservedPropertiesSchema, tbAny, timezones, tinyBirdBaseSchema, topActionsResponseSchema, topBrowsersResponseSchema, topDevicesResponseSchema, topLocationsResponseSchema, topPagesResponseSchema, topSourcesResponseSchema, topSourcesSchema, userEventsResponseSchema };
|