@classic-homes/api 1.0.0 → 1.0.1
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/auth.d.ts +10 -10
- package/dist/auth.js +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/auth.ts +1 -1
- package/src/client.ts +1 -1
- package/src/index.ts +5 -5
package/dist/auth.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* token fresh and follows refresh-token ROTATION (every refresh returns a new refresh token
|
|
8
8
|
* that must replace the old one).
|
|
9
9
|
*/
|
|
10
|
-
import { type ChapiClient } from './client';
|
|
10
|
+
import { type ChapiClient } from './client.js';
|
|
11
11
|
/** Shape of a CHAPI error body: `{ error: { code, message } }`. */
|
|
12
12
|
export interface ChapiApiError {
|
|
13
13
|
error?: {
|
|
@@ -43,7 +43,7 @@ export declare function login(client: ChapiClient, body: {
|
|
|
43
43
|
};
|
|
44
44
|
requestBody: {
|
|
45
45
|
content: {
|
|
46
|
-
"application/json": import("./types").components["schemas"]["LoginRequest"];
|
|
46
|
+
"application/json": import("./types.js").components["schemas"]["LoginRequest"];
|
|
47
47
|
};
|
|
48
48
|
};
|
|
49
49
|
responses: {
|
|
@@ -52,7 +52,7 @@ export declare function login(client: ChapiClient, body: {
|
|
|
52
52
|
[name: string]: unknown;
|
|
53
53
|
};
|
|
54
54
|
content: {
|
|
55
|
-
"application/json": import("./types").components["schemas"]["LoginResponse"];
|
|
55
|
+
"application/json": import("./types.js").components["schemas"]["LoginResponse"];
|
|
56
56
|
};
|
|
57
57
|
};
|
|
58
58
|
400: {
|
|
@@ -60,7 +60,7 @@ export declare function login(client: ChapiClient, body: {
|
|
|
60
60
|
[name: string]: unknown;
|
|
61
61
|
};
|
|
62
62
|
content: {
|
|
63
|
-
"application/json": import("./types").components["schemas"]["Error"];
|
|
63
|
+
"application/json": import("./types.js").components["schemas"]["Error"];
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
66
|
401: {
|
|
@@ -68,7 +68,7 @@ export declare function login(client: ChapiClient, body: {
|
|
|
68
68
|
[name: string]: unknown;
|
|
69
69
|
};
|
|
70
70
|
content: {
|
|
71
|
-
"application/json": import("./types").components["schemas"]["Error"];
|
|
71
|
+
"application/json": import("./types.js").components["schemas"]["Error"];
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
74
|
423: {
|
|
@@ -76,7 +76,7 @@ export declare function login(client: ChapiClient, body: {
|
|
|
76
76
|
[name: string]: unknown;
|
|
77
77
|
};
|
|
78
78
|
content: {
|
|
79
|
-
"application/json": import("./types").components["schemas"]["Error"];
|
|
79
|
+
"application/json": import("./types.js").components["schemas"]["Error"];
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
82
|
429: {
|
|
@@ -84,7 +84,7 @@ export declare function login(client: ChapiClient, body: {
|
|
|
84
84
|
[name: string]: unknown;
|
|
85
85
|
};
|
|
86
86
|
content: {
|
|
87
|
-
"application/json": import("./types").components["schemas"]["Error"];
|
|
87
|
+
"application/json": import("./types.js").components["schemas"]["Error"];
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
};
|
|
@@ -125,7 +125,7 @@ export declare function refresh(client: ChapiClient, refreshToken: string): Prom
|
|
|
125
125
|
[name: string]: unknown;
|
|
126
126
|
};
|
|
127
127
|
content: {
|
|
128
|
-
"application/json": import("./types").components["schemas"]["Error"];
|
|
128
|
+
"application/json": import("./types.js").components["schemas"]["Error"];
|
|
129
129
|
};
|
|
130
130
|
};
|
|
131
131
|
};
|
|
@@ -147,7 +147,7 @@ export declare function logout(client: ChapiClient): Promise<import("openapi-fet
|
|
|
147
147
|
[name: string]: unknown;
|
|
148
148
|
};
|
|
149
149
|
content: {
|
|
150
|
-
"application/json": import("./types").components["schemas"]["MessageResponse"];
|
|
150
|
+
"application/json": import("./types.js").components["schemas"]["MessageResponse"];
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
401: {
|
|
@@ -155,7 +155,7 @@ export declare function logout(client: ChapiClient): Promise<import("openapi-fet
|
|
|
155
155
|
[name: string]: unknown;
|
|
156
156
|
};
|
|
157
157
|
content: {
|
|
158
|
-
"application/json": import("./types").components["schemas"]["Error"];
|
|
158
|
+
"application/json": import("./types.js").components["schemas"]["Error"];
|
|
159
159
|
};
|
|
160
160
|
};
|
|
161
161
|
};
|
package/dist/auth.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* token fresh and follows refresh-token ROTATION (every refresh returns a new refresh token
|
|
8
8
|
* that must replace the old one).
|
|
9
9
|
*/
|
|
10
|
-
import { createChapiClient } from './client';
|
|
10
|
+
import { createChapiClient } from './client.js';
|
|
11
11
|
function hasCode(err, ...codes) {
|
|
12
12
|
const code = err?.error?.code;
|
|
13
13
|
return typeof code === 'string' && codes.includes(code);
|
package/dist/client.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* into `types.ts`). No hand-maintained call signatures.
|
|
7
7
|
*/
|
|
8
8
|
import { type ClientOptions, type Client } from 'openapi-fetch';
|
|
9
|
-
import type { paths } from './types';
|
|
9
|
+
import type { paths } from './types.js';
|
|
10
10
|
export interface ChapiClientOptions extends ClientOptions {
|
|
11
11
|
/** API origin, e.g. https://api.example.com (no trailing slash needed). */
|
|
12
12
|
baseUrl: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { createChapiClient } from './client';
|
|
2
|
-
export type { ChapiClient, ChapiClientOptions } from './client';
|
|
3
|
-
export type { paths, components, operations } from './types';
|
|
4
|
-
export { login, refresh, logout, createAuthSession, isUnauthorized, isForbidden, isRateLimited, isAccountLocked, } from './auth';
|
|
5
|
-
export type { AuthTokens, AuthSession, AuthSessionOptions, ChapiApiError } from './auth';
|
|
1
|
+
export { createChapiClient } from './client.js';
|
|
2
|
+
export type { ChapiClient, ChapiClientOptions } from './client.js';
|
|
3
|
+
export type { paths, components, operations } from './types.js';
|
|
4
|
+
export { login, refresh, logout, createAuthSession, isUnauthorized, isForbidden, isRateLimited, isAccountLocked, } from './auth.js';
|
|
5
|
+
export type { AuthTokens, AuthSession, AuthSessionOptions, ChapiApiError } from './auth.js';
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createChapiClient } from './client';
|
|
1
|
+
export { createChapiClient } from './client.js';
|
|
2
2
|
// Auth helpers: typed login/refresh/logout, error predicates, auto-refreshing session.
|
|
3
|
-
export { login, refresh, logout, createAuthSession, isUnauthorized, isForbidden, isRateLimited, isAccountLocked, } from './auth';
|
|
3
|
+
export { login, refresh, logout, createAuthSession, isUnauthorized, isForbidden, isRateLimited, isAccountLocked, } from './auth.js';
|
package/package.json
CHANGED
package/src/auth.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* token fresh and follows refresh-token ROTATION (every refresh returns a new refresh token
|
|
8
8
|
* that must replace the old one).
|
|
9
9
|
*/
|
|
10
|
-
import { createChapiClient, type ChapiClient } from './client';
|
|
10
|
+
import { createChapiClient, type ChapiClient } from './client.js';
|
|
11
11
|
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
// Typed error predicates
|
package/src/client.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* into `types.ts`). No hand-maintained call signatures.
|
|
7
7
|
*/
|
|
8
8
|
import createClient, { type ClientOptions, type Client } from 'openapi-fetch';
|
|
9
|
-
import type { paths } from './types';
|
|
9
|
+
import type { paths } from './types.js';
|
|
10
10
|
|
|
11
11
|
export interface ChapiClientOptions extends ClientOptions {
|
|
12
12
|
/** API origin, e.g. https://api.example.com (no trailing slash needed). */
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { createChapiClient } from './client';
|
|
2
|
-
export type { ChapiClient, ChapiClientOptions } from './client';
|
|
3
|
-
export type { paths, components, operations } from './types';
|
|
1
|
+
export { createChapiClient } from './client.js';
|
|
2
|
+
export type { ChapiClient, ChapiClientOptions } from './client.js';
|
|
3
|
+
export type { paths, components, operations } from './types.js';
|
|
4
4
|
|
|
5
5
|
// Auth helpers: typed login/refresh/logout, error predicates, auto-refreshing session.
|
|
6
6
|
export {
|
|
@@ -12,5 +12,5 @@ export {
|
|
|
12
12
|
isForbidden,
|
|
13
13
|
isRateLimited,
|
|
14
14
|
isAccountLocked,
|
|
15
|
-
} from './auth';
|
|
16
|
-
export type { AuthTokens, AuthSession, AuthSessionOptions, ChapiApiError } from './auth';
|
|
15
|
+
} from './auth.js';
|
|
16
|
+
export type { AuthTokens, AuthSession, AuthSessionOptions, ChapiApiError } from './auth.js';
|