deliveryapi 0.2.0 → 0.2.2
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/index.cjs +8 -7
- package/dist/index.d.cts +11 -10
- package/dist/index.d.ts +11 -10
- package/dist/index.js +8 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -296,15 +296,16 @@ var PublicResource = class {
|
|
|
296
296
|
};
|
|
297
297
|
|
|
298
298
|
// src/client.ts
|
|
299
|
+
var BASE_URL = "https://api.deliveryapi.co.kr";
|
|
299
300
|
var noToken = async () => null;
|
|
300
301
|
var HomepageClient = class {
|
|
301
|
-
constructor(options) {
|
|
302
|
-
const {
|
|
303
|
-
this.auth = new AuthResource(
|
|
304
|
-
this.dashboard = new DashboardResource(
|
|
305
|
-
this.qna = new QnaResource(
|
|
306
|
-
this.admin = new AdminResource(
|
|
307
|
-
this.public = new PublicResource(
|
|
302
|
+
constructor(options = {}) {
|
|
303
|
+
const { getToken = noToken } = options;
|
|
304
|
+
this.auth = new AuthResource(BASE_URL, getToken);
|
|
305
|
+
this.dashboard = new DashboardResource(BASE_URL, getToken);
|
|
306
|
+
this.qna = new QnaResource(BASE_URL, getToken);
|
|
307
|
+
this.admin = new AdminResource(BASE_URL, getToken);
|
|
308
|
+
this.public = new PublicResource(BASE_URL);
|
|
308
309
|
}
|
|
309
310
|
};
|
|
310
311
|
|
package/dist/index.d.cts
CHANGED
|
@@ -60,22 +60,23 @@ interface IssueApiKeyResult {
|
|
|
60
60
|
interface Post {
|
|
61
61
|
id: string;
|
|
62
62
|
title: string;
|
|
63
|
-
content
|
|
63
|
+
content?: string;
|
|
64
64
|
authorUid: string;
|
|
65
65
|
authorName: string;
|
|
66
66
|
isSecret: boolean;
|
|
67
67
|
commentCount: number;
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
viewCount: number;
|
|
69
|
+
dateCreated: string | null;
|
|
70
|
+
dateModified?: string | null;
|
|
70
71
|
}
|
|
71
72
|
interface Comment {
|
|
72
73
|
id: string;
|
|
73
|
-
postId
|
|
74
|
+
postId?: string;
|
|
74
75
|
content: string;
|
|
75
76
|
authorUid: string;
|
|
76
77
|
authorName: string;
|
|
77
78
|
isAdmin: boolean;
|
|
78
|
-
dateCreated: string;
|
|
79
|
+
dateCreated: string | null;
|
|
79
80
|
}
|
|
80
81
|
interface ListPostsParams {
|
|
81
82
|
cursor?: string;
|
|
@@ -84,7 +85,7 @@ interface ListPostsParams {
|
|
|
84
85
|
interface ListPostsResult {
|
|
85
86
|
posts: Post[];
|
|
86
87
|
nextCursor: string | null;
|
|
87
|
-
|
|
88
|
+
hasMore: boolean;
|
|
88
89
|
}
|
|
89
90
|
interface CreatePostParams {
|
|
90
91
|
title: string;
|
|
@@ -325,8 +326,6 @@ interface ListTrackingLogsResult {
|
|
|
325
326
|
totalPages: number;
|
|
326
327
|
}
|
|
327
328
|
interface HomepageClientOptions {
|
|
328
|
-
/** API base URL (e.g. 'https://api.deliveryapi.co.kr') */
|
|
329
|
-
baseUrl: string;
|
|
330
329
|
/** Returns Firebase ID Token for authenticated requests */
|
|
331
330
|
getToken?: () => Promise<string | null>;
|
|
332
331
|
}
|
|
@@ -362,7 +361,9 @@ declare class QnaResource {
|
|
|
362
361
|
/** 게시글 상세 조회 */
|
|
363
362
|
getPost(postId: string): Promise<Post>;
|
|
364
363
|
/** 게시글 작성 (로그인 필요) */
|
|
365
|
-
createPost(params: CreatePostParams): Promise<
|
|
364
|
+
createPost(params: CreatePostParams): Promise<{
|
|
365
|
+
id: string;
|
|
366
|
+
}>;
|
|
366
367
|
/** 게시글 수정 (작성자/관리자만) */
|
|
367
368
|
updatePost(postId: string, params: UpdatePostParams): Promise<Post>;
|
|
368
369
|
/** 게시글 삭제 (작성자/관리자만) */
|
|
@@ -429,7 +430,7 @@ declare class HomepageClient {
|
|
|
429
430
|
readonly qna: QnaResource;
|
|
430
431
|
readonly admin: AdminResource;
|
|
431
432
|
readonly public: PublicResource;
|
|
432
|
-
constructor(options
|
|
433
|
+
constructor(options?: HomepageClientOptions);
|
|
433
434
|
}
|
|
434
435
|
|
|
435
436
|
declare class ApiError extends Error {
|
package/dist/index.d.ts
CHANGED
|
@@ -60,22 +60,23 @@ interface IssueApiKeyResult {
|
|
|
60
60
|
interface Post {
|
|
61
61
|
id: string;
|
|
62
62
|
title: string;
|
|
63
|
-
content
|
|
63
|
+
content?: string;
|
|
64
64
|
authorUid: string;
|
|
65
65
|
authorName: string;
|
|
66
66
|
isSecret: boolean;
|
|
67
67
|
commentCount: number;
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
viewCount: number;
|
|
69
|
+
dateCreated: string | null;
|
|
70
|
+
dateModified?: string | null;
|
|
70
71
|
}
|
|
71
72
|
interface Comment {
|
|
72
73
|
id: string;
|
|
73
|
-
postId
|
|
74
|
+
postId?: string;
|
|
74
75
|
content: string;
|
|
75
76
|
authorUid: string;
|
|
76
77
|
authorName: string;
|
|
77
78
|
isAdmin: boolean;
|
|
78
|
-
dateCreated: string;
|
|
79
|
+
dateCreated: string | null;
|
|
79
80
|
}
|
|
80
81
|
interface ListPostsParams {
|
|
81
82
|
cursor?: string;
|
|
@@ -84,7 +85,7 @@ interface ListPostsParams {
|
|
|
84
85
|
interface ListPostsResult {
|
|
85
86
|
posts: Post[];
|
|
86
87
|
nextCursor: string | null;
|
|
87
|
-
|
|
88
|
+
hasMore: boolean;
|
|
88
89
|
}
|
|
89
90
|
interface CreatePostParams {
|
|
90
91
|
title: string;
|
|
@@ -325,8 +326,6 @@ interface ListTrackingLogsResult {
|
|
|
325
326
|
totalPages: number;
|
|
326
327
|
}
|
|
327
328
|
interface HomepageClientOptions {
|
|
328
|
-
/** API base URL (e.g. 'https://api.deliveryapi.co.kr') */
|
|
329
|
-
baseUrl: string;
|
|
330
329
|
/** Returns Firebase ID Token for authenticated requests */
|
|
331
330
|
getToken?: () => Promise<string | null>;
|
|
332
331
|
}
|
|
@@ -362,7 +361,9 @@ declare class QnaResource {
|
|
|
362
361
|
/** 게시글 상세 조회 */
|
|
363
362
|
getPost(postId: string): Promise<Post>;
|
|
364
363
|
/** 게시글 작성 (로그인 필요) */
|
|
365
|
-
createPost(params: CreatePostParams): Promise<
|
|
364
|
+
createPost(params: CreatePostParams): Promise<{
|
|
365
|
+
id: string;
|
|
366
|
+
}>;
|
|
366
367
|
/** 게시글 수정 (작성자/관리자만) */
|
|
367
368
|
updatePost(postId: string, params: UpdatePostParams): Promise<Post>;
|
|
368
369
|
/** 게시글 삭제 (작성자/관리자만) */
|
|
@@ -429,7 +430,7 @@ declare class HomepageClient {
|
|
|
429
430
|
readonly qna: QnaResource;
|
|
430
431
|
readonly admin: AdminResource;
|
|
431
432
|
readonly public: PublicResource;
|
|
432
|
-
constructor(options
|
|
433
|
+
constructor(options?: HomepageClientOptions);
|
|
433
434
|
}
|
|
434
435
|
|
|
435
436
|
declare class ApiError extends Error {
|
package/dist/index.js
CHANGED
|
@@ -294,15 +294,16 @@ var PublicResource = class {
|
|
|
294
294
|
};
|
|
295
295
|
|
|
296
296
|
// src/client.ts
|
|
297
|
+
var BASE_URL = "https://api.deliveryapi.co.kr";
|
|
297
298
|
var noToken = async () => null;
|
|
298
299
|
var HomepageClient = class {
|
|
299
|
-
constructor(options) {
|
|
300
|
-
const {
|
|
301
|
-
this.auth = new AuthResource(
|
|
302
|
-
this.dashboard = new DashboardResource(
|
|
303
|
-
this.qna = new QnaResource(
|
|
304
|
-
this.admin = new AdminResource(
|
|
305
|
-
this.public = new PublicResource(
|
|
300
|
+
constructor(options = {}) {
|
|
301
|
+
const { getToken = noToken } = options;
|
|
302
|
+
this.auth = new AuthResource(BASE_URL, getToken);
|
|
303
|
+
this.dashboard = new DashboardResource(BASE_URL, getToken);
|
|
304
|
+
this.qna = new QnaResource(BASE_URL, getToken);
|
|
305
|
+
this.admin = new AdminResource(BASE_URL, getToken);
|
|
306
|
+
this.public = new PublicResource(BASE_URL);
|
|
306
307
|
}
|
|
307
308
|
};
|
|
308
309
|
|