@proveanything/smartlinks 1.0.64 → 1.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.
@@ -0,0 +1,111 @@
1
+ import type { IdField } from './common';
2
+ export interface BroadcastEvent {
3
+ orgId: string;
4
+ broadcastId: string;
5
+ userId?: string;
6
+ contactId?: string;
7
+ channel?: string;
8
+ timestamp: string;
9
+ [k: string]: any;
10
+ }
11
+ export interface BroadcastQueryByUser {
12
+ userId?: string;
13
+ contactId?: string;
14
+ from?: string;
15
+ to?: string;
16
+ limit?: number;
17
+ }
18
+ export interface RecipientIdsQuery {
19
+ broadcastId: string;
20
+ idField?: IdField;
21
+ from?: string;
22
+ to?: string;
23
+ limit?: number;
24
+ }
25
+ export interface RecipientsWithoutActionQuery {
26
+ broadcastId: string;
27
+ actionId?: string;
28
+ appId?: string;
29
+ idField?: IdField;
30
+ from?: string;
31
+ to?: string;
32
+ limit?: number;
33
+ }
34
+ export interface RecipientsWithActionQuery {
35
+ broadcastId: string;
36
+ actionId?: string;
37
+ appId?: string;
38
+ outcome?: string;
39
+ idField?: IdField;
40
+ includeOutcome?: boolean;
41
+ from?: string;
42
+ to?: string;
43
+ limit?: number;
44
+ }
45
+ export type RecipientId = string;
46
+ export interface RecipientWithOutcome {
47
+ id: string;
48
+ outcome: string;
49
+ }
50
+ export interface AppendBroadcastBody {
51
+ broadcastId: string;
52
+ userId?: string;
53
+ contactId?: string;
54
+ channel?: string;
55
+ timestamp?: string;
56
+ [k: string]: any;
57
+ }
58
+ export interface AppendBroadcastBulkBody {
59
+ params: {
60
+ broadcastId: string;
61
+ [k: string]: any;
62
+ };
63
+ ids: string[];
64
+ idField?: IdField;
65
+ }
66
+ export interface AppendResult {
67
+ success: true;
68
+ }
69
+ export interface AppendBulkResult {
70
+ success: true;
71
+ count: number;
72
+ }
73
+ export interface CreateBroadcastBody {
74
+ appId: string;
75
+ data?: Record<string, any>;
76
+ }
77
+ export interface UpdateBroadcastBody {
78
+ appId?: string;
79
+ data?: Record<string, any>;
80
+ }
81
+ export interface ListBroadcastsQuery {
82
+ limit?: number;
83
+ offset?: number;
84
+ appId?: string;
85
+ }
86
+ export interface BroadcastRecord {
87
+ id: string;
88
+ collectionId: string;
89
+ appId: string;
90
+ templateId?: string;
91
+ segmentId?: string;
92
+ status?: 'draft' | 'scheduled' | 'sending' | 'sent' | string;
93
+ scheduledAt?: string;
94
+ sentAt?: string;
95
+ data?: {
96
+ display?: {
97
+ title?: string;
98
+ description?: string;
99
+ icon?: string;
100
+ color?: string;
101
+ };
102
+ broadcastType?: string;
103
+ [key: string]: unknown;
104
+ };
105
+ createdAt: string;
106
+ }
107
+ export interface BroadcastList {
108
+ items: BroadcastRecord[];
109
+ limit: number;
110
+ offset: number;
111
+ }
@@ -0,0 +1,2 @@
1
+ // src/types/broadcasts.ts
2
+ export {};
@@ -0,0 +1 @@
1
+ export type IdField = 'userId' | 'contactId';
@@ -0,0 +1,2 @@
1
+ // src/types/common.ts
2
+ export {};
@@ -11,3 +11,8 @@ export * from "./auth";
11
11
  export * from "./comms";
12
12
  export * from "./nfc";
13
13
  export * from "./contact";
