@omerlo/omerlo-webkit 0.0.45 → 0.0.47
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/omerlo/reader/endpoints/events.d.ts +3 -3
- package/dist/omerlo/reader/endpoints/events.js +2 -3
- package/dist/omerlo/reader/endpoints/organizations.d.ts +1 -1
- package/dist/omerlo/reader/endpoints/person.d.ts +1 -1
- package/dist/omerlo/reader/endpoints/profiles.d.ts +4 -4
- package/dist/omerlo/reader/endpoints/projects.d.ts +1 -1
- package/dist/omerlo/reader/fetchers.d.ts +2 -2
- package/dist/omerlo/reader/fetchers.js +1 -1
- package/dist/omerlo/reader/index.d.ts +1 -1
- package/dist/omerlo/reader/index.js +1 -1
- package/dist/omerlo/reader/server/hooks.js +2 -0
- package/dist/omerlo/reader/server/utils.d.ts +1 -1
- package/dist/omerlo/reader/server/utils.js +13 -3
- package/dist/omerlo/reader/utils/request.js +1 -0
- package/package.json +1 -1
- /package/dist/omerlo/reader/endpoints/{profileType.d.ts → profile-types.d.ts} +0 -0
- /package/dist/omerlo/reader/endpoints/{profileType.js → profile-types.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Category } from './categories';
|
|
2
2
|
import { type ApiAssocs, type ApiData, type ApiParams } from '../utils/api';
|
|
3
3
|
import type { LocalesMetadata } from '../utils/response';
|
|
4
|
-
import type { ProfileType } from './
|
|
4
|
+
import type { ProfileType } from './profile-types';
|
|
5
5
|
import type { ListProfilesParams, ProfileAddress, ProfileContact, ProfileDescription } from './profiles';
|
|
6
6
|
export declare const eventFetchers: (f: typeof fetch) => {
|
|
7
7
|
listEvents: (params?: Partial<ListEventsParams>) => Promise<import("../utils/api").ApiResponse<EventSummary[]>>;
|
|
@@ -35,8 +35,8 @@ export interface EventSummary {
|
|
|
35
35
|
name: string | null;
|
|
36
36
|
summaryHtml: string | null;
|
|
37
37
|
summaryText: string | null;
|
|
38
|
-
startsAt: Date
|
|
39
|
-
endsAt: Date
|
|
38
|
+
startsAt: Date;
|
|
39
|
+
endsAt: Date;
|
|
40
40
|
updatedAt: Date;
|
|
41
41
|
}
|
|
42
42
|
export interface Event extends EventSummary {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { parseMany } from '../utils/api';
|
|
2
2
|
import { getAssoc, getAssocs } from '../utils/assocs';
|
|
3
|
-
import { parseDate } from '../utils/parseHelpers';
|
|
4
3
|
import { parseProfileAddress, parseProfileBlock, parseProfileContact, parseProfileDescription } from './profiles';
|
|
5
4
|
import { buildMeta } from '../utils/parseHelpers';
|
|
6
5
|
import { requestPublisher } from '../utils/request';
|
|
@@ -51,8 +50,8 @@ export function parseEventSummary(data, assocs) {
|
|
|
51
50
|
summaryHtml,
|
|
52
51
|
summaryText,
|
|
53
52
|
meta: buildMeta(data.localized?.locale),
|
|
54
|
-
startsAt:
|
|
55
|
-
endsAt:
|
|
53
|
+
startsAt: new Date(data.starts_at),
|
|
54
|
+
endsAt: new Date(data.ends_at),
|
|
56
55
|
updatedAt: new Date(data.updated_at)
|
|
57
56
|
};
|
|
58
57
|
}
|
|
@@ -5,7 +5,7 @@ import type { Category } from './categories';
|
|
|
5
5
|
import { type ListProfilesParams, type ProfileAddress } from './profiles';
|
|
6
6
|
import { type ProfileContact } from './profiles';
|
|
7
7
|
import { type ProfileDescription } from './profiles';
|
|
8
|
-
import type { ProfileType } from './
|
|
8
|
+
import type { ProfileType } from './profile-types';
|
|
9
9
|
export declare const organizationFetchers: (f: typeof fetch) => {
|
|
10
10
|
listOrganizations: (params?: Partial<ListProfilesParams>) => Promise<import("../utils/api").ApiResponse<OrganizationSummary[]>>;
|
|
11
11
|
getOrganization: (id: string, params?: Partial<ApiParams>) => Promise<import("../utils/api").ApiResponse<Organization>>;
|
|
@@ -4,7 +4,7 @@ import { type LocalesMetadata } from '../utils/response';
|
|
|
4
4
|
import { type ListProfilesParams, type ProfileAddress } from './profiles';
|
|
5
5
|
import { type ProfileContact } from './profiles';
|
|
6
6
|
import { type ProfileDescription } from './profiles';
|
|
7
|
-
import type { ProfileType } from './
|
|
7
|
+
import type { ProfileType } from './profile-types';
|
|
8
8
|
export declare const personFetchers: (f: typeof fetch) => {
|
|
9
9
|
listPeople: (params?: Partial<ListProfilesParams>) => Promise<import("../utils/api").ApiResponse<PersonSummary[]>>;
|
|
10
10
|
getPerson: (id: string, params?: Partial<ApiParams>) => Promise<import("../utils/api").ApiResponse<Person>>;
|
|
@@ -40,8 +40,8 @@ export interface ProfileDescription {
|
|
|
40
40
|
}
|
|
41
41
|
export type ProfileDescriptionBlock = {
|
|
42
42
|
kind: string;
|
|
43
|
-
contentHtml: string;
|
|
44
|
-
contentText: string;
|
|
43
|
+
contentHtml: string | null;
|
|
44
|
+
contentText: string | null;
|
|
45
45
|
image: Image | null;
|
|
46
46
|
slideshow: Slideshow | null;
|
|
47
47
|
video: Video | null;
|
|
@@ -80,7 +80,7 @@ export declare function parseProfileContact(data: ApiData, _assocs: ApiAssocs):
|
|
|
80
80
|
export declare function parseProfileDescriptionBlock(data: ApiData, assocs: ApiAssocs): ProfileDescriptionBlock;
|
|
81
81
|
export declare function parseProfileDescription(data: ApiData, assocs: ApiAssocs): ProfileDescription;
|
|
82
82
|
export interface ListProfilesParams extends PagingParams {
|
|
83
|
-
profile_type_ids?: string | null;
|
|
84
|
-
category_ids?: string | null;
|
|
83
|
+
profile_type_ids?: string[] | null;
|
|
84
|
+
category_ids?: string[] | null;
|
|
85
85
|
}
|
|
86
86
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { LocalesMetadata } from '../utils/response';
|
|
|
2
2
|
import type { Category } from './categories';
|
|
3
3
|
import { type ProfileAddress, type ProfileContact, type ProfileDescription, type ListProfilesParams } from './profiles';
|
|
4
4
|
import { type ApiData, type ApiAssocs, type ApiParams } from '../utils/api';
|
|
5
|
-
import type { ProfileType } from './
|
|
5
|
+
import type { ProfileType } from './profile-types';
|
|
6
6
|
export declare const projectFetchers: (f: typeof fetch) => {
|
|
7
7
|
listProjects: (params?: Partial<ListProfilesParams>) => Promise<import("../utils/api").ApiResponse<ProjectSummary[]>>;
|
|
8
8
|
getProject: (id: string, params?: Partial<ApiParams>) => Promise<import("../utils/api").ApiResponse<Project>>;
|
|
@@ -24,8 +24,8 @@ export declare const fetchers: (f: typeof fetch) => {
|
|
|
24
24
|
listOrganizations: (params?: Partial<import(".").ListProfilesParams>) => Promise<import("./utils/api").ApiResponse<import("./endpoints/organizations").OrganizationSummary[]>>;
|
|
25
25
|
getOrganization: (id: string, params?: Partial<import("./utils/api").ApiParams>) => Promise<import("./utils/api").ApiResponse<import("./endpoints/organizations").Organization>>;
|
|
26
26
|
allOrganizationBlocks: (id: string, params?: Partial<import("./utils/api").ApiParams>) => Promise<import("./utils/api").ApiResponse<import(".").ProfileBlockKind[]>>;
|
|
27
|
-
listProfileTypes: (params?: Partial<import("./utils/api").PagingParams>) => Promise<import("./utils/api").ApiResponse<import("./endpoints/
|
|
28
|
-
getProfileType: (id: string, params?: Partial<import("./utils/api").ApiParams>) => Promise<import("./utils/api").ApiResponse<import("./endpoints/
|
|
27
|
+
listProfileTypes: (params?: Partial<import("./utils/api").PagingParams>) => Promise<import("./utils/api").ApiResponse<import("./endpoints/profile-types").ProfileTypeSummary[]>>;
|
|
28
|
+
getProfileType: (id: string, params?: Partial<import("./utils/api").ApiParams>) => Promise<import("./utils/api").ApiResponse<import("./endpoints/profile-types").ProfileType>>;
|
|
29
29
|
listWebpages: (params?: Partial<import("./utils/api").PagingParams>) => Promise<import("./utils/api").ApiResponse<import("./endpoints/webpage").WebpageSummary[]>>;
|
|
30
30
|
getWebpage: (slug: string, params?: Partial<import("./utils/api").ApiParams>) => Promise<import("./utils/api").ApiResponse<import("./endpoints/webpage").OrgWebpage>>;
|
|
31
31
|
getMenu: (key: string, params?: Partial<import("./utils/api").ApiParams>) => Promise<import("./utils/api").ApiResponse<import("./endpoints/menu").Menu>>;
|
|
@@ -14,7 +14,7 @@ import { eventFetchers } from './endpoints/events';
|
|
|
14
14
|
import { personFetchers } from './endpoints/person';
|
|
15
15
|
import { projectFetchers } from './endpoints/projects';
|
|
16
16
|
import { webpageFetchers } from './endpoints/webpage';
|
|
17
|
-
import { profileTypeFetchers } from './endpoints/
|
|
17
|
+
import { profileTypeFetchers } from './endpoints/profile-types';
|
|
18
18
|
export const fetchers = (f) => {
|
|
19
19
|
return {
|
|
20
20
|
...accountsFetchers(f),
|
|
@@ -13,7 +13,7 @@ export type * from './endpoints/notification';
|
|
|
13
13
|
export type * from './endpoints/oauth';
|
|
14
14
|
export type * from './endpoints/organizations';
|
|
15
15
|
export type * from './endpoints/person';
|
|
16
|
-
export type * from './endpoints/
|
|
16
|
+
export type * from './endpoints/profile-types';
|
|
17
17
|
export type * from './endpoints/profiles';
|
|
18
18
|
export type * from './endpoints/projects';
|
|
19
19
|
export type * from './endpoints/visuals';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseCategory } from './endpoints/categories';
|
|
2
2
|
import { parseProfileBlockTypeSummary, parseProfileSummary } from './endpoints/profiles';
|
|
3
3
|
import { parseContentBlockTemplate, parseContentTemplate } from './endpoints/content-templates';
|
|
4
|
-
import { parseProfileTypeSummary } from './endpoints/
|
|
4
|
+
import { parseProfileTypeSummary } from './endpoints/profile-types';
|
|
5
5
|
import { registerAssocParser } from './utils/assocs';
|
|
6
6
|
import { parseContentSummary } from './endpoints/contents';
|
|
7
7
|
import { parseIssueBlockConfiguration, parseIssueSummary, parseIssueType } from './endpoints/magazines';
|
|
@@ -24,6 +24,7 @@ const handleApiProxy = async ({ event, ...tail }) => {
|
|
|
24
24
|
.then(async (resp) => {
|
|
25
25
|
const headers = new Headers();
|
|
26
26
|
if (resp.status === 401 && event.locals.accessToken) {
|
|
27
|
+
console.log('handleApiProxy:41');
|
|
27
28
|
clearAuthorizationUsingHeader(headers);
|
|
28
29
|
event.locals.accessToken = undefined;
|
|
29
30
|
resp = await handleApiProxy({ event, ...tail });
|
|
@@ -90,6 +91,7 @@ export const handleUserToken = async ({ event, resolve }) => {
|
|
|
90
91
|
}
|
|
91
92
|
catch (err) {
|
|
92
93
|
if (err instanceof ApiError && err.status == 401) {
|
|
94
|
+
console.log('handleUserToken l:124');
|
|
93
95
|
event.setHeaders({ 'x-logout': 'true' });
|
|
94
96
|
clearAuthorizationCookies(event.cookies);
|
|
95
97
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UserSession } from '../stores/user_session';
|
|
2
1
|
import type { Cookies } from '@sveltejs/kit';
|
|
2
|
+
import type { UserSession } from '../stores/user_session';
|
|
3
3
|
import { type OmerloToken } from './token';
|
|
4
4
|
export declare function loadUserSession(f: typeof fetch, cookies: Cookies): Promise<UserSession>;
|
|
5
5
|
export declare function isAuthenticated(cookies: Cookies): boolean;
|
|
@@ -22,14 +22,24 @@ const accessTokenCookieName = 'access_token';
|
|
|
22
22
|
const refreshTokenCookieName = 'refresh_token';
|
|
23
23
|
const THREE_MONTH = 90 * 24 * 60 * 60;
|
|
24
24
|
export function setAuthorizationCookies(cookies, token) {
|
|
25
|
-
cookies.set('logged_in', 'true', {
|
|
25
|
+
cookies.set('logged_in', 'true', {
|
|
26
|
+
path: '/',
|
|
27
|
+
httpOnly: false,
|
|
28
|
+
sameSite: 'none',
|
|
29
|
+
secure: true,
|
|
30
|
+
maxAge: THREE_MONTH
|
|
31
|
+
});
|
|
26
32
|
cookies.set(accessTokenCookieName, token.accessToken, {
|
|
27
|
-
httpOnly:
|
|
33
|
+
httpOnly: false,
|
|
34
|
+
sameSite: 'none',
|
|
35
|
+
secure: true,
|
|
28
36
|
path: '/',
|
|
29
37
|
maxAge: token.expiresIn - 60
|
|
30
38
|
});
|
|
31
39
|
cookies.set(refreshTokenCookieName, token.refreshToken, {
|
|
32
|
-
httpOnly:
|
|
40
|
+
httpOnly: false,
|
|
41
|
+
sameSite: 'none',
|
|
42
|
+
secure: true,
|
|
33
43
|
path: '/',
|
|
34
44
|
maxAge: THREE_MONTH
|
|
35
45
|
});
|
|
@@ -34,6 +34,7 @@ export async function dirtyRequest(f, path, opts) {
|
|
|
34
34
|
}
|
|
35
35
|
const resp = await f(path.toString(), opts);
|
|
36
36
|
if (BROWSER && resp.headers.get('x-logout') == 'true') {
|
|
37
|
+
console.log('dirtyrequest:69');
|
|
37
38
|
const webkitComponent = document.getElementById('omerlo-webkit');
|
|
38
39
|
if (webkitComponent) {
|
|
39
40
|
webkitComponent.dispatchEvent(new Event('logout'));
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|