pryv 2.4.2 → 2.4.4
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/package.json +1 -1
- package/src/index.d.ts +14 -21
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare module 'pryv' {
|
|
2
2
|
type Timestamp = number;
|
|
3
3
|
type Identifier = string;
|
|
4
|
-
export type
|
|
4
|
+
export type PermissionLevel = 'read' | 'contribute' | 'manage' | 'create-only';
|
|
5
5
|
export type KeyValue = { [key: string]: string | number };
|
|
6
6
|
|
|
7
7
|
export type Attachment = {
|
|
@@ -46,7 +46,7 @@ declare module 'pryv' {
|
|
|
46
46
|
|
|
47
47
|
export type Permission = {
|
|
48
48
|
streamId: Identifier;
|
|
49
|
-
level:
|
|
49
|
+
level: PermissionLevel;
|
|
50
50
|
feature?: 'selfRevoke';
|
|
51
51
|
setting?: 'forbidden';
|
|
52
52
|
};
|
|
@@ -560,7 +560,7 @@ declare module 'pryv' {
|
|
|
560
560
|
|
|
561
561
|
export type APICallProgressHandler = (percentage: number) => void;
|
|
562
562
|
|
|
563
|
-
export
|
|
563
|
+
export type AccessInfo = Access & {
|
|
564
564
|
calls: KeyValue;
|
|
565
565
|
user: KeyValue;
|
|
566
566
|
}
|
|
@@ -570,7 +570,7 @@ declare module 'pryv' {
|
|
|
570
570
|
} & PossibleError;
|
|
571
571
|
|
|
572
572
|
export class Connection {
|
|
573
|
-
constructor (apiEndpoint: string, service?: Service)
|
|
573
|
+
constructor (apiEndpoint: string, service?: Service);
|
|
574
574
|
get service(): Service;
|
|
575
575
|
username(): Promise<string>;
|
|
576
576
|
api<Calls extends APICall[] = APICall[]>(
|
|
@@ -671,7 +671,7 @@ declare module 'pryv' {
|
|
|
671
671
|
export type AuthRequestedPermission = {
|
|
672
672
|
streamId: Identifier;
|
|
673
673
|
defaultName: string;
|
|
674
|
-
level:
|
|
674
|
+
level: PermissionLevel;
|
|
675
675
|
};
|
|
676
676
|
|
|
677
677
|
export type States =
|
|
@@ -697,7 +697,7 @@ declare module 'pryv' {
|
|
|
697
697
|
poll_rate_ms: number;
|
|
698
698
|
requestedPermissions: Array<{
|
|
699
699
|
streamId: string;
|
|
700
|
-
level:
|
|
700
|
+
level: PermissionLevel;
|
|
701
701
|
defaultName: string;
|
|
702
702
|
}>;
|
|
703
703
|
requestingAppId: string;
|
|
@@ -783,23 +783,21 @@ declare module 'pryv' {
|
|
|
783
783
|
get state(): AuthStatePayload;
|
|
784
784
|
}
|
|
785
785
|
|
|
786
|
-
export
|
|
786
|
+
export const Auth: {
|
|
787
787
|
setupAuth: SetupAuth;
|
|
788
788
|
AuthStates: AuthStates;
|
|
789
789
|
AuthController: AuthController;
|
|
790
790
|
}
|
|
791
791
|
|
|
792
|
-
export type CookieUtils = {
|
|
793
|
-
set(cookieKey: string, value: any, expireInDays: number): void;
|
|
794
|
-
get(cookieKey: string): any;
|
|
795
|
-
del(cookieKey: string): void;
|
|
796
|
-
}
|
|
797
|
-
|
|
798
792
|
export type getServiceInfoFromURL = (url: string) => string;
|
|
799
793
|
|
|
800
|
-
export
|
|
794
|
+
export const Browser: {
|
|
801
795
|
LoginButton: CustomLoginButton;
|
|
802
|
-
CookieUtils:
|
|
796
|
+
CookieUtils: {
|
|
797
|
+
set(cookieKey: string, value: any, expireInDays: number): void;
|
|
798
|
+
get(cookieKey: string): any;
|
|
799
|
+
del(cookieKey: string): void;
|
|
800
|
+
};
|
|
803
801
|
AuthStates: AuthStates;
|
|
804
802
|
setupAuth: SetupAuth;
|
|
805
803
|
serviceInfoFromUrl: getServiceInfoFromURL;
|
|
@@ -810,7 +808,7 @@ declare module 'pryv' {
|
|
|
810
808
|
token: string;
|
|
811
809
|
};
|
|
812
810
|
|
|
813
|
-
export
|
|
811
|
+
export const utils: {
|
|
814
812
|
isBrowser(): boolean;
|
|
815
813
|
extractTokenAndAPIEndpoint(apiEndpoint: string): TokenAndAPIEndpoint;
|
|
816
814
|
buildAPIEndpoint(tokenAndAPI: TokenAndAPIEndpoint): string;
|
|
@@ -822,11 +820,6 @@ declare module 'pryv' {
|
|
|
822
820
|
type version = string;
|
|
823
821
|
|
|
824
822
|
let pryv: {
|
|
825
|
-
Service: Service;
|
|
826
|
-
Connection: Connection;
|
|
827
|
-
Auth: Auth;
|
|
828
|
-
Browser: Browser;
|
|
829
|
-
utils: utils;
|
|
830
823
|
version: version;
|
|
831
824
|
};
|
|
832
825
|
|