@attrove/sdk 0.1.3 → 0.1.5
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/cjs/README.md +247 -0
- package/cjs/package.json +56 -0
- package/cjs/src/__mocks__/version.js +17 -0
- package/cjs/src/__mocks__/version.js.map +1 -0
- package/cjs/src/admin-client.js +221 -0
- package/cjs/src/admin-client.js.map +1 -0
- package/cjs/src/client.js +312 -0
- package/cjs/src/client.js.map +1 -0
- package/cjs/src/constants.js +69 -0
- package/cjs/src/constants.js.map +1 -0
- package/cjs/src/errors/index.js +307 -0
- package/cjs/src/errors/index.js.map +1 -0
- package/cjs/src/index.js +98 -0
- package/cjs/src/index.js.map +1 -0
- package/cjs/src/resources/conversations.js +95 -0
- package/cjs/src/resources/conversations.js.map +1 -0
- package/cjs/src/resources/index.js +17 -0
- package/cjs/src/resources/index.js.map +1 -0
- package/cjs/src/resources/integrations.js +69 -0
- package/cjs/src/resources/integrations.js.map +1 -0
- package/cjs/src/resources/messages.js +98 -0
- package/cjs/src/resources/messages.js.map +1 -0
- package/cjs/src/resources/query.js +143 -0
- package/cjs/src/resources/query.js.map +1 -0
- package/cjs/src/resources/users.js +91 -0
- package/cjs/src/resources/users.js.map +1 -0
- package/cjs/src/types/index.js +292 -0
- package/cjs/src/types/index.js.map +1 -0
- package/cjs/src/utils/fetch.js +417 -0
- package/cjs/src/utils/fetch.js.map +1 -0
- package/cjs/src/utils/index.js +12 -0
- package/cjs/src/utils/index.js.map +1 -0
- package/cjs/src/utils/streaming.js +368 -0
- package/cjs/src/utils/streaming.js.map +1 -0
- package/cjs/src/version.js +31 -0
- package/cjs/src/version.js.map +1 -0
- package/esm/README.md +247 -0
- package/esm/package.json +56 -0
- package/esm/src/__mocks__/version.js +12 -0
- package/esm/src/__mocks__/version.js.map +1 -0
- package/esm/src/admin-client.js +216 -0
- package/esm/src/admin-client.js.map +1 -0
- package/esm/src/client.js +308 -0
- package/esm/src/client.js.map +1 -0
- package/esm/src/constants.js +65 -0
- package/esm/src/constants.js.map +1 -0
- package/esm/src/errors/index.js +285 -0
- package/esm/src/errors/index.js.map +1 -0
- package/esm/src/index.js +68 -0
- package/esm/src/index.js.map +1 -0
- package/esm/src/resources/conversations.js +91 -0
- package/esm/src/resources/conversations.js.map +1 -0
- package/esm/src/resources/index.js +9 -0
- package/esm/src/resources/index.js.map +1 -0
- package/esm/src/resources/integrations.js +65 -0
- package/esm/src/resources/integrations.js.map +1 -0
- package/esm/src/resources/messages.js +94 -0
- package/esm/src/resources/messages.js.map +1 -0
- package/esm/src/resources/query.js +139 -0
- package/esm/src/resources/query.js.map +1 -0
- package/esm/src/resources/users.js +87 -0
- package/esm/src/resources/users.js.map +1 -0
- package/esm/src/types/index.js +277 -0
- package/esm/src/types/index.js.map +1 -0
- package/esm/src/utils/fetch.js +413 -0
- package/esm/src/utils/fetch.js.map +1 -0
- package/esm/src/utils/index.js +6 -0
- package/esm/src/utils/index.js.map +1 -0
- package/esm/src/utils/streaming.js +363 -0
- package/esm/src/utils/streaming.js.map +1 -0
- package/esm/src/version.js +26 -0
- package/esm/src/version.js.map +1 -0
- package/package.json +16 -9
- package/types/src/__mocks__/version.d.ts +8 -0
- package/types/src/__mocks__/version.d.ts.map +1 -0
- package/types/src/admin-client.d.ts +144 -0
- package/types/src/admin-client.d.ts.map +1 -0
- package/types/src/client.d.ts +233 -0
- package/types/src/client.d.ts.map +1 -0
- package/types/src/constants.d.ts +47 -0
- package/types/src/constants.d.ts.map +1 -0
- package/types/src/errors/index.d.ts +206 -0
- package/types/src/errors/index.d.ts.map +1 -0
- package/types/src/index.d.ts +65 -0
- package/types/src/index.d.ts.map +1 -0
- package/types/src/resources/conversations.d.ts +81 -0
- package/types/src/resources/conversations.d.ts.map +1 -0
- package/types/src/resources/index.d.ts +12 -0
- package/types/src/resources/index.d.ts.map +1 -0
- package/types/src/resources/integrations.d.ts +63 -0
- package/types/src/resources/integrations.d.ts.map +1 -0
- package/types/src/resources/messages.d.ts +69 -0
- package/types/src/resources/messages.d.ts.map +1 -0
- package/types/src/resources/query.d.ts +86 -0
- package/types/src/resources/query.d.ts.map +1 -0
- package/types/src/resources/users.d.ts +88 -0
- package/types/src/resources/users.d.ts.map +1 -0
- package/types/src/types/index.d.ts +807 -0
- package/types/src/types/index.d.ts.map +1 -0
- package/types/src/utils/fetch.d.ts +161 -0
- package/types/src/utils/fetch.d.ts.map +1 -0
- package/types/src/utils/index.d.ts +8 -0
- package/types/src/utils/index.d.ts.map +1 -0
- package/types/src/utils/streaming.d.ts +210 -0
- package/types/src/utils/streaming.d.ts.map +1 -0
- package/types/src/version.d.ts +21 -0
- package/types/src/version.d.ts.map +1 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query Resource
|
|
3
|
+
*
|
|
4
|
+
* Provides methods for RAG (Retrieval-Augmented Generation) queries.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Query resource for RAG operations.
|
|
8
|
+
*
|
|
9
|
+
* Provides methods for AI-powered queries and semantic search
|
|
10
|
+
* across the user's unified context.
|
|
11
|
+
*/
|
|
12
|
+
export class QueryResource {
|
|
13
|
+
constructor(http, userId) {
|
|
14
|
+
this.http = http;
|
|
15
|
+
this.userId = userId;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Query the user's unified context with AI.
|
|
19
|
+
*
|
|
20
|
+
* Performs semantic search across connected integrations and returns
|
|
21
|
+
* an AI-generated answer based on the relevant context.
|
|
22
|
+
*
|
|
23
|
+
* @param prompt - The natural language question to answer
|
|
24
|
+
* @param options - Query options including history, filters, etc.
|
|
25
|
+
* @returns AI-generated answer with conversation history and source references
|
|
26
|
+
*
|
|
27
|
+
* @throws {AuthenticationError} If the API key is invalid or expired
|
|
28
|
+
* @throws {ValidationError} If the query parameters are invalid
|
|
29
|
+
* @throws {RateLimitError} If rate limits are exceeded
|
|
30
|
+
* @throws {NetworkError} If unable to reach the API
|
|
31
|
+
* @throws {ServerError} If the server encounters an error during processing
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* // Simple query
|
|
36
|
+
* const response = await attrove.query('What did Sarah say about the Q4 budget?');
|
|
37
|
+
*
|
|
38
|
+
* // With conversation history
|
|
39
|
+
* const response = await attrove.query('What about Q3?', {
|
|
40
|
+
* history: [
|
|
41
|
+
* { role: 'user', content: 'What did Sarah say about the Q4 budget?' },
|
|
42
|
+
* { role: 'assistant', content: 'Sarah mentioned...' }
|
|
43
|
+
* ]
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* // With filters
|
|
47
|
+
* const response = await attrove.query('Latest updates', {
|
|
48
|
+
* integrationIds: ['550e8400-e29b-41d4-a716-446655440000'],
|
|
49
|
+
* includeSources: true
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
async query(prompt, options = {}) {
|
|
54
|
+
const body = {
|
|
55
|
+
query: prompt,
|
|
56
|
+
client_timezone: options.timezone || Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
57
|
+
};
|
|
58
|
+
if (options.history?.length) {
|
|
59
|
+
body.history = options.history;
|
|
60
|
+
}
|
|
61
|
+
if (options.integrationIds?.length) {
|
|
62
|
+
body.integration_ids = options.integrationIds;
|
|
63
|
+
}
|
|
64
|
+
if (options.conversationIds?.length) {
|
|
65
|
+
body.conversation_ids = options.conversationIds;
|
|
66
|
+
}
|
|
67
|
+
if (options.allowBotMessages !== undefined) {
|
|
68
|
+
body.allow_bot_messages = options.allowBotMessages;
|
|
69
|
+
}
|
|
70
|
+
if (options.includeSources) {
|
|
71
|
+
body.expand = 'sources';
|
|
72
|
+
}
|
|
73
|
+
const response = await this.http.post(`/v1/users/${this.userId}/ai/query`, body);
|
|
74
|
+
return {
|
|
75
|
+
answer: response.answer,
|
|
76
|
+
history: response.history,
|
|
77
|
+
used_message_ids: response.used_message_ids,
|
|
78
|
+
sources: response.sources,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Semantic search across the user's context.
|
|
83
|
+
*
|
|
84
|
+
* Returns raw matching messages grouped by conversation, without AI summarization.
|
|
85
|
+
* Use this when you need full control over how results are displayed.
|
|
86
|
+
*
|
|
87
|
+
* @param query - The search query (semantic, not keyword-based)
|
|
88
|
+
* @param options - Search options including filters, date range, etc.
|
|
89
|
+
* @returns Matching messages grouped by conversation
|
|
90
|
+
*
|
|
91
|
+
* @throws {AuthenticationError} If the API key is invalid or expired
|
|
92
|
+
* @throws {ValidationError} If the search parameters are invalid
|
|
93
|
+
* @throws {RateLimitError} If rate limits are exceeded
|
|
94
|
+
* @throws {NetworkError} If unable to reach the API
|
|
95
|
+
* @throws {ServerError} If the server encounters an error during search
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* // Basic search
|
|
100
|
+
* const results = await attrove.search('product launch');
|
|
101
|
+
*
|
|
102
|
+
* // With filters
|
|
103
|
+
* const results = await attrove.search('budget discussion', {
|
|
104
|
+
* afterDate: '2024-01-01T00:00:00Z',
|
|
105
|
+
* senderDomains: ['acme.com'],
|
|
106
|
+
* includeBodyText: true
|
|
107
|
+
* });
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
async search(query, options = {}) {
|
|
111
|
+
const body = { query };
|
|
112
|
+
if (options.integrationIds?.length) {
|
|
113
|
+
body.integration_ids = options.integrationIds;
|
|
114
|
+
}
|
|
115
|
+
if (options.conversationIds?.length) {
|
|
116
|
+
body.conversation_ids = options.conversationIds;
|
|
117
|
+
}
|
|
118
|
+
if (options.afterDate) {
|
|
119
|
+
body.after_date = options.afterDate;
|
|
120
|
+
}
|
|
121
|
+
if (options.beforeDate) {
|
|
122
|
+
body.before_date = options.beforeDate;
|
|
123
|
+
}
|
|
124
|
+
if (options.allowBotMessages !== undefined) {
|
|
125
|
+
body.allow_bot_messages = options.allowBotMessages;
|
|
126
|
+
}
|
|
127
|
+
if (options.senderDomains?.length) {
|
|
128
|
+
body.sender_domains = options.senderDomains;
|
|
129
|
+
}
|
|
130
|
+
if (options.entityIds?.length) {
|
|
131
|
+
body.entity_ids = options.entityIds;
|
|
132
|
+
}
|
|
133
|
+
if (options.includeBodyText) {
|
|
134
|
+
body.expand = 'body_text';
|
|
135
|
+
}
|
|
136
|
+
return this.http.post(`/v1/users/${this.userId}/ai/search`, body);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../../../../packages/sdk/src/resources/query.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqBH;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IACxB,YACmB,IAAgB,EAChB,MAAc;QADd,SAAI,GAAJ,IAAI,CAAY;QAChB,WAAM,GAAN,MAAM,CAAQ;IAC9B,CAAC;IAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH,KAAK,CAAC,KAAK,CAAC,MAAc,EAAE,UAAwB,EAAE;QACpD,MAAM,IAAI,GAA4B;YACpC,KAAK,EAAE,MAAM;YACb,eAAe,EAAE,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;SACtF,CAAC;QAEF,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;YAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QACjC,CAAC;QACD,IAAI,OAAO,CAAC,cAAc,EAAE,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;QAChD,CAAC;QACD,IAAI,OAAO,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;YACpC,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;QAClD,CAA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OAAO,CAAC,gBAAgB,CAAC;QACrD,CAAC;QACD,IAAI,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,CAAC;YAClC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;QAC9C,CAAC;QACD,IAAI,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;YAC9B,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACtC,CAAC;QACD,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC;QAC5B,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CACnB,aAAa,IAAI,CAAC,MAAM,YAAY,EACpC,IAAI,CACL,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Users Resource
|
|
3
|
+
*
|
|
4
|
+
* Provides methods for accessing user data and sync statistics.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Users resource for accessing user data.
|
|
8
|
+
*
|
|
9
|
+
* Provides methods for retrieving user profiles, updating settings,
|
|
10
|
+
* and accessing sync statistics across integrations.
|
|
11
|
+
*/
|
|
12
|
+
export class UsersResource {
|
|
13
|
+
constructor(http, userId) {
|
|
14
|
+
this.http = http;
|
|
15
|
+
this.userId = userId;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get the current user's profile and integrations.
|
|
19
|
+
*
|
|
20
|
+
* @returns User profile with connected integrations
|
|
21
|
+
*
|
|
22
|
+
* @throws {AuthenticationError} If the API key is invalid or expired
|
|
23
|
+
* @throws {NotFoundError} If the user does not exist
|
|
24
|
+
* @throws {NetworkError} If unable to reach the API
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const { user, integrations } = await attrove.users.get();
|
|
29
|
+
* console.log(`${user.email} has ${integrations.length} integrations`);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
async get() {
|
|
33
|
+
return this.http.get(`/v1/users/${this.userId}`);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Update the current user's profile.
|
|
37
|
+
*
|
|
38
|
+
* @param options - Fields to update
|
|
39
|
+
* @returns Updated user profile
|
|
40
|
+
*
|
|
41
|
+
* @throws {AuthenticationError} If the API key is invalid or expired
|
|
42
|
+
* @throws {ValidationError} If the update options are invalid
|
|
43
|
+
* @throws {NotFoundError} If the user does not exist
|
|
44
|
+
* @throws {NetworkError} If unable to reach the API
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const user = await attrove.users.update({
|
|
49
|
+
* timezone: 'America/New_York',
|
|
50
|
+
* firstName: 'John'
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
async update(options) {
|
|
55
|
+
const body = {};
|
|
56
|
+
if (options.firstName !== undefined)
|
|
57
|
+
body.first_name = options.firstName;
|
|
58
|
+
if (options.lastName !== undefined)
|
|
59
|
+
body.last_name = options.lastName;
|
|
60
|
+
if (options.role !== undefined)
|
|
61
|
+
body.role = options.role;
|
|
62
|
+
if (options.timezone !== undefined)
|
|
63
|
+
body.timezone = options.timezone;
|
|
64
|
+
if (options.onboarded !== undefined)
|
|
65
|
+
body.onboarded = options.onboarded;
|
|
66
|
+
return this.http.patch(`/v1/users/${this.userId}`, body);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get sync statistics for the user's integrations.
|
|
70
|
+
*
|
|
71
|
+
* @returns Sync statistics including message counts and last sync times
|
|
72
|
+
*
|
|
73
|
+
* @throws {AuthenticationError} If the API key is invalid or expired
|
|
74
|
+
* @throws {NotFoundError} If the user does not exist
|
|
75
|
+
* @throws {NetworkError} If unable to reach the API
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const stats = await attrove.users.syncStats();
|
|
80
|
+
* console.log(`Total messages: ${stats.totals.messages.count}`);
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
async syncStats() {
|
|
84
|
+
return this.http.get(`/v1/users/${this.userId}/sync-stats`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=users.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../../../../../packages/sdk/src/resources/users.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAwBH;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IACxB,YACmB,IAAgB,EAChB,MAAc;QADd,SAAI,GAAJ,IAAI,CAAY;QAChB,WAAM,GAAN,MAAM,CAAQ;IAC9B,CAAC;IAEJ;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,GAAG;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAuB,aAAa,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,KAAK,CAAC,MAAM,CAAC,OAA0B;QACrC,MAAM,IAAI,GAA4B,EAAE,CAAC;QAEzC,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;YAAE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACzE,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS;YAAE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;QACtE,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;YAAE,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzD,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS;YAAE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACrE,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS;YAAE,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QAExE,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAO,aAAa,IAAI,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,SAAS;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAY,aAAa,IAAI,CAAC,MAAM,aAAa,CAAC,CAAC;IACzE,CAAC;CACF"}
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attrove SDK Types
|
|
3
|
+
*
|
|
4
|
+
* Standalone type definitions for the SDK. These are bundled with the package
|
|
5
|
+
* and do not depend on internal monorepo packages.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Helper to cast a string to a branded type.
|
|
9
|
+
*
|
|
10
|
+
* Use with caution - this bypasses type safety. Prefer using the
|
|
11
|
+
* validation factory functions (createUserId, createApiKey, etc.)
|
|
12
|
+
* which validate the input before branding.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // Only use after validating the format
|
|
17
|
+
* const userId = asBrandedString<UserId>(validatedUuid);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export function asBrandedString(value) {
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
// =============================================================================
|
|
24
|
+
// Validation Factory Functions
|
|
25
|
+
// =============================================================================
|
|
26
|
+
//
|
|
27
|
+
// These functions validate input and return branded types. Use these instead
|
|
28
|
+
// of asBrandedString when you want runtime validation.
|
|
29
|
+
//
|
|
30
|
+
/**
|
|
31
|
+
* UUID regex pattern.
|
|
32
|
+
* Validates the 8-4-4-4-12 hexadecimal format but does not enforce a specific UUID version.
|
|
33
|
+
*/
|
|
34
|
+
const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
35
|
+
/**
|
|
36
|
+
* API key regex pattern (sk_ prefix followed by alphanumeric and underscores).
|
|
37
|
+
*/
|
|
38
|
+
const API_KEY_REGEX = /^sk_[a-zA-Z0-9_]+$/;
|
|
39
|
+
/**
|
|
40
|
+
* ISO 8601 date regex pattern (basic validation).
|
|
41
|
+
*/
|
|
42
|
+
const ISO_DATE_REGEX = /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/;
|
|
43
|
+
/**
|
|
44
|
+
* Check if a string is a valid UUID format.
|
|
45
|
+
* Validates the 8-4-4-4-12 hexadecimal format but does not enforce a specific UUID version.
|
|
46
|
+
*
|
|
47
|
+
* @param value - String to validate
|
|
48
|
+
* @returns True if the string is a valid UUID format
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* if (isValidUUID(userId)) {
|
|
53
|
+
* // proceed with the valid UUID
|
|
54
|
+
* }
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export function isValidUUID(value) {
|
|
58
|
+
return UUID_REGEX.test(value);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Validate and create a UserId from a string.
|
|
62
|
+
*
|
|
63
|
+
* @param value - String to validate
|
|
64
|
+
* @returns Validation result with branded UserId or error message
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const result = createUserId('550e8400-e29b-41d4-a716-446655440000');
|
|
69
|
+
* if (result.success) {
|
|
70
|
+
* const userId: UserId = result.value;
|
|
71
|
+
* } else {
|
|
72
|
+
* console.error(result.error);
|
|
73
|
+
* }
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export function createUserId(value) {
|
|
77
|
+
if (!value || typeof value !== 'string') {
|
|
78
|
+
return { success: false, error: 'UserId must be a non-empty string' };
|
|
79
|
+
}
|
|
80
|
+
if (!UUID_REGEX.test(value)) {
|
|
81
|
+
return { success: false, error: 'UserId must be a valid UUID format' };
|
|
82
|
+
}
|
|
83
|
+
return { success: true, value: value };
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Validate and create an IntegrationId from a string.
|
|
87
|
+
*/
|
|
88
|
+
export function createIntegrationId(value) {
|
|
89
|
+
if (!value || typeof value !== 'string') {
|
|
90
|
+
return { success: false, error: 'IntegrationId must be a non-empty string' };
|
|
91
|
+
}
|
|
92
|
+
if (!UUID_REGEX.test(value)) {
|
|
93
|
+
return { success: false, error: 'IntegrationId must be a valid UUID format' };
|
|
94
|
+
}
|
|
95
|
+
return { success: true, value: value };
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Validate and create a MessageId from a string.
|
|
99
|
+
*/
|
|
100
|
+
export function createMessageId(value) {
|
|
101
|
+
if (!value || typeof value !== 'string') {
|
|
102
|
+
return { success: false, error: 'MessageId must be a non-empty string' };
|
|
103
|
+
}
|
|
104
|
+
if (!UUID_REGEX.test(value)) {
|
|
105
|
+
return { success: false, error: 'MessageId must be a valid UUID format' };
|
|
106
|
+
}
|
|
107
|
+
return { success: true, value: value };
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Validate and create a ConversationId from a string.
|
|
111
|
+
*/
|
|
112
|
+
export function createConversationId(value) {
|
|
113
|
+
if (!value || typeof value !== 'string') {
|
|
114
|
+
return { success: false, error: 'ConversationId must be a non-empty string' };
|
|
115
|
+
}
|
|
116
|
+
if (!UUID_REGEX.test(value)) {
|
|
117
|
+
return { success: false, error: 'ConversationId must be a valid UUID format' };
|
|
118
|
+
}
|
|
119
|
+
return { success: true, value: value };
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Validate and create an ApiKeyToken from a string.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* const result = createApiKey('sk_live_abc123');
|
|
127
|
+
* if (result.success) {
|
|
128
|
+
* const apiKey: ApiKeyToken = result.value;
|
|
129
|
+
* }
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
export function createApiKey(value) {
|
|
133
|
+
if (!value || typeof value !== 'string') {
|
|
134
|
+
return { success: false, error: 'ApiKey must be a non-empty string' };
|
|
135
|
+
}
|
|
136
|
+
if (!API_KEY_REGEX.test(value)) {
|
|
137
|
+
return { success: false, error: 'ApiKey must start with "sk_" followed by alphanumeric characters' };
|
|
138
|
+
}
|
|
139
|
+
return { success: true, value: value };
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Validate and create an ISODateString from a string.
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```ts
|
|
146
|
+
* const result = createISODate('2024-01-15T10:30:00Z');
|
|
147
|
+
* if (result.success) {
|
|
148
|
+
* const date: ISODateString = result.value;
|
|
149
|
+
* }
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
export function createISODate(value) {
|
|
153
|
+
if (!value || typeof value !== 'string') {
|
|
154
|
+
return { success: false, error: 'ISODateString must be a non-empty string' };
|
|
155
|
+
}
|
|
156
|
+
if (!ISO_DATE_REGEX.test(value)) {
|
|
157
|
+
return { success: false, error: 'ISODateString must be a valid ISO 8601 date format' };
|
|
158
|
+
}
|
|
159
|
+
// Additional validation: ensure it parses to a valid date
|
|
160
|
+
const parsed = Date.parse(value);
|
|
161
|
+
if (Number.isNaN(parsed)) {
|
|
162
|
+
return { success: false, error: 'ISODateString must be a valid date' };
|
|
163
|
+
}
|
|
164
|
+
return { success: true, value: value };
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Validate and create a UUID from a string.
|
|
168
|
+
*/
|
|
169
|
+
export function createUUID(value) {
|
|
170
|
+
if (!value || typeof value !== 'string') {
|
|
171
|
+
return { success: false, error: 'UUID must be a non-empty string' };
|
|
172
|
+
}
|
|
173
|
+
if (!UUID_REGEX.test(value)) {
|
|
174
|
+
return { success: false, error: 'UUID must be a valid UUID format' };
|
|
175
|
+
}
|
|
176
|
+
return { success: true, value: value };
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Check if a string is a valid API key format.
|
|
180
|
+
*/
|
|
181
|
+
export function isValidApiKey(value) {
|
|
182
|
+
return API_KEY_REGEX.test(value);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Check if a string is a valid ISO 8601 date format.
|
|
186
|
+
*/
|
|
187
|
+
export function isValidISODate(value) {
|
|
188
|
+
return ISO_DATE_REGEX.test(value) && !Number.isNaN(Date.parse(value));
|
|
189
|
+
}
|
|
190
|
+
// =============================================================================
|
|
191
|
+
// Error Types
|
|
192
|
+
// =============================================================================
|
|
193
|
+
/**
|
|
194
|
+
* Standardized error codes from the Attrove API.
|
|
195
|
+
*/
|
|
196
|
+
export const ErrorCodes = {
|
|
197
|
+
// Authentication errors
|
|
198
|
+
AUTH_MISSING_TOKEN: 'AUTH_MISSING_TOKEN',
|
|
199
|
+
AUTH_INVALID_TOKEN: 'AUTH_INVALID_TOKEN',
|
|
200
|
+
AUTH_EXPIRED_TOKEN: 'AUTH_EXPIRED_TOKEN',
|
|
201
|
+
AUTH_USER_MISMATCH: 'AUTH_USER_MISMATCH',
|
|
202
|
+
AUTH_INSUFFICIENT_PERMISSIONS: 'AUTH_INSUFFICIENT_PERMISSIONS',
|
|
203
|
+
// Resource errors
|
|
204
|
+
RESOURCE_NOT_FOUND: 'RESOURCE_NOT_FOUND',
|
|
205
|
+
RESOURCE_ACCESS_DENIED: 'RESOURCE_ACCESS_DENIED',
|
|
206
|
+
RESOURCE_ALREADY_EXISTS: 'RESOURCE_ALREADY_EXISTS',
|
|
207
|
+
RESOURCE_DELETED: 'RESOURCE_DELETED',
|
|
208
|
+
// Validation errors
|
|
209
|
+
VALIDATION_INVALID_ID: 'VALIDATION_INVALID_ID',
|
|
210
|
+
VALIDATION_REQUIRED_FIELD: 'VALIDATION_REQUIRED_FIELD',
|
|
211
|
+
VALIDATION_INVALID_FORMAT: 'VALIDATION_INVALID_FORMAT',
|
|
212
|
+
VALIDATION_OUT_OF_RANGE: 'VALIDATION_OUT_OF_RANGE',
|
|
213
|
+
// Integration errors
|
|
214
|
+
INTEGRATION_OAUTH_FAILED: 'INTEGRATION_OAUTH_FAILED',
|
|
215
|
+
INTEGRATION_EMAIL_EXISTS: 'INTEGRATION_EMAIL_EXISTS',
|
|
216
|
+
INTEGRATION_TOKEN_EXPIRED: 'INTEGRATION_TOKEN_EXPIRED',
|
|
217
|
+
INTEGRATION_SYNC_FAILED: 'INTEGRATION_SYNC_FAILED',
|
|
218
|
+
INTEGRATION_NOT_CONNECTED: 'INTEGRATION_NOT_CONNECTED',
|
|
219
|
+
// Rate limiting
|
|
220
|
+
RATE_LIMIT_EXCEEDED: 'RATE_LIMIT_EXCEEDED',
|
|
221
|
+
// Server errors
|
|
222
|
+
INTERNAL_ERROR: 'INTERNAL_ERROR',
|
|
223
|
+
SERVICE_UNAVAILABLE: 'SERVICE_UNAVAILABLE',
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Valid stream frame types.
|
|
227
|
+
*/
|
|
228
|
+
const VALID_FRAME_TYPES = new Set(['chunk', 'end', 'error', 'state', 'message_ids', 'stream_start']);
|
|
229
|
+
/**
|
|
230
|
+
* Runtime validator for StreamFrame objects.
|
|
231
|
+
* Validates that parsed JSON has the required structure for a StreamFrame.
|
|
232
|
+
*
|
|
233
|
+
* @param data - Unknown data to validate (typically from JSON.parse)
|
|
234
|
+
* @returns True if the data is a valid StreamFrame, false otherwise
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```ts
|
|
238
|
+
* const parsed = JSON.parse(event.data);
|
|
239
|
+
* if (isValidStreamFrame(parsed)) {
|
|
240
|
+
* // TypeScript knows parsed is StreamFrame
|
|
241
|
+
* handleFrame(parsed);
|
|
242
|
+
* }
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
export function isValidStreamFrame(data) {
|
|
246
|
+
if (!data || typeof data !== 'object') {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
const frame = data;
|
|
250
|
+
// All frames must have type and message_id
|
|
251
|
+
if (typeof frame.type !== 'string' || !VALID_FRAME_TYPES.has(frame.type)) {
|
|
252
|
+
return false;
|
|
253
|
+
}
|
|
254
|
+
if (typeof frame.message_id !== 'string') {
|
|
255
|
+
return false;
|
|
256
|
+
}
|
|
257
|
+
// Type-specific validation
|
|
258
|
+
switch (frame.type) {
|
|
259
|
+
case 'chunk':
|
|
260
|
+
return typeof frame.content === 'string';
|
|
261
|
+
case 'end':
|
|
262
|
+
return typeof frame.reason === 'string' &&
|
|
263
|
+
['completed', 'cancelled', 'error'].includes(frame.reason);
|
|
264
|
+
case 'error':
|
|
265
|
+
return typeof frame.error === 'string';
|
|
266
|
+
case 'state':
|
|
267
|
+
return typeof frame.state === 'string';
|
|
268
|
+
case 'message_ids':
|
|
269
|
+
return Array.isArray(frame.used_message_ids) &&
|
|
270
|
+
frame.used_message_ids.every((id) => typeof id === 'string');
|
|
271
|
+
case 'stream_start':
|
|
272
|
+
return true;
|
|
273
|
+
default:
|
|
274
|
+
return false;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/sdk/src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuDH;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe,CAAmB,KAAa;IAC7D,OAAO,KAAU,CAAC;AACpB,CAAC;AAED,gFAAgF;AAChF,+BAA+B;AAC/B,gFAAgF;AAChF,EAAE;AACF,6EAA6E;AAC7E,uDAAuD;AACvD,EAAE;AAEF;;;GAGG;AACH,MAAM,UAAU,GAAG,iEAAiE,CAAC;AAErF;;GAEG;AACH,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAE3C;;GAEG;AACH,MAAM,cAAc,GAAG,sEAAsE,CAAC;AAE9F;;;;;;;;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