orizu 0.1.5 → 0.2.0
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/README.md +5 -0
- package/dist/credentials.js +55 -6
- package/dist/http.js +41 -4
- package/dist/index.js +253 -136
- package/package.json +1 -1
- package/src/credentials.ts +82 -11
- package/src/http.ts +54 -5
- package/src/index.ts +305 -147
- package/src/types.ts +19 -4
package/src/types.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface SessionServerCredentials {
|
|
2
|
+
credentialType?: 'session'
|
|
2
3
|
accessToken: string
|
|
3
4
|
refreshToken: string
|
|
4
5
|
expiresAt: number
|
|
5
6
|
}
|
|
6
7
|
|
|
8
|
+
export interface PatServerCredentials {
|
|
9
|
+
credentialType: 'pat'
|
|
10
|
+
apiKey: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type ServerCredentials = SessionServerCredentials | PatServerCredentials
|
|
14
|
+
|
|
7
15
|
export interface StoredCredentialsV1 {
|
|
8
16
|
baseUrl: string
|
|
9
17
|
accessToken: string
|
|
@@ -14,6 +22,12 @@ export interface StoredCredentialsV1 {
|
|
|
14
22
|
export interface StoredCredentialsV2 {
|
|
15
23
|
version: 2
|
|
16
24
|
activeBaseUrl: string | null
|
|
25
|
+
servers: Record<string, SessionServerCredentials>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface StoredCredentialsV3 {
|
|
29
|
+
version: 3
|
|
30
|
+
activeBaseUrl: string | null
|
|
17
31
|
servers: Record<string, ServerCredentials>
|
|
18
32
|
}
|
|
19
33
|
|
|
@@ -21,9 +35,10 @@ export interface StoredCredentialsV2 {
|
|
|
21
35
|
export type StoredCredentials = StoredCredentialsV1
|
|
22
36
|
|
|
23
37
|
export interface LoginResponse {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
38
|
+
apiKey?: string
|
|
39
|
+
accessToken?: string
|
|
40
|
+
refreshToken?: string
|
|
41
|
+
expiresAt?: number
|
|
27
42
|
user: {
|
|
28
43
|
id: string
|
|
29
44
|
email: string | null
|