@pontive/pontkit-core 1.1.2 → 1.1.3
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/catalog.json +1 -1
- package/custom-elements.json +1 -1
- package/dist/index.js +72 -72
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +286 -311
- package/dist/index.mjs.map +1 -1
- package/dist/service/http/fetch.d.ts +9 -0
- package/dist/service/http/user/index.d.ts +7 -2
- package/dist/types/core/index.d.ts +12 -1
- package/package.json +1 -1
|
@@ -6,4 +6,13 @@ export declare class ApiError extends Error {
|
|
|
6
6
|
export interface RequestOptions extends RequestInit {
|
|
7
7
|
token?: string;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Calls the management API on `apiBaseUrl` with the signed-in user's access
|
|
11
|
+
* token.
|
|
12
|
+
*
|
|
13
|
+
* No project header is sent. The token's issuer is the project's own auth
|
|
14
|
+
* domain, and that is what the gateway resolves the project from — a header
|
|
15
|
+
* naming any other project would be refused. What the browser sends is exactly
|
|
16
|
+
* the bearer, so the request needs no cookies and no credentialed CORS.
|
|
17
|
+
*/
|
|
9
18
|
export declare function apiFetch<T>(endpoint: string, options?: RequestOptions): Promise<T>;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { UpdateUserRequest, User } from '../../../types';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* The signed-in user's own profile. `/me` is the one management route a
|
|
4
|
+
* project user's token may reach: the subject is the caller, so there is no
|
|
5
|
+
* identifier to pass and nothing to authorize beyond "you are you".
|
|
6
|
+
*/
|
|
7
|
+
export declare function getUser(): Promise<User>;
|
|
8
|
+
export declare function updateUser(data: UpdateUserRequest): Promise<User>;
|
|
@@ -25,6 +25,17 @@ export interface EnvConfig {
|
|
|
25
25
|
* browser's `Accept-Language` and then the project's default locale.
|
|
26
26
|
*/
|
|
27
27
|
locales?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The management gateway, e.g. `"https://api.us.pontive.com"`. Called directly
|
|
30
|
+
* from the browser with the signed-in user's bearer token; the SDK adds the
|
|
31
|
+
* `/mgmt/v1` prefix itself.
|
|
32
|
+
*/
|
|
28
33
|
apiBaseUrl: string;
|
|
29
|
-
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Not read by the SDK. The project is carried by the access
|
|
36
|
+
* token's issuer, so nothing here needs to name it. Kept optional so
|
|
37
|
+
* consumers built against earlier typings still compile; remove when the
|
|
38
|
+
* framework packages are rebuilt from this core.
|
|
39
|
+
*/
|
|
40
|
+
projectId?: string;
|
|
30
41
|
}
|