@tuteliq/sdk 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1034 -0
  3. package/dist/cjs/client.js +1283 -0
  4. package/dist/cjs/client.js.map +1 -0
  5. package/dist/cjs/constants.js +179 -0
  6. package/dist/cjs/constants.js.map +1 -0
  7. package/dist/cjs/errors.js +129 -0
  8. package/dist/cjs/errors.js.map +1 -0
  9. package/dist/cjs/index.js +37 -0
  10. package/dist/cjs/index.js.map +1 -0
  11. package/dist/cjs/types/account.js +6 -0
  12. package/dist/cjs/types/account.js.map +1 -0
  13. package/dist/cjs/types/analysis.js +6 -0
  14. package/dist/cjs/types/analysis.js.map +1 -0
  15. package/dist/cjs/types/guidance.js +3 -0
  16. package/dist/cjs/types/guidance.js.map +1 -0
  17. package/dist/cjs/types/index.js +28 -0
  18. package/dist/cjs/types/index.js.map +1 -0
  19. package/dist/cjs/types/media.js +6 -0
  20. package/dist/cjs/types/media.js.map +1 -0
  21. package/dist/cjs/types/policy.js +6 -0
  22. package/dist/cjs/types/policy.js.map +1 -0
  23. package/dist/cjs/types/pricing.js +6 -0
  24. package/dist/cjs/types/pricing.js.map +1 -0
  25. package/dist/cjs/types/reports.js +3 -0
  26. package/dist/cjs/types/reports.js.map +1 -0
  27. package/dist/cjs/types/safety.js +7 -0
  28. package/dist/cjs/types/safety.js.map +1 -0
  29. package/dist/cjs/types/voice-stream.js +6 -0
  30. package/dist/cjs/types/voice-stream.js.map +1 -0
  31. package/dist/cjs/types/webhooks.js +6 -0
  32. package/dist/cjs/types/webhooks.js.map +1 -0
  33. package/dist/cjs/utils/retry.js +64 -0
  34. package/dist/cjs/utils/retry.js.map +1 -0
  35. package/dist/cjs/voice-stream.js +184 -0
  36. package/dist/cjs/voice-stream.js.map +1 -0
  37. package/dist/client.d.ts +643 -0
  38. package/dist/client.d.ts.map +1 -0
  39. package/dist/client.js +1280 -0
  40. package/dist/client.js.map +1 -0
  41. package/dist/constants.d.ts +141 -0
  42. package/dist/constants.d.ts.map +1 -0
  43. package/dist/constants.js +176 -0
  44. package/dist/constants.js.map +1 -0
  45. package/dist/errors.d.ts +81 -0
  46. package/dist/errors.d.ts.map +1 -0
  47. package/dist/errors.js +116 -0
  48. package/dist/errors.js.map +1 -0
  49. package/dist/index.d.ts +6 -0
  50. package/dist/index.d.ts.map +1 -0
  51. package/dist/index.js +9 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/types/account.d.ts +161 -0
  54. package/dist/types/account.d.ts.map +1 -0
  55. package/dist/types/account.js +5 -0
  56. package/dist/types/account.js.map +1 -0
  57. package/dist/types/analysis.d.ts +41 -0
  58. package/dist/types/analysis.d.ts.map +1 -0
  59. package/dist/types/analysis.js +4 -0
  60. package/dist/types/analysis.js.map +1 -0
  61. package/dist/types/guidance.d.ts +35 -0
  62. package/dist/types/guidance.d.ts.map +1 -0
  63. package/dist/types/guidance.js +2 -0
  64. package/dist/types/guidance.js.map +1 -0
  65. package/dist/types/index.d.ts +231 -0
  66. package/dist/types/index.d.ts.map +1 -0
  67. package/dist/types/index.js +12 -0
  68. package/dist/types/index.js.map +1 -0
  69. package/dist/types/media.d.ts +121 -0
  70. package/dist/types/media.d.ts.map +1 -0
  71. package/dist/types/media.js +4 -0
  72. package/dist/types/media.js.map +1 -0
  73. package/dist/types/policy.d.ts +54 -0
  74. package/dist/types/policy.d.ts.map +1 -0
  75. package/dist/types/policy.js +5 -0
  76. package/dist/types/policy.js.map +1 -0
  77. package/dist/types/pricing.d.ts +53 -0
  78. package/dist/types/pricing.d.ts.map +1 -0
  79. package/dist/types/pricing.js +5 -0
  80. package/dist/types/pricing.js.map +1 -0
  81. package/dist/types/reports.d.ts +44 -0
  82. package/dist/types/reports.d.ts.map +1 -0
  83. package/dist/types/reports.js +2 -0
  84. package/dist/types/reports.js.map +1 -0
  85. package/dist/types/safety.d.ts +151 -0
  86. package/dist/types/safety.d.ts.map +1 -0
  87. package/dist/types/safety.js +4 -0
  88. package/dist/types/safety.js.map +1 -0
  89. package/dist/types/voice-stream.d.ts +97 -0
  90. package/dist/types/voice-stream.d.ts.map +1 -0
  91. package/dist/types/voice-stream.js +5 -0
  92. package/dist/types/voice-stream.js.map +1 -0
  93. package/dist/types/webhooks.d.ts +110 -0
  94. package/dist/types/webhooks.d.ts.map +1 -0
  95. package/dist/types/webhooks.js +4 -0
  96. package/dist/types/webhooks.js.map +1 -0
  97. package/dist/utils/retry.d.ts +17 -0
  98. package/dist/utils/retry.d.ts.map +1 -0
  99. package/dist/utils/retry.js +61 -0
  100. package/dist/utils/retry.js.map +1 -0
  101. package/dist/voice-stream.d.ts +16 -0
  102. package/dist/voice-stream.d.ts.map +1 -0
  103. package/dist/voice-stream.js +148 -0
  104. package/dist/voice-stream.js.map +1 -0
  105. package/package.json +81 -0
@@ -0,0 +1,161 @@
1
+ /**
2
+ * Result of account data deletion (GDPR Article 17 - Right to Erasure)
3
+ */
4
+ export interface AccountDeletionResult {
5
+ /** Confirmation message */
6
+ message: string;
7
+ /** Number of records deleted */
8
+ deleted_count: number;
9
+ }
10
+ /**
11
+ * Exported user data (GDPR Article 20 - Right to Data Portability)
12
+ */
13
+ export interface AccountExportResult {
14
+ /** User ID */
15
+ userId: string;
16
+ /** ISO timestamp of when the export was created */
17
+ exportedAt: string;
18
+ /** All user data grouped by collection */
19
+ data: Record<string, unknown[]>;
20
+ }
21
+ export type ConsentType = 'data_processing' | 'analytics' | 'marketing' | 'third_party_sharing' | 'child_safety_monitoring';
22
+ export type ConsentStatus = 'granted' | 'withdrawn';
23
+ export interface RecordConsentInput {
24
+ /** Type of consent being recorded */
25
+ consent_type: ConsentType;
26
+ /** Policy version the user is consenting to */
27
+ version: string;
28
+ }
29
+ export interface ConsentRecord {
30
+ /** Consent record ID */
31
+ id: string;
32
+ /** User ID */
33
+ user_id: string;
34
+ /** Type of consent */
35
+ consent_type: ConsentType;
36
+ /** Current status */
37
+ status: ConsentStatus;
38
+ /** Policy version */
39
+ version: string;
40
+ /** When the consent was recorded */
41
+ created_at: string;
42
+ }
43
+ export interface ConsentStatusResult {
44
+ /** List of consent records */
45
+ consents: ConsentRecord[];
46
+ }
47
+ export interface ConsentActionResult {
48
+ /** Confirmation message */
49
+ message: string;
50
+ /** The consent record */
51
+ consent: ConsentRecord;
52
+ }
53
+ export interface RectifyDataInput {
54
+ /** Firestore collection name */
55
+ collection: string;
56
+ /** Document ID to rectify */
57
+ document_id: string;
58
+ /** Fields to update (only allowlisted fields accepted) */
59
+ fields: Record<string, unknown>;
60
+ }
61
+ export interface RectifyDataResult {
62
+ /** Confirmation message */
63
+ message: string;
64
+ /** List of fields that were updated */
65
+ updated_fields: string[];
66
+ }
67
+ export type AuditAction = 'data_access' | 'data_export' | 'data_deletion' | 'data_rectification' | 'consent_granted' | 'consent_withdrawn' | 'breach_notification';
68
+ export interface AuditLogEntry {
69
+ /** Audit log entry ID */
70
+ id: string;
71
+ /** User ID */
72
+ user_id: string;
73
+ /** Action that was performed */
74
+ action: AuditAction;
75
+ /** Additional details */
76
+ details?: Record<string, unknown>;
77
+ /** When the action occurred */
78
+ created_at: string;
79
+ }
80
+ export interface AuditLogsResult {
81
+ /** List of audit log entries */
82
+ audit_logs: AuditLogEntry[];
83
+ }
84
+ export interface GetAuditLogsOptions {
85
+ /** Filter by action type */
86
+ action?: AuditAction;
87
+ /** Maximum number of results */
88
+ limit?: number;
89
+ }
90
+ export type BreachSeverity = 'low' | 'medium' | 'high' | 'critical';
91
+ export type BreachStatus = 'detected' | 'investigating' | 'contained' | 'reported' | 'resolved';
92
+ export type BreachNotificationStatus = 'pending' | 'users_notified' | 'dpa_notified' | 'completed';
93
+ export interface LogBreachInput {
94
+ /** Title of the breach */
95
+ title: string;
96
+ /** Description of the breach */
97
+ description: string;
98
+ /** Severity level */
99
+ severity: BreachSeverity;
100
+ /** List of affected user IDs */
101
+ affected_user_ids: string[];
102
+ /** Categories of data affected */
103
+ data_categories: string[];
104
+ /** Who reported the breach */
105
+ reported_by: string;
106
+ }
107
+ export interface UpdateBreachInput {
108
+ /** New status */
109
+ status: BreachStatus;
110
+ /** Notification status update */
111
+ notification_status?: BreachNotificationStatus;
112
+ /** Additional notes */
113
+ notes?: string;
114
+ }
115
+ export interface BreachRecord {
116
+ /** Breach ID */
117
+ id: string;
118
+ /** Title */
119
+ title: string;
120
+ /** Description */
121
+ description: string;
122
+ /** Severity level */
123
+ severity: BreachSeverity;
124
+ /** Current status */
125
+ status: BreachStatus;
126
+ /** Notification status */
127
+ notification_status: BreachNotificationStatus;
128
+ /** List of affected user IDs */
129
+ affected_user_ids: string[];
130
+ /** Categories of data affected */
131
+ data_categories: string[];
132
+ /** Who reported the breach */
133
+ reported_by: string;
134
+ /** Deadline for notification (ISO timestamp) */
135
+ notification_deadline: string;
136
+ /** When the breach was logged (ISO timestamp) */
137
+ created_at: string;
138
+ /** When the breach was last updated (ISO timestamp) */
139
+ updated_at: string;
140
+ }
141
+ export interface LogBreachResult {
142
+ /** Confirmation message */
143
+ message: string;
144
+ /** The created breach record */
145
+ breach: BreachRecord;
146
+ }
147
+ export interface BreachListResult {
148
+ /** List of breach records */
149
+ breaches: BreachRecord[];
150
+ }
151
+ export interface BreachResult {
152
+ /** The breach record */
153
+ breach: BreachRecord;
154
+ }
155
+ export interface GetBreachesOptions {
156
+ /** Filter by status */
157
+ status?: BreachStatus;
158
+ /** Maximum number of results */
159
+ limit?: number;
160
+ }
161
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/types/account.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,qBAAqB;IAClC,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,aAAa,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,cAAc;IACd,MAAM,EAA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,iBAAiB;IAC9B,iBAAiB;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,iCAAiC;IACjC,mBAAmB,CAAC,EAAE,wBAAwB,CAAC;IAC/C,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IACzB,gBAAgB;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,qBAAqB;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,0BAA0B;IAC1B,mBAAmB,EAAE,wBAAwB,CAAC;IAC9C,gCAAgC;IAChC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,kCAAkC;IAClC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,8BAA8B;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,qBAAqB,EAAE,MAAM,CAAC;IAC9B,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC5B,2BAA2B;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,gCAAgC;IAChC,MAAM,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC7B,6BAA6B;IAC7B,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IACzB,wBAAwB;IACxB,MAAM,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IAC/B,uBAAuB;IACvB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,5 @@
1
+ // =============================================================================
2
+ // Account Management Types (GDPR)
3
+ // =============================================================================
4
+ export {};
5
+ //# sourceMappingURL=account.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/types/account.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,kCAAkC;AAClC,gFAAgF"}
@@ -0,0 +1,41 @@
1
+ import { ContextInput } from './safety.js';
2
+ import { EmotionTrend } from '../constants.js';
3
+ import { TrackingFields } from './index.js';
4
+ export { EmotionTrend };
5
+ export interface EmotionMessage {
6
+ /** Sender identifier or role */
7
+ sender: string;
8
+ /** Message content */
9
+ content: string;
10
+ /** Optional timestamp */
11
+ timestamp?: string | Date;
12
+ }
13
+ export interface AnalyzeEmotionsInput extends TrackingFields {
14
+ /** Single content string or message history to analyze */
15
+ content?: string;
16
+ /** Chat history to analyze (alternative to content) */
17
+ messages?: EmotionMessage[];
18
+ /** Context for better analysis */
19
+ context?: ContextInput;
20
+ }
21
+ export interface EmotionsResult {
22
+ /** Primary emotions detected */
23
+ dominant_emotions: string[];
24
+ /** Scores for each detected emotion (0-1) */
25
+ emotion_scores: Record<string, number>;
26
+ /** Overall emotional trend */
27
+ trend: EmotionTrend;
28
+ /** Summary of the emotional analysis */
29
+ summary: string;
30
+ /** Recommended follow-up action */
31
+ recommended_followup: string;
32
+ /** Number of credits consumed by this request */
33
+ credits_used?: number;
34
+ /** Echo of provided external_id (if any) */
35
+ external_id?: string;
36
+ /** Echo of provided metadata (if any) */
37
+ metadata?: Record<string, unknown>;
38
+ }
39
+ export type EmotionSummaryRequest = AnalyzeEmotionsInput;
40
+ export type EmotionSummaryResponse = EmotionsResult;
41
+ //# sourceMappingURL=analysis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../../src/types/analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,EAAE,YAAY,EAAE,CAAC;AAMxB,MAAM,WAAW,cAAc;IAC3B,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IACxD,0DAA0D;IAC1D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;IAC5B,kCAAkC;IAClC,OAAO,CAAC,EAAE,YAAY,CAAC;CAC1B;AAED,MAAM,WAAW,cAAc;IAC3B,gCAAgC;IAChC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,6CAA6C;IAC7C,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,8BAA8B;IAC9B,KAAK,EAAE,YAAY,CAAC;IACpB,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAGD,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AACzD,MAAM,MAAM,sBAAsB,GAAG,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { EmotionTrend } from '../constants.js';
2
+ // Re-export enum for convenience
3
+ export { EmotionTrend };
4
+ //# sourceMappingURL=analysis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analysis.js","sourceRoot":"","sources":["../../src/types/analysis.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,iCAAiC;AACjC,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { TrackingFields } from './index.js';
2
+ /**
3
+ * Target audience for action plans
4
+ */
5
+ export type Audience = 'child' | 'parent' | 'educator' | 'platform';
6
+ export interface GetActionPlanInput extends TrackingFields {
7
+ /** Description of the situation */
8
+ situation: string;
9
+ /** Age of the child */
10
+ childAge?: number;
11
+ /** Target audience for the guidance (defaults to 'parent') */
12
+ audience?: Audience;
13
+ /** Severity level to tailor the response */
14
+ severity?: 'low' | 'medium' | 'high' | 'critical';
15
+ }
16
+ export interface ActionPlanResult {
17
+ /** Target audience label */
18
+ audience: string;
19
+ /** Step-by-step action items */
20
+ steps: string[];
21
+ /** Tone used in the guidance */
22
+ tone: string;
23
+ /** Approximate reading level */
24
+ reading_level?: string;
25
+ /** Number of credits consumed by this request */
26
+ credits_used?: number;
27
+ /** Echo of provided external_id (if any) */
28
+ external_id?: string;
29
+ /** Echo of provided metadata (if any) */
30
+ metadata?: Record<string, unknown>;
31
+ }
32
+ export type ActionPlanRole = Audience;
33
+ export type ActionPlanRequest = GetActionPlanInput;
34
+ export type ActionPlanResponse = ActionPlanResult;
35
+ //# sourceMappingURL=guidance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guidance.d.ts","sourceRoot":"","sources":["../../src/types/guidance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,GAAG,UAAU,CAAC;AAMpE,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACtD,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;CACrD;AAED,MAAM,WAAW,gBAAgB;IAC7B,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,gCAAgC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAGD,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC;AACtC,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AACnD,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=guidance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guidance.js","sourceRoot":"","sources":["../../src/types/guidance.ts"],"names":[],"mappings":""}
@@ -0,0 +1,231 @@
1
+ export * from './safety.js';
2
+ export * from './analysis.js';
3
+ export * from './guidance.js';
4
+ export * from './reports.js';
5
+ export * from './policy.js';
6
+ export * from './account.js';
7
+ export * from './media.js';
8
+ export * from './webhooks.js';
9
+ export * from './pricing.js';
10
+ export * from './voice-stream.js';
11
+ /**
12
+ * Tracking fields for correlating requests with your systems
13
+ */
14
+ export interface TrackingFields {
15
+ /**
16
+ * Your unique identifier for this request (e.g., message ID, user ID, session ID)
17
+ * Maximum 255 characters. Echoed back in response and included in webhooks.
18
+ */
19
+ external_id?: string;
20
+ /**
21
+ * Your end-customer identifier for multi-tenant / B2B2C scenarios.
22
+ * Maximum 255 characters. Echoed back in response and included in webhooks,
23
+ * enabling you to route alerts to the correct customer from a single webhook endpoint.
24
+ */
25
+ customer_id?: string;
26
+ /**
27
+ * Custom key-value pairs for additional context
28
+ * Stored with detection results and included in webhooks.
29
+ */
30
+ metadata?: Record<string, unknown>;
31
+ }
32
+ export interface ApiError {
33
+ error: {
34
+ code: string;
35
+ message: string;
36
+ details?: unknown;
37
+ suggestion?: string;
38
+ links?: Record<string, string>;
39
+ };
40
+ }
41
+ export interface TuteliqOptions {
42
+ /** Request timeout in milliseconds (defaults to 30000) */
43
+ timeout?: number;
44
+ /** Number of retry attempts (defaults to 3) */
45
+ retries?: number;
46
+ /** Initial retry delay in milliseconds (defaults to 1000) */
47
+ retryDelay?: number;
48
+ }
49
+ export interface Usage {
50
+ /** Total monthly message limit */
51
+ limit: number;
52
+ /** Messages used this month */
53
+ used: number;
54
+ /** Messages remaining this month */
55
+ remaining: number;
56
+ }
57
+ export interface RateLimitInfo {
58
+ /** Rate limit per minute */
59
+ limit: number;
60
+ /** Remaining requests this minute */
61
+ remaining: number;
62
+ /** Unix timestamp when limit resets */
63
+ reset?: number;
64
+ }
65
+ export interface UsageSummary {
66
+ /** Messages used in current billing period */
67
+ messages_used: number;
68
+ /** Monthly message limit */
69
+ message_limit: number;
70
+ /** Purchased credits available */
71
+ purchased_credits: number;
72
+ /** Total available (limit + credits) */
73
+ total_available: number;
74
+ /** Usage percentage (0-100) */
75
+ usage_percentage: number;
76
+ /** Billing period start date (ISO string) */
77
+ period_start: string;
78
+ /** Billing period end date (ISO string) */
79
+ period_end: string;
80
+ /** Days remaining in billing period */
81
+ days_remaining: number;
82
+ }
83
+ export interface UsageQuota {
84
+ /** Rate limit per minute */
85
+ rate_limit: number;
86
+ /** Remaining requests this minute */
87
+ remaining: number;
88
+ /** Seconds until rate limit resets */
89
+ reset_in_seconds: number;
90
+ /** Current tier */
91
+ tier: string;
92
+ }
93
+ /** A single day's usage data. */
94
+ export interface UsageDay {
95
+ /** Date in YYYY-MM-DD format */
96
+ date: string;
97
+ /** Total requests on this day */
98
+ total_requests: number;
99
+ /** Successful requests */
100
+ success_requests: number;
101
+ /** Failed requests */
102
+ error_requests: number;
103
+ }
104
+ /** Result from `GET /api/v1/usage/history`. */
105
+ export interface UsageHistoryResult {
106
+ /** API key ID */
107
+ api_key_id: string;
108
+ /** Daily usage data */
109
+ days: UsageDay[];
110
+ }
111
+ /** Result from `GET /api/v1/usage/by-tool`. */
112
+ export interface UsageByToolResult {
113
+ /** Date in YYYY-MM-DD format */
114
+ date: string;
115
+ /** Request counts per tool */
116
+ tools: Record<string, number>;
117
+ /** Request counts per endpoint */
118
+ endpoints: Record<string, number>;
119
+ }
120
+ /** Result from `GET /api/v1/usage/monthly`. */
121
+ export interface UsageMonthlyResult {
122
+ /** Current tier */
123
+ tier: string;
124
+ /** Tier display name */
125
+ tier_display_name: string;
126
+ /** Billing period info */
127
+ billing: {
128
+ current_period_start: string;
129
+ current_period_end: string;
130
+ days_remaining: number;
131
+ };
132
+ /** Monthly usage stats */
133
+ usage: {
134
+ used: number;
135
+ limit: number;
136
+ remaining: number;
137
+ percent_used: number;
138
+ };
139
+ /** Rate limit info */
140
+ rate_limit: {
141
+ requests_per_minute: number;
142
+ };
143
+ /** Upgrade recommendations (null if not applicable) */
144
+ recommendations: {
145
+ should_upgrade: boolean;
146
+ reason: string;
147
+ suggested_tier: string;
148
+ upgrade_url: string;
149
+ } | null;
150
+ /** Useful links */
151
+ links: {
152
+ dashboard: string;
153
+ pricing: string;
154
+ buy_credits: string;
155
+ };
156
+ }
157
+ export interface BatchItemBase {
158
+ /** Optional context - string shorthand or detailed object */
159
+ context?: string | {
160
+ language?: string;
161
+ ageGroup?: string;
162
+ relationship?: string;
163
+ platform?: string;
164
+ };
165
+ /** Optional external ID for correlation */
166
+ external_id?: string;
167
+ }
168
+ export interface BatchTextItem extends BatchItemBase {
169
+ /** Analysis type to perform */
170
+ type: 'bullying' | 'unsafe' | 'emotions';
171
+ /** Content to analyze */
172
+ content: string;
173
+ }
174
+ export interface BatchGroomingItem extends BatchItemBase {
175
+ /** Grooming analysis type */
176
+ type: 'grooming';
177
+ /** Messages to analyze for grooming patterns */
178
+ messages: Array<{
179
+ role: string;
180
+ content: string;
181
+ }>;
182
+ /** Age of the child */
183
+ childAge?: number;
184
+ }
185
+ export type BatchItem = BatchTextItem | BatchGroomingItem;
186
+ export interface BatchAnalyzeInput {
187
+ /** Items to analyze (max 25) */
188
+ items: BatchItem[];
189
+ /** Process items in parallel (default: true) */
190
+ parallel?: boolean;
191
+ /** Continue processing if an item fails (default: true) */
192
+ continueOnError?: boolean;
193
+ }
194
+ export interface BatchResultItem {
195
+ /** Index of the item in the original array */
196
+ index: number;
197
+ /** Whether analysis succeeded */
198
+ success: boolean;
199
+ /** Analysis result (if successful) */
200
+ result?: unknown;
201
+ /** Error message (if failed) */
202
+ error?: string;
203
+ /** External ID (if provided) */
204
+ external_id?: string;
205
+ }
206
+ export interface BatchAnalyzeResult {
207
+ /** Individual results */
208
+ results: BatchResultItem[];
209
+ /** Summary statistics */
210
+ summary: {
211
+ total: number;
212
+ successful: number;
213
+ failed: number;
214
+ };
215
+ /** Total processing time in ms */
216
+ processing_time_ms: number;
217
+ }
218
+ export interface RequestMeta {
219
+ /** Request correlation ID */
220
+ requestId: string;
221
+ /** Request latency in milliseconds */
222
+ latencyMs: number;
223
+ /** Current usage stats */
224
+ usage?: Usage;
225
+ }
226
+ /**
227
+ * @deprecated Use `TuteliqOptions` instead. The API key is passed as the first
228
+ * argument to the `Tuteliq` constructor, not as an option.
229
+ */
230
+ export type TuteliqClientOptions = TuteliqOptions;
231
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc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
1
+ // Re-export all types
2
+ export * from './safety.js';
3
+ export * from './analysis.js';
4
+ export * from './guidance.js';
5
+ export * from './reports.js';
6
+ export * from './policy.js';
7
+ export * from './account.js';
8
+ export * from './media.js';
9
+ export * from './webhooks.js';
10
+ export * from './pricing.js';
11
+ export * from './voice-stream.js';
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,sBAAsB;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { TrackingFields } from './index.js';
2
+ import { ContentSeverity } from '../constants.js';
3
+ import { BullyingResult, GroomingResult, UnsafeResult } from './safety.js';
4
+ import { EmotionsResult } from './analysis.js';
5
+ export { ContentSeverity };
6
+ export interface TranscriptionSegment {
7
+ /** Segment start time in seconds */
8
+ start: number;
9
+ /** Segment end time in seconds */
10
+ end: number;
11
+ /** Transcribed text for this segment */
12
+ text: string;
13
+ }
14
+ export interface TranscriptionResult {
15
+ /** Full transcribed text */
16
+ text: string;
17
+ /** Detected language */
18
+ language: string;
19
+ /** Audio duration in seconds */
20
+ duration: number;
21
+ /** Timestamped segments */
22
+ segments: TranscriptionSegment[];
23
+ }
24
+ export interface AnalyzeVoiceInput extends TrackingFields {
25
+ /** Audio file — Buffer, Blob, or File */
26
+ file: Buffer | Blob | File;
27
+ /** Original filename (e.g., "recording.mp3") */
28
+ filename: string;
29
+ /** Analysis types to run on the transcript */
30
+ analysisType?: 'bullying' | 'unsafe' | 'grooming' | 'emotions' | 'all';
31
+ /** Customer-provided file reference ID (echoed in response) */
32
+ fileId?: string;
33
+ /** Age group for calibrated analysis */
34
+ ageGroup?: string;
35
+ /** Language hint */
36
+ language?: string;
37
+ /** Platform name */
38
+ platform?: string;
39
+ /** Child's age (used for grooming analysis) */
40
+ childAge?: number;
41
+ }
42
+ export interface VoiceAnalysisResult {
43
+ /** Customer-provided file reference (if provided) */
44
+ file_id?: string;
45
+ /** Transcription result with timestamps */
46
+ transcription: TranscriptionResult;
47
+ /** Safety analysis results keyed by type */
48
+ analysis: {
49
+ bullying?: BullyingResult;
50
+ unsafe?: UnsafeResult;
51
+ grooming?: GroomingResult;
52
+ emotions?: EmotionsResult;
53
+ };
54
+ /** Maximum risk score across all analyses (0-1) */
55
+ overall_risk_score: number;
56
+ /** Overall severity level */
57
+ overall_severity: ContentSeverity;
58
+ /** Number of credits consumed by this request */
59
+ credits_used?: number;
60
+ /** Echo of provided external_id */
61
+ external_id?: string;
62
+ /** Echo of provided customer_id */
63
+ customer_id?: string;
64
+ /** Echo of provided metadata */
65
+ metadata?: Record<string, unknown>;
66
+ }
67
+ export interface VisionResult {
68
+ /** All text extracted via OCR */
69
+ extracted_text: string;
70
+ /** Visual harm categories detected */
71
+ visual_categories: string[];
72
+ /** Visual content severity */
73
+ visual_severity: ContentSeverity;
74
+ /** Confidence in visual classification (0-1) */
75
+ visual_confidence: number;
76
+ /** Brief description of image content */
77
+ visual_description: string;
78
+ /** Whether text was found in the image */
79
+ contains_text: boolean;
80
+ /** Whether faces were detected */
81
+ contains_faces: boolean;
82
+ }
83
+ export interface AnalyzeImageInput extends TrackingFields {
84
+ /** Image file — Buffer, Blob, or File */
85
+ file: Buffer | Blob | File;
86
+ /** Original filename (e.g., "screenshot.png") */
87
+ filename: string;
88
+ /** Analysis types to run on extracted text */
89
+ analysisType?: 'bullying' | 'unsafe' | 'emotions' | 'all';
90
+ /** Customer-provided file reference ID (echoed in response) */
91
+ fileId?: string;
92
+ /** Age group for calibrated analysis */
93
+ ageGroup?: string;
94
+ /** Platform name */
95
+ platform?: string;
96
+ }
97
+ export interface ImageAnalysisResult {
98
+ /** Customer-provided file reference (if provided) */
99
+ file_id?: string;
100
+ /** Vision analysis results */
101
+ vision: VisionResult;
102
+ /** Text-based safety analysis (if OCR text was found) */
103
+ text_analysis?: {
104
+ bullying?: BullyingResult;
105
+ unsafe?: UnsafeResult;
106
+ emotions?: EmotionsResult;
107
+ };
108
+ /** Maximum risk score across all analyses (0-1) */
109
+ overall_risk_score: number;
110
+ /** Overall severity level */
111
+ overall_severity: ContentSeverity;
112
+ /** Number of credits consumed by this request */
113
+ credits_used?: number;
114
+ /** Echo of provided external_id */
115
+ external_id?: string;
116
+ /** Echo of provided customer_id */
117
+ customer_id?: string;
118
+ /** Echo of provided metadata */
119
+ metadata?: Record<string, unknown>;
120
+ }
121
+ //# sourceMappingURL=media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../src/types/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,CAAC;AAM3B,MAAM,WAAW,oBAAoB;IACjC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,kCAAkC;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,mBAAmB;IAChC,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,QAAQ,EAAE,oBAA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