@koloseum/utils 0.3.7 → 0.3.9
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/client.d.ts +0 -11
- package/dist/client.js +0 -15
- package/dist/server.js +0 -23
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -128,15 +128,4 @@ export declare const Interface: {
|
|
|
128
128
|
* @returns `true` if the page is active, `false` otherwise.
|
|
129
129
|
*/
|
|
130
130
|
pageIsActive: (page: Page, slug: string | undefined, microservice?: Microservice<MicroserviceGroup>, base?: string) => boolean;
|
|
131
|
-
/**
|
|
132
|
-
* Resolves a path and returns the result.
|
|
133
|
-
* Wraps around the `resolve` function in SvelteKit's `$app/paths` module.
|
|
134
|
-
*
|
|
135
|
-
* https://svelte.dev/docs/kit/$app-paths#resolve
|
|
136
|
-
*
|
|
137
|
-
* @param path - The path to resolve
|
|
138
|
-
* @param params - The parameters to resolve the path with
|
|
139
|
-
* @returns {string} The resolved path without the leading dot
|
|
140
|
-
*/
|
|
141
|
-
resolvePath: (path: string, params?: Record<string, string>) => Promise<string>;
|
|
142
131
|
};
|
package/dist/client.js
CHANGED
|
@@ -693,20 +693,5 @@ export const Interface = {
|
|
|
693
693
|
// Match exact or subpath otherwise
|
|
694
694
|
const target = `${cleanBase}/${slug}`;
|
|
695
695
|
return page.url.pathname === target || page.url.pathname.startsWith(`${target}/`);
|
|
696
|
-
},
|
|
697
|
-
/**
|
|
698
|
-
* Resolves a path and returns the result.
|
|
699
|
-
* Wraps around the `resolve` function in SvelteKit's `$app/paths` module.
|
|
700
|
-
*
|
|
701
|
-
* https://svelte.dev/docs/kit/$app-paths#resolve
|
|
702
|
-
*
|
|
703
|
-
* @param path - The path to resolve
|
|
704
|
-
* @param params - The parameters to resolve the path with
|
|
705
|
-
* @returns {string} The resolved path without the leading dot
|
|
706
|
-
*/
|
|
707
|
-
resolvePath: async (path, params = {}) => {
|
|
708
|
-
const { resolve } = await import("$app/paths");
|
|
709
|
-
const resolved = resolve(path, params);
|
|
710
|
-
return resolved.charAt(0) === "." ? resolved.slice(1) : resolved;
|
|
711
696
|
}
|
|
712
697
|
};
|
package/dist/server.js
CHANGED
|
@@ -165,29 +165,6 @@ export const Instance = {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
// If user has completed Player registration
|
|
169
|
-
if (roles.includes("player")) {
|
|
170
|
-
// Prepare person data
|
|
171
|
-
let personData = {};
|
|
172
|
-
if (user.app_metadata.person_data) {
|
|
173
|
-
const { first_name: firstName, last_name: lastName, pseudonym } = user.app_metadata.person_data;
|
|
174
|
-
personData = { firstName, lastName, pseudonym };
|
|
175
|
-
if (user.phone != null)
|
|
176
|
-
personData.phone = user.phone;
|
|
177
|
-
}
|
|
178
|
-
// Validate SuprSend subscriber
|
|
179
|
-
const { code, error: validationError } = await Instance.callEdgeFunction(false, supabase, `suprsend/validate-subscriber?user-id=${user.id}`, {
|
|
180
|
-
method: "POST",
|
|
181
|
-
headers: { "Content-Type": "application/json" },
|
|
182
|
-
body: personData
|
|
183
|
-
});
|
|
184
|
-
if (validationError)
|
|
185
|
-
return { error: Exception.customError(code, validationError) };
|
|
186
|
-
// Send welcome notification if not already sent
|
|
187
|
-
const { error: welcomeError } = await Instance.sendWelcomeNotification(supabase, user, microserviceGroup);
|
|
188
|
-
if (welcomeError)
|
|
189
|
-
return { error: welcomeError };
|
|
190
|
-
}
|
|
191
168
|
// Return result
|
|
192
169
|
return { isAuthorised };
|
|
193
170
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@koloseum/utils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"author": "Koloseum Technologies Limited",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Utility logic for use across Koloseum web apps (TypeScript)",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"validator": "^13.15.15"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@koloseum/types": "^0.3.
|
|
65
|
+
"@koloseum/types": "^0.3.9",
|
|
66
66
|
"@playwright/test": "^1.55.0",
|
|
67
67
|
"@suprsend/web-components": "^0.4.0",
|
|
68
68
|
"@types/sanitize-html": "^2.16.0",
|