@dev-crew-berlin/enter-js-utils 0.81.1 → 0.82.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/lib/tokens.d.ts +6 -0
- package/dist/lib/tokens.js +14 -0
- package/dist/ui/icons/caret-icon.js +1 -1
- package/package.json +2 -2
package/dist/lib/tokens.d.ts
CHANGED
|
@@ -18,6 +18,12 @@ export type RegistrationToken = {
|
|
|
18
18
|
isExpired: boolean;
|
|
19
19
|
};
|
|
20
20
|
export declare function parseRegistrationToken(tokenString: string | undefined, options: TokenOptions): Result<TokenValidationError, RegistrationToken>;
|
|
21
|
+
export declare function parseTrackingToken(tokenString: string | undefined, options: TokenOptions): Result<TokenValidationError, {
|
|
22
|
+
attendeeId: string;
|
|
23
|
+
emailName: string;
|
|
24
|
+
target: string;
|
|
25
|
+
mailingId: string;
|
|
26
|
+
}>;
|
|
21
27
|
export declare function parseUnsubscribeToken(tokenString: string | undefined, options: TokenOptions): Result<TokenValidationError, {
|
|
22
28
|
emailAddress: string;
|
|
23
29
|
attendeeId: string;
|
package/dist/lib/tokens.js
CHANGED
|
@@ -27,6 +27,20 @@ export function parseRegistrationToken(tokenString, options) {
|
|
|
27
27
|
isExpired
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
+
export function parseTrackingToken(tokenString, options) {
|
|
31
|
+
const tokenResult = parseJWS(tokenString, options);
|
|
32
|
+
if (!tokenResult.success) return tokenResult;
|
|
33
|
+
const payload = tokenResult.data.payload;
|
|
34
|
+
if (payload.instance_name !== options.instanceName || typeof payload.target !== 'string' || typeof payload.attendee_id !== 'string' || typeof payload.mailing_id !== 'string' || typeof payload.email_name !== 'string') {
|
|
35
|
+
return failure('token_invalid');
|
|
36
|
+
}
|
|
37
|
+
return success({
|
|
38
|
+
attendeeId: payload.attendee_id,
|
|
39
|
+
emailName: payload.email_name,
|
|
40
|
+
target: payload.target,
|
|
41
|
+
mailingId: payload.mailing_id
|
|
42
|
+
});
|
|
43
|
+
}
|
|
30
44
|
export function parseUnsubscribeToken(tokenString, options) {
|
|
31
45
|
const tokenResult = parseJWS(tokenString, options);
|
|
32
46
|
if (!tokenResult.success) return tokenResult;
|
|
@@ -12,7 +12,7 @@ export const CaretIcon = ({
|
|
|
12
12
|
fill: color
|
|
13
13
|
}, /*#__PURE__*/React.createElement("g", {
|
|
14
14
|
transform: `rotate(${rotateDeg})`,
|
|
15
|
-
|
|
15
|
+
transformOrigin: 'center'
|
|
16
16
|
}, /*#__PURE__*/React.createElement("path", {
|
|
17
17
|
color: color,
|
|
18
18
|
fillRule: "evenodd",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev-crew-berlin/enter-js-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.1",
|
|
4
4
|
"description": "utils such as vaildation and other helpers to work with data from the enter app",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"prettier": "^2.6.2",
|
|
68
68
|
"react": "^18.3.1",
|
|
69
69
|
"react-dom": "^18.3.1",
|
|
70
|
-
"typescript": "^5.7.
|
|
70
|
+
"typescript": "^5.7.3"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"react": "^18.1.0",
|