@sylphx/management 0.4.2 → 0.5.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.
- package/CHANGELOG.md +31 -2
- package/README.md +6 -6
- package/dist/auth.d.ts +7 -18
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +1 -2
- package/dist/authSettings.d.ts +7 -60
- package/dist/authSettings.d.ts.map +1 -1
- package/dist/authSettings.js +11 -19
- package/dist/backups.d.ts +7 -24
- package/dist/backups.d.ts.map +1 -1
- package/dist/backups.js +21 -7
- package/dist/client.d.ts +5 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -2
- package/dist/domains.d.ts +1 -1
- package/dist/domains.d.ts.map +1 -1
- package/dist/domains.js +1 -1
- package/dist/email.d.ts +22 -29
- package/dist/email.d.ts.map +1 -1
- package/dist/email.js +52 -12
- package/dist/environments.d.ts.map +1 -1
- package/dist/environments.js +4 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +6 -3
- package/dist/newsletter.d.ts +32 -257
- package/dist/newsletter.d.ts.map +1 -1
- package/dist/newsletter.js +135 -95
- package/dist/oidc.d.ts +6 -27
- package/dist/oidc.d.ts.map +1 -1
- package/dist/oidc.js +16 -6
- package/dist/organizations.d.ts +3 -1
- package/dist/organizations.d.ts.map +1 -1
- package/dist/organizations.js +8 -0
- package/dist/privacy.d.ts +3 -98
- package/dist/privacy.d.ts.map +1 -1
- package/dist/privacy.js +57 -25
- package/dist/refresh.d.ts +11 -12
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +10 -2
- package/dist/runners.d.ts +7 -58
- package/dist/runners.d.ts.map +1 -1
- package/dist/runners.js +18 -17
- package/dist/search.d.ts +7 -40
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +28 -18
- package/dist/serviceTokens.d.ts +8 -44
- package/dist/serviceTokens.d.ts.map +1 -1
- package/dist/serviceTokens.js +24 -8
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environments.d.ts","sourceRoot":"","sources":["../src/environments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACX,sBAAsB,EACtB,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACvB;AAQD,eAAO,MAAM,IAAI,GAChB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,UAAS,uBAA4B,KACnC,OAAO,CAAC,WAAW,EAAE,CASvB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,GACrB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,SAAS,MAAM,EACf,UAAS,uBAA4B,KACnC,OAAO,CAAC,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"environments.d.ts","sourceRoot":"","sources":["../src/environments.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACX,sBAAsB,EACtB,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,sBAAsB,EACtB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACvB;AAQD,eAAO,MAAM,IAAI,GAChB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,UAAS,uBAA4B,KACnC,OAAO,CAAC,WAAW,EAAE,CASvB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,GACrB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,SAAS,MAAM,EACf,UAAS,uBAA4B,KACnC,OAAO,CAAC,MAAM,GAAG,IAAI,CASvB,CA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@@ export const list = async (client, projectId, options = {}) => {
|
|
|
20
20
|
*/
|
|
21
21
|
export const resolveId = async (client, projectId, envType, options = {}) => {
|
|
22
22
|
const envs = await list(client, projectId, options);
|
|
23
|
-
const needle = envType.toLowerCase();
|
|
23
|
+
const needle = envType.trim().toLowerCase();
|
|
24
|
+
const byId = envs.find((e) => e.id === envType.trim());
|
|
25
|
+
if (byId)
|
|
26
|
+
return byId.id;
|
|
24
27
|
const byName = envs.find((e) => (e.name ?? '').toLowerCase() === needle);
|
|
25
28
|
if (byName)
|
|
26
29
|
return byName.id;
|
package/dist/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAMzC,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAA;IAC7D;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAA;IAC/D;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvC;AAqBD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAO9F;AAED,wBAAsB,OAAO,CAAC,CAAC,EAC9B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,cAAc,GACnB,OAAO,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAMzC,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAA;IAC7D;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAA;IAC/D;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACvC;AAqBD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,MAAM,CAO9F;AAED,wBAAsB,OAAO,CAAC,CAAC,EAC9B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE,cAAc,GACnB,OAAO,CAAC,CAAC,CAAC,CAiEZ"}
|
package/dist/http.js
CHANGED
|
@@ -84,11 +84,14 @@ export async function request(client, method, path, opts) {
|
|
|
84
84
|
headers['Idempotency-Key'] = explicit ?? newIdempotencyKey();
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
const
|
|
87
|
+
const init = {
|
|
88
88
|
method,
|
|
89
89
|
headers,
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
};
|
|
91
|
+
if (hasBody)
|
|
92
|
+
init.body = JSON.stringify(opts.body);
|
|
93
|
+
const fetchImpl = client.fetch ?? fetch;
|
|
94
|
+
const res = await fetchImpl(url, init);
|
|
92
95
|
if (!res.ok) {
|
|
93
96
|
const text = await res.text();
|
|
94
97
|
let parsed = text;
|
package/dist/newsletter.d.ts
CHANGED
|
@@ -1,279 +1,54 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Newsletter
|
|
2
|
+
* Newsletter management SDK.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* GET /newsletter/subscribers/by-email — by email
|
|
9
|
-
* GET /newsletter/subscribers/preferences — preferences by email
|
|
10
|
-
* GET /newsletter/subscribers/export — CSV export
|
|
11
|
-
* GET /newsletter/subscribers/stats — aggregate stats
|
|
12
|
-
* DELETE /newsletter/subscribers — GDPR delete
|
|
13
|
-
* POST /newsletter/subscribers/bulk-delete
|
|
14
|
-
* POST /newsletter/subscribers/resend-verification
|
|
15
|
-
*
|
|
16
|
-
* Sequences (automation workflows)
|
|
17
|
-
* GET /newsletter/sequences
|
|
18
|
-
* GET /newsletter/sequences/:sequenceId
|
|
19
|
-
* POST /newsletter/sequences
|
|
20
|
-
* PATCH /newsletter/sequences/:sequenceId
|
|
21
|
-
* DELETE /newsletter/sequences/:sequenceId
|
|
22
|
-
* GET /newsletter/sequences/:sequenceId/analytics
|
|
23
|
-
*
|
|
24
|
-
* Steps (inside sequences)
|
|
25
|
-
* POST /newsletter/steps
|
|
26
|
-
* PATCH /newsletter/steps/:stepId
|
|
27
|
-
* DELETE /newsletter/steps/:stepId
|
|
28
|
-
* POST /newsletter/steps/reorder
|
|
29
|
-
*
|
|
30
|
-
* Enrollments (subscribers inside sequences)
|
|
31
|
-
* GET /newsletter/enrollments
|
|
32
|
-
* GET /newsletter/enrollments/:enrollmentId
|
|
33
|
-
* POST /newsletter/enrollments
|
|
34
|
-
* POST /newsletter/enrollments/:enrollmentId/cancel
|
|
35
|
-
* POST /newsletter/enrollments/:enrollmentId/pause
|
|
36
|
-
* POST /newsletter/enrollments/:enrollmentId/resume
|
|
37
|
-
*
|
|
38
|
-
* `SubscriberPreferences` is returned as an object keyed on preference ID;
|
|
39
|
-
* the service stores the underlying rows as an array but flattens for wire.
|
|
4
|
+
* Wire paths, methods, and public response/body shapes are sourced from
|
|
5
|
+
* `@sylphx/contract`. This module only adapts the ergonomic SDK call shape
|
|
6
|
+
* where callers pass booleans/numbers and the HTTP query contract carries
|
|
7
|
+
* strings.
|
|
40
8
|
*/
|
|
9
|
+
import { type AddStepInput, type BulkDeleteSubscribersInput, type BulkDeleteSubscribersResult, type CreateSequenceInput, type DeleteSubscriberResult, type Enrollment, type EnrollmentStatus, type EnrollSubscriberInput, type ExportSubscribersQuery, type ExportSubscribersResult, type ListEnrollmentsQuery, type ListEnrollmentsResult, type ListSequencesQuery, type ListSequencesResult, type ListSubscribersQuery, type ListSubscribersResult, type NewsletterSuccessResult, type ReorderStepsInput, type ResendVerificationResult, type Sequence, type SequenceAnalytics, type SequenceTrigger, type SequenceWithSteps, type Step, type StepConfig, type StepType, type Subscriber, type SubscriberDetail, type SubscriberPreferences, type SubscriberSource, type SubscriberStatsResult, type TriggerConditions, type UpdateSequenceInput, type UpdateStepInput } from '@sylphx/contract';
|
|
41
10
|
import type { Client } from './client.js';
|
|
42
|
-
export type
|
|
43
|
-
export type
|
|
44
|
-
export type
|
|
45
|
-
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
readonly subscribedAt: string | null;
|
|
52
|
-
readonly unsubscribedAt: string | null;
|
|
53
|
-
readonly createdAt: string;
|
|
54
|
-
readonly preferences: SubscriberPreferences | null;
|
|
55
|
-
}
|
|
56
|
-
export interface SubscriberDetail extends Subscriber {
|
|
57
|
-
readonly metadata: Readonly<Record<string, unknown>> | null;
|
|
58
|
-
readonly updatedAt: string;
|
|
59
|
-
}
|
|
60
|
-
export interface ListSubscribersOptions {
|
|
61
|
-
readonly projectId?: string;
|
|
11
|
+
export type { AddStepInput, BulkDeleteSubscribersInput, BulkDeleteSubscribersResult, CreateSequenceInput, DeleteSubscriberResult, Enrollment, EnrollmentStatus, EnrollSubscriberInput, ExportSubscribersResult, ListEnrollmentsResult, ListSequencesResult, ListSubscribersResult, NewsletterSuccessResult, ReorderStepsInput, ResendVerificationResult, Sequence, SequenceAnalytics, SequenceTrigger, SequenceWithSteps, Step, StepConfig, StepType, Subscriber, SubscriberDetail, SubscriberPreferences, SubscriberSource, SubscriberStatsResult, TriggerConditions, UpdateSequenceInput, UpdateStepInput, };
|
|
12
|
+
export type SubscriberStats = SubscriberStatsResult;
|
|
13
|
+
export type ListSubscribersOptions = Omit<ListSubscribersQuery, 'verified' | 'includeUnsubscribed' | 'limit' | 'offset'> & {
|
|
14
|
+
readonly verified?: boolean;
|
|
15
|
+
readonly includeUnsubscribed?: boolean;
|
|
16
|
+
readonly limit?: number;
|
|
17
|
+
readonly offset?: number;
|
|
18
|
+
};
|
|
19
|
+
export type ExportSubscribersOptions = Omit<ExportSubscribersQuery, 'verified' | 'includeUnsubscribed'> & {
|
|
62
20
|
readonly verified?: boolean;
|
|
63
|
-
readonly source?: SubscriberSource;
|
|
64
|
-
readonly search?: string;
|
|
65
21
|
readonly includeUnsubscribed?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export type ListSequencesOptions = Omit<ListSequencesQuery, 'projectId' | 'includeInactive'> & {
|
|
24
|
+
readonly includeInactive?: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type ListEnrollmentsOptions = Omit<ListEnrollmentsQuery, 'sequenceId' | 'limit' | 'offset'> & {
|
|
66
27
|
readonly limit?: number;
|
|
67
28
|
readonly offset?: number;
|
|
68
|
-
}
|
|
69
|
-
export interface ListSubscribersResult {
|
|
70
|
-
readonly subscribers: readonly Subscriber[];
|
|
71
|
-
readonly total: number;
|
|
72
|
-
readonly hasMore: boolean;
|
|
73
|
-
}
|
|
29
|
+
};
|
|
74
30
|
export declare const listSubscribers: (client: Client, options?: ListSubscribersOptions) => Promise<ListSubscribersResult>;
|
|
75
31
|
export declare const getSubscriber: (client: Client, email: string) => Promise<SubscriberDetail>;
|
|
76
32
|
export declare const getPreferences: (client: Client, email: string) => Promise<SubscriberPreferences>;
|
|
77
|
-
export interface ExportSubscribersOptions {
|
|
78
|
-
readonly verified?: boolean;
|
|
79
|
-
readonly includeUnsubscribed?: boolean;
|
|
80
|
-
}
|
|
81
|
-
export interface ExportSubscribersResult {
|
|
82
|
-
readonly csv: string;
|
|
83
|
-
readonly filename: string;
|
|
84
|
-
}
|
|
85
33
|
export declare const exportSubscribers: (client: Client, options?: ExportSubscribersOptions) => Promise<ExportSubscribersResult>;
|
|
86
|
-
export
|
|
87
|
-
|
|
88
|
-
readonly verified: number;
|
|
89
|
-
readonly unsubscribed: number;
|
|
90
|
-
readonly bySource: Readonly<Record<string, number>>;
|
|
91
|
-
}
|
|
92
|
-
export declare const subscriberStats: (client: Client) => Promise<SubscriberStats>;
|
|
93
|
-
export declare const deleteSubscriber: (client: Client, email: string) => Promise<{
|
|
94
|
-
success: boolean;
|
|
95
|
-
message: string;
|
|
96
|
-
}>;
|
|
97
|
-
export interface BulkDeleteSubscribersInput {
|
|
98
|
-
readonly projectId: string;
|
|
99
|
-
readonly subscriberIds: readonly string[];
|
|
100
|
-
}
|
|
101
|
-
export interface BulkDeleteSubscribersResult {
|
|
102
|
-
readonly deleted: number;
|
|
103
|
-
readonly errors?: readonly {
|
|
104
|
-
readonly id: string;
|
|
105
|
-
readonly error: string;
|
|
106
|
-
}[];
|
|
107
|
-
}
|
|
34
|
+
export declare const subscriberStats: (client: Client) => Promise<SubscriberStatsResult>;
|
|
35
|
+
export declare const deleteSubscriber: (client: Client, email: string) => Promise<DeleteSubscriberResult>;
|
|
108
36
|
export declare const bulkDeleteSubscribers: (client: Client, input: BulkDeleteSubscribersInput) => Promise<BulkDeleteSubscribersResult>;
|
|
109
|
-
export declare const resendVerification: (client: Client, email: string) => Promise<
|
|
110
|
-
|
|
111
|
-
}>;
|
|
112
|
-
export type SequenceTrigger = 'subscribe' | 'verify_email' | 'tag_added' | 'manual' | 'event';
|
|
113
|
-
export type StepType = 'email' | 'delay' | 'condition' | 'tag' | 'webhook';
|
|
114
|
-
export type EnrollmentStatus = 'active' | 'completed' | 'paused' | 'cancelled' | 'unsubscribed';
|
|
115
|
-
export interface TriggerCondition {
|
|
116
|
-
readonly field: string;
|
|
117
|
-
readonly operator: 'eq' | 'neq' | 'contains' | 'exists';
|
|
118
|
-
readonly value?: string;
|
|
119
|
-
}
|
|
120
|
-
export interface TriggerConditions {
|
|
121
|
-
readonly tag?: string;
|
|
122
|
-
readonly event?: string;
|
|
123
|
-
readonly conditions?: readonly TriggerCondition[];
|
|
124
|
-
}
|
|
125
|
-
export type StepConfig = {
|
|
126
|
-
readonly type: 'email';
|
|
127
|
-
readonly templateId?: string;
|
|
128
|
-
readonly subject: string;
|
|
129
|
-
readonly body: string;
|
|
130
|
-
readonly fromName?: string;
|
|
131
|
-
} | {
|
|
132
|
-
readonly type: 'delay';
|
|
133
|
-
readonly duration: number;
|
|
134
|
-
readonly unit: 'minutes' | 'hours' | 'days' | 'weeks';
|
|
135
|
-
} | {
|
|
136
|
-
readonly type: 'condition';
|
|
137
|
-
readonly field: string;
|
|
138
|
-
readonly operator: 'eq' | 'neq' | 'contains' | 'exists' | 'opened_email' | 'clicked_link';
|
|
139
|
-
readonly value?: string;
|
|
140
|
-
readonly trueBranch?: string;
|
|
141
|
-
readonly falseBranch?: string;
|
|
142
|
-
} | {
|
|
143
|
-
readonly type: 'tag';
|
|
144
|
-
readonly action: 'add' | 'remove';
|
|
145
|
-
readonly tag: string;
|
|
146
|
-
} | {
|
|
147
|
-
readonly type: 'webhook';
|
|
148
|
-
readonly url: string;
|
|
149
|
-
readonly method: 'GET' | 'POST';
|
|
150
|
-
readonly headers?: Readonly<Record<string, string>>;
|
|
151
|
-
readonly body?: Readonly<Record<string, unknown>>;
|
|
152
|
-
};
|
|
153
|
-
export interface Sequence {
|
|
154
|
-
readonly id: string;
|
|
155
|
-
readonly projectId: string;
|
|
156
|
-
readonly name: string;
|
|
157
|
-
readonly description: string | null;
|
|
158
|
-
readonly trigger: SequenceTrigger;
|
|
159
|
-
readonly triggerConditions: TriggerConditions | null;
|
|
160
|
-
readonly isActive: boolean;
|
|
161
|
-
readonly allowReenrollment: boolean;
|
|
162
|
-
readonly exitOnUnsubscribe: boolean;
|
|
163
|
-
readonly createdAt: string;
|
|
164
|
-
readonly updatedAt: string;
|
|
165
|
-
}
|
|
166
|
-
export interface Step {
|
|
167
|
-
readonly id: string;
|
|
168
|
-
readonly sequenceId: string;
|
|
169
|
-
readonly stepNumber: number;
|
|
170
|
-
readonly type: StepType;
|
|
171
|
-
readonly name: string;
|
|
172
|
-
readonly config: StepConfig;
|
|
173
|
-
readonly isEnabled: boolean;
|
|
174
|
-
readonly createdAt: string;
|
|
175
|
-
readonly updatedAt: string;
|
|
176
|
-
}
|
|
177
|
-
export interface SequenceWithSteps extends Sequence {
|
|
178
|
-
readonly steps: readonly Step[];
|
|
179
|
-
}
|
|
180
|
-
export interface ListSequencesOptions {
|
|
181
|
-
readonly includeInactive?: boolean;
|
|
182
|
-
}
|
|
183
|
-
export declare const listSequences: (client: Client, projectId: string, options?: ListSequencesOptions) => Promise<readonly Sequence[]>;
|
|
37
|
+
export declare const resendVerification: (client: Client, email: string) => Promise<ResendVerificationResult>;
|
|
38
|
+
export declare const listSequences: (client: Client, projectId: string, options?: ListSequencesOptions) => Promise<ListSequencesResult>;
|
|
184
39
|
export declare const getSequence: (client: Client, sequenceId: string) => Promise<SequenceWithSteps>;
|
|
185
|
-
export interface CreateSequenceInput {
|
|
186
|
-
readonly projectId: string;
|
|
187
|
-
readonly name: string;
|
|
188
|
-
readonly description?: string;
|
|
189
|
-
readonly trigger: SequenceTrigger;
|
|
190
|
-
readonly triggerConditions?: TriggerConditions;
|
|
191
|
-
readonly allowReenrollment?: boolean;
|
|
192
|
-
readonly exitOnUnsubscribe?: boolean;
|
|
193
|
-
}
|
|
194
40
|
export declare const createSequence: (client: Client, input: CreateSequenceInput) => Promise<SequenceWithSteps>;
|
|
195
|
-
export interface UpdateSequenceInput {
|
|
196
|
-
readonly name?: string;
|
|
197
|
-
readonly description?: string;
|
|
198
|
-
readonly trigger?: SequenceTrigger;
|
|
199
|
-
readonly triggerConditions?: TriggerConditions;
|
|
200
|
-
readonly isActive?: boolean;
|
|
201
|
-
readonly allowReenrollment?: boolean;
|
|
202
|
-
readonly exitOnUnsubscribe?: boolean;
|
|
203
|
-
}
|
|
204
41
|
export declare const updateSequence: (client: Client, sequenceId: string, input: UpdateSequenceInput) => Promise<SequenceWithSteps>;
|
|
205
|
-
export declare const deleteSequence: (client: Client, sequenceId: string) => Promise<
|
|
206
|
-
success: boolean;
|
|
207
|
-
}>;
|
|
208
|
-
export interface StepAnalytics {
|
|
209
|
-
readonly stepId: string;
|
|
210
|
-
readonly stepName: string;
|
|
211
|
-
readonly reached: number;
|
|
212
|
-
readonly completed: number;
|
|
213
|
-
readonly avgDurationMs: number | null;
|
|
214
|
-
}
|
|
215
|
-
export interface SequenceAnalytics {
|
|
216
|
-
readonly sequenceId: string;
|
|
217
|
-
readonly totalEnrollments: number;
|
|
218
|
-
readonly activeEnrollments: number;
|
|
219
|
-
readonly completedEnrollments: number;
|
|
220
|
-
readonly cancelledEnrollments: number;
|
|
221
|
-
readonly unsubscribedEnrollments: number;
|
|
222
|
-
readonly stepAnalytics: readonly StepAnalytics[];
|
|
223
|
-
}
|
|
42
|
+
export declare const deleteSequence: (client: Client, sequenceId: string) => Promise<NewsletterSuccessResult>;
|
|
224
43
|
export declare const sequenceAnalytics: (client: Client, sequenceId: string) => Promise<SequenceAnalytics>;
|
|
225
|
-
export interface AddStepInput {
|
|
226
|
-
readonly sequenceId: string;
|
|
227
|
-
readonly stepNumber: number;
|
|
228
|
-
readonly type: StepType;
|
|
229
|
-
readonly name: string;
|
|
230
|
-
readonly config: StepConfig;
|
|
231
|
-
readonly isEnabled?: boolean;
|
|
232
|
-
}
|
|
233
44
|
export declare const addStep: (client: Client, input: AddStepInput) => Promise<Step>;
|
|
234
|
-
export interface UpdateStepInput {
|
|
235
|
-
readonly stepNumber?: number;
|
|
236
|
-
readonly name?: string;
|
|
237
|
-
readonly config?: StepConfig;
|
|
238
|
-
readonly isEnabled?: boolean;
|
|
239
|
-
}
|
|
240
45
|
export declare const updateStep: (client: Client, stepId: string, input: UpdateStepInput) => Promise<Step>;
|
|
241
|
-
export declare const deleteStep: (client: Client, stepId: string) => Promise<
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
export declare const reorderSteps: (client: Client, sequenceId: string, stepOrder: readonly string[]) => Promise<{
|
|
245
|
-
success: boolean;
|
|
246
|
-
}>;
|
|
247
|
-
export interface Enrollment {
|
|
248
|
-
readonly id: string;
|
|
249
|
-
readonly sequenceId: string;
|
|
250
|
-
readonly subscriberId: string;
|
|
251
|
-
readonly status: EnrollmentStatus;
|
|
252
|
-
readonly currentStep: number;
|
|
253
|
-
readonly context: Readonly<Record<string, unknown>> | null;
|
|
254
|
-
readonly enrolledAt: string;
|
|
255
|
-
readonly completedAt: string | null;
|
|
256
|
-
}
|
|
257
|
-
export interface ListEnrollmentsOptions {
|
|
258
|
-
readonly status?: EnrollmentStatus;
|
|
259
|
-
readonly limit?: number;
|
|
260
|
-
readonly offset?: number;
|
|
261
|
-
}
|
|
262
|
-
export declare const listEnrollments: (client: Client, sequenceId: string, options?: ListEnrollmentsOptions) => Promise<readonly Enrollment[]>;
|
|
46
|
+
export declare const deleteStep: (client: Client, stepId: string) => Promise<NewsletterSuccessResult>;
|
|
47
|
+
export declare const reorderSteps: (client: Client, sequenceId: string, stepOrder: readonly string[]) => Promise<NewsletterSuccessResult>;
|
|
48
|
+
export declare const listEnrollments: (client: Client, sequenceId: string, options?: ListEnrollmentsOptions) => Promise<ListEnrollmentsResult>;
|
|
263
49
|
export declare const getEnrollment: (client: Client, enrollmentId: string) => Promise<Enrollment>;
|
|
264
|
-
export interface EnrollSubscriberInput {
|
|
265
|
-
readonly sequenceId: string;
|
|
266
|
-
readonly subscriberId: string;
|
|
267
|
-
readonly context?: Readonly<Record<string, unknown>>;
|
|
268
|
-
}
|
|
269
50
|
export declare const enrollSubscriber: (client: Client, input: EnrollSubscriberInput) => Promise<Enrollment>;
|
|
270
|
-
export declare const cancelEnrollment: (client: Client, enrollmentId: string) => Promise<
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
export declare const pauseEnrollment: (client: Client, enrollmentId: string) => Promise<{
|
|
274
|
-
success: boolean;
|
|
275
|
-
}>;
|
|
276
|
-
export declare const resumeEnrollment: (client: Client, enrollmentId: string) => Promise<{
|
|
277
|
-
success: boolean;
|
|
278
|
-
}>;
|
|
51
|
+
export declare const cancelEnrollment: (client: Client, enrollmentId: string) => Promise<NewsletterSuccessResult>;
|
|
52
|
+
export declare const pauseEnrollment: (client: Client, enrollmentId: string) => Promise<NewsletterSuccessResult>;
|
|
53
|
+
export declare const resumeEnrollment: (client: Client, enrollmentId: string) => Promise<NewsletterSuccessResult>;
|
|
279
54
|
//# sourceMappingURL=newsletter.d.ts.map
|
package/dist/newsletter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"newsletter.d.ts","sourceRoot":"","sources":["../src/newsletter.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"newsletter.d.ts","sourceRoot":"","sources":["../src/newsletter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,0BAA0B,EAC/B,KAAK,2BAA2B,EAChC,KAAK,mBAAmB,EAExB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,K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