14
+ export * from "./actions";
15
+ export * from "./broadcasts";
16
+ export * from "./segments";
17
+ export * from "./common";
18
+ export * from "./journeys";
@@ -13,3 +13,8 @@ export * from "./auth";
13
13
  export * from "./comms";
14
14
  export * from "./nfc";
15
15
  export * from "./contact";
16
+ export * from "./actions";
17
+ export * from "./broadcasts";
18
+ export * from "./segments";
19
+ export * from "./common";
20
+ export * from "./journeys";
@@ -0,0 +1,57 @@
1
+ export interface JourneyRecord {
2
+ id: string;
3
+ collectionId: string;
4
+ appId?: string;
5
+ name: string;
6
+ active: boolean;
7
+ journeyType: 'event_triggered' | 'scheduled';
8
+ data?: {
9
+ display?: {
10
+ title?: string;
11
+ description?: string;
12
+ icon?: string;
13
+ color?: string;
14
+ };
15
+ steps?: Array<{
16
+ id: string;
17
+ type: string;
18
+ config?: Record<string, unknown>;
19
+ }>;
20
+ triggers?: Array<{
21
+ type: string;
22
+ config?: Record<string, unknown>;
23
+ }>;
24
+ entryRules?: any[];
25
+ exitRules?: any[];
26
+ metadata?: Record<string, unknown>;
27
+ [key: string]: unknown;
28
+ };
29
+ createdAt: string;
30
+ updatedAt: string;
31
+ }
32
+ export interface JourneyList {
33
+ items: JourneyRecord[];
34
+ limit: number;
35
+ offset: number;
36
+ }
37
+ export interface ListJourneysQuery {
38
+ appId?: string;
39
+ active?: boolean;
40
+ journeyType?: 'event_triggered' | 'scheduled';
41
+ limit?: number;
42
+ offset?: number;
43
+ }
44
+ export interface CreateJourneyBody {
45
+ appId?: string;
46
+ name: string;
47
+ active?: boolean;
48
+ journeyType: 'event_triggered' | 'scheduled';
49
+ data?: Record<string, unknown>;
50
+ }
51
+ export interface UpdateJourneyBody {
52
+ appId?: string;
53
+ name?: string;
54
+ active?: boolean;
55
+ journeyType?: 'event_triggered' | 'scheduled';
56
+ data?: Record<string, unknown>;
57
+ }
@@ -0,0 +1,2 @@
1
+ // src/types/journeys.ts
2
+ export {};
@@ -0,0 +1,40 @@
1
+ export interface SegmentRecord {
2
+ id: string;
3
+ collectionId: string;
4
+ appId?: string;
5
+ name: string;
6
+ filterType: 'dynamic' | 'static';
7
+ estimatedCount?: number;
8
+ lastCalculatedAt?: string;
9
+ createdAt: string;
10
+ data?: {
11
+ filterRules: any[];
12
+ description?: string;
13
+ staticContactIds?: string[];
14
+ [key: string]: unknown;
15
+ };
16
+ }
17
+ export interface ListSegmentsQuery {
18
+ appId?: string;
19
+ filterType?: 'dynamic' | 'static';
20
+ limit?: number;
21
+ offset?: number;
22
+ }
23
+ export interface SegmentList {
24
+ items: SegmentRecord[];
25
+ limit: number;
26
+ offset: number;
27
+ }
28
+ export interface SegmentCalculateResult {
29
+ scheduled: true;
30
+ lastCalculatedAt?: string;
31
+ estimatedCount?: number | null;
32
+ note?: string;
33
+ }
34
+ export interface SegmentRecipientsResponse {
35
+ items: string[];
36
+ limit: number;
37
+ offset: number;
38
+ total: number;
39
+ note?: string;
40
+ }
@@ -0,0 +1,2 @@
1
+ // src/types/segments.ts
2
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proveanything/smartlinks",
3
- "version": "1.0.64",
3
+ "version": "1.1.0",
4
4
  "description": "Official JavaScript/TypeScript SDK for the Smartlinks API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",