@cossistant/core 0.0.23 → 0.0.25
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/conversation.d.ts +8 -8
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/package.json +1 -1
- package/realtime-events.d.ts +5 -5
- package/registries.d.ts.map +1 -1
- package/schemas3.d.ts +2 -2
- package/store/create-store.d.ts.map +1 -1
- package/timeline-item.d.ts +4 -4
- package/util.d.ts.map +1 -1
- package/visitor-name.d.ts +36 -0
- package/visitor-name.d.ts.map +1 -0
- package/visitor-name.js +271 -0
- package/visitor-name.js.map +1 -0
package/conversation.d.ts
CHANGED
|
@@ -29,7 +29,6 @@ declare const createConversationRequestSchema: ZodObject<{
|
|
|
29
29
|
}, $strip>, ZodObject<{
|
|
30
30
|
type: ZodLiteral<"event">;
|
|
31
31
|
eventType: ZodEnum<{
|
|
32
|
-
resolved: "resolved";
|
|
33
32
|
assigned: "assigned";
|
|
34
33
|
unassigned: "unassigned";
|
|
35
34
|
participant_requested: "participant_requested";
|
|
@@ -39,6 +38,7 @@ declare const createConversationRequestSchema: ZodObject<{
|
|
|
39
38
|
priority_changed: "priority_changed";
|
|
40
39
|
tag_added: "tag_added";
|
|
41
40
|
tag_removed: "tag_removed";
|
|
41
|
+
resolved: "resolved";
|
|
42
42
|
reopened: "reopened";
|
|
43
43
|
visitor_blocked: "visitor_blocked";
|
|
44
44
|
visitor_unblocked: "visitor_unblocked";
|
|
@@ -102,7 +102,6 @@ declare const createConversationResponseSchema: ZodObject<{
|
|
|
102
102
|
}, $strip>, ZodObject<{
|
|
103
103
|
type: ZodLiteral<"event">;
|
|
104
104
|
eventType: ZodEnum<{
|
|
105
|
-
resolved: "resolved";
|
|
106
105
|
assigned: "assigned";
|
|
107
106
|
unassigned: "unassigned";
|
|
108
107
|
participant_requested: "participant_requested";
|
|
@@ -112,6 +111,7 @@ declare const createConversationResponseSchema: ZodObject<{
|
|
|
112
111
|
priority_changed: "priority_changed";
|
|
113
112
|
tag_added: "tag_added";
|
|
114
113
|
tag_removed: "tag_removed";
|
|
114
|
+
resolved: "resolved";
|
|
115
115
|
reopened: "reopened";
|
|
116
116
|
visitor_blocked: "visitor_blocked";
|
|
117
117
|
visitor_unblocked: "visitor_unblocked";
|
|
@@ -158,8 +158,8 @@ declare const createConversationResponseSchema: ZodObject<{
|
|
|
158
158
|
visitorId: ZodString;
|
|
159
159
|
websiteId: ZodString;
|
|
160
160
|
status: ZodDefault<ZodEnum<{
|
|
161
|
-
open: "open";
|
|
162
161
|
resolved: "resolved";
|
|
162
|
+
open: "open";
|
|
163
163
|
spam: "spam";
|
|
164
164
|
}>>;
|
|
165
165
|
deletedAt: ZodDefault<ZodNullable<ZodString>>;
|
|
@@ -184,7 +184,6 @@ declare const createConversationResponseSchema: ZodObject<{
|
|
|
184
184
|
}, $strip>, ZodObject<{
|
|
185
185
|
type: ZodLiteral<"event">;
|
|
186
186
|
eventType: ZodEnum<{
|
|
187
|
-
resolved: "resolved";
|
|
188
187
|
assigned: "assigned";
|
|
189
188
|
unassigned: "unassigned";
|
|
190
189
|
participant_requested: "participant_requested";
|
|
@@ -194,6 +193,7 @@ declare const createConversationResponseSchema: ZodObject<{
|
|
|
194
193
|
priority_changed: "priority_changed";
|
|
195
194
|
tag_added: "tag_added";
|
|
196
195
|
tag_removed: "tag_removed";
|
|
196
|
+
resolved: "resolved";
|
|
197
197
|
reopened: "reopened";
|
|
198
198
|
visitor_blocked: "visitor_blocked";
|
|
199
199
|
visitor_unblocked: "visitor_unblocked";
|
|
@@ -262,8 +262,8 @@ declare const listConversationsResponseSchema: ZodObject<{
|
|
|
262
262
|
visitorId: ZodString;
|
|
263
263
|
websiteId: ZodString;
|
|
264
264
|
status: ZodDefault<ZodEnum<{
|
|
265
|
-
open: "open";
|
|
266
265
|
resolved: "resolved";
|
|
266
|
+
open: "open";
|
|
267
267
|
spam: "spam";
|
|
268
268
|
}>>;
|
|
269
269
|
deletedAt: ZodDefault<ZodNullable<ZodString>>;
|
|
@@ -288,7 +288,6 @@ declare const listConversationsResponseSchema: ZodObject<{
|
|
|
288
288
|
}, $strip>, ZodObject<{
|
|
289
289
|
type: ZodLiteral<"event">;
|
|
290
290
|
eventType: ZodEnum<{
|
|
291
|
-
resolved: "resolved";
|
|
292
291
|
assigned: "assigned";
|
|
293
292
|
unassigned: "unassigned";
|
|
294
293
|
participant_requested: "participant_requested";
|
|
@@ -298,6 +297,7 @@ declare const listConversationsResponseSchema: ZodObject<{
|
|
|
298
297
|
priority_changed: "priority_changed";
|
|
299
298
|
tag_added: "tag_added";
|
|
300
299
|
tag_removed: "tag_removed";
|
|
300
|
+
resolved: "resolved";
|
|
301
301
|
reopened: "reopened";
|
|
302
302
|
visitor_blocked: "visitor_blocked";
|
|
303
303
|
visitor_unblocked: "visitor_unblocked";
|
|
@@ -359,8 +359,8 @@ declare const getConversationResponseSchema: ZodObject<{
|
|
|
359
359
|
visitorId: ZodString;
|
|
360
360
|
websiteId: ZodString;
|
|
361
361
|
status: ZodDefault<ZodEnum<{
|
|
362
|
-
open: "open";
|
|
363
362
|
resolved: "resolved";
|
|
363
|
+
open: "open";
|
|
364
364
|
spam: "spam";
|
|
365
365
|
}>>;
|
|
366
366
|
deletedAt: ZodDefault<ZodNullable<ZodString>>;
|
|
@@ -385,7 +385,6 @@ declare const getConversationResponseSchema: ZodObject<{
|
|
|
385
385
|
}, $strip>, ZodObject<{
|
|
386
386
|
type: ZodLiteral<"event">;
|
|
387
387
|
eventType: ZodEnum<{
|
|
388
|
-
resolved: "resolved";
|
|
389
388
|
assigned: "assigned";
|
|
390
389
|
unassigned: "unassigned";
|
|
391
390
|
participant_requested: "participant_requested";
|
|
@@ -395,6 +394,7 @@ declare const getConversationResponseSchema: ZodObject<{
|
|
|
395
394
|
priority_changed: "priority_changed";
|
|
396
395
|
tag_added: "tag_added";
|
|
397
396
|
tag_removed: "tag_removed";
|
|
397
|
+
resolved: "resolved";
|
|
398
398
|
reopened: "reopened";
|
|
399
399
|
visitor_blocked: "visitor_blocked";
|
|
400
400
|
visitor_unblocked: "visitor_unblocked";
|
package/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { DefaultRoutes, NavigationState, RouteRegistry, SUPPORT_PAGES, SupportCo
|
|
|
10
10
|
import { ConversationTypingState, TypingActorType, TypingEntry, TypingState, TypingStore, TypingStoreDependencies, applyConversationTypingEvent, clearTypingFromTimelineItem, clearTypingState, createTypingStore, getConversationTyping, setTypingState } from "./store/typing-store.js";
|
|
11
11
|
import { generateConversationId, generateMessageId } from "./utils.js";
|
|
12
12
|
import { VisitorData, collectVisitorData } from "./visitor-data.js";
|
|
13
|
+
import { generateVisitorName, getVisitorNameWithFallback } from "./visitor-name.js";
|
|
13
14
|
import { clearAllVisitorIds, clearVisitorId, getVisitorId, setVisitorId } from "./visitor-tracker.js";
|
|
14
15
|
import { CossistantConfig, CossistantError } from "@cossistant/types";
|
|
15
|
-
export { type ConversationPagination, type ConversationSeenState, type ConversationTimelineItemsState, type ConversationTypingState, type ConversationsState, type ConversationsStore, CossistantAPIError, CossistantClient, type CossistantConfig, type CossistantError, CossistantRestClient, type DefaultRoutes, type NavigationState, type RouteRegistry, type SUPPORT_PAGES, type SeenActorType, type SeenEntry, type SeenState, type SeenStore, type SupportConfig, type SupportNavigation, type SupportPage, type SupportStore, type SupportStoreActions, type SupportStoreOptions, type SupportStoreState, type SupportStoreStorage, type TimelineItemsState, type TimelineItemsStore, type TypingActorType, type TypingEntry, type TypingState, type TypingStore, type TypingStoreDependencies, type VisitorData, type WebsiteError, type WebsiteState, type WebsiteStatus, type WebsiteStore, applyConversationSeenEvent, applyConversationTypingEvent, clearAllVisitorIds, clearTypingFromTimelineItem, clearTypingState, clearVisitorId, collectVisitorData, createConversationsStore, createSeenStore, createSupportStore, createTimelineItemsStore, createTypingStore, createWebsiteStore, CossistantClient as default, generateConversationId, generateMessageId, getConversationById, getConversationPagination, getConversationTimelineItems, getConversationTyping, getConversations, getVisitorId, getWebsiteState, hydrateConversationSeen, normalizeLocale, setTypingState, setVisitorId, upsertConversationSeen };
|
|
16
|
+
export { type ConversationPagination, type ConversationSeenState, type ConversationTimelineItemsState, type ConversationTypingState, type ConversationsState, type ConversationsStore, CossistantAPIError, CossistantClient, type CossistantConfig, type CossistantError, CossistantRestClient, type DefaultRoutes, type NavigationState, type RouteRegistry, type SUPPORT_PAGES, type SeenActorType, type SeenEntry, type SeenState, type SeenStore, type SupportConfig, type SupportNavigation, type SupportPage, type SupportStore, type SupportStoreActions, type SupportStoreOptions, type SupportStoreState, type SupportStoreStorage, type TimelineItemsState, type TimelineItemsStore, type TypingActorType, type TypingEntry, type TypingState, type TypingStore, type TypingStoreDependencies, type VisitorData, type WebsiteError, type WebsiteState, type WebsiteStatus, type WebsiteStore, applyConversationSeenEvent, applyConversationTypingEvent, clearAllVisitorIds, clearTypingFromTimelineItem, clearTypingState, clearVisitorId, collectVisitorData, createConversationsStore, createSeenStore, createSupportStore, createTimelineItemsStore, createTypingStore, createWebsiteStore, CossistantClient as default, generateConversationId, generateMessageId, generateVisitorName, getConversationById, getConversationPagination, getConversationTimelineItems, getConversationTyping, getConversations, getVisitorId, getVisitorNameWithFallback, getWebsiteState, hydrateConversationSeen, normalizeLocale, setTypingState, setVisitorId, upsertConversationSeen };
|
package/index.js
CHANGED
|
@@ -11,5 +11,6 @@ import { normalizeLocale } from "./locale-utils.js";
|
|
|
11
11
|
import { applyConversationSeenEvent, createSeenStore, hydrateConversationSeen, upsertConversationSeen } from "./store/seen-store.js";
|
|
12
12
|
import { createSupportStore } from "./store/support-store.js";
|
|
13
13
|
import { applyConversationTypingEvent, clearTypingFromTimelineItem, clearTypingState, createTypingStore, getConversationTyping, setTypingState } from "./store/typing-store.js";
|
|
14
|
+
import { generateVisitorName, getVisitorNameWithFallback } from "./visitor-name.js";
|
|
14
15
|
|
|
15
|
-
export { CossistantAPIError, CossistantClient, CossistantRestClient, applyConversationSeenEvent, applyConversationTypingEvent, clearAllVisitorIds, clearTypingFromTimelineItem, clearTypingState, clearVisitorId, collectVisitorData, createConversationsStore, createSeenStore, createSupportStore, createTimelineItemsStore, createTypingStore, createWebsiteStore, CossistantClient as default, generateConversationId, generateMessageId, getConversationById, getConversationPagination, getConversationTimelineItems, getConversationTyping, getConversations, getVisitorId, getWebsiteState, hydrateConversationSeen, normalizeLocale, setTypingState, setVisitorId, upsertConversationSeen };
|
|
16
|
+
export { CossistantAPIError, CossistantClient, CossistantRestClient, applyConversationSeenEvent, applyConversationTypingEvent, clearAllVisitorIds, clearTypingFromTimelineItem, clearTypingState, clearVisitorId, collectVisitorData, createConversationsStore, createSeenStore, createSupportStore, createTimelineItemsStore, createTypingStore, createWebsiteStore, CossistantClient as default, generateConversationId, generateMessageId, generateVisitorName, getConversationById, getConversationPagination, getConversationTimelineItems, getConversationTyping, getConversations, getVisitorId, getVisitorNameWithFallback, getWebsiteState, hydrateConversationSeen, normalizeLocale, setTypingState, setVisitorId, upsertConversationSeen };
|
package/package.json
CHANGED
package/realtime-events.d.ts
CHANGED
|
@@ -111,8 +111,8 @@ declare const realtimeSchema: {
|
|
|
111
111
|
visitorId: ZodString;
|
|
112
112
|
websiteId: ZodString;
|
|
113
113
|
status: ZodDefault<ZodEnum<{
|
|
114
|
-
open: "open";
|
|
115
114
|
resolved: "resolved";
|
|
115
|
+
open: "open";
|
|
116
116
|
spam: "spam";
|
|
117
117
|
}>>;
|
|
118
118
|
deletedAt: ZodDefault<ZodNullable<ZodString>>;
|
|
@@ -137,7 +137,6 @@ declare const realtimeSchema: {
|
|
|
137
137
|
}, $strip>, ZodObject<{
|
|
138
138
|
type: ZodLiteral<"event">;
|
|
139
139
|
eventType: ZodEnum<{
|
|
140
|
-
resolved: "resolved";
|
|
141
140
|
assigned: "assigned";
|
|
142
141
|
unassigned: "unassigned";
|
|
143
142
|
participant_requested: "participant_requested";
|
|
@@ -147,6 +146,7 @@ declare const realtimeSchema: {
|
|
|
147
146
|
priority_changed: "priority_changed";
|
|
148
147
|
tag_added: "tag_added";
|
|
149
148
|
tag_removed: "tag_removed";
|
|
149
|
+
resolved: "resolved";
|
|
150
150
|
reopened: "reopened";
|
|
151
151
|
visitor_blocked: "visitor_blocked";
|
|
152
152
|
visitor_unblocked: "visitor_unblocked";
|
|
@@ -189,8 +189,8 @@ declare const realtimeSchema: {
|
|
|
189
189
|
header: ZodObject<{
|
|
190
190
|
id: ZodString;
|
|
191
191
|
status: ZodEnum<{
|
|
192
|
-
open: "open";
|
|
193
192
|
resolved: "resolved";
|
|
193
|
+
open: "open";
|
|
194
194
|
spam: "spam";
|
|
195
195
|
}>;
|
|
196
196
|
priority: ZodEnum<{
|
|
@@ -250,7 +250,6 @@ declare const realtimeSchema: {
|
|
|
250
250
|
}, $strip>, ZodObject<{
|
|
251
251
|
type: ZodLiteral<"event">;
|
|
252
252
|
eventType: ZodEnum<{
|
|
253
|
-
resolved: "resolved";
|
|
254
253
|
assigned: "assigned";
|
|
255
254
|
unassigned: "unassigned";
|
|
256
255
|
participant_requested: "participant_requested";
|
|
@@ -260,6 +259,7 @@ declare const realtimeSchema: {
|
|
|
260
259
|
priority_changed: "priority_changed";
|
|
261
260
|
tag_added: "tag_added";
|
|
262
261
|
tag_removed: "tag_removed";
|
|
262
|
+
resolved: "resolved";
|
|
263
263
|
reopened: "reopened";
|
|
264
264
|
visitor_blocked: "visitor_blocked";
|
|
265
265
|
visitor_unblocked: "visitor_unblocked";
|
|
@@ -319,7 +319,6 @@ declare const realtimeSchema: {
|
|
|
319
319
|
}, $strip>, ZodObject<{
|
|
320
320
|
type: ZodLiteral<"event">;
|
|
321
321
|
eventType: ZodEnum<{
|
|
322
|
-
resolved: "resolved";
|
|
323
322
|
assigned: "assigned";
|
|
324
323
|
unassigned: "unassigned";
|
|
325
324
|
participant_requested: "participant_requested";
|
|
@@ -329,6 +328,7 @@ declare const realtimeSchema: {
|
|
|
329
328
|
priority_changed: "priority_changed";
|
|
330
329
|
tag_added: "tag_added";
|
|
331
330
|
tag_removed: "tag_removed";
|
|
331
|
+
resolved: "resolved";
|
|
332
332
|
reopened: "reopened";
|
|
333
333
|
visitor_blocked: "visitor_blocked";
|
|
334
334
|
visitor_unblocked: "visitor_unblocked";
|
package/registries.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registries.d.ts","names":["core","$ZodType","$output","$input","$replace","Meta","S","output","input","M","P","K","R","MetadataType","$ZodRegistry","Schema","WeakMap","Map","JSONSchemaMeta","GlobalMeta","registry","T","globalRegistry"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/registries.d.cts"],"sourcesContent":["import type * as core from \"./core.cjs\";\nimport type { $ZodType } from \"./schemas.cjs\";\nexport declare const $output: unique symbol;\nexport type $output = typeof $output;\nexport declare const $input: unique symbol;\nexport type $input = typeof $input;\nexport type $replace<Meta, S extends $ZodType> = Meta extends $output ? core.output<S> : Meta extends $input ? core.input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends (...args: infer P) => infer R ? (...args: {\n [K in keyof P]: $replace<P[K], S>;\n}) => $replace<R, S> : Meta extends object ? {\n [K in keyof Meta]: $replace<Meta[K], S>;\n} : Meta;\ntype MetadataType = object | undefined;\nexport declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {\n _meta: Meta;\n _schema: Schema;\n _map: WeakMap<Schema, $replace<Meta, Schema>>;\n _idmap: Map<string, Schema>;\n add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;\n clear(): this;\n remove(schema: Schema): this;\n get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;\n has(schema: Schema): boolean;\n}\nexport interface JSONSchemaMeta {\n id?: string | undefined;\n title?: string | undefined;\n description?: string | undefined;\n deprecated?: boolean | undefined;\n [k: string]: unknown;\n}\nexport interface GlobalMeta extends JSONSchemaMeta {\n}\nexport declare function registry<T extends MetadataType = MetadataType, S extends $ZodType = $ZodType>(): $ZodRegistry<T, S>;\nexport declare const globalRegistry: $ZodRegistry<GlobalMeta>;\nexport {};\n"],"x_google_ignoreList":[0],"mappings":";;;;cAEqBE;KACTA,OAAAA,UAAiBA;AADRA,cAEAC,MAFsB,EAAA,OAAA,MAAA;AAC/BD,KAEAC,MAAAA,GAFO,OAESA,MAFCD;AACRC,KAETC,QAF8B,CAAA,IAAA,EAAA,UAELH,QAFK,CAAA,GAEOI,IAFP,SAEoBH,OAFpB,GAE8BF,MAF9B,CAE0CM,CAF1C,CAAA,GAE+CD,IAF/C,SAE4DF,MAF5D,GAEqEH,KAFrE,CAEgFM,CAFhF,CAAA,GAEqFD,IAFrF,SAAA,CAAA,KAAA,EAAA,CAAA,EAAA,GAEgHD,QAFhH,CAEyHK,CAFzH,EAE4HH,CAF5H,CAAA,EAAA,GAEmID,IAFnI,UAAA,CAAA,GAAA,IAAA,EAAA,KAAA,EAAA,EAAA,GAAA,KAAA,EAAA,IAAA,CAAA,GAAA,IAAA,EAAA,QAC9BF,MAEIO,CAFE,GAEEN,QAFQD,CAECO,CAFDP,CAEGQ,CAFHR,
|
|
1
|
+
{"version":3,"file":"registries.d.ts","names":["core","$ZodType","$output","$input","$replace","Meta","S","output","input","M","P","K","R","MetadataType","$ZodRegistry","Schema","WeakMap","Map","JSONSchemaMeta","GlobalMeta","registry","T","globalRegistry"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/registries.d.cts"],"sourcesContent":["import type * as core from \"./core.cjs\";\nimport type { $ZodType } from \"./schemas.cjs\";\nexport declare const $output: unique symbol;\nexport type $output = typeof $output;\nexport declare const $input: unique symbol;\nexport type $input = typeof $input;\nexport type $replace<Meta, S extends $ZodType> = Meta extends $output ? core.output<S> : Meta extends $input ? core.input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends (...args: infer P) => infer R ? (...args: {\n [K in keyof P]: $replace<P[K], S>;\n}) => $replace<R, S> : Meta extends object ? {\n [K in keyof Meta]: $replace<Meta[K], S>;\n} : Meta;\ntype MetadataType = object | undefined;\nexport declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {\n _meta: Meta;\n _schema: Schema;\n _map: WeakMap<Schema, $replace<Meta, Schema>>;\n _idmap: Map<string, Schema>;\n add<S extends Schema>(schema: S, ..._meta: undefined extends Meta ? [$replace<Meta, S>?] : [$replace<Meta, S>]): this;\n clear(): this;\n remove(schema: Schema): this;\n get<S extends Schema>(schema: S): $replace<Meta, S> | undefined;\n has(schema: Schema): boolean;\n}\nexport interface JSONSchemaMeta {\n id?: string | undefined;\n title?: string | undefined;\n description?: string | undefined;\n deprecated?: boolean | undefined;\n [k: string]: unknown;\n}\nexport interface GlobalMeta extends JSONSchemaMeta {\n}\nexport declare function registry<T extends MetadataType = MetadataType, S extends $ZodType = $ZodType>(): $ZodRegistry<T, S>;\nexport declare const globalRegistry: $ZodRegistry<GlobalMeta>;\nexport {};\n"],"x_google_ignoreList":[0],"mappings":";;;;cAEqBE;KACTA,OAAAA,UAAiBA;AADRA,cAEAC,MAFsB,EAAA,OAAA,MAAA;AAC/BD,KAEAC,MAAAA,GAFO,OAESA,MAFCD;AACRC,KAETC,QAF8B,CAAA,IAAA,EAAA,UAELH,QAFK,CAAA,GAEOI,IAFP,SAEoBH,OAFpB,GAE8BF,MAF9B,CAE0CM,CAF1C,CAAA,GAE+CD,IAF/C,SAE4DF,MAF5D,GAEqEH,KAFrE,CAEgFM,CAFhF,CAAA,GAEqFD,IAFrF,SAAA,CAAA,KAAA,EAAA,CAAA,EAAA,GAEgHD,QAFhH,CAEyHK,CAFzH,EAE4HH,CAF5H,CAAA,EAAA,GAEmID,IAFnI,UAAA,CAAA,GAAA,IAAA,EAAA,KAAA,EAAA,EAAA,GAAA,KAAA,EAAA,IAAA,CAAA,GAAA,IAAA,EAAA,QAC9BF,MAEIO,CAFE,GAEEN,QAFQD,CAECO,CAFDP,CAEGQ,CAFHR,CAAM,EAECG,CAFD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Ae1IW,MAf0IX,CAAAA,EAAAA,OAAAA;;AAC1IM,UAgBCQ,cAAAA,CAhBDR;EAAaA,EAAAA,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAEC,KAAAA,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAIL,WAAAA,CAAAA,EAAAA,MAAAA,GAAAA,SAAAA;EAAfF,UAAAA,CAAAA,EAAAA,OAAAA,GAAAA,SAAAA;EACLQ,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;AAATR,UAsBWe,UAAAA,SAAmBD,cAtB9Bd,CAAAA"}
|
package/schemas3.d.ts
CHANGED
|
@@ -12,8 +12,8 @@ declare const conversationSchema: ZodObject<{
|
|
|
12
12
|
visitorId: ZodString;
|
|
13
13
|
websiteId: ZodString;
|
|
14
14
|
status: ZodDefault<ZodEnum<{
|
|
15
|
-
open: "open";
|
|
16
15
|
resolved: "resolved";
|
|
16
|
+
open: "open";
|
|
17
17
|
spam: "spam";
|
|
18
18
|
}>>;
|
|
19
19
|
deletedAt: ZodDefault<ZodNullable<ZodString>>;
|
|
@@ -38,7 +38,6 @@ declare const conversationSchema: ZodObject<{
|
|
|
38
38
|
}, $strip>, ZodObject<{
|
|
39
39
|
type: ZodLiteral<"event">;
|
|
40
40
|
eventType: ZodEnum<{
|
|
41
|
-
resolved: "resolved";
|
|
42
41
|
assigned: "assigned";
|
|
43
42
|
unassigned: "unassigned";
|
|
44
43
|
participant_requested: "participant_requested";
|
|
@@ -48,6 +47,7 @@ declare const conversationSchema: ZodObject<{
|
|
|
48
47
|
priority_changed: "priority_changed";
|
|
49
48
|
tag_added: "tag_added";
|
|
50
49
|
tag_removed: "tag_removed";
|
|
50
|
+
resolved: "resolved";
|
|
51
51
|
reopened: "reopened";
|
|
52
52
|
visitor_blocked: "visitor_blocked";
|
|
53
53
|
visitor_unblocked: "visitor_unblocked";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-store.d.ts","names":[],"sources":["../../src/store/create-store.ts"],"sourcesContent":[],"mappings":";KAAY,gCAAgC;AAAhC,KAEA,gBAAA,GAFa,GAAA,
|
|
1
|
+
{"version":3,"file":"create-store.d.ts","names":[],"sources":["../../src/store/create-store.ts"],"sourcesContent":[],"mappings":";KAAY,gCAAgC;AAAhC,KAEA,gBAAA,GAFa,GAAA,GAAmB,IAAA;AAEhC,KAEA,YAFgB,CAAA,MAAA,CAAA,GAAA,CAAA,KAAA,EAEe,MAFf,EAAA,GAE0B,MAF1B;AAEhB,KAEA,KAFA,CAAA,MAAY,CAAA,GAAA;EAEZ,QAAK,EAAA,EACJ,MADI;EACJ,QAAA,CAAA,OAAA,EACM,YADN,CACmB,MADnB,CAAA,CAAA,EAAA,IAAA;EACmB,SAAA,CAAA,QAAA,EACX,aADW,CACG,MADH,CAAA,CAAA,EACa,gBADb;EAAb,KAAA,CAAA,EAAA,EAAA,GAAA,GAAA,IAAA,CAAA,EAAA,IAAA;CACgB;AAAd,iBAIL,WAJK,CAAA,MAAA,CAAA,CAAA,YAAA,EAI6B,MAJ7B,CAAA,EAIsC,KAJtC,CAI4C,MAJ5C,CAAA"}
|
package/timeline-item.d.ts
CHANGED
|
@@ -27,7 +27,6 @@ declare const timelineItemSchema: ZodObject<{
|
|
|
27
27
|
}, $strip>, ZodObject<{
|
|
28
28
|
type: ZodLiteral<"event">;
|
|
29
29
|
eventType: ZodEnum<{
|
|
30
|
-
resolved: "resolved";
|
|
31
30
|
assigned: "assigned";
|
|
32
31
|
unassigned: "unassigned";
|
|
33
32
|
participant_requested: "participant_requested";
|
|
@@ -37,6 +36,7 @@ declare const timelineItemSchema: ZodObject<{
|
|
|
37
36
|
priority_changed: "priority_changed";
|
|
38
37
|
tag_added: "tag_added";
|
|
39
38
|
tag_removed: "tag_removed";
|
|
39
|
+
resolved: "resolved";
|
|
40
40
|
reopened: "reopened";
|
|
41
41
|
visitor_blocked: "visitor_blocked";
|
|
42
42
|
visitor_unblocked: "visitor_unblocked";
|
|
@@ -104,7 +104,6 @@ declare const getConversationTimelineItemsResponseSchema: ZodObject<{
|
|
|
104
104
|
}, $strip>, ZodObject<{
|
|
105
105
|
type: ZodLiteral<"event">;
|
|
106
106
|
eventType: ZodEnum<{
|
|
107
|
-
resolved: "resolved";
|
|
108
107
|
assigned: "assigned";
|
|
109
108
|
unassigned: "unassigned";
|
|
110
109
|
participant_requested: "participant_requested";
|
|
@@ -114,6 +113,7 @@ declare const getConversationTimelineItemsResponseSchema: ZodObject<{
|
|
|
114
113
|
priority_changed: "priority_changed";
|
|
115
114
|
tag_added: "tag_added";
|
|
116
115
|
tag_removed: "tag_removed";
|
|
116
|
+
resolved: "resolved";
|
|
117
117
|
reopened: "reopened";
|
|
118
118
|
visitor_blocked: "visitor_blocked";
|
|
119
119
|
visitor_unblocked: "visitor_unblocked";
|
|
@@ -171,7 +171,6 @@ declare const sendTimelineItemRequestSchema: ZodObject<{
|
|
|
171
171
|
}, $strip>, ZodObject<{
|
|
172
172
|
type: ZodLiteral<"event">;
|
|
173
173
|
eventType: ZodEnum<{
|
|
174
|
-
resolved: "resolved";
|
|
175
174
|
assigned: "assigned";
|
|
176
175
|
unassigned: "unassigned";
|
|
177
176
|
participant_requested: "participant_requested";
|
|
@@ -181,6 +180,7 @@ declare const sendTimelineItemRequestSchema: ZodObject<{
|
|
|
181
180
|
priority_changed: "priority_changed";
|
|
182
181
|
tag_added: "tag_added";
|
|
183
182
|
tag_removed: "tag_removed";
|
|
183
|
+
resolved: "resolved";
|
|
184
184
|
reopened: "reopened";
|
|
185
185
|
visitor_blocked: "visitor_blocked";
|
|
186
186
|
visitor_unblocked: "visitor_unblocked";
|
|
@@ -247,7 +247,6 @@ declare const sendTimelineItemResponseSchema: ZodObject<{
|
|
|
247
247
|
}, $strip>, ZodObject<{
|
|
248
248
|
type: ZodLiteral<"event">;
|
|
249
249
|
eventType: ZodEnum<{
|
|
250
|
-
resolved: "resolved";
|
|
251
250
|
assigned: "assigned";
|
|
252
251
|
unassigned: "unassigned";
|
|
253
252
|
participant_requested: "participant_requested";
|
|
@@ -257,6 +256,7 @@ declare const sendTimelineItemResponseSchema: ZodObject<{
|
|
|
257
256
|
priority_changed: "priority_changed";
|
|
258
257
|
tag_added: "tag_added";
|
|
259
258
|
tag_removed: "tag_removed";
|
|
259
|
+
resolved: "resolved";
|
|
260
260
|
reopened: "reopened";
|
|
261
261
|
visitor_blocked: "visitor_blocked";
|
|
262
262
|
visitor_unblocked: "visitor_unblocked";
|
package/util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","names":["checks","$ZodConfig","errors","schemas","JSONType","JWTAlgorithm","HashAlgorithm","HashEncoding","HashFormat","IPVersion","MimeTypes","ParsedTypes","AssertEqual","V","T","U","AssertNotEqual","AssertExtends","IsAny","Omit","K","Exclude","Pick","OmitKeys","MakePartial","InexactPartial","MakeRequired","Required","Exactly","X","Record","NoUndefined","Whatever","LoosePartial","Mask","Keys","PropertyKey","Writeable","P","EmptyObject","BuiltIn","Symbol","toStringTag","Date","Error","Generator","Promise","RegExp","MakeReadonly","Map","ReadonlyMap","Set","ReadonlySet","Head","Tail","Array","ReadonlyArray","Readonly","SomeObject","Identity","Flatten","k","Mapped","Prettify","NoNeverKeys","NoNever","Extend","A","B","TupleItems","SomeType","AnyFunc","IsProp","MaybeAsync","KeyOf","OmitIndexSignature","ExtractIndexSignature","SchemaClass","EnumValue","EnumLike","ToEnum","KeysEnum","KeysArray","Literal","LiteralArray","Primitive","PrimitiveArray","HasSize","HasLength","Numeric","SafeParseResult","SafeParseSuccess","SafeParseError","$ZodError","PropValues","PrimitiveSet","assertEqual","assertNotEqual","assertIs","assertNever","assert","getEnumValues","joinValues","jsonStringifyReplacer","cached","nullish","cleanRegex","floatSafeRemainder","defineLazy","objectClone","assignProp","mergeDefs","cloneDef","$ZodType","getElementAtPath","promiseAllObject","Awaited","randomString","esc","captureStackTrace","Function","isObject","allowsEval","isPlainObject","shallowClone","numKeys","getParsedType","propertyKeyTypes","primitiveTypes","escapeRegex","clone","EmptyToNever","Normalize","normalizeParams","createTransparentProxy","stringifyPrimitive","optionalKeys","$ZodShape","CleanKey","ToCleanMap","$ZodLooseShape","FromCleanMap","NUMBER_FORMAT_RANGES","$ZodNumberFormats","BIGINT_FORMAT_RANGES","$ZodBigIntFormats","pick","$ZodObject","omit","extend","safeExtend","merge","partial","$ZodOptional","required","$ZodNonOptional","Constructor","Def","aborted","ParsePayload","prefixIssues","$ZodRawIssue","unwrapMessage","finalizeIssue","ParseContextInternal","$ZodIssue","getSizableOrigin","getLengthableOrigin","issue","cleanEnum","base64ToUint8Array","Uint8Array","InstanceType","uint8ArrayToBase64","base64urlToUint8Array","uint8ArrayToBase64url","hexToUint8Array","uint8ArrayToHex","Class"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/util.d.cts"],"sourcesContent":["import type * as checks from \"./checks.cjs\";\nimport type { $ZodConfig } from \"./core.cjs\";\nimport type * as errors from \"./errors.cjs\";\nimport type * as schemas from \"./schemas.cjs\";\nexport type JSONType = string | number | boolean | null | JSONType[] | {\n [key: string]: JSONType;\n};\nexport type JWTAlgorithm = \"HS256\" | \"HS384\" | \"HS512\" | \"RS256\" | \"RS384\" | \"RS512\" | \"ES256\" | \"ES384\" | \"ES512\" | \"PS256\" | \"PS384\" | \"PS512\" | \"EdDSA\" | (string & {});\nexport type HashAlgorithm = \"md5\" | \"sha1\" | \"sha256\" | \"sha384\" | \"sha512\";\nexport type HashEncoding = \"hex\" | \"base64\" | \"base64url\";\nexport type HashFormat = `${HashAlgorithm}_${HashEncoding}`;\nexport type IPVersion = \"v4\" | \"v6\";\nexport type MimeTypes = \"application/json\" | \"application/xml\" | \"application/x-www-form-urlencoded\" | \"application/javascript\" | \"application/pdf\" | \"application/zip\" | \"application/vnd.ms-excel\" | \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" | \"application/msword\" | \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" | \"application/vnd.ms-powerpoint\" | \"application/vnd.openxmlformats-officedocument.presentationml.presentation\" | \"application/octet-stream\" | \"application/graphql\" | \"text/html\" | \"text/plain\" | \"text/css\" | \"text/javascript\" | \"text/csv\" | \"image/png\" | \"image/jpeg\" | \"image/gif\" | \"image/svg+xml\" | \"image/webp\" | \"audio/mpeg\" | \"audio/ogg\" | \"audio/wav\" | \"audio/webm\" | \"video/mp4\" | \"video/webm\" | \"video/ogg\" | \"font/woff\" | \"font/woff2\" | \"font/ttf\" | \"font/otf\" | \"multipart/form-data\" | (string & {});\nexport type ParsedTypes = \"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"file\" | \"date\" | \"array\" | \"map\" | \"set\" | \"nan\" | \"null\" | \"promise\";\nexport type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;\nexport type AssertNotEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? false : true;\nexport type AssertExtends<T, U> = T extends U ? T : never;\nexport type IsAny<T> = 0 extends 1 & T ? true : false;\nexport type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\nexport type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;\nexport type MakePartial<T, K extends keyof T> = Omit<T, K> & InexactPartial<Pick<T, K>>;\nexport type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;\nexport type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;\nexport type NoUndefined<T> = T extends undefined ? never : T;\nexport type Whatever = {} | undefined | null;\nexport type LoosePartial<T extends object> = InexactPartial<T> & {\n [k: string]: unknown;\n};\nexport type Mask<Keys extends PropertyKey> = {\n [K in Keys]?: true;\n};\nexport type Writeable<T> = {\n -readonly [P in keyof T]: T[P];\n} & {};\nexport type InexactPartial<T> = {\n [P in keyof T]?: T[P] | undefined;\n};\nexport type EmptyObject = Record<string, never>;\nexport type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {\n readonly [Symbol.toStringTag]: string;\n} | Date | Error | Generator | Promise<unknown> | RegExp;\nexport type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;\nexport type SomeObject = Record<PropertyKey, any>;\nexport type Identity<T> = T;\nexport type Flatten<T> = Identity<{\n [k in keyof T]: T[k];\n}>;\nexport type Mapped<T> = {\n [k in keyof T]: T[k];\n};\nexport type Prettify<T> = {\n [K in keyof T]: T[K];\n} & {};\nexport type NoNeverKeys<T> = {\n [k in keyof T]: [T[k]] extends [never] ? never : k;\n}[keyof T];\nexport type NoNever<T> = Identity<{\n [k in NoNeverKeys<T>]: k extends keyof T ? T[k] : never;\n}>;\nexport type Extend<A extends SomeObject, B extends SomeObject> = Flatten<keyof A & keyof B extends never ? A & B : {\n [K in keyof A as K extends keyof B ? never : K]: A[K];\n} & {\n [K in keyof B]: B[K];\n}>;\nexport type TupleItems = ReadonlyArray<schemas.SomeType>;\nexport type AnyFunc = (...args: any[]) => any;\nexport type IsProp<T, K extends keyof T> = T[K] extends AnyFunc ? never : K;\nexport type MaybeAsync<T> = T | Promise<T>;\nexport type KeyOf<T> = keyof OmitIndexSignature<T>;\nexport type OmitIndexSignature<T> = {\n [K in keyof T as string extends K ? never : K extends string ? K : never]: T[K];\n};\nexport type ExtractIndexSignature<T> = {\n [K in keyof T as string extends K ? K : K extends string ? never : K]: T[K];\n};\nexport type Keys<T extends object> = keyof OmitIndexSignature<T>;\nexport type SchemaClass<T extends schemas.SomeType> = {\n new (def: T[\"_zod\"][\"def\"]): T;\n};\nexport type EnumValue = string | number;\nexport type EnumLike = Readonly<Record<string, EnumValue>>;\nexport type ToEnum<T extends EnumValue> = Flatten<{\n [k in T]: k;\n}>;\nexport type KeysEnum<T extends object> = ToEnum<Exclude<keyof T, symbol>>;\nexport type KeysArray<T extends object> = Flatten<(keyof T & string)[]>;\nexport type Literal = string | number | bigint | boolean | null | undefined;\nexport type LiteralArray = Array<Literal>;\nexport type Primitive = string | number | symbol | bigint | boolean | null | undefined;\nexport type PrimitiveArray = Array<Primitive>;\nexport type HasSize = {\n size: number;\n};\nexport type HasLength = {\n length: number;\n};\nexport type Numeric = number | bigint | Date;\nexport type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseError<T>;\nexport type SafeParseSuccess<T> = {\n success: true;\n data: T;\n error?: never;\n};\nexport type SafeParseError<T> = {\n success: false;\n data?: never;\n error: errors.$ZodError<T>;\n};\nexport type PropValues = Record<string, Set<Primitive>>;\nexport type PrimitiveSet = Set<Primitive>;\nexport declare function assertEqual<A, B>(val: AssertEqual<A, B>): AssertEqual<A, B>;\nexport declare function assertNotEqual<A, B>(val: AssertNotEqual<A, B>): AssertNotEqual<A, B>;\nexport declare function assertIs<T>(_arg: T): void;\nexport declare function assertNever(_x: never): never;\nexport declare function assert<T>(_: any): asserts _ is T;\nexport declare function getEnumValues(entries: EnumLike): EnumValue[];\nexport declare function joinValues<T extends Primitive[]>(array: T, separator?: string): string;\nexport declare function jsonStringifyReplacer(_: string, value: any): any;\nexport declare function cached<T>(getter: () => T): {\n value: T;\n};\nexport declare function nullish(input: any): boolean;\nexport declare function cleanRegex(source: string): string;\nexport declare function floatSafeRemainder(val: number, step: number): number;\nexport declare function defineLazy<T, K extends keyof T>(object: T, key: K, getter: () => T[K]): void;\nexport declare function objectClone(obj: object): any;\nexport declare function assignProp<T extends object, K extends PropertyKey>(target: T, prop: K, value: K extends keyof T ? T[K] : any): void;\nexport declare function mergeDefs(...defs: Record<string, any>[]): any;\nexport declare function cloneDef(schema: schemas.$ZodType): any;\nexport declare function getElementAtPath(obj: any, path: (string | number)[] | null | undefined): any;\nexport declare function promiseAllObject<T extends object>(promisesObj: T): Promise<{\n [k in keyof T]: Awaited<T[k]>;\n}>;\nexport declare function randomString(length?: number): string;\nexport declare function esc(str: string): string;\nexport declare const captureStackTrace: (targetObject: object, constructorOpt?: Function) => void;\nexport declare function isObject(data: any): data is Record<PropertyKey, unknown>;\nexport declare const allowsEval: {\n value: boolean;\n};\nexport declare function isPlainObject(o: any): o is Record<PropertyKey, unknown>;\nexport declare function shallowClone(o: any): any;\nexport declare function numKeys(data: any): number;\nexport declare const getParsedType: (data: any) => ParsedTypes;\nexport declare const propertyKeyTypes: Set<string>;\nexport declare const primitiveTypes: Set<string>;\nexport declare function escapeRegex(str: string): string;\nexport declare function clone<T extends schemas.$ZodType>(inst: T, def?: T[\"_zod\"][\"def\"], params?: {\n parent: boolean;\n}): T;\nexport type EmptyToNever<T> = keyof T extends never ? never : T;\nexport type Normalize<T> = T extends undefined ? never : T extends Record<any, any> ? Flatten<{\n [k in keyof Omit<T, \"error\" | \"message\">]: T[k];\n} & (\"error\" extends keyof T ? {\n error?: Exclude<T[\"error\"], string>;\n} : unknown)> : never;\nexport declare function normalizeParams<T>(_params: T): Normalize<T>;\nexport declare function createTransparentProxy<T extends object>(getter: () => T): T;\nexport declare function stringifyPrimitive(value: any): string;\nexport declare function optionalKeys(shape: schemas.$ZodShape): string[];\nexport type CleanKey<T extends PropertyKey> = T extends `?${infer K}` ? K : T extends `${infer K}?` ? K : T;\nexport type ToCleanMap<T extends schemas.$ZodLooseShape> = {\n [k in keyof T]: k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k;\n};\nexport type FromCleanMap<T extends schemas.$ZodLooseShape> = {\n [k in keyof T as k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k]: k;\n};\nexport declare const NUMBER_FORMAT_RANGES: Record<checks.$ZodNumberFormats, [number, number]>;\nexport declare const BIGINT_FORMAT_RANGES: Record<checks.$ZodBigIntFormats, [bigint, bigint]>;\nexport declare function pick(schema: schemas.$ZodObject, mask: Record<string, unknown>): any;\nexport declare function omit(schema: schemas.$ZodObject, mask: object): any;\nexport declare function extend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): any;\nexport declare function safeExtend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): any;\nexport declare function merge(a: schemas.$ZodObject, b: schemas.$ZodObject): any;\nexport declare function partial(Class: SchemaClass<schemas.$ZodOptional> | null, schema: schemas.$ZodObject, mask: object | undefined): any;\nexport declare function required(Class: SchemaClass<schemas.$ZodNonOptional>, schema: schemas.$ZodObject, mask: object | undefined): any;\nexport type Constructor<T, Def extends any[] = any[]> = new (...args: Def) => T;\nexport declare function aborted(x: schemas.ParsePayload, startIndex?: number): boolean;\nexport declare function prefixIssues(path: PropertyKey, issues: errors.$ZodRawIssue[]): errors.$ZodRawIssue[];\nexport declare function unwrapMessage(message: string | {\n message: string;\n} | undefined | null): string | undefined;\nexport declare function finalizeIssue(iss: errors.$ZodRawIssue, ctx: schemas.ParseContextInternal | undefined, config: $ZodConfig): errors.$ZodIssue;\nexport declare function getSizableOrigin(input: any): \"set\" | \"map\" | \"file\" | \"unknown\";\nexport declare function getLengthableOrigin(input: any): \"array\" | \"string\" | \"unknown\";\nexport declare function issue(_iss: string, input: any, inst: any): errors.$ZodRawIssue;\nexport declare function issue(_iss: errors.$ZodRawIssue): errors.$ZodRawIssue;\nexport declare function cleanEnum(obj: Record<string, EnumValue>): EnumValue[];\nexport declare function base64ToUint8Array(base64: string): InstanceType<typeof Uint8Array>;\nexport declare function uint8ArrayToBase64(bytes: Uint8Array): string;\nexport declare function base64urlToUint8Array(base64url: string): InstanceType<typeof Uint8Array>;\nexport declare function uint8ArrayToBase64url(bytes: Uint8Array): string;\nexport declare function hexToUint8Array(hex: string): InstanceType<typeof Uint8Array>;\nexport declare function uint8ArrayToHex(bytes: Uint8Array): string;\nexport declare abstract class Class {\n constructor(..._args: any[]);\n}\n"],"x_google_ignoreList":[0],"mappings":";;AAkBkEoB,KAXtDf,YAAAA,GAWsDe,OAAAA,GAAAA,OAAAA,GAAAA,OAA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A,GAAAA,IAAAA,GAAAA,SAAAA;AAAMhD,KA0BViE,SAAAA,GA1BUjE,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,OAAAA,GAAAA,IAAAA,GAAAA,SAAAA;AAKMN,KA0BhB0E,SAAAA,GA1BgB1E;EAAYA,MAAAA,EAAAA,MAAAA;CAARgC;AAAO,KA6B3B2C,OAAAA,GA7B2B,MAAA,GAAA,MAAA,GA6BC9C,IA7BD;AAcU,KA2BrCmD,UAAAA,GAAahE,MA3BwB,CAAA,MAAA,EA2BTqB,GA3BS,CA2BLkC,SA3BK,CAAA,CAAA;AAKrCF,KAuBAY,YAAAA,GAAe5C,GAvBR,CAuBYkC,SAvBZ,CAAA;KAgEP8C,wBAAwBrH,0BAA0BA;uBA4ChCoK,KAAAA"}
|
|
1
|
+
{"version":3,"file":"util.d.ts","names":["checks","$ZodConfig","errors","schemas","JSONType","JWTAlgorithm","HashAlgorithm","HashEncoding","HashFormat","IPVersion","MimeTypes","ParsedTypes","AssertEqual","V","T","U","AssertNotEqual","AssertExtends","IsAny","Omit","K","Exclude","Pick","OmitKeys","MakePartial","InexactPartial","MakeRequired","Required","Exactly","X","Record","NoUndefined","Whatever","LoosePartial","Mask","Keys","PropertyKey","Writeable","P","EmptyObject","BuiltIn","Symbol","toStringTag","Date","Error","Generator","Promise","RegExp","MakeReadonly","Map","ReadonlyMap","Set","ReadonlySet","Head","Tail","Array","ReadonlyArray","Readonly","SomeObject","Identity","Flatten","k","Mapped","Prettify","NoNeverKeys","NoNever","Extend","A","B","TupleItems","SomeType","AnyFunc","IsProp","MaybeAsync","KeyOf","OmitIndexSignature","ExtractIndexSignature","SchemaClass","EnumValue","EnumLike","ToEnum","KeysEnum","KeysArray","Literal","LiteralArray","Primitive","PrimitiveArray","HasSize","HasLength","Numeric","SafeParseResult","SafeParseSuccess","SafeParseError","$ZodError","PropValues","PrimitiveSet","assertEqual","assertNotEqual","assertIs","assertNever","assert","getEnumValues","joinValues","jsonStringifyReplacer","cached","nullish","cleanRegex","floatSafeRemainder","defineLazy","objectClone","assignProp","mergeDefs","cloneDef","$ZodType","getElementAtPath","promiseAllObject","Awaited","randomString","esc","captureStackTrace","Function","isObject","allowsEval","isPlainObject","shallowClone","numKeys","getParsedType","propertyKeyTypes","primitiveTypes","escapeRegex","clone","EmptyToNever","Normalize","normalizeParams","createTransparentProxy","stringifyPrimitive","optionalKeys","$ZodShape","CleanKey","ToCleanMap","$ZodLooseShape","FromCleanMap","NUMBER_FORMAT_RANGES","$ZodNumberFormats","BIGINT_FORMAT_RANGES","$ZodBigIntFormats","pick","$ZodObject","omit","extend","safeExtend","merge","partial","$ZodOptional","required","$ZodNonOptional","Constructor","Def","aborted","ParsePayload","prefixIssues","$ZodRawIssue","unwrapMessage","finalizeIssue","ParseContextInternal","$ZodIssue","getSizableOrigin","getLengthableOrigin","issue","cleanEnum","base64ToUint8Array","Uint8Array","InstanceType","uint8ArrayToBase64","base64urlToUint8Array","uint8ArrayToBase64url","hexToUint8Array","uint8ArrayToHex","Class"],"sources":["../../../node_modules/.bun/zod@4.1.12/node_modules/zod/v4/core/util.d.cts"],"sourcesContent":["import type * as checks from \"./checks.cjs\";\nimport type { $ZodConfig } from \"./core.cjs\";\nimport type * as errors from \"./errors.cjs\";\nimport type * as schemas from \"./schemas.cjs\";\nexport type JSONType = string | number | boolean | null | JSONType[] | {\n [key: string]: JSONType;\n};\nexport type JWTAlgorithm = \"HS256\" | \"HS384\" | \"HS512\" | \"RS256\" | \"RS384\" | \"RS512\" | \"ES256\" | \"ES384\" | \"ES512\" | \"PS256\" | \"PS384\" | \"PS512\" | \"EdDSA\" | (string & {});\nexport type HashAlgorithm = \"md5\" | \"sha1\" | \"sha256\" | \"sha384\" | \"sha512\";\nexport type HashEncoding = \"hex\" | \"base64\" | \"base64url\";\nexport type HashFormat = `${HashAlgorithm}_${HashEncoding}`;\nexport type IPVersion = \"v4\" | \"v6\";\nexport type MimeTypes = \"application/json\" | \"application/xml\" | \"application/x-www-form-urlencoded\" | \"application/javascript\" | \"application/pdf\" | \"application/zip\" | \"application/vnd.ms-excel\" | \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" | \"application/msword\" | \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\" | \"application/vnd.ms-powerpoint\" | \"application/vnd.openxmlformats-officedocument.presentationml.presentation\" | \"application/octet-stream\" | \"application/graphql\" | \"text/html\" | \"text/plain\" | \"text/css\" | \"text/javascript\" | \"text/csv\" | \"image/png\" | \"image/jpeg\" | \"image/gif\" | \"image/svg+xml\" | \"image/webp\" | \"audio/mpeg\" | \"audio/ogg\" | \"audio/wav\" | \"audio/webm\" | \"video/mp4\" | \"video/webm\" | \"video/ogg\" | \"font/woff\" | \"font/woff2\" | \"font/ttf\" | \"font/otf\" | \"multipart/form-data\" | (string & {});\nexport type ParsedTypes = \"string\" | \"number\" | \"bigint\" | \"boolean\" | \"symbol\" | \"undefined\" | \"object\" | \"function\" | \"file\" | \"date\" | \"array\" | \"map\" | \"set\" | \"nan\" | \"null\" | \"promise\";\nexport type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;\nexport type AssertNotEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? false : true;\nexport type AssertExtends<T, U> = T extends U ? T : never;\nexport type IsAny<T> = 0 extends 1 & T ? true : false;\nexport type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\nexport type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;\nexport type MakePartial<T, K extends keyof T> = Omit<T, K> & InexactPartial<Pick<T, K>>;\nexport type MakeRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;\nexport type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;\nexport type NoUndefined<T> = T extends undefined ? never : T;\nexport type Whatever = {} | undefined | null;\nexport type LoosePartial<T extends object> = InexactPartial<T> & {\n [k: string]: unknown;\n};\nexport type Mask<Keys extends PropertyKey> = {\n [K in Keys]?: true;\n};\nexport type Writeable<T> = {\n -readonly [P in keyof T]: T[P];\n} & {};\nexport type InexactPartial<T> = {\n [P in keyof T]?: T[P] | undefined;\n};\nexport type EmptyObject = Record<string, never>;\nexport type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {\n readonly [Symbol.toStringTag]: string;\n} | Date | Error | Generator | Promise<unknown> | RegExp;\nexport type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;\nexport type SomeObject = Record<PropertyKey, any>;\nexport type Identity<T> = T;\nexport type Flatten<T> = Identity<{\n [k in keyof T]: T[k];\n}>;\nexport type Mapped<T> = {\n [k in keyof T]: T[k];\n};\nexport type Prettify<T> = {\n [K in keyof T]: T[K];\n} & {};\nexport type NoNeverKeys<T> = {\n [k in keyof T]: [T[k]] extends [never] ? never : k;\n}[keyof T];\nexport type NoNever<T> = Identity<{\n [k in NoNeverKeys<T>]: k extends keyof T ? T[k] : never;\n}>;\nexport type Extend<A extends SomeObject, B extends SomeObject> = Flatten<keyof A & keyof B extends never ? A & B : {\n [K in keyof A as K extends keyof B ? never : K]: A[K];\n} & {\n [K in keyof B]: B[K];\n}>;\nexport type TupleItems = ReadonlyArray<schemas.SomeType>;\nexport type AnyFunc = (...args: any[]) => any;\nexport type IsProp<T, K extends keyof T> = T[K] extends AnyFunc ? never : K;\nexport type MaybeAsync<T> = T | Promise<T>;\nexport type KeyOf<T> = keyof OmitIndexSignature<T>;\nexport type OmitIndexSignature<T> = {\n [K in keyof T as string extends K ? never : K extends string ? K : never]: T[K];\n};\nexport type ExtractIndexSignature<T> = {\n [K in keyof T as string extends K ? K : K extends string ? never : K]: T[K];\n};\nexport type Keys<T extends object> = keyof OmitIndexSignature<T>;\nexport type SchemaClass<T extends schemas.SomeType> = {\n new (def: T[\"_zod\"][\"def\"]): T;\n};\nexport type EnumValue = string | number;\nexport type EnumLike = Readonly<Record<string, EnumValue>>;\nexport type ToEnum<T extends EnumValue> = Flatten<{\n [k in T]: k;\n}>;\nexport type KeysEnum<T extends object> = ToEnum<Exclude<keyof T, symbol>>;\nexport type KeysArray<T extends object> = Flatten<(keyof T & string)[]>;\nexport type Literal = string | number | bigint | boolean | null | undefined;\nexport type LiteralArray = Array<Literal>;\nexport type Primitive = string | number | symbol | bigint | boolean | null | undefined;\nexport type PrimitiveArray = Array<Primitive>;\nexport type HasSize = {\n size: number;\n};\nexport type HasLength = {\n length: number;\n};\nexport type Numeric = number | bigint | Date;\nexport type SafeParseResult<T> = SafeParseSuccess<T> | SafeParseError<T>;\nexport type SafeParseSuccess<T> = {\n success: true;\n data: T;\n error?: never;\n};\nexport type SafeParseError<T> = {\n success: false;\n data?: never;\n error: errors.$ZodError<T>;\n};\nexport type PropValues = Record<string, Set<Primitive>>;\nexport type PrimitiveSet = Set<Primitive>;\nexport declare function assertEqual<A, B>(val: AssertEqual<A, B>): AssertEqual<A, B>;\nexport declare function assertNotEqual<A, B>(val: AssertNotEqual<A, B>): AssertNotEqual<A, B>;\nexport declare function assertIs<T>(_arg: T): void;\nexport declare function assertNever(_x: never): never;\nexport declare function assert<T>(_: any): asserts _ is T;\nexport declare function getEnumValues(entries: EnumLike): EnumValue[];\nexport declare function joinValues<T extends Primitive[]>(array: T, separator?: string): string;\nexport declare function jsonStringifyReplacer(_: string, value: any): any;\nexport declare function cached<T>(getter: () => T): {\n value: T;\n};\nexport declare function nullish(input: any): boolean;\nexport declare function cleanRegex(source: string): string;\nexport declare function floatSafeRemainder(val: number, step: number): number;\nexport declare function defineLazy<T, K extends keyof T>(object: T, key: K, getter: () => T[K]): void;\nexport declare function objectClone(obj: object): any;\nexport declare function assignProp<T extends object, K extends PropertyKey>(target: T, prop: K, value: K extends keyof T ? T[K] : any): void;\nexport declare function mergeDefs(...defs: Record<string, any>[]): any;\nexport declare function cloneDef(schema: schemas.$ZodType): any;\nexport declare function getElementAtPath(obj: any, path: (string | number)[] | null | undefined): any;\nexport declare function promiseAllObject<T extends object>(promisesObj: T): Promise<{\n [k in keyof T]: Awaited<T[k]>;\n}>;\nexport declare function randomString(length?: number): string;\nexport declare function esc(str: string): string;\nexport declare const captureStackTrace: (targetObject: object, constructorOpt?: Function) => void;\nexport declare function isObject(data: any): data is Record<PropertyKey, unknown>;\nexport declare const allowsEval: {\n value: boolean;\n};\nexport declare function isPlainObject(o: any): o is Record<PropertyKey, unknown>;\nexport declare function shallowClone(o: any): any;\nexport declare function numKeys(data: any): number;\nexport declare const getParsedType: (data: any) => ParsedTypes;\nexport declare const propertyKeyTypes: Set<string>;\nexport declare const primitiveTypes: Set<string>;\nexport declare function escapeRegex(str: string): string;\nexport declare function clone<T extends schemas.$ZodType>(inst: T, def?: T[\"_zod\"][\"def\"], params?: {\n parent: boolean;\n}): T;\nexport type EmptyToNever<T> = keyof T extends never ? never : T;\nexport type Normalize<T> = T extends undefined ? never : T extends Record<any, any> ? Flatten<{\n [k in keyof Omit<T, \"error\" | \"message\">]: T[k];\n} & (\"error\" extends keyof T ? {\n error?: Exclude<T[\"error\"], string>;\n} : unknown)> : never;\nexport declare function normalizeParams<T>(_params: T): Normalize<T>;\nexport declare function createTransparentProxy<T extends object>(getter: () => T): T;\nexport declare function stringifyPrimitive(value: any): string;\nexport declare function optionalKeys(shape: schemas.$ZodShape): string[];\nexport type CleanKey<T extends PropertyKey> = T extends `?${infer K}` ? K : T extends `${infer K}?` ? K : T;\nexport type ToCleanMap<T extends schemas.$ZodLooseShape> = {\n [k in keyof T]: k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k;\n};\nexport type FromCleanMap<T extends schemas.$ZodLooseShape> = {\n [k in keyof T as k extends `?${infer K}` ? K : k extends `${infer K}?` ? K : k]: k;\n};\nexport declare const NUMBER_FORMAT_RANGES: Record<checks.$ZodNumberFormats, [number, number]>;\nexport declare const BIGINT_FORMAT_RANGES: Record<checks.$ZodBigIntFormats, [bigint, bigint]>;\nexport declare function pick(schema: schemas.$ZodObject, mask: Record<string, unknown>): any;\nexport declare function omit(schema: schemas.$ZodObject, mask: object): any;\nexport declare function extend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): any;\nexport declare function safeExtend(schema: schemas.$ZodObject, shape: schemas.$ZodShape): any;\nexport declare function merge(a: schemas.$ZodObject, b: schemas.$ZodObject): any;\nexport declare function partial(Class: SchemaClass<schemas.$ZodOptional> | null, schema: schemas.$ZodObject, mask: object | undefined): any;\nexport declare function required(Class: SchemaClass<schemas.$ZodNonOptional>, schema: schemas.$ZodObject, mask: object | undefined): any;\nexport type Constructor<T, Def extends any[] = any[]> = new (...args: Def) => T;\nexport declare function aborted(x: schemas.ParsePayload, startIndex?: number): boolean;\nexport declare function prefixIssues(path: PropertyKey, issues: errors.$ZodRawIssue[]): errors.$ZodRawIssue[];\nexport declare function unwrapMessage(message: string | {\n message: string;\n} | undefined | null): string | undefined;\nexport declare function finalizeIssue(iss: errors.$ZodRawIssue, ctx: schemas.ParseContextInternal | undefined, config: $ZodConfig): errors.$ZodIssue;\nexport declare function getSizableOrigin(input: any): \"set\" | \"map\" | \"file\" | \"unknown\";\nexport declare function getLengthableOrigin(input: any): \"array\" | \"string\" | \"unknown\";\nexport declare function issue(_iss: string, input: any, inst: any): errors.$ZodRawIssue;\nexport declare function issue(_iss: errors.$ZodRawIssue): errors.$ZodRawIssue;\nexport declare function cleanEnum(obj: Record<string, EnumValue>): EnumValue[];\nexport declare function base64ToUint8Array(base64: string): InstanceType<typeof Uint8Array>;\nexport declare function uint8ArrayToBase64(bytes: Uint8Array): string;\nexport declare function base64urlToUint8Array(base64url: string): InstanceType<typeof Uint8Array>;\nexport declare function uint8ArrayToBase64url(bytes: Uint8Array): string;\nexport declare function hexToUint8Array(hex: string): InstanceType<typeof Uint8Array>;\nexport declare function uint8ArrayToHex(bytes: Uint8Array): string;\nexport declare abstract class Class {\n constructor(..._args: any[]);\n}\n"],"x_google_ignoreList":[0],"mappings":";;AAkBkEoB,KAXtDf,YAAAA,GAWsDe,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA,GAAAA,OAAAA,GAAAA,CAAAA,MAAAA,GAAAA,CAAAA,CAAAA,CAAAA;AAEkBA,KAHxEF,KAGwEE,CAAAA,CAAAA,CAAAA,GAAAA,CAAAA,SAAAA,CAAAA,GAH/CN,CAG+CM,GAAAA,IAAAA,GAAAA,KAAAA;AAARE,KAFhEH,IAEgEG,CAAAA,CAAAA,EAAAA,YAAAA,MAFxCR,CAEwCQ,CAAAA,GAFnCA,IAEmCA,CAF9BR,CAE8BQ,EAF3BD,OAE2BC,CAAAA,MAFbR,CAEaQ,EAFVF,GAEUE,CAAAA,CAAAA;AAAD,KAA/DE,WAA+D,CAAA,CAAA,EAAA,YAAA,MAAhCV,CAAgC,CAAA,GAA3BK,IAA2B,CAAtBL,CAAsB,EAAnBM,GAAmB,CAAA,GAAdK,cAAc,CAACH,IAAD,CAAMR,CAAN,EAASM,GAAT,CAAA,CAAA;AAQ/Dc,KALAH,WAKII,CAAAA,CAAAA,CAAAA,GALarB,CAKCsB,SAAAA,SAChB,GAAA,KAAA,GAN6CtB,CAM7C;AAMEA,KAVJmB,YAUInB,CAAAA,UAAAA,MAAAA,CAAAA,GAV6BW,cAU7BX,CAV4CA,CAU5CA,CAAAA,GAAAA;EAAKA,CAAAA,CAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;CAAEwB;AAAC,KAPZJ,IAOY,CAAA,aAPME,WAON,CAAA,GAAA,QANdD,IASS,IAAA,IAAA,EACLM;AACiBK,KANnBrB,cAMmBqB,CAAAA,CAAAA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,GAqBqBwC,OArBrBxC,CAAAA,QAsBXN,CAtB2BsD,GAsBvBP,CAtBuBO,EAAYhD,CAAAA;AAEjCgD,KAwBJe,OAAAA,GAxBIf,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,OAAAA,GAAAA,IAAAA,GAAAA,SAAAA;AAAMhD,KA0BViE,SAAAA,GA1BUjE,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,MAAAA,GAAAA,OAAAA,GAAAA,IAAAA,GAAAA,SAAAA;AAKMN,KA0BhB0E,SAAAA,GA1BgB1E;EAAYA,MAAAA,EAAAA,MAAAA;CAARgC;AAAO,KA6B3B2C,OAAAA,GA7B2B,MAAA,GAAA,MAAA,GA6BC9C,IA7BD;AAcU,KA2BrCmD,UAAAA,GAAahE,MA3BwB,CAAA,MAAA,EA2BTqB,GA3BS,CA2BLkC,SA3BK,CAAA,CAAA;AAKrCF,KAuBAY,YAAAA,GAAe5C,GAvBR,CAuBYkC,SAvBZ,CAAA;KAgEP8C,wBAAwBrH,0BAA0BA;uBA4ChCoK,KAAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//#region src/visitor-name.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Visitor Name Generator
|
|
4
|
+
*
|
|
5
|
+
* Generates consistent, deterministic names for anonymous visitors
|
|
6
|
+
* based on their visitor ID. The same ID will always produce the same name.
|
|
7
|
+
*
|
|
8
|
+
* This module is shared between frontend and backend to ensure consistency.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Generate a deterministic visitor name from a seed (typically visitor ID)
|
|
12
|
+
* The same seed will always produce the same name.
|
|
13
|
+
*
|
|
14
|
+
* @param seed - A string to use as seed (typically visitor ID)
|
|
15
|
+
* @returns A name like "Happy Panda" or "Cosmic Eagle"
|
|
16
|
+
*/
|
|
17
|
+
declare function generateVisitorName(seed: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Get a display name for a visitor, with fallbacks:
|
|
20
|
+
* 1. Contact name (if available)
|
|
21
|
+
* 2. Email username (if available)
|
|
22
|
+
* 3. Generated name from visitor ID
|
|
23
|
+
*
|
|
24
|
+
* @param visitor - Visitor object with optional contact info and required ID
|
|
25
|
+
* @returns A display name for the visitor
|
|
26
|
+
*/
|
|
27
|
+
declare function getVisitorNameWithFallback(visitor: {
|
|
28
|
+
contact?: {
|
|
29
|
+
name?: string | null;
|
|
30
|
+
email?: string | null;
|
|
31
|
+
} | null;
|
|
32
|
+
id: string;
|
|
33
|
+
}): string;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { generateVisitorName, getVisitorNameWithFallback };
|
|
36
|
+
//# sourceMappingURL=visitor-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitor-name.d.ts","names":[],"sources":["../src/visitor-name.ts"],"sourcesContent":[],"mappings":";;AAgQA;AAsBA;;;;;;;;;;;;;iBAtBgB,mBAAA;;;;;;;;;;iBAsBA,0BAAA"}
|
package/visitor-name.js
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
//#region src/visitor-name.ts
|
|
2
|
+
/**
|
|
3
|
+
* Visitor Name Generator
|
|
4
|
+
*
|
|
5
|
+
* Generates consistent, deterministic names for anonymous visitors
|
|
6
|
+
* based on their visitor ID. The same ID will always produce the same name.
|
|
7
|
+
*
|
|
8
|
+
* This module is shared between frontend and backend to ensure consistency.
|
|
9
|
+
*/
|
|
10
|
+
const ADJECTIVES = [
|
|
11
|
+
"happy",
|
|
12
|
+
"sunny",
|
|
13
|
+
"cosmic",
|
|
14
|
+
"stellar",
|
|
15
|
+
"swift",
|
|
16
|
+
"mighty",
|
|
17
|
+
"clever",
|
|
18
|
+
"brave",
|
|
19
|
+
"gentle",
|
|
20
|
+
"noble",
|
|
21
|
+
"quick",
|
|
22
|
+
"bright",
|
|
23
|
+
"silver",
|
|
24
|
+
"golden",
|
|
25
|
+
"crystal",
|
|
26
|
+
"mystic",
|
|
27
|
+
"ancient",
|
|
28
|
+
"modern",
|
|
29
|
+
"electric",
|
|
30
|
+
"magnetic",
|
|
31
|
+
"dynamic",
|
|
32
|
+
"static",
|
|
33
|
+
"flying",
|
|
34
|
+
"dancing",
|
|
35
|
+
"singing",
|
|
36
|
+
"laughing",
|
|
37
|
+
"smiling",
|
|
38
|
+
"glowing",
|
|
39
|
+
"shining",
|
|
40
|
+
"sparkling",
|
|
41
|
+
"dazzling",
|
|
42
|
+
"radiant",
|
|
43
|
+
"peaceful",
|
|
44
|
+
"serene",
|
|
45
|
+
"tranquil",
|
|
46
|
+
"vibrant",
|
|
47
|
+
"energetic",
|
|
48
|
+
"lively",
|
|
49
|
+
"spirited",
|
|
50
|
+
"bold",
|
|
51
|
+
"fearless",
|
|
52
|
+
"curious",
|
|
53
|
+
"wise",
|
|
54
|
+
"witty",
|
|
55
|
+
"charming",
|
|
56
|
+
"elegant",
|
|
57
|
+
"graceful",
|
|
58
|
+
"agile",
|
|
59
|
+
"nimble",
|
|
60
|
+
"speedy",
|
|
61
|
+
"zippy",
|
|
62
|
+
"bouncy",
|
|
63
|
+
"jolly",
|
|
64
|
+
"merry",
|
|
65
|
+
"cheerful",
|
|
66
|
+
"playful",
|
|
67
|
+
"friendly",
|
|
68
|
+
"loyal",
|
|
69
|
+
"honest",
|
|
70
|
+
"kind",
|
|
71
|
+
"warm",
|
|
72
|
+
"cool",
|
|
73
|
+
"chill",
|
|
74
|
+
"awesome",
|
|
75
|
+
"amazing",
|
|
76
|
+
"wonderful",
|
|
77
|
+
"fantastic",
|
|
78
|
+
"magnificent",
|
|
79
|
+
"marvelous",
|
|
80
|
+
"splendid",
|
|
81
|
+
"brilliant",
|
|
82
|
+
"genius",
|
|
83
|
+
"super",
|
|
84
|
+
"mega",
|
|
85
|
+
"ultra",
|
|
86
|
+
"hyper",
|
|
87
|
+
"turbo",
|
|
88
|
+
"quantum",
|
|
89
|
+
"nano",
|
|
90
|
+
"micro",
|
|
91
|
+
"macro",
|
|
92
|
+
"epic",
|
|
93
|
+
"legendary",
|
|
94
|
+
"mythic",
|
|
95
|
+
"heroic",
|
|
96
|
+
"royal",
|
|
97
|
+
"imperial",
|
|
98
|
+
"majestic"
|
|
99
|
+
];
|
|
100
|
+
const NOUNS = [
|
|
101
|
+
"panda",
|
|
102
|
+
"dolphin",
|
|
103
|
+
"eagle",
|
|
104
|
+
"falcon",
|
|
105
|
+
"hawk",
|
|
106
|
+
"owl",
|
|
107
|
+
"raven",
|
|
108
|
+
"phoenix",
|
|
109
|
+
"dragon",
|
|
110
|
+
"unicorn",
|
|
111
|
+
"griffin",
|
|
112
|
+
"pegasus",
|
|
113
|
+
"lion",
|
|
114
|
+
"tiger",
|
|
115
|
+
"leopard",
|
|
116
|
+
"cheetah",
|
|
117
|
+
"panther",
|
|
118
|
+
"wolf",
|
|
119
|
+
"fox",
|
|
120
|
+
"bear",
|
|
121
|
+
"koala",
|
|
122
|
+
"kangaroo",
|
|
123
|
+
"rabbit",
|
|
124
|
+
"squirrel",
|
|
125
|
+
"hedgehog",
|
|
126
|
+
"otter",
|
|
127
|
+
"seal",
|
|
128
|
+
"whale",
|
|
129
|
+
"shark",
|
|
130
|
+
"octopus",
|
|
131
|
+
"jellyfish",
|
|
132
|
+
"starfish",
|
|
133
|
+
"butterfly",
|
|
134
|
+
"dragonfly",
|
|
135
|
+
"firefly",
|
|
136
|
+
"bee",
|
|
137
|
+
"hummingbird",
|
|
138
|
+
"peacock",
|
|
139
|
+
"flamingo",
|
|
140
|
+
"penguin",
|
|
141
|
+
"mountain",
|
|
142
|
+
"valley",
|
|
143
|
+
"river",
|
|
144
|
+
"ocean",
|
|
145
|
+
"forest",
|
|
146
|
+
"desert",
|
|
147
|
+
"glacier",
|
|
148
|
+
"volcano",
|
|
149
|
+
"canyon",
|
|
150
|
+
"meadow",
|
|
151
|
+
"prairie",
|
|
152
|
+
"savanna",
|
|
153
|
+
"tundra",
|
|
154
|
+
"rainforest",
|
|
155
|
+
"waterfall",
|
|
156
|
+
"geyser",
|
|
157
|
+
"aurora",
|
|
158
|
+
"comet",
|
|
159
|
+
"meteor",
|
|
160
|
+
"planet",
|
|
161
|
+
"galaxy",
|
|
162
|
+
"nebula",
|
|
163
|
+
"constellation",
|
|
164
|
+
"star",
|
|
165
|
+
"moon",
|
|
166
|
+
"sun",
|
|
167
|
+
"eclipse",
|
|
168
|
+
"horizon",
|
|
169
|
+
"sunrise",
|
|
170
|
+
"sunset",
|
|
171
|
+
"rainbow",
|
|
172
|
+
"thunder",
|
|
173
|
+
"lightning",
|
|
174
|
+
"storm",
|
|
175
|
+
"breeze",
|
|
176
|
+
"wind",
|
|
177
|
+
"tornado",
|
|
178
|
+
"hurricane",
|
|
179
|
+
"blizzard",
|
|
180
|
+
"avalanche",
|
|
181
|
+
"rocket",
|
|
182
|
+
"satellite",
|
|
183
|
+
"spaceship",
|
|
184
|
+
"explorer",
|
|
185
|
+
"pioneer",
|
|
186
|
+
"voyager",
|
|
187
|
+
"wanderer",
|
|
188
|
+
"nomad",
|
|
189
|
+
"knight",
|
|
190
|
+
"samurai",
|
|
191
|
+
"ninja",
|
|
192
|
+
"wizard",
|
|
193
|
+
"sage",
|
|
194
|
+
"oracle",
|
|
195
|
+
"prophet",
|
|
196
|
+
"champion",
|
|
197
|
+
"guardian",
|
|
198
|
+
"sentinel",
|
|
199
|
+
"watcher",
|
|
200
|
+
"keeper",
|
|
201
|
+
"protector",
|
|
202
|
+
"defender",
|
|
203
|
+
"warrior",
|
|
204
|
+
"hero",
|
|
205
|
+
"artist",
|
|
206
|
+
"painter",
|
|
207
|
+
"sculptor",
|
|
208
|
+
"musician",
|
|
209
|
+
"composer",
|
|
210
|
+
"poet",
|
|
211
|
+
"writer",
|
|
212
|
+
"dreamer",
|
|
213
|
+
"thinker",
|
|
214
|
+
"scholar",
|
|
215
|
+
"scientist",
|
|
216
|
+
"inventor",
|
|
217
|
+
"creator",
|
|
218
|
+
"builder",
|
|
219
|
+
"architect",
|
|
220
|
+
"engineer"
|
|
221
|
+
];
|
|
222
|
+
/**
|
|
223
|
+
* Simple hash function to convert string to number
|
|
224
|
+
* Used for deterministic visitor name generation
|
|
225
|
+
*/
|
|
226
|
+
function hashString(str) {
|
|
227
|
+
let hash = 0;
|
|
228
|
+
for (let i = 0; i < str.length; i++) {
|
|
229
|
+
const char = str.charCodeAt(i);
|
|
230
|
+
hash = (hash << 5) - hash + char;
|
|
231
|
+
hash &= hash;
|
|
232
|
+
}
|
|
233
|
+
return Math.abs(hash);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Capitalize the first letter of a string
|
|
237
|
+
*/
|
|
238
|
+
function capitalize(str) {
|
|
239
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Generate a deterministic visitor name from a seed (typically visitor ID)
|
|
243
|
+
* The same seed will always produce the same name.
|
|
244
|
+
*
|
|
245
|
+
* @param seed - A string to use as seed (typically visitor ID)
|
|
246
|
+
* @returns A name like "Happy Panda" or "Cosmic Eagle"
|
|
247
|
+
*/
|
|
248
|
+
function generateVisitorName(seed) {
|
|
249
|
+
const hash = hashString(seed);
|
|
250
|
+
const adjectiveIndex = hash % ADJECTIVES.length;
|
|
251
|
+
const nounIndex = (hash >> 8) % NOUNS.length;
|
|
252
|
+
const adjective = ADJECTIVES[adjectiveIndex] ?? "anonymous";
|
|
253
|
+
const noun = NOUNS[nounIndex] ?? "visitor";
|
|
254
|
+
return `${capitalize(adjective)} ${capitalize(noun)}`;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Get a display name for a visitor, with fallbacks:
|
|
258
|
+
* 1. Contact name (if available)
|
|
259
|
+
* 2. Email username (if available)
|
|
260
|
+
* 3. Generated name from visitor ID
|
|
261
|
+
*
|
|
262
|
+
* @param visitor - Visitor object with optional contact info and required ID
|
|
263
|
+
* @returns A display name for the visitor
|
|
264
|
+
*/
|
|
265
|
+
function getVisitorNameWithFallback(visitor) {
|
|
266
|
+
return visitor?.contact?.name || visitor?.contact?.email?.split("@")[0] || generateVisitorName(visitor.id);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
//#endregion
|
|
270
|
+
export { generateVisitorName, getVisitorNameWithFallback };
|
|
271
|
+
//# sourceMappingURL=visitor-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitor-name.js","names":[],"sources":["../src/visitor-name.ts"],"sourcesContent":["/**\n * Visitor Name Generator\n *\n * Generates consistent, deterministic names for anonymous visitors\n * based on their visitor ID. The same ID will always produce the same name.\n *\n * This module is shared between frontend and backend to ensure consistency.\n */\n\n// Adjectives - descriptors for the visitor name\nconst ADJECTIVES = [\n\t\"happy\",\n\t\"sunny\",\n\t\"cosmic\",\n\t\"stellar\",\n\t\"swift\",\n\t\"mighty\",\n\t\"clever\",\n\t\"brave\",\n\t\"gentle\",\n\t\"noble\",\n\t\"quick\",\n\t\"bright\",\n\t\"silver\",\n\t\"golden\",\n\t\"crystal\",\n\t\"mystic\",\n\t\"ancient\",\n\t\"modern\",\n\t\"electric\",\n\t\"magnetic\",\n\t\"dynamic\",\n\t\"static\",\n\t\"flying\",\n\t\"dancing\",\n\t\"singing\",\n\t\"laughing\",\n\t\"smiling\",\n\t\"glowing\",\n\t\"shining\",\n\t\"sparkling\",\n\t\"dazzling\",\n\t\"radiant\",\n\t\"peaceful\",\n\t\"serene\",\n\t\"tranquil\",\n\t\"vibrant\",\n\t\"energetic\",\n\t\"lively\",\n\t\"spirited\",\n\t\"bold\",\n\t\"fearless\",\n\t\"curious\",\n\t\"wise\",\n\t\"witty\",\n\t\"charming\",\n\t\"elegant\",\n\t\"graceful\",\n\t\"agile\",\n\t\"nimble\",\n\t\"speedy\",\n\t\"zippy\",\n\t\"bouncy\",\n\t\"jolly\",\n\t\"merry\",\n\t\"cheerful\",\n\t\"playful\",\n\t\"friendly\",\n\t\"loyal\",\n\t\"honest\",\n\t\"kind\",\n\t\"warm\",\n\t\"cool\",\n\t\"chill\",\n\t\"awesome\",\n\t\"amazing\",\n\t\"wonderful\",\n\t\"fantastic\",\n\t\"magnificent\",\n\t\"marvelous\",\n\t\"splendid\",\n\t\"brilliant\",\n\t\"genius\",\n\t\"super\",\n\t\"mega\",\n\t\"ultra\",\n\t\"hyper\",\n\t\"turbo\",\n\t\"quantum\",\n\t\"nano\",\n\t\"micro\",\n\t\"macro\",\n\t\"epic\",\n\t\"legendary\",\n\t\"mythic\",\n\t\"heroic\",\n\t\"royal\",\n\t\"imperial\",\n\t\"majestic\",\n] as const;\n\n// Nouns - animals, objects, nature elements\nconst NOUNS = [\n\t// Animals\n\t\"panda\",\n\t\"dolphin\",\n\t\"eagle\",\n\t\"falcon\",\n\t\"hawk\",\n\t\"owl\",\n\t\"raven\",\n\t\"phoenix\",\n\t\"dragon\",\n\t\"unicorn\",\n\t\"griffin\",\n\t\"pegasus\",\n\t\"lion\",\n\t\"tiger\",\n\t\"leopard\",\n\t\"cheetah\",\n\t\"panther\",\n\t\"wolf\",\n\t\"fox\",\n\t\"bear\",\n\t\"koala\",\n\t\"kangaroo\",\n\t\"rabbit\",\n\t\"squirrel\",\n\t\"hedgehog\",\n\t\"otter\",\n\t\"seal\",\n\t\"whale\",\n\t\"shark\",\n\t\"octopus\",\n\t\"jellyfish\",\n\t\"starfish\",\n\t\"butterfly\",\n\t\"dragonfly\",\n\t\"firefly\",\n\t\"bee\",\n\t\"hummingbird\",\n\t\"peacock\",\n\t\"flamingo\",\n\t\"penguin\",\n\t// Nature elements\n\t\"mountain\",\n\t\"valley\",\n\t\"river\",\n\t\"ocean\",\n\t\"forest\",\n\t\"desert\",\n\t\"glacier\",\n\t\"volcano\",\n\t\"canyon\",\n\t\"meadow\",\n\t\"prairie\",\n\t\"savanna\",\n\t\"tundra\",\n\t\"rainforest\",\n\t\"waterfall\",\n\t\"geyser\",\n\t\"aurora\",\n\t\"comet\",\n\t\"meteor\",\n\t\"planet\",\n\t\"galaxy\",\n\t\"nebula\",\n\t\"constellation\",\n\t\"star\",\n\t\"moon\",\n\t\"sun\",\n\t\"eclipse\",\n\t\"horizon\",\n\t\"sunrise\",\n\t\"sunset\",\n\t\"rainbow\",\n\t\"thunder\",\n\t\"lightning\",\n\t\"storm\",\n\t\"breeze\",\n\t\"wind\",\n\t\"tornado\",\n\t\"hurricane\",\n\t\"blizzard\",\n\t\"avalanche\",\n\t// Cool objects and concepts\n\t\"rocket\",\n\t\"satellite\",\n\t\"spaceship\",\n\t\"explorer\",\n\t\"pioneer\",\n\t\"voyager\",\n\t\"wanderer\",\n\t\"nomad\",\n\t\"knight\",\n\t\"samurai\",\n\t\"ninja\",\n\t\"wizard\",\n\t\"sage\",\n\t\"oracle\",\n\t\"prophet\",\n\t\"champion\",\n\t\"guardian\",\n\t\"sentinel\",\n\t\"watcher\",\n\t\"keeper\",\n\t\"protector\",\n\t\"defender\",\n\t\"warrior\",\n\t\"hero\",\n\t\"artist\",\n\t\"painter\",\n\t\"sculptor\",\n\t\"musician\",\n\t\"composer\",\n\t\"poet\",\n\t\"writer\",\n\t\"dreamer\",\n\t\"thinker\",\n\t\"scholar\",\n\t\"scientist\",\n\t\"inventor\",\n\t\"creator\",\n\t\"builder\",\n\t\"architect\",\n\t\"engineer\",\n] as const;\n\n/**\n * Simple hash function to convert string to number\n * Used for deterministic visitor name generation\n */\nfunction hashString(str: string): number {\n\tlet hash = 0;\n\tfor (let i = 0; i < str.length; i++) {\n\t\tconst char = str.charCodeAt(i);\n\t\thash = (hash << 5) - hash + char;\n\t\thash &= hash; // Convert to 32-bit integer\n\t}\n\treturn Math.abs(hash);\n}\n\n/**\n * Capitalize the first letter of a string\n */\nfunction capitalize(str: string): string {\n\treturn str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n/**\n * Generate a deterministic visitor name from a seed (typically visitor ID)\n * The same seed will always produce the same name.\n *\n * @param seed - A string to use as seed (typically visitor ID)\n * @returns A name like \"Happy Panda\" or \"Cosmic Eagle\"\n */\nexport function generateVisitorName(seed: string): string {\n\tconst hash = hashString(seed);\n\n\t// Use different parts of the hash for each word selection\n\tconst adjectiveIndex = hash % ADJECTIVES.length;\n\tconst nounIndex = (hash >> 8) % NOUNS.length;\n\n\tconst adjective = ADJECTIVES[adjectiveIndex] ?? \"anonymous\";\n\tconst noun = NOUNS[nounIndex] ?? \"visitor\";\n\n\treturn `${capitalize(adjective)} ${capitalize(noun)}`;\n}\n\n/**\n * Get a display name for a visitor, with fallbacks:\n * 1. Contact name (if available)\n * 2. Email username (if available)\n * 3. Generated name from visitor ID\n *\n * @param visitor - Visitor object with optional contact info and required ID\n * @returns A display name for the visitor\n */\nexport function getVisitorNameWithFallback(visitor: {\n\tcontact?: {\n\t\tname?: string | null;\n\t\temail?: string | null;\n\t} | null;\n\tid: string;\n}): string {\n\treturn (\n\t\tvisitor?.contact?.name ||\n\t\tvisitor?.contact?.email?.split(\"@\")[0] ||\n\t\tgenerateVisitorName(visitor.id)\n\t);\n}\n"],"mappings":";;;;;;;;;AAUA,MAAM,aAAa;CAClB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAGD,MAAM,QAAQ;CAEb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;;AAMD,SAAS,WAAW,KAAqB;CACxC,IAAI,OAAO;AACX,MAAK,IAAI,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;EACpC,MAAM,OAAO,IAAI,WAAW,EAAE;AAC9B,UAAQ,QAAQ,KAAK,OAAO;AAC5B,UAAQ;;AAET,QAAO,KAAK,IAAI,KAAK;;;;;AAMtB,SAAS,WAAW,KAAqB;AACxC,QAAO,IAAI,OAAO,EAAE,CAAC,aAAa,GAAG,IAAI,MAAM,EAAE;;;;;;;;;AAUlD,SAAgB,oBAAoB,MAAsB;CACzD,MAAM,OAAO,WAAW,KAAK;CAG7B,MAAM,iBAAiB,OAAO,WAAW;CACzC,MAAM,aAAa,QAAQ,KAAK,MAAM;CAEtC,MAAM,YAAY,WAAW,mBAAmB;CAChD,MAAM,OAAO,MAAM,cAAc;AAEjC,QAAO,GAAG,WAAW,UAAU,CAAC,GAAG,WAAW,KAAK;;;;;;;;;;;AAYpD,SAAgB,2BAA2B,SAMhC;AACV,QACC,SAAS,SAAS,QAClB,SAAS,SAAS,OAAO,MAAM,IAAI,CAAC,MACpC,oBAAoB,QAAQ,GAAG"}
|