shred-api-client 1.12.1-rc.2 → 1.12.1
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/dist/api/Notification.api.d.ts +6 -1
- package/dist/api/Notification.api.js +22 -0
- package/dist/api/Project.api.d.ts +1 -1
- package/dist/api/Project.api.js +2 -2
- package/dist/api/Subscription.api.d.ts +3 -1
- package/dist/api/Subscription.api.js +12 -2
- package/dist/api/User.api.d.ts +2 -0
- package/dist/api/User.api.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/model/Api.d.ts +6 -0
- package/dist/model/Notification.schema.d.ts +36 -6
- package/dist/model/Notification.schema.js +16 -0
- package/dist/model/Project.schema.d.ts +27 -15
- package/dist/model/Project.schema.js +13 -13
- package/dist/model/Subscription.schema.d.ts +14 -3
- package/dist/model/Subscription.schema.js +11 -3
- package/dist/model/User.schema.d.ts +12 -1
- package/dist/model/User.schema.js +8 -0
- package/dist/namespace.d.ts +20 -12
- package/dist/namespace.js +14 -9
- package/package.json +1 -1
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import Environment from "../model/Env";
|
|
2
|
-
import { NotificationSchema, NotificationDetail } from "../model/Notification.schema";
|
|
2
|
+
import { NotificationSchema, NotificationDetail, Trigger } from "../model/Notification.schema";
|
|
3
3
|
import Context from "../model/Context";
|
|
4
|
+
import { APIResponse } from "../model/Api";
|
|
4
5
|
declare class NotificationAPI implements NotificationSchema {
|
|
5
6
|
private env;
|
|
6
7
|
private clientHTTP;
|
|
7
8
|
constructor(env: Environment);
|
|
9
|
+
deleteTrigger(ctx: Context, triggerId: string): Promise<boolean>;
|
|
10
|
+
updateTrigger(ctx: Context, triggerId: string, t: Partial<Trigger>): Promise<Trigger>;
|
|
11
|
+
createTrigger(ctx: Context, t: Trigger): Promise<Trigger>;
|
|
12
|
+
getTriggers(ctx: Context): Promise<APIResponse<Trigger>>;
|
|
8
13
|
push(ctx: Context, notification: NotificationDetail): Promise<boolean>;
|
|
9
14
|
}
|
|
10
15
|
export default NotificationAPI;
|
|
@@ -10,6 +10,28 @@ class NotificationAPI {
|
|
|
10
10
|
this.env = env;
|
|
11
11
|
this.clientHTTP = new HTTPClient_1.default();
|
|
12
12
|
}
|
|
13
|
+
async deleteTrigger(ctx, triggerId) {
|
|
14
|
+
const endpointData = Notification_schema_1.NotificationEndpoints.Delete;
|
|
15
|
+
const endpoint = endpointData.uri.replace(":id", triggerId);
|
|
16
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpoint, endpointData.method, null, ctx);
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
async updateTrigger(ctx, triggerId, t) {
|
|
20
|
+
const endpointData = Notification_schema_1.NotificationEndpoints.Update;
|
|
21
|
+
const endpoint = endpointData.uri.replace(":id", triggerId);
|
|
22
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpoint, endpointData.method, t, ctx);
|
|
23
|
+
return data;
|
|
24
|
+
}
|
|
25
|
+
async createTrigger(ctx, t) {
|
|
26
|
+
const endpointData = Notification_schema_1.NotificationEndpoints.Create;
|
|
27
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpointData.uri, endpointData.method, t, ctx);
|
|
28
|
+
return data;
|
|
29
|
+
}
|
|
30
|
+
async getTriggers(ctx) {
|
|
31
|
+
const endpointInfo = Notification_schema_1.NotificationEndpoints.List;
|
|
32
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, null, ctx);
|
|
33
|
+
return data;
|
|
34
|
+
}
|
|
13
35
|
async push(ctx, notification) {
|
|
14
36
|
const endpointInfo = Notification_schema_1.NotificationEndpoints.Push;
|
|
15
37
|
const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, notification, ctx);
|
|
@@ -10,7 +10,7 @@ declare class ProjectAPI implements ProjectAPISchema {
|
|
|
10
10
|
review(ctx: Context, pId: string, revision: string): Promise<boolean>;
|
|
11
11
|
cancel(ctx: Context, projectId: string): Promise<boolean>;
|
|
12
12
|
list(context: Context, query: Query): Promise<Project[]>;
|
|
13
|
-
deny(ctx: Context, pId: string, denyFB: string): Promise<boolean>;
|
|
13
|
+
deny(ctx: Context, pId: string, denyFB: string, categories?: string[]): Promise<boolean>;
|
|
14
14
|
unschedule(context: Context, projectId: string): Promise<boolean>;
|
|
15
15
|
start(context: Context, projectId: string): Promise<boolean>;
|
|
16
16
|
approve(ctx: Context, pId: string, approve: Approve): Promise<boolean>;
|
package/dist/api/Project.api.js
CHANGED
|
@@ -38,10 +38,10 @@ class ProjectAPI {
|
|
|
38
38
|
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}?startDate=${query.startDate}&endDate=${query.endDate}&timezone=${query.timeZone}`, endpointData.method, null, context);
|
|
39
39
|
return data;
|
|
40
40
|
}
|
|
41
|
-
async deny(ctx, pId, denyFB) {
|
|
41
|
+
async deny(ctx, pId, denyFB, categories) {
|
|
42
42
|
const endpointData = Project_schema_1.ProjectEndpoints.Deny;
|
|
43
43
|
const endpoint = endpointData.uri.replace(":projectId", pId);
|
|
44
|
-
const data = await this.clientHTTP.makeRequest(this.env, endpoint, endpointData.method, { denyFeedback: denyFB }, ctx);
|
|
44
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpoint, endpointData.method, { denyFeedback: denyFB, categories: categories || [] }, ctx);
|
|
45
45
|
return data.success;
|
|
46
46
|
}
|
|
47
47
|
async unschedule(context, projectId) {
|
|
@@ -5,11 +5,13 @@ declare class SubscriptionAPI implements SubscriptionAPISchema {
|
|
|
5
5
|
private env;
|
|
6
6
|
private clientHTTP;
|
|
7
7
|
constructor(env: Environment);
|
|
8
|
+
updatePlan(ctx: Context, planId: string): Promise<boolean>;
|
|
8
9
|
getProduct(id: string, context?: Context): Promise<Product>;
|
|
9
10
|
getCharges(ctx: Context): Promise<Charge[]>;
|
|
10
11
|
getSubscription(context: Context, userId?: string): Promise<Subscription | null>;
|
|
11
12
|
charge(ctx: Context): Promise<boolean>;
|
|
12
|
-
|
|
13
|
+
pause(ctx: Context): Promise<boolean>;
|
|
14
|
+
resume(ctx: Context): Promise<boolean>;
|
|
13
15
|
getProducts(ctx?: Context): Promise<Product[]>;
|
|
14
16
|
createCheckout(planId: string | null, ctx: Context): Promise<string>;
|
|
15
17
|
}
|
|
@@ -10,6 +10,11 @@ class SubscriptionAPI {
|
|
|
10
10
|
this.env = env;
|
|
11
11
|
this.clientHTTP = new HTTPClient_1.default();
|
|
12
12
|
}
|
|
13
|
+
async updatePlan(ctx, planId) {
|
|
14
|
+
const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.UpdatePlan;
|
|
15
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, { planId }, ctx);
|
|
16
|
+
return data;
|
|
17
|
+
}
|
|
13
18
|
async getProduct(id, context) {
|
|
14
19
|
const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.GetProduct;
|
|
15
20
|
const data = await this.clientHTTP.makeRequest(this.env, `${endpointInfo.uri}/${id}`, endpointInfo.method, null, context);
|
|
@@ -38,8 +43,13 @@ class SubscriptionAPI {
|
|
|
38
43
|
const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, null, ctx);
|
|
39
44
|
return data.success;
|
|
40
45
|
}
|
|
41
|
-
async
|
|
42
|
-
const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.
|
|
46
|
+
async pause(ctx) {
|
|
47
|
+
const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.Pause;
|
|
48
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, null, ctx);
|
|
49
|
+
return data;
|
|
50
|
+
}
|
|
51
|
+
async resume(ctx) {
|
|
52
|
+
const endpointInfo = Subscription_schema_1.SubscriptionEndpoints.Resume;
|
|
43
53
|
const data = await this.clientHTTP.makeRequest(this.env, endpointInfo.uri, endpointInfo.method, null, ctx);
|
|
44
54
|
return data;
|
|
45
55
|
}
|
package/dist/api/User.api.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ declare class UserAPI implements UserAPISchema {
|
|
|
6
6
|
private clientHTTP;
|
|
7
7
|
constructor(env: Environment);
|
|
8
8
|
deleteAccount(ctx: Context): Promise<boolean>;
|
|
9
|
+
createIntegrationToken(ctx: Context): Promise<string>;
|
|
10
|
+
getIntegrationToken(ctx: Context): Promise<string | null>;
|
|
9
11
|
sendValidationCode(email: string): Promise<boolean>;
|
|
10
12
|
changePassword(email: string, pass: string, passConfirm: string, code: number): Promise<boolean>;
|
|
11
13
|
changeEmail(ctx: Context, email: string, code: number): Promise<boolean>;
|
package/dist/api/User.api.js
CHANGED
|
@@ -15,6 +15,16 @@ class UserAPI {
|
|
|
15
15
|
const data = await this.clientHTTP.makeRequest(this.env, endpointData.uri, endpointData.method, null, ctx);
|
|
16
16
|
return data.success;
|
|
17
17
|
}
|
|
18
|
+
async createIntegrationToken(ctx) {
|
|
19
|
+
const endpointData = User_schema_1.UserEndpoints.CreateToken;
|
|
20
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, null, ctx);
|
|
21
|
+
return data.token;
|
|
22
|
+
}
|
|
23
|
+
async getIntegrationToken(ctx) {
|
|
24
|
+
const endpointData = User_schema_1.UserEndpoints.GetIntegrationToken;
|
|
25
|
+
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}`, endpointData.method, null, ctx);
|
|
26
|
+
return data.token;
|
|
27
|
+
}
|
|
18
28
|
async sendValidationCode(email) {
|
|
19
29
|
const endpointData = User_schema_1.UserEndpoints.SendValidationCode;
|
|
20
30
|
const data = await this.clientHTTP.makeRequest(this.env, `${endpointData.uri}?email=${email}`, endpointData.method);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { ShredAPI } from "./model/Api";
|
|
1
2
|
import { Role, System } from "./model/User.schema";
|
|
2
3
|
import { Status as ProjectStatus, Styles, CaptionStyle } from "./model/Project.schema";
|
|
3
4
|
import Exceptions from "./model/exceptions/";
|
|
4
5
|
export { Role, System, Exceptions, ProjectStatus, Styles, CaptionStyle };
|
|
6
|
+
export default ShredAPI;
|
|
5
7
|
export * from "./namespace";
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.CaptionStyle = exports.Styles = exports.ProjectStatus = exports.Exceptions = exports.System = exports.Role = void 0;
|
|
21
|
+
const Api_1 = require("./model/Api");
|
|
21
22
|
const User_schema_1 = require("./model/User.schema");
|
|
22
23
|
Object.defineProperty(exports, "Role", { enumerable: true, get: function () { return User_schema_1.Role; } });
|
|
23
24
|
Object.defineProperty(exports, "System", { enumerable: true, get: function () { return User_schema_1.System; } });
|
|
@@ -27,4 +28,5 @@ Object.defineProperty(exports, "Styles", { enumerable: true, get: function () {
|
|
|
27
28
|
Object.defineProperty(exports, "CaptionStyle", { enumerable: true, get: function () { return Project_schema_1.CaptionStyle; } });
|
|
28
29
|
const exceptions_1 = __importDefault(require("./model/exceptions/"));
|
|
29
30
|
exports.Exceptions = exceptions_1.default;
|
|
31
|
+
exports.default = Api_1.ShredAPI;
|
|
30
32
|
__exportStar(require("./namespace"), exports);
|
package/dist/model/Api.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ import { TenantAPISchema } from "./Tenant.schema";
|
|
|
8
8
|
import { ProjectAPISchema } from "./Project.schema";
|
|
9
9
|
import { APPConfigSchema } from "./AppConfig.schema";
|
|
10
10
|
import { TrackAPISchema } from "./Track.schema";
|
|
11
|
+
export type APIResponse<T> = {
|
|
12
|
+
perPage: number;
|
|
13
|
+
last?: T;
|
|
14
|
+
data: T[];
|
|
15
|
+
count: number;
|
|
16
|
+
};
|
|
11
17
|
export declare class ShredAPI {
|
|
12
18
|
user: UserAPISchema;
|
|
13
19
|
subscription: SubscriptionAPISchema;
|
|
@@ -1,9 +1,30 @@
|
|
|
1
1
|
import Context from "./Context";
|
|
2
2
|
import { Notification } from "./../namespace";
|
|
3
|
+
import { APIResponse } from "./Api";
|
|
3
4
|
interface NotificationSchema {
|
|
5
|
+
getTriggers: (ctx: Context) => Promise<APIResponse<Trigger>>;
|
|
6
|
+
createTrigger: (ctx: Context, t: Trigger) => Promise<Trigger>;
|
|
7
|
+
deleteTrigger: (ctx: Context, triggerId: string) => Promise<boolean>;
|
|
8
|
+
updateTrigger: (ctx: Context, triggerId: string, trigger: Partial<Trigger>) => Promise<Trigger>;
|
|
4
9
|
push: (context: Context, notification: NotificationDetail) => Promise<boolean>;
|
|
5
10
|
}
|
|
6
11
|
declare const NotificationEndpoints: {
|
|
12
|
+
Create: {
|
|
13
|
+
uri: string;
|
|
14
|
+
method: string;
|
|
15
|
+
};
|
|
16
|
+
List: {
|
|
17
|
+
uri: string;
|
|
18
|
+
method: string;
|
|
19
|
+
};
|
|
20
|
+
Update: {
|
|
21
|
+
uri: string;
|
|
22
|
+
method: string;
|
|
23
|
+
};
|
|
24
|
+
Delete: {
|
|
25
|
+
uri: string;
|
|
26
|
+
method: string;
|
|
27
|
+
};
|
|
7
28
|
Push: {
|
|
8
29
|
uri: string;
|
|
9
30
|
method: string;
|
|
@@ -26,18 +47,27 @@ type History = {
|
|
|
26
47
|
errorList?: string[];
|
|
27
48
|
executionTimeDuration?: number;
|
|
28
49
|
};
|
|
50
|
+
type RecurrenceRule = {
|
|
51
|
+
frequency: Notification.Frequency;
|
|
52
|
+
interval: number;
|
|
53
|
+
weekDays?: Notification.WeekDay[];
|
|
54
|
+
dayOfMonth?: number;
|
|
55
|
+
endDate?: string;
|
|
56
|
+
ocurrences?: number;
|
|
57
|
+
};
|
|
29
58
|
type Trigger = {
|
|
30
59
|
id: string;
|
|
31
60
|
title: string;
|
|
32
61
|
description: string;
|
|
33
62
|
transportType: Notification.TransportType[];
|
|
34
63
|
notification: NotificationDetail;
|
|
35
|
-
executionTime: string;
|
|
36
|
-
repeatDays: Notification.WeekDay[];
|
|
37
64
|
history?: History[];
|
|
38
65
|
status: Notification.Status;
|
|
39
|
-
|
|
40
|
-
|
|
66
|
+
recurrence?: RecurrenceRule;
|
|
67
|
+
timezone?: string | null;
|
|
68
|
+
tenantIds?: string[];
|
|
69
|
+
executionDate?: string;
|
|
70
|
+
timeOfDay: string;
|
|
41
71
|
criteria: Criteria;
|
|
42
72
|
nextExecution?: number;
|
|
43
73
|
createdAt?: number;
|
|
@@ -47,6 +77,6 @@ type NotificationDetail = {
|
|
|
47
77
|
title: string;
|
|
48
78
|
body: string;
|
|
49
79
|
userToken?: string;
|
|
50
|
-
metadata?: any
|
|
80
|
+
metadata?: Record<string, any>;
|
|
51
81
|
};
|
|
52
|
-
export { NotificationSchema, NotificationEndpoints, NotificationDetail, Trigger, Criteria, History, };
|
|
82
|
+
export { NotificationSchema, NotificationEndpoints, NotificationDetail, RecurrenceRule, Trigger, Criteria, History, };
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NotificationEndpoints = void 0;
|
|
4
4
|
const NotificationEndpoints = {
|
|
5
|
+
Create: {
|
|
6
|
+
uri: "/notifications/trigger/",
|
|
7
|
+
method: "POST",
|
|
8
|
+
},
|
|
9
|
+
List: {
|
|
10
|
+
uri: "/notifications/trigger/list/",
|
|
11
|
+
method: "GET",
|
|
12
|
+
},
|
|
13
|
+
Update: {
|
|
14
|
+
uri: "/notifications/trigger/:id/",
|
|
15
|
+
method: "PUT",
|
|
16
|
+
},
|
|
17
|
+
Delete: {
|
|
18
|
+
uri: "/notifications/trigger/:id/",
|
|
19
|
+
method: "DELETE",
|
|
20
|
+
},
|
|
5
21
|
Push: {
|
|
6
22
|
uri: "/notifications/push/",
|
|
7
23
|
method: "POST",
|
|
@@ -24,7 +24,7 @@ interface ProjectAPISchema {
|
|
|
24
24
|
start: (context: Context, projectId: string) => Promise<boolean>;
|
|
25
25
|
sendToApproval: (context: Context, projectId: string, data: SendToApproval) => Promise<boolean>;
|
|
26
26
|
approve: (context: Context, projectId: string, data: Approve) => Promise<boolean>;
|
|
27
|
-
deny: (context: Context, projectId: string, denyFeedback: string) => Promise<boolean>;
|
|
27
|
+
deny: (context: Context, projectId: string, denyFeedback: string, categories?: string[]) => Promise<boolean>;
|
|
28
28
|
unschedule: (context: Context, projectId: string) => Promise<boolean>;
|
|
29
29
|
}
|
|
30
30
|
declare const ProjectEndpoints: {
|
|
@@ -80,46 +80,58 @@ export declare enum Status {
|
|
|
80
80
|
SCHEDULED = 7
|
|
81
81
|
}
|
|
82
82
|
export declare enum CaptionStyle {
|
|
83
|
-
ONE_LINE =
|
|
84
|
-
ONE_LINE_EMOJIS =
|
|
85
|
-
TWO_LINES =
|
|
86
|
-
TWO_LINES_EMOJIS =
|
|
87
|
-
HOME_HIGHLIGHT =
|
|
83
|
+
ONE_LINE = 1,
|
|
84
|
+
ONE_LINE_EMOJIS = 2,
|
|
85
|
+
TWO_LINES = 5,
|
|
86
|
+
TWO_LINES_EMOJIS = 3,
|
|
87
|
+
HOME_HIGHLIGHT = 4
|
|
88
88
|
}
|
|
89
|
-
|
|
89
|
+
interface Style {
|
|
90
|
+
value: CaptionStyle;
|
|
91
|
+
label: string;
|
|
92
|
+
}
|
|
93
|
+
export declare const Styles: Style[];
|
|
90
94
|
type DenyFeedback = {
|
|
91
95
|
timestamp: number;
|
|
92
96
|
feedback: string;
|
|
93
97
|
resolved: boolean;
|
|
98
|
+
categories?: string[];
|
|
99
|
+
};
|
|
100
|
+
type TimelineItem = {
|
|
101
|
+
status: Status;
|
|
102
|
+
title: string;
|
|
103
|
+
description: string;
|
|
104
|
+
timestamp: number;
|
|
105
|
+
metadata: Record<string, any>;
|
|
94
106
|
};
|
|
95
107
|
type Project = {
|
|
96
108
|
id: string;
|
|
97
109
|
title: string;
|
|
98
110
|
instructions: string;
|
|
99
111
|
submitMonth: string;
|
|
100
|
-
status: Status;
|
|
101
112
|
captionStyle: CaptionStyle;
|
|
102
113
|
finalVideoId?: string;
|
|
103
|
-
canRevision: boolean;
|
|
104
114
|
thumbnailUrl?: string;
|
|
105
|
-
revision?: string;
|
|
106
115
|
modified: number;
|
|
107
116
|
captionSuggestion?: string;
|
|
108
117
|
editorId: string;
|
|
109
118
|
userId: string;
|
|
110
119
|
assets?: Asset[];
|
|
111
|
-
denyFeedback?: DenyFeedback[];
|
|
112
|
-
approvedBy?: string;
|
|
113
|
-
approveTimestamp?: number;
|
|
114
120
|
expirationTimestamp: number;
|
|
121
|
+
timeline?: TimelineItem[];
|
|
122
|
+
approveTimestamp?: number;
|
|
115
123
|
sentToApproveTimestamp?: number;
|
|
116
124
|
submitTimestamp: number;
|
|
117
125
|
editTimestamp?: number;
|
|
118
126
|
completeTimestamp?: number;
|
|
119
127
|
revisedAt?: number;
|
|
120
|
-
isFreeProject?: boolean;
|
|
121
128
|
scheduledAt?: number;
|
|
122
129
|
scheduledTime?: number;
|
|
130
|
+
revision?: string;
|
|
131
|
+
canRevision: boolean;
|
|
132
|
+
denyFeedback?: DenyFeedback[];
|
|
133
|
+
approvedBy?: string;
|
|
134
|
+
status: Status;
|
|
123
135
|
tenantId?: string;
|
|
124
136
|
};
|
|
125
|
-
export { Project, ProjectAPISchema, ProjectEndpoints };
|
|
137
|
+
export { Project, ProjectAPISchema, ProjectEndpoints, TimelineItem };
|
|
@@ -12,7 +12,7 @@ const ProjectEndpoints = {
|
|
|
12
12
|
},
|
|
13
13
|
FindOne: {
|
|
14
14
|
uri: `/projects/:projectId/`,
|
|
15
|
-
method: "
|
|
15
|
+
method: "GET",
|
|
16
16
|
},
|
|
17
17
|
Review: {
|
|
18
18
|
uri: "/projects/:projectId/review/",
|
|
@@ -57,16 +57,16 @@ var Status;
|
|
|
57
57
|
})(Status || (exports.Status = Status = {}));
|
|
58
58
|
var CaptionStyle;
|
|
59
59
|
(function (CaptionStyle) {
|
|
60
|
-
CaptionStyle["ONE_LINE"] =
|
|
61
|
-
CaptionStyle["ONE_LINE_EMOJIS"] =
|
|
62
|
-
CaptionStyle["TWO_LINES"] =
|
|
63
|
-
CaptionStyle["TWO_LINES_EMOJIS"] =
|
|
64
|
-
CaptionStyle["HOME_HIGHLIGHT"] =
|
|
60
|
+
CaptionStyle[CaptionStyle["ONE_LINE"] = 1] = "ONE_LINE";
|
|
61
|
+
CaptionStyle[CaptionStyle["ONE_LINE_EMOJIS"] = 2] = "ONE_LINE_EMOJIS";
|
|
62
|
+
CaptionStyle[CaptionStyle["TWO_LINES"] = 5] = "TWO_LINES";
|
|
63
|
+
CaptionStyle[CaptionStyle["TWO_LINES_EMOJIS"] = 3] = "TWO_LINES_EMOJIS";
|
|
64
|
+
CaptionStyle[CaptionStyle["HOME_HIGHLIGHT"] = 4] = "HOME_HIGHLIGHT";
|
|
65
65
|
})(CaptionStyle || (exports.CaptionStyle = CaptionStyle = {}));
|
|
66
|
-
exports.Styles =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
exports.Styles = [
|
|
67
|
+
{ value: CaptionStyle.ONE_LINE, label: "One Line" },
|
|
68
|
+
{ value: CaptionStyle.ONE_LINE_EMOJIS, label: "One Line + Emojis" },
|
|
69
|
+
{ value: CaptionStyle.TWO_LINES, label: "Two Lines" },
|
|
70
|
+
{ value: CaptionStyle.TWO_LINES_EMOJIS, label: "Two Lines + Emojis" },
|
|
71
|
+
{ value: CaptionStyle.HOME_HIGHLIGHT, label: "Home Tour" },
|
|
72
|
+
];
|
|
@@ -5,7 +5,9 @@ interface SubscriptionAPISchema {
|
|
|
5
5
|
getProduct: (id: string, context?: Context) => Promise<Product>;
|
|
6
6
|
getProducts: (ctx?: Context) => Promise<Product[]>;
|
|
7
7
|
charge: (ctx: Context) => Promise<boolean>;
|
|
8
|
-
|
|
8
|
+
pause: (ctx: Context) => Promise<boolean>;
|
|
9
|
+
resume: (ctx: Context) => Promise<boolean>;
|
|
10
|
+
updatePlan: (ctx: Context, planId: string) => Promise<boolean>;
|
|
9
11
|
createCheckout: (planId: string | null, ctx: Context) => Promise<string>;
|
|
10
12
|
}
|
|
11
13
|
declare const SubscriptionEndpoints: {
|
|
@@ -41,7 +43,15 @@ declare const SubscriptionEndpoints: {
|
|
|
41
43
|
uri: string;
|
|
42
44
|
method: string;
|
|
43
45
|
};
|
|
44
|
-
|
|
46
|
+
Pause: {
|
|
47
|
+
uri: string;
|
|
48
|
+
method: string;
|
|
49
|
+
};
|
|
50
|
+
Resume: {
|
|
51
|
+
uri: string;
|
|
52
|
+
method: string;
|
|
53
|
+
};
|
|
54
|
+
UpdatePlan: {
|
|
45
55
|
uri: string;
|
|
46
56
|
method: string;
|
|
47
57
|
};
|
|
@@ -51,7 +61,8 @@ type Plan = {
|
|
|
51
61
|
currency: string;
|
|
52
62
|
price: string;
|
|
53
63
|
interval: string;
|
|
54
|
-
metadata:
|
|
64
|
+
metadata: Record<string, string>;
|
|
65
|
+
subscriptionItemId: string;
|
|
55
66
|
};
|
|
56
67
|
type Description = {
|
|
57
68
|
description: string;
|
|
@@ -34,9 +34,17 @@ const SubscriptionEndpoints = {
|
|
|
34
34
|
uri: "/subscriptions/payment/charge/",
|
|
35
35
|
method: "POST",
|
|
36
36
|
},
|
|
37
|
-
|
|
38
|
-
uri: "/subscriptions/
|
|
39
|
-
method: "
|
|
37
|
+
Pause: {
|
|
38
|
+
uri: "/subscriptions/pause/",
|
|
39
|
+
method: "PUT",
|
|
40
|
+
},
|
|
41
|
+
Resume: {
|
|
42
|
+
uri: "/subscriptions/resume/",
|
|
43
|
+
method: "PUT",
|
|
44
|
+
},
|
|
45
|
+
UpdatePlan: {
|
|
46
|
+
uri: "/subscriptions/plan/update/",
|
|
47
|
+
method: "PUT",
|
|
40
48
|
},
|
|
41
49
|
};
|
|
42
50
|
exports.SubscriptionEndpoints = SubscriptionEndpoints;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Context from "./Context";
|
|
2
|
-
export type Update = Pick<User, "name" | "profession" | "preferences" | "photoUrl" | "fcmToken">;
|
|
2
|
+
export type Update = Pick<User, "name" | "profession" | "preferences" | "photoUrl" | "fcmToken" | "timezone" | "experienceId">;
|
|
3
3
|
interface UserAPISchema {
|
|
4
4
|
getUserInfo: (context: Context) => Promise<User>;
|
|
5
5
|
isEmailAvaliable: (email: string) => Promise<boolean>;
|
|
@@ -12,6 +12,8 @@ interface UserAPISchema {
|
|
|
12
12
|
setup: (context: Context) => Promise<boolean>;
|
|
13
13
|
getBindedUsers: (ctx: Context) => Promise<User[]>;
|
|
14
14
|
deleteAccount: (ctx: Context) => Promise<boolean>;
|
|
15
|
+
getIntegrationToken: (ctx: Context) => Promise<string | null>;
|
|
16
|
+
createIntegrationToken: (ctx: Context) => Promise<string>;
|
|
15
17
|
createUser: (email: string, name: string, password: string, passwordConfirmation: string, profession: string | null, invitationCode: string | null) => Promise<User>;
|
|
16
18
|
}
|
|
17
19
|
declare const UserEndpoints: {
|
|
@@ -39,6 +41,14 @@ declare const UserEndpoints: {
|
|
|
39
41
|
uri: string;
|
|
40
42
|
method: string;
|
|
41
43
|
};
|
|
44
|
+
GetIntegrationToken: {
|
|
45
|
+
uri: string;
|
|
46
|
+
method: string;
|
|
47
|
+
};
|
|
48
|
+
CreateToken: {
|
|
49
|
+
uri: string;
|
|
50
|
+
method: string;
|
|
51
|
+
};
|
|
42
52
|
ConfirmCode: {
|
|
43
53
|
uri: string;
|
|
44
54
|
method: string;
|
|
@@ -99,6 +109,7 @@ type User = {
|
|
|
99
109
|
tenantId?: string;
|
|
100
110
|
editorId?: string;
|
|
101
111
|
timezone?: string;
|
|
112
|
+
experienceId?: string;
|
|
102
113
|
customerId: string;
|
|
103
114
|
role: Role;
|
|
104
115
|
};
|
|
@@ -26,6 +26,14 @@ const UserEndpoints = {
|
|
|
26
26
|
uri: "/accounts/public/email/avaliable",
|
|
27
27
|
method: "GET",
|
|
28
28
|
},
|
|
29
|
+
GetIntegrationToken: {
|
|
30
|
+
uri: "/accounts/user/getToken/",
|
|
31
|
+
method: "GET",
|
|
32
|
+
},
|
|
33
|
+
CreateToken: {
|
|
34
|
+
uri: "/accounts/user/createToken/",
|
|
35
|
+
method: "POST",
|
|
36
|
+
},
|
|
29
37
|
ConfirmCode: {
|
|
30
38
|
uri: "/accounts/public/email/validate",
|
|
31
39
|
method: "POST",
|
package/dist/namespace.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Product as TProduct, Subscription as TSubscription, Charge as TCharge } from "./model/Subscription.schema";
|
|
2
|
-
import { Trigger as TTrigger, Criteria as TCriteria, NotificationDetail as TNContent, History as THistory } from "./model/Notification.schema";
|
|
2
|
+
import { Trigger as TTrigger, Criteria as TCriteria, NotificationDetail as TNContent, RecurrenceRule as TRRule, History as THistory } from "./model/Notification.schema";
|
|
3
|
+
import { APIResponse } from "./model/Api";
|
|
3
4
|
import { System as TSystem, User as TUser, Preferences as UserPreferences, Role as TRole } from "./model/User.schema";
|
|
4
5
|
import { Email as TEmail } from "./model/Email.schema";
|
|
5
6
|
import { Asset as TAsset } from "./model/Asset.schema";
|
|
6
|
-
import { Project as TProject } from "./model/Project.schema";
|
|
7
|
+
import { Project as TProject, TimelineItem as TTimlineItem } from "./model/Project.schema";
|
|
7
8
|
import { Tenant as TTenant } from "./model/Tenant.schema";
|
|
8
9
|
import { Track as TTrack } from "./model/Track.schema";
|
|
9
10
|
import { Prompt as TPrompt, Script as TScript, Category as TCategory } from "./model/Prompt.schema";
|
|
@@ -11,6 +12,7 @@ export declare namespace Permissions {
|
|
|
11
12
|
type Role = TRole;
|
|
12
13
|
}
|
|
13
14
|
export declare namespace Shred {
|
|
15
|
+
type Response<T> = APIResponse<T>;
|
|
14
16
|
type Tenant = TTenant;
|
|
15
17
|
type Product = TProduct;
|
|
16
18
|
type Subscription = TSubscription;
|
|
@@ -19,6 +21,7 @@ export declare namespace Shred {
|
|
|
19
21
|
type Email = TEmail;
|
|
20
22
|
type System = TSystem;
|
|
21
23
|
type Project = TProject;
|
|
24
|
+
type TimelineItem = TTimlineItem;
|
|
22
25
|
type Asset = TAsset;
|
|
23
26
|
type Track = TTrack;
|
|
24
27
|
namespace PromptTypes {
|
|
@@ -28,21 +31,25 @@ export declare namespace Shred {
|
|
|
28
31
|
}
|
|
29
32
|
}
|
|
30
33
|
export declare namespace Notification {
|
|
34
|
+
enum Frequency {
|
|
35
|
+
DAILY = "daily",
|
|
36
|
+
WEEKLY = "weekly",
|
|
37
|
+
MONTHLY = "monthly"
|
|
38
|
+
}
|
|
31
39
|
enum WeekDay {
|
|
32
|
-
MONDAY =
|
|
33
|
-
TUESDAY =
|
|
34
|
-
WEDNESDAY =
|
|
35
|
-
THURSDAY =
|
|
36
|
-
FRIDAY =
|
|
37
|
-
SATURDAY =
|
|
38
|
-
SUNDAY =
|
|
40
|
+
MONDAY = 1,
|
|
41
|
+
TUESDAY = 2,
|
|
42
|
+
WEDNESDAY = 3,
|
|
43
|
+
THURSDAY = 4,
|
|
44
|
+
FRIDAY = 5,
|
|
45
|
+
SATURDAY = 6,
|
|
46
|
+
SUNDAY = 7
|
|
39
47
|
}
|
|
40
48
|
enum CriteriaType {
|
|
41
|
-
NoLogin = "noLogin",
|
|
42
49
|
AllUsers = "allUsers",
|
|
43
50
|
NoProjects = "noProjects",
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
NoSubscription = "noSubscription",
|
|
52
|
+
UsersFromTier = "usersFromTier"
|
|
46
53
|
}
|
|
47
54
|
enum TransportType {
|
|
48
55
|
Push = "push",
|
|
@@ -58,6 +65,7 @@ export declare namespace Notification {
|
|
|
58
65
|
ACTIVE = "active",
|
|
59
66
|
EXPIRED = "expired"
|
|
60
67
|
}
|
|
68
|
+
type RecurrenceRule = TRRule;
|
|
61
69
|
type Trigger = TTrigger;
|
|
62
70
|
type Criteria = TCriteria;
|
|
63
71
|
type History = THistory;
|
package/dist/namespace.js
CHANGED
|
@@ -3,23 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Notification = void 0;
|
|
4
4
|
var Notification;
|
|
5
5
|
(function (Notification) {
|
|
6
|
+
let Frequency;
|
|
7
|
+
(function (Frequency) {
|
|
8
|
+
Frequency["DAILY"] = "daily";
|
|
9
|
+
Frequency["WEEKLY"] = "weekly";
|
|
10
|
+
Frequency["MONTHLY"] = "monthly";
|
|
11
|
+
})(Frequency = Notification.Frequency || (Notification.Frequency = {}));
|
|
6
12
|
let WeekDay;
|
|
7
13
|
(function (WeekDay) {
|
|
8
|
-
WeekDay["MONDAY"] = "
|
|
9
|
-
WeekDay["TUESDAY"] = "
|
|
10
|
-
WeekDay["WEDNESDAY"] = "
|
|
11
|
-
WeekDay["THURSDAY"] = "
|
|
12
|
-
WeekDay["FRIDAY"] = "
|
|
13
|
-
WeekDay["SATURDAY"] = "
|
|
14
|
-
WeekDay["SUNDAY"] = "
|
|
14
|
+
WeekDay[WeekDay["MONDAY"] = 1] = "MONDAY";
|
|
15
|
+
WeekDay[WeekDay["TUESDAY"] = 2] = "TUESDAY";
|
|
16
|
+
WeekDay[WeekDay["WEDNESDAY"] = 3] = "WEDNESDAY";
|
|
17
|
+
WeekDay[WeekDay["THURSDAY"] = 4] = "THURSDAY";
|
|
18
|
+
WeekDay[WeekDay["FRIDAY"] = 5] = "FRIDAY";
|
|
19
|
+
WeekDay[WeekDay["SATURDAY"] = 6] = "SATURDAY";
|
|
20
|
+
WeekDay[WeekDay["SUNDAY"] = 7] = "SUNDAY";
|
|
15
21
|
})(WeekDay = Notification.WeekDay || (Notification.WeekDay = {}));
|
|
16
22
|
let CriteriaType;
|
|
17
23
|
(function (CriteriaType) {
|
|
18
|
-
CriteriaType["NoLogin"] = "noLogin";
|
|
19
24
|
CriteriaType["AllUsers"] = "allUsers";
|
|
20
25
|
CriteriaType["NoProjects"] = "noProjects";
|
|
21
|
-
CriteriaType["InactiveUsers"] = "inactiveUsers";
|
|
22
26
|
CriteriaType["NoSubscription"] = "noSubscription";
|
|
27
|
+
CriteriaType["UsersFromTier"] = "usersFromTier";
|
|
23
28
|
})(CriteriaType = Notification.CriteriaType || (Notification.CriteriaType = {}));
|
|
24
29
|
let TransportType;
|
|
25
30
|
(function (TransportType) {
|