@dev-crew-berlin/enter-js-utils 0.43.0 → 0.45.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/dist/api-client/api-base.d.ts +2 -2
- package/dist/api-client/api-base.js +2 -2
- package/dist/api-client/index.d.ts +6 -0
- package/dist/api-client/index.js +6 -0
- package/dist/generated/api-schema.d.ts +35 -2
- package/dist/models/email.d.ts +2 -0
- package/dist/models/email.js +1 -0
- package/package.json +1 -1
|
@@ -20,12 +20,12 @@ export declare type RequestBody<Path extends keyof paths, Method extends HTTPMet
|
|
|
20
20
|
export default class APIBase {
|
|
21
21
|
private credentials;
|
|
22
22
|
private isLoggedIn;
|
|
23
|
-
private
|
|
23
|
+
private requesterId;
|
|
24
24
|
private deviceName;
|
|
25
25
|
private onLogout;
|
|
26
26
|
constructor(args: {
|
|
27
27
|
credentials: APICredentials;
|
|
28
|
-
|
|
28
|
+
requesterId: string;
|
|
29
29
|
deviceName: string;
|
|
30
30
|
onLogout: (reason?: string) => void;
|
|
31
31
|
});
|
|
@@ -3,7 +3,7 @@ export default class APIBase {
|
|
|
3
3
|
constructor(args) {
|
|
4
4
|
this.credentials = args.credentials;
|
|
5
5
|
this.onLogout = args.onLogout;
|
|
6
|
-
this.
|
|
6
|
+
this.requesterId = args.requesterId;
|
|
7
7
|
this.deviceName = args.deviceName;
|
|
8
8
|
this.isLoggedIn = true;
|
|
9
9
|
}
|
|
@@ -21,7 +21,7 @@ export default class APIBase {
|
|
|
21
21
|
Authorization: `bearer ${this.credentials.accessToken}`,
|
|
22
22
|
'Content-Type': 'application/json',
|
|
23
23
|
'X-Enter-Device-Name': this.deviceName,
|
|
24
|
-
'X-Enter-
|
|
24
|
+
'X-Enter-Requester-Id': this.requesterId
|
|
25
25
|
};
|
|
26
26
|
const res = await APIBase.fetchResult(`${this.credentials.url}${endpoint}`, {
|
|
27
27
|
method: method.toUpperCase(),
|
|
@@ -8,6 +8,7 @@ import { Instance } from '../models/instance';
|
|
|
8
8
|
import { User } from '../models/user';
|
|
9
9
|
import { Variable } from '../models/variable';
|
|
10
10
|
import { components } from '../generated/api-schema';
|
|
11
|
+
import { Email } from '../models/email';
|
|
11
12
|
export type { APICredentials } from './api-base';
|
|
12
13
|
export default class API extends APIBase {
|
|
13
14
|
getInstanceList(): Promise<APIResult<Instance[]>>;
|
|
@@ -65,5 +66,10 @@ export default class API extends APIBase {
|
|
|
65
66
|
attendeeId: string;
|
|
66
67
|
emailName: string;
|
|
67
68
|
}): Promise<APIResult<null>>;
|
|
69
|
+
getRenderedEmail(args: {
|
|
70
|
+
instanceName: string;
|
|
71
|
+
attendeeId: string;
|
|
72
|
+
emailName: string;
|
|
73
|
+
}): Promise<APIResult<Email>>;
|
|
68
74
|
createEvents(args: Event[]): Promise<APIResult<null>>;
|
|
69
75
|
}
|
package/dist/api-client/index.js
CHANGED
|
@@ -99,6 +99,12 @@ export default class API extends APIBase {
|
|
|
99
99
|
const emailName = args.emailName;
|
|
100
100
|
return this.post(`/instances/${instanceName}/attendees/${attendeeId}/emails/${emailName}/send`, null);
|
|
101
101
|
}
|
|
102
|
+
async getRenderedEmail(args) {
|
|
103
|
+
const instanceName = args.instanceName;
|
|
104
|
+
const attendeeId = args.attendeeId;
|
|
105
|
+
const emailName = args.emailName;
|
|
106
|
+
return this.get(`/instances/${instanceName}/attendees/${attendeeId}/emails/${emailName}/render`);
|
|
107
|
+
}
|
|
102
108
|
async createEvents(args) {
|
|
103
109
|
return this.post(`/events`, args);
|
|
104
110
|
}
|
|
@@ -47,6 +47,9 @@ export declare type paths = {
|
|
|
47
47
|
"/instances/{instance_name}/attendees/{attendee_id}/emails/{email_name}/send": {
|
|
48
48
|
post: operations["send_email_instances__instance_name__attendees__attendee_id__emails__email_name__send_post"];
|
|
49
49
|
};
|
|
50
|
+
"/instances/{instance_name}/attendees/{attendee_id}/emails/{email_name}/render": {
|
|
51
|
+
get: operations["rendered_email_content_instances__instance_name__attendees__attendee_id__emails__email_name__render_get"];
|
|
52
|
+
};
|
|
50
53
|
"/instances/{instance_name}/variables": {
|
|
51
54
|
get: operations["variable_list_instances__instance_name__variables_get"];
|
|
52
55
|
post: operations["create_variable_instances__instance_name__variables_post"];
|
|
@@ -657,8 +660,6 @@ export declare type components = {
|
|
|
657
660
|
instanceName: string;
|
|
658
661
|
/** Emailaddress */
|
|
659
662
|
emailAddress: string;
|
|
660
|
-
/** Signature */
|
|
661
|
-
signature: string;
|
|
662
663
|
};
|
|
663
664
|
/** EventList */
|
|
664
665
|
EventList: (components["schemas"]["AttendeeCreatedEvent"] | components["schemas"]["AttendeeUpdatedEvent"] | components["schemas"]["AttendeeRespondedEvent"] | components["schemas"]["EmailUnsubscribedEvent"] | components["schemas"]["AttendeeDeletedEvent"] | components["schemas"]["CheckinCreatedEvent"] | components["schemas"]["CheckinDeletedEvent"] | components["schemas"]["PaymentPaidEvent"])[];
|
|
@@ -1031,6 +1032,15 @@ export declare type components = {
|
|
|
1031
1032
|
*/
|
|
1032
1033
|
deleted: boolean;
|
|
1033
1034
|
};
|
|
1035
|
+
/** PublicEmail */
|
|
1036
|
+
PublicEmail: {
|
|
1037
|
+
/** Subject */
|
|
1038
|
+
subject: string;
|
|
1039
|
+
/** Htmlcontent */
|
|
1040
|
+
htmlContent?: string;
|
|
1041
|
+
/** Plaintextcontent */
|
|
1042
|
+
plaintextContent: string;
|
|
1043
|
+
};
|
|
1034
1044
|
/** PublicInstance */
|
|
1035
1045
|
PublicInstance: {
|
|
1036
1046
|
/** Name */
|
|
@@ -1624,6 +1634,29 @@ export declare type operations = {
|
|
|
1624
1634
|
};
|
|
1625
1635
|
};
|
|
1626
1636
|
};
|
|
1637
|
+
rendered_email_content_instances__instance_name__attendees__attendee_id__emails__email_name__render_get: {
|
|
1638
|
+
parameters: {
|
|
1639
|
+
path: {
|
|
1640
|
+
instance_name: string;
|
|
1641
|
+
attendee_id: string;
|
|
1642
|
+
email_name: string;
|
|
1643
|
+
};
|
|
1644
|
+
};
|
|
1645
|
+
responses: {
|
|
1646
|
+
/** Successful Response */
|
|
1647
|
+
200: {
|
|
1648
|
+
content: {
|
|
1649
|
+
"application/json": components["schemas"]["PublicEmail"];
|
|
1650
|
+
};
|
|
1651
|
+
};
|
|
1652
|
+
/** Validation Error */
|
|
1653
|
+
422: {
|
|
1654
|
+
content: {
|
|
1655
|
+
"application/json": components["schemas"]["HTTPValidationError"];
|
|
1656
|
+
};
|
|
1657
|
+
};
|
|
1658
|
+
};
|
|
1659
|
+
};
|
|
1627
1660
|
variable_list_instances__instance_name__variables_get: {
|
|
1628
1661
|
parameters: {
|
|
1629
1662
|
path: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|