@reopt-ai/brandapp-sdk 3.4.0 → 3.6.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/CHANGELOG.md +62 -0
- package/README.md +2 -0
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +1 -1
- package/dist/ai-provider/index.js +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/better-auth/index.d.ts +1 -1
- package/dist/better-auth/index.js +2 -2
- package/dist/client-A4YrHjDc.d.ts +272 -0
- package/dist/{client-D-yNxNfk.js → client-B84P9y2F.js} +2 -2
- package/dist/{client-DPmoKuR9.js → client-BFM7OGqI.js} +4 -4
- package/dist/{client-D3RHHUUW.d.ts → client-BGLDrf3N.d.ts} +12 -8
- package/dist/{client-DDw5yz_h.d.ts → client-BTS6Ewv_.d.ts} +2 -2
- package/dist/{client-BGGd_cpV.d.ts → client-CAGo56KO.d.ts} +2 -2
- package/dist/{client-B1q5P8rv.js → client-C_YUxs_X.js} +2 -2
- package/dist/{client-Beivhucf.js → client-CiCPE2MW.js} +3 -3
- package/dist/{client-BruP5_nU.d.ts → client-Ckm-i_Du.d.ts} +2 -2
- package/dist/{client-DBnK7ooQ.js → client-CxyXO_0C.js} +2 -2
- package/dist/{client-EbhUIhHq.js → client-D4Z2xj4t.js} +2 -2
- package/dist/{client-lk6wBu_0.d.ts → client-DHZ484kb.d.ts} +3 -3
- package/dist/{client-D0eBxh8j.d.ts → client-DPbXH8tr.d.ts} +2 -2
- package/dist/{client-DsdakibF.js → client-DVydvzc2.js} +3 -3
- package/dist/{client-D6gs61w8.d.ts → client-DfEeaOsQ.d.ts} +2 -2
- package/dist/{client-B9QHVhdM.js → client-WP3Xsxri.js} +11 -7
- package/dist/client-m29R8F0R.js +273 -0
- package/dist/{client-Dxg8_DIH.d.ts → client-yBQen4Yi.d.ts} +2 -2
- package/dist/cms/index.d.ts +1 -1
- package/dist/cms/index.js +1 -1
- package/dist/{config-Cw0a3-C8.js → config-BV8Fn7Uo.js} +2 -2
- package/dist/{config-CRytOPPl.d.ts → config-C7WQtC3l.d.ts} +3 -1
- package/dist/dev/index.d.ts +1 -1
- package/dist/dev/index.js +351 -6
- package/dist/eav/index.d.ts +2 -2
- package/dist/eav/index.js +2 -2
- package/dist/eav/migrate.d.ts +2 -2
- package/dist/eav/schema.d.ts +2 -2
- package/dist/feedback/index.d.ts +1 -1
- package/dist/feedback/index.js +1 -1
- package/dist/files/index.d.ts +2 -2
- package/dist/files/index.js +1 -1
- package/dist/{http-client-QKUvvirs.js → http-client-6XUgrg3k.js} +2 -2
- package/dist/{index-Z6OGcurJ.d.ts → index-CvNJ8zp1.d.ts} +11 -11
- package/dist/{index-DrVaKfhs.d.ts → index-DV_OWwx5.d.ts} +16 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +11 -11
- package/dist/logout/index.d.ts +1 -1
- package/dist/logout/index.js +1 -1
- package/dist/plans/index.d.ts +1 -1
- package/dist/plans/index.js +1 -1
- package/dist/push/index.d.ts +1 -1
- package/dist/push/index.js +1 -1
- package/dist/{query-BvbCiGWb.js → query-C98fDfVW.js} +2 -2
- package/dist/react/hooks.d.ts +64 -5
- package/dist/react/hooks.js +121 -3
- package/dist/terms/index.d.ts +2 -2
- package/dist/terms/index.js +1 -1
- package/dist/testing/index.d.ts +2 -2
- package/dist/{types-BrghN2rJ.d.ts → types-C69OzBn6.d.ts} +2 -2
- package/docs/api-reference.md +41 -2
- package/docs/errors.md +19 -0
- package/docs/files.md +165 -7
- package/package.json +2 -2
- package/dist/client-BJcy1V1a.js +0 -140
- package/dist/client-p49ol9pg.d.ts +0 -124
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as DebugLogger, i as DebugLevel, n as ReoptSDKConfig, r as resolveBaseUrl, t as REOPT_BASE_URLS } from "./config-
|
|
2
|
-
import { a as CompletionOptions, c as FinishReason, d as MessageRole, f as ModelInfo, i as ChatMessage, l as ImageGenerateOptions, m as StreamEvent, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "./client-
|
|
1
|
+
import { a as DebugLogger, i as DebugLevel, n as ReoptSDKConfig, r as resolveBaseUrl, t as REOPT_BASE_URLS } from "./config-C7WQtC3l.js";
|
|
2
|
+
import { a as CompletionOptions, c as FinishReason, d as MessageRole, f as ModelInfo, i as ChatMessage, l as ImageGenerateOptions, m as StreamEvent, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "./client-DPbXH8tr.js";
|
|
3
3
|
import { C as isModelAccessError, D as mapHttpStatusToError, E as isValidationError, S as isCreditLimitError, T as isRequiredTermsError, _ as ReoptSDKError, a as ConflictError, b as ServerError, c as DuplicateAuthUserError, d as ForbiddenError, f as LimitExceededError, g as RateLimitError, h as NotFoundError, i as BadRequestError, l as ErrorDiagnostic, m as ModelNotFoundError, n as AuthUserNotFoundError, o as ContentFilterError, p as ModelAccessError, r as AuthUserRecordExistsError, s as CreditLimitError, t as AuthError, u as FieldError, v as ReoptSDKErrorContext, w as isReoptSDKError, x as ValidationError, y as RequiredTermsError } from "./errors-CRCcErNC.js";
|
|
4
|
-
import { i as TypedEavRecord, r as EntityClient } from "./client-
|
|
5
|
-
import { a as initReoptSDK, i as getReoptSDK, n as createReoptSDK, o as resetSDK, r as createLazySDK, s as BaseHttpClient, t as ReoptSDK } from "./index-
|
|
4
|
+
import { i as TypedEavRecord, r as EntityClient } from "./client-CAGo56KO.js";
|
|
5
|
+
import { a as initReoptSDK, i as getReoptSDK, n as createReoptSDK, o as resetSDK, r as createLazySDK, s as BaseHttpClient, t as ReoptSDK } from "./index-CvNJ8zp1.js";
|
|
6
6
|
export { type AgentInfo, AuthError, AuthUserNotFoundError, AuthUserRecordExistsError, BadRequestError, BaseHttpClient, type ChatMessage, type CompletionOptions, type CompletionResult, ConflictError, ContentFilterError, type CreditInfo, CreditLimitError, type DebugLevel, type DebugLogger, DuplicateAuthUserError, type EntityClient, type ErrorDiagnostic, type FieldError, type FinishReason, ForbiddenError, type ImageGenerateOptions, type ImageGenerateResult, LimitExceededError, type MessageRole, ModelAccessError, type ModelInfo, ModelNotFoundError, NotFoundError, REOPT_BASE_URLS, RateLimitError, ReoptSDK, type ReoptSDKConfig, ReoptSDKError, type ReoptSDKErrorContext, RequiredTermsError, ServerError, type StreamDoneData, type StreamEvent, type TypedEavRecord, ValidationError, createLazySDK, createReoptSDK, getReoptSDK, initReoptSDK, isCreditLimitError, isModelAccessError, isReoptSDKError, isRequiredTermsError, isValidationError, mapHttpStatusToError, resetSDK, resolveBaseUrl };
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { A as mapHttpStatusToError, C as ServerError, D as isReoptSDKError, E as isModelAccessError, O as isRequiredTermsError, S as RequiredTermsError, T as isCreditLimitError, _ as ModelAccessError, b as RateLimitError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, k as isValidationError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError, p as CreditLimitError, r as assertBrowserSafe, s as AuthError, t as REOPT_BASE_URLS, u as BadRequestError, v as ModelNotFoundError, w as ValidationError, x as ReoptSDKError, y as NotFoundError } from "./config-
|
|
2
|
-
import { t as BaseHttpClient } from "./http-client-
|
|
3
|
-
import { n as createReoptAiClient } from "./client-
|
|
4
|
-
import { n as createReoptAuthClient } from "./client-
|
|
5
|
-
import { t as createReoptCmsClient } from "./client-
|
|
6
|
-
import { t as createReoptEavClient } from "./client-
|
|
7
|
-
import { n as createReoptFeedbackClient } from "./client-
|
|
8
|
-
import { n as createReoptFileClient } from "./client-
|
|
9
|
-
import { n as createReoptPlansClient } from "./client-
|
|
10
|
-
import { n as createReoptPushClient } from "./client-
|
|
11
|
-
import { n as createReoptTermsClient } from "./client-
|
|
1
|
+
import { A as mapHttpStatusToError, C as ServerError, D as isReoptSDKError, E as isModelAccessError, O as isRequiredTermsError, S as RequiredTermsError, T as isCreditLimitError, _ as ModelAccessError, b as RateLimitError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, k as isValidationError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError, p as CreditLimitError, r as assertBrowserSafe, s as AuthError, t as REOPT_BASE_URLS, u as BadRequestError, v as ModelNotFoundError, w as ValidationError, x as ReoptSDKError, y as NotFoundError } from "./config-BV8Fn7Uo.js";
|
|
2
|
+
import { t as BaseHttpClient } from "./http-client-6XUgrg3k.js";
|
|
3
|
+
import { n as createReoptAiClient } from "./client-BFM7OGqI.js";
|
|
4
|
+
import { n as createReoptAuthClient } from "./client-D4Z2xj4t.js";
|
|
5
|
+
import { t as createReoptCmsClient } from "./client-CiCPE2MW.js";
|
|
6
|
+
import { t as createReoptEavClient } from "./client-DVydvzc2.js";
|
|
7
|
+
import { n as createReoptFeedbackClient } from "./client-CxyXO_0C.js";
|
|
8
|
+
import { n as createReoptFileClient } from "./client-m29R8F0R.js";
|
|
9
|
+
import { n as createReoptPlansClient } from "./client-WP3Xsxri.js";
|
|
10
|
+
import { n as createReoptPushClient } from "./client-B84P9y2F.js";
|
|
11
|
+
import { n as createReoptTermsClient } from "./client-C_YUxs_X.js";
|
|
12
12
|
|
|
13
13
|
//#region src/singleton.ts
|
|
14
14
|
let _instance;
|
package/dist/logout/index.d.ts
CHANGED
package/dist/logout/index.js
CHANGED
package/dist/plans/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as CheckoutStatus, c as MeterPricingMode, d as PlanInterval, f as PlanMeter, i as CheckoutSession, l as Plan, m as PlanRequiredTerms, n as createReoptPlansClient, o as CreateCheckoutInput, p as PlanMeterTier, r as CancelSubscriptionResult, s as CurrentPlan, t as ReoptPlansClient, u as PlanBillingModel } from "../client-
|
|
1
|
+
import { a as CheckoutStatus, c as MeterPricingMode, d as PlanInterval, f as PlanMeter, i as CheckoutSession, l as Plan, m as PlanRequiredTerms, n as createReoptPlansClient, o as CreateCheckoutInput, p as PlanMeterTier, r as CancelSubscriptionResult, s as CurrentPlan, t as ReoptPlansClient, u as PlanBillingModel } from "../client-BGLDrf3N.js";
|
|
2
2
|
export { type CancelSubscriptionResult, type CheckoutSession, type CheckoutStatus, type CreateCheckoutInput, type CurrentPlan, type MeterPricingMode, type Plan, type PlanBillingModel, type PlanInterval, type PlanMeter, type PlanMeterTier, type PlanRequiredTerms, ReoptPlansClient, createReoptPlansClient };
|
package/dist/plans/index.js
CHANGED
package/dist/push/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RegisterPushTokenInput, c as UnregisterPushTokenInput, i as PushProvider, l as UnregisterPushTokenResult, n as createReoptPushClient, o as RegisterPushTokenResult, r as PushPlatform, s as RegisteredPushDevice, t as ReoptPushClient } from "../client-
|
|
1
|
+
import { a as RegisterPushTokenInput, c as UnregisterPushTokenInput, i as PushProvider, l as UnregisterPushTokenResult, n as createReoptPushClient, o as RegisterPushTokenResult, r as PushPlatform, s as RegisteredPushDevice, t as ReoptPushClient } from "../client-DfEeaOsQ.js";
|
|
2
2
|
export { type PushPlatform, type PushProvider, type RegisterPushTokenInput, type RegisterPushTokenResult, type RegisteredPushDevice, ReoptPushClient, type UnregisterPushTokenInput, type UnregisterPushTokenResult, createReoptPushClient };
|
package/dist/push/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { x as ReoptSDKError } from "./config-
|
|
1
|
+
import { x as ReoptSDKError } from "./config-BV8Fn7Uo.js";
|
|
2
2
|
|
|
3
3
|
//#region src/core/query.ts
|
|
4
4
|
/**
|
|
@@ -32,4 +32,4 @@ function buildQuery(params) {
|
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
34
34
|
export { buildQuery as t };
|
|
35
|
-
//# sourceMappingURL=query-
|
|
35
|
+
//# sourceMappingURL=query-C98fDfVW.js.map
|
package/dist/react/hooks.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as EavEntity, D as ListRecordsQuery, M as UpsertRecordInput, N as UpsertRecordResult, O as PaginatedResponse, b as EavAttribute, j as UpdateRecordInput, m as BulkUpdateItem, v as CreateRecordInput, w as EavRecord, y as DeleteWhereInput } from "../config-
|
|
2
|
-
import { a as CompletionOptions, f as ModelInfo, l as ImageGenerateOptions, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "../client-
|
|
1
|
+
import { C as EavEntity, D as ListRecordsQuery, M as UpsertRecordInput, N as UpsertRecordResult, O as PaginatedResponse, b as EavAttribute, j as UpdateRecordInput, m as BulkUpdateItem, v as CreateRecordInput, w as EavRecord, y as DeleteWhereInput } from "../config-C7WQtC3l.js";
|
|
2
|
+
import { a as CompletionOptions, f as ModelInfo, l as ImageGenerateOptions, o as CompletionResult, p as StreamDoneData, r as AgentInfo, s as CreditInfo, u as ImageGenerateResult } from "../client-DPbXH8tr.js";
|
|
3
3
|
import { _ as ReoptSDKError } from "../errors-CRCcErNC.js";
|
|
4
4
|
import { a as ListTagsQuery, c as PostGroup, d as Tag, i as ListPostsQuery, o as Post, r as ListPostGroupsQuery, s as PostDetail, t as CmsPaginatedResponse } from "../types-BXDcoJHG.js";
|
|
5
|
-
import { a as
|
|
6
|
-
import { t as ReoptSDK } from "../index-
|
|
5
|
+
import { a as FileListQuery, c as FolderInfo, d as UpdateFolderInput, f as UploadOptions, i as FileInfo, l as FolderListQuery, o as FileListResponse, r as CreateFolderInput, s as FileUsageInfo, u as UpdateFileInput } from "../client-A4YrHjDc.js";
|
|
6
|
+
import { t as ReoptSDK } from "../index-CvNJ8zp1.js";
|
|
7
7
|
import { UseInfiniteQueryOptions, UseInfiniteQueryResult, UseMutationOptions, UseMutationResult, UseQueryOptions, UseQueryResult } from "@tanstack/react-query";
|
|
8
8
|
//#region src/react/use-ai-stream.d.ts
|
|
9
9
|
type UseAiStreamOptions = {
|
|
@@ -54,7 +54,11 @@ declare const keys: {
|
|
|
54
54
|
postGroup: (groupId: string) => ReoptQueryKey<["postGroup", string]>;
|
|
55
55
|
tags: (brandappId?: string, query?: ListTagsQuery) => ReoptQueryKey<["tags", string | undefined, ListTagsQuery | undefined]>;
|
|
56
56
|
files: (brandappId?: string, query?: FileListQuery) => ReoptQueryKey<["files", string | undefined, FileListQuery | undefined]>;
|
|
57
|
+
filesPrefix: (brandappId?: string) => ReoptQueryKey<["files", string | undefined]>;
|
|
57
58
|
file: (fileId: string) => ReoptQueryKey<["file", string]>;
|
|
59
|
+
folders: (brandappId?: string, query?: FolderListQuery) => ReoptQueryKey<["folders", string | undefined, FolderListQuery | undefined]>;
|
|
60
|
+
foldersPrefix: (brandappId?: string) => ReoptQueryKey<["folders", string | undefined]>;
|
|
61
|
+
fileUsage: (brandappId?: string) => ReoptQueryKey<["fileUsage", string | undefined]>;
|
|
58
62
|
};
|
|
59
63
|
/**
|
|
60
64
|
* List every EAV entity defined for the current brandapp, including their
|
|
@@ -373,6 +377,61 @@ declare function useUploadFile(sdk: ReoptSDK, options?: UseMutationOptions<FileI
|
|
|
373
377
|
file: Blob | Uint8Array | File;
|
|
374
378
|
options?: UploadOptions;
|
|
375
379
|
}>;
|
|
380
|
+
/**
|
|
381
|
+
* 파일 수정(rename/move) mutation
|
|
382
|
+
*
|
|
383
|
+
* @example
|
|
384
|
+
* ```tsx
|
|
385
|
+
* const update = useUpdateFile(sdk);
|
|
386
|
+
* await update.mutateAsync({ fileId, input: { name: "renamed.png" } });
|
|
387
|
+
* await update.mutateAsync({ fileId, input: { folderId } }); // 폴더 이동
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
390
|
+
declare function useUpdateFile(sdk: ReoptSDK, options?: UseMutationOptions<FileInfo, Error, {
|
|
391
|
+
fileId: string;
|
|
392
|
+
input: UpdateFileInput;
|
|
393
|
+
}>): UseMutationResult<FileInfo, Error, {
|
|
394
|
+
fileId: string;
|
|
395
|
+
input: UpdateFileInput;
|
|
396
|
+
}>;
|
|
397
|
+
/**
|
|
398
|
+
* 직속 자식 폴더 목록 조회 (미지정 = 루트)
|
|
399
|
+
*
|
|
400
|
+
* @example
|
|
401
|
+
* ```tsx
|
|
402
|
+
* const { data: rootFolders } = useFolders(sdk);
|
|
403
|
+
* const { data: children } = useFolders(sdk, { parentId: folder.id });
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
declare function useFolders(sdk: ReoptSDK, query?: FolderListQuery, options?: Omit<UseQueryOptions<FolderInfo[]>, "queryKey" | "queryFn">): UseQueryResult<FolderInfo[]>;
|
|
407
|
+
/**
|
|
408
|
+
* 폴더 생성 mutation
|
|
409
|
+
*/
|
|
410
|
+
declare function useCreateFolder(sdk: ReoptSDK, options?: UseMutationOptions<FolderInfo, Error, CreateFolderInput>): UseMutationResult<FolderInfo, Error, CreateFolderInput>;
|
|
411
|
+
/**
|
|
412
|
+
* 폴더 수정(rename/move) mutation
|
|
413
|
+
*/
|
|
414
|
+
declare function useUpdateFolder(sdk: ReoptSDK, options?: UseMutationOptions<FolderInfo, Error, {
|
|
415
|
+
folderId: string;
|
|
416
|
+
input: UpdateFolderInput;
|
|
417
|
+
}>): UseMutationResult<FolderInfo, Error, {
|
|
418
|
+
folderId: string;
|
|
419
|
+
input: UpdateFolderInput;
|
|
420
|
+
}>;
|
|
421
|
+
/**
|
|
422
|
+
* 폴더 삭제 mutation — 비어있어야 성공 (아니면 409 FOLDER_NOT_EMPTY)
|
|
423
|
+
*/
|
|
424
|
+
declare function useDeleteFolder(sdk: ReoptSDK, options?: UseMutationOptions<void, Error, string>): UseMutationResult<void, Error, string>;
|
|
425
|
+
/**
|
|
426
|
+
* 저장공간 사용량 조회 — 사용량 미터·임박 경고용
|
|
427
|
+
*
|
|
428
|
+
* @example
|
|
429
|
+
* ```tsx
|
|
430
|
+
* const { data: usage } = useFileUsage(sdk);
|
|
431
|
+
* // usage?.usedBytes / usage?.limitBytes (null = 무제한)
|
|
432
|
+
* ```
|
|
433
|
+
*/
|
|
434
|
+
declare function useFileUsage(sdk: ReoptSDK, options?: Omit<UseQueryOptions<FileUsageInfo>, "queryKey" | "queryFn">): UseQueryResult<FileUsageInfo>;
|
|
376
435
|
//#endregion
|
|
377
|
-
export { type UseAiStreamOptions, type UseAiStreamReturn, keys as reoptQueryKeys, useAiAgents, useAiCompletion, useAiCredits, useAiImageGenerate, useAiModels, useAiStream, useBulkCreateRecords, useBulkDeleteRecords, useBulkUpdateRecords, useCmsTags, useCreateRecord, useDeleteFile, useDeleteRecord, useDeleteRecordsWhere, useEavEntities, useEavEntity, useEavRecord, useEavRecordCount, useEavRecords, useEavRecordsInfinite, useFile, useFiles, usePost, usePostBySlug, usePostGroup, usePostGroupList, usePostList, useUpdateRecord, useUploadFile, useUpsertRecord };
|
|
436
|
+
export { type UseAiStreamOptions, type UseAiStreamReturn, keys as reoptQueryKeys, useAiAgents, useAiCompletion, useAiCredits, useAiImageGenerate, useAiModels, useAiStream, useBulkCreateRecords, useBulkDeleteRecords, useBulkUpdateRecords, useCmsTags, useCreateFolder, useCreateRecord, useDeleteFile, useDeleteFolder, useDeleteRecord, useDeleteRecordsWhere, useEavEntities, useEavEntity, useEavRecord, useEavRecordCount, useEavRecords, useEavRecordsInfinite, useFile, useFileUsage, useFiles, useFolders, usePost, usePostBySlug, usePostGroup, usePostGroupList, usePostList, useUpdateFile, useUpdateFolder, useUpdateRecord, useUploadFile, useUpsertRecord };
|
|
378
437
|
//# sourceMappingURL=hooks.d.ts.map
|
package/dist/react/hooks.js
CHANGED
|
@@ -243,10 +243,31 @@ const keys = {
|
|
|
243
243
|
brandappId,
|
|
244
244
|
query
|
|
245
245
|
],
|
|
246
|
+
filesPrefix: (brandappId) => [
|
|
247
|
+
...keys.all,
|
|
248
|
+
"files",
|
|
249
|
+
brandappId
|
|
250
|
+
],
|
|
246
251
|
file: (fileId) => [
|
|
247
252
|
...keys.all,
|
|
248
253
|
"file",
|
|
249
254
|
fileId
|
|
255
|
+
],
|
|
256
|
+
folders: (brandappId, query) => [
|
|
257
|
+
...keys.all,
|
|
258
|
+
"folders",
|
|
259
|
+
brandappId,
|
|
260
|
+
query
|
|
261
|
+
],
|
|
262
|
+
foldersPrefix: (brandappId) => [
|
|
263
|
+
...keys.all,
|
|
264
|
+
"folders",
|
|
265
|
+
brandappId
|
|
266
|
+
],
|
|
267
|
+
fileUsage: (brandappId) => [
|
|
268
|
+
...keys.all,
|
|
269
|
+
"fileUsage",
|
|
270
|
+
brandappId
|
|
250
271
|
]
|
|
251
272
|
};
|
|
252
273
|
/**
|
|
@@ -773,7 +794,9 @@ function useDeleteFile(sdk, options) {
|
|
|
773
794
|
return useMutation({
|
|
774
795
|
mutationFn: (fileId) => sdk.files.delete(fileId),
|
|
775
796
|
onSuccess: () => {
|
|
776
|
-
queryClient.invalidateQueries({ queryKey: keys.
|
|
797
|
+
queryClient.invalidateQueries({ queryKey: keys.filesPrefix(sdk.config.brandappId) });
|
|
798
|
+
queryClient.invalidateQueries({ queryKey: keys.foldersPrefix(sdk.config.brandappId) });
|
|
799
|
+
queryClient.invalidateQueries({ queryKey: keys.fileUsage(sdk.config.brandappId) });
|
|
777
800
|
},
|
|
778
801
|
...options
|
|
779
802
|
});
|
|
@@ -796,12 +819,107 @@ function useUploadFile(sdk, options) {
|
|
|
796
819
|
return useMutation({
|
|
797
820
|
mutationFn: (input) => sdk.files.upload(input.file, input.options),
|
|
798
821
|
onSuccess: () => {
|
|
799
|
-
queryClient.invalidateQueries({ queryKey: keys.
|
|
822
|
+
queryClient.invalidateQueries({ queryKey: keys.filesPrefix(sdk.config.brandappId) });
|
|
823
|
+
queryClient.invalidateQueries({ queryKey: keys.foldersPrefix(sdk.config.brandappId) });
|
|
824
|
+
queryClient.invalidateQueries({ queryKey: keys.fileUsage(sdk.config.brandappId) });
|
|
825
|
+
},
|
|
826
|
+
...options
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* 파일 수정(rename/move) mutation
|
|
831
|
+
*
|
|
832
|
+
* @example
|
|
833
|
+
* ```tsx
|
|
834
|
+
* const update = useUpdateFile(sdk);
|
|
835
|
+
* await update.mutateAsync({ fileId, input: { name: "renamed.png" } });
|
|
836
|
+
* await update.mutateAsync({ fileId, input: { folderId } }); // 폴더 이동
|
|
837
|
+
* ```
|
|
838
|
+
*/
|
|
839
|
+
function useUpdateFile(sdk, options) {
|
|
840
|
+
const queryClient = useQueryClient();
|
|
841
|
+
return useMutation({
|
|
842
|
+
mutationFn: ({ fileId, input }) => sdk.files.update(fileId, input),
|
|
843
|
+
onSuccess: (_data, variables) => {
|
|
844
|
+
queryClient.invalidateQueries({ queryKey: keys.filesPrefix(sdk.config.brandappId) });
|
|
845
|
+
queryClient.invalidateQueries({ queryKey: keys.file(variables.fileId) });
|
|
846
|
+
queryClient.invalidateQueries({ queryKey: keys.foldersPrefix(sdk.config.brandappId) });
|
|
847
|
+
},
|
|
848
|
+
...options
|
|
849
|
+
});
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* 직속 자식 폴더 목록 조회 (미지정 = 루트)
|
|
853
|
+
*
|
|
854
|
+
* @example
|
|
855
|
+
* ```tsx
|
|
856
|
+
* const { data: rootFolders } = useFolders(sdk);
|
|
857
|
+
* const { data: children } = useFolders(sdk, { parentId: folder.id });
|
|
858
|
+
* ```
|
|
859
|
+
*/
|
|
860
|
+
function useFolders(sdk, query, options) {
|
|
861
|
+
return useQuery({
|
|
862
|
+
queryKey: keys.folders(sdk.config.brandappId, query),
|
|
863
|
+
queryFn: () => sdk.files.listFolders(query),
|
|
864
|
+
...options
|
|
865
|
+
});
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* 폴더 생성 mutation
|
|
869
|
+
*/
|
|
870
|
+
function useCreateFolder(sdk, options) {
|
|
871
|
+
const queryClient = useQueryClient();
|
|
872
|
+
return useMutation({
|
|
873
|
+
mutationFn: (input) => sdk.files.createFolder(input),
|
|
874
|
+
onSuccess: () => {
|
|
875
|
+
queryClient.invalidateQueries({ queryKey: keys.foldersPrefix(sdk.config.brandappId) });
|
|
800
876
|
},
|
|
801
877
|
...options
|
|
802
878
|
});
|
|
803
879
|
}
|
|
880
|
+
/**
|
|
881
|
+
* 폴더 수정(rename/move) mutation
|
|
882
|
+
*/
|
|
883
|
+
function useUpdateFolder(sdk, options) {
|
|
884
|
+
const queryClient = useQueryClient();
|
|
885
|
+
return useMutation({
|
|
886
|
+
mutationFn: ({ folderId, input }) => sdk.files.updateFolder(folderId, input),
|
|
887
|
+
onSuccess: () => {
|
|
888
|
+
queryClient.invalidateQueries({ queryKey: keys.foldersPrefix(sdk.config.brandappId) });
|
|
889
|
+
},
|
|
890
|
+
...options
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* 폴더 삭제 mutation — 비어있어야 성공 (아니면 409 FOLDER_NOT_EMPTY)
|
|
895
|
+
*/
|
|
896
|
+
function useDeleteFolder(sdk, options) {
|
|
897
|
+
const queryClient = useQueryClient();
|
|
898
|
+
return useMutation({
|
|
899
|
+
mutationFn: (folderId) => sdk.files.deleteFolder(folderId),
|
|
900
|
+
onSuccess: () => {
|
|
901
|
+
queryClient.invalidateQueries({ queryKey: keys.foldersPrefix(sdk.config.brandappId) });
|
|
902
|
+
},
|
|
903
|
+
...options
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* 저장공간 사용량 조회 — 사용량 미터·임박 경고용
|
|
908
|
+
*
|
|
909
|
+
* @example
|
|
910
|
+
* ```tsx
|
|
911
|
+
* const { data: usage } = useFileUsage(sdk);
|
|
912
|
+
* // usage?.usedBytes / usage?.limitBytes (null = 무제한)
|
|
913
|
+
* ```
|
|
914
|
+
*/
|
|
915
|
+
function useFileUsage(sdk, options) {
|
|
916
|
+
return useQuery({
|
|
917
|
+
queryKey: keys.fileUsage(sdk.config.brandappId),
|
|
918
|
+
queryFn: () => sdk.files.usage(),
|
|
919
|
+
...options
|
|
920
|
+
});
|
|
921
|
+
}
|
|
804
922
|
|
|
805
923
|
//#endregion
|
|
806
|
-
export { keys as reoptQueryKeys, useAiAgents, useAiCompletion, useAiCredits, useAiImageGenerate, useAiModels, useAiStream, useBulkCreateRecords, useBulkDeleteRecords, useBulkUpdateRecords, useCmsTags, useCreateRecord, useDeleteFile, useDeleteRecord, useDeleteRecordsWhere, useEavEntities, useEavEntity, useEavRecord, useEavRecordCount, useEavRecords, useEavRecordsInfinite, useFile, useFiles, usePost, usePostBySlug, usePostGroup, usePostGroupList, usePostList, useUpdateRecord, useUploadFile, useUpsertRecord };
|
|
924
|
+
export { keys as reoptQueryKeys, useAiAgents, useAiCompletion, useAiCredits, useAiImageGenerate, useAiModels, useAiStream, useBulkCreateRecords, useBulkDeleteRecords, useBulkUpdateRecords, useCmsTags, useCreateFolder, useCreateRecord, useDeleteFile, useDeleteFolder, useDeleteRecord, useDeleteRecordsWhere, useEavEntities, useEavEntity, useEavRecord, useEavRecordCount, useEavRecords, useEavRecordsInfinite, useFile, useFileUsage, useFiles, useFolders, usePost, usePostBySlug, usePostGroup, usePostGroupList, usePostList, useUpdateFile, useUpdateFolder, useUpdateRecord, useUploadFile, useUpsertRecord };
|
|
807
925
|
//# sourceMappingURL=hooks.js.map
|
package/dist/terms/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as CreateConsentsResult, c as TermsJurisdiction, d as TermsVersion, f as WithdrawConsentResult, i as CreateConsentsRequest, l as TermsListResponse, n as ConsentRecord, o as ListTermsOptions, r as ConsentStatus, s as TermsItem, t as ConsentInput, u as TermsType } from "../types-
|
|
2
|
-
import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-
|
|
1
|
+
import { a as CreateConsentsResult, c as TermsJurisdiction, d as TermsVersion, f as WithdrawConsentResult, i as CreateConsentsRequest, l as TermsListResponse, n as ConsentRecord, o as ListTermsOptions, r as ConsentStatus, s as TermsItem, t as ConsentInput, u as TermsType } from "../types-C69OzBn6.js";
|
|
2
|
+
import { n as createReoptTermsClient, t as ReoptTermsClient } from "../client-DHZ484kb.js";
|
|
3
3
|
export { type ConsentInput, type ConsentRecord, type ConsentStatus, type CreateConsentsRequest, type CreateConsentsResult, type ListTermsOptions, ReoptTermsClient, type TermsItem, type TermsJurisdiction, type TermsListResponse, type TermsType, type TermsVersion, type WithdrawConsentResult, createReoptTermsClient };
|
package/dist/terms/index.js
CHANGED
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as SeedAllInput, c as SeedPostGroupInput, d as SeedTermsItem, l as SeedPostInput, n as DevServer, o as SeedData, t as DevSchema } from "../index-
|
|
2
|
-
import { t as ReoptSDK } from "../index-
|
|
1
|
+
import { a as SeedAllInput, c as SeedPostGroupInput, d as SeedTermsItem, l as SeedPostInput, n as DevServer, o as SeedData, t as DevSchema } from "../index-DV_OWwx5.js";
|
|
2
|
+
import { t as ReoptSDK } from "../index-CvNJ8zp1.js";
|
|
3
3
|
//#region src/testing/index.d.ts
|
|
4
4
|
type TestSDKOptions = {
|
|
5
5
|
/** EAV schema to seed entities and attributes */
|
|
@@ -6,7 +6,7 @@ import { n as EditorSpec } from "./types-BXDcoJHG.js";
|
|
|
6
6
|
* Mirrors the response shape of `/api/v1/brandapp/{brandappId}/terms/*`.
|
|
7
7
|
*/
|
|
8
8
|
type TermsType = "termsOfService" | "privacyPolicy" | "marketingConsent" | "custom";
|
|
9
|
-
/** Mirrors the Prisma `
|
|
9
|
+
/** Mirrors the Prisma `BrandTermsJurisdiction` enum. */
|
|
10
10
|
type TermsJurisdiction = "global" | "KR" | "US" | "EU" | "GB" | "JP" | "CN" | "BR" | "CA" | "AU";
|
|
11
11
|
type TermsVersion = {
|
|
12
12
|
id: string;
|
|
@@ -102,4 +102,4 @@ type ListTermsOptions = {
|
|
|
102
102
|
};
|
|
103
103
|
//#endregion
|
|
104
104
|
export { CreateConsentsResult as a, TermsJurisdiction as c, TermsVersion as d, WithdrawConsentResult as f, CreateConsentsRequest as i, TermsListResponse as l, ConsentRecord as n, ListTermsOptions as o, ConsentStatus as r, TermsItem as s, ConsentInput as t, TermsType as u };
|
|
105
|
-
//# sourceMappingURL=types-
|
|
105
|
+
//# sourceMappingURL=types-C69OzBn6.d.ts.map
|
package/docs/api-reference.md
CHANGED
|
@@ -203,7 +203,8 @@ export async function GET(request: Request) {
|
|
|
203
203
|
const { data: files, meta } = await sdk.files.list({
|
|
204
204
|
page?: number; // Default: 1
|
|
205
205
|
limit?: number; // Default: 20
|
|
206
|
-
contentType?: string; // e.g. "image/*"
|
|
206
|
+
contentType?: string; // e.g. "image/png" 또는 와일드카드 "image/*"
|
|
207
|
+
folderId?: string | null; // 미지정=전체, null=루트만, id=해당 폴더 직속
|
|
207
208
|
sortBy?: "createdAt" | "name" | "size";
|
|
208
209
|
sortOrder?: "asc" | "desc";
|
|
209
210
|
});
|
|
@@ -211,19 +212,50 @@ const { data: files, meta } = await sdk.files.list({
|
|
|
211
212
|
|
|
212
213
|
// Get single file
|
|
213
214
|
const file = await sdk.files.get(fileId);
|
|
214
|
-
// Returns: { id, name, url, size, contentType, pathname, createdAt, updatedAt }
|
|
215
|
+
// Returns: { id, name, url, size, contentType, pathname, folderId, createdAt, updatedAt }
|
|
215
216
|
|
|
216
217
|
// Upload file (multipart FormData)
|
|
217
218
|
const uploaded = await sdk.files.upload(file, {
|
|
218
219
|
name?: string; // Override filename
|
|
219
220
|
contentType?: string; // Override MIME type
|
|
221
|
+
folderId?: string; // 업로드할 폴더 (미지정 = 루트)
|
|
220
222
|
});
|
|
221
223
|
// Accepts: Blob | Uint8Array | File
|
|
222
224
|
// Returns: FileInfo
|
|
223
225
|
|
|
226
|
+
// Rename / move file
|
|
227
|
+
const updated = await sdk.files.update(fileId, {
|
|
228
|
+
name?: string; // 표시명 변경 (pathname은 불변)
|
|
229
|
+
folderId?: string | null; // 폴더 이동 (null = 루트로)
|
|
230
|
+
});
|
|
231
|
+
// Returns: FileInfo
|
|
232
|
+
|
|
233
|
+
// Read text content (미리보기용 — text/*, application/json 등만. 그 외 415, 1MB 초과 413)
|
|
234
|
+
const text = await sdk.files.readContent(fileId);
|
|
235
|
+
// Returns: string
|
|
236
|
+
|
|
237
|
+
// Storage usage (사용량 미터 — usedBytes/limitBytes는 워크스페이스 단위, 402 STORAGE_LIMIT 판정과 동일 소스)
|
|
238
|
+
const usage = await sdk.files.usage();
|
|
239
|
+
// Returns: { usedBytes: number, limitBytes: number | null, fileCount: number }
|
|
240
|
+
|
|
224
241
|
// Delete file
|
|
225
242
|
await sdk.files.delete(fileId);
|
|
226
243
|
// Returns: void
|
|
244
|
+
|
|
245
|
+
// ---- Folders (3.5+) ----
|
|
246
|
+
|
|
247
|
+
// List direct child folders (미지정 = 루트)
|
|
248
|
+
const folders = await sdk.files.listFolders({ parentId?: string | null });
|
|
249
|
+
// Returns: FolderInfo[] — { id, name, parentId, childCount, fileCount, createdAt, updatedAt }
|
|
250
|
+
|
|
251
|
+
// Create folder
|
|
252
|
+
const folder = await sdk.files.createFolder({ name: "docs", parentId?: string | null });
|
|
253
|
+
|
|
254
|
+
// Rename / move folder (자기 자신·자손으로의 이동은 400)
|
|
255
|
+
await sdk.files.updateFolder(folderId, { name?: string, parentId?: string | null });
|
|
256
|
+
|
|
257
|
+
// Delete folder (비어있어야 함 — 아니면 409 FOLDER_NOT_EMPTY)
|
|
258
|
+
await sdk.files.deleteFolder(folderId);
|
|
227
259
|
```
|
|
228
260
|
|
|
229
261
|
### Image URL helpers (1.8+)
|
|
@@ -328,6 +360,13 @@ const { records, total } = await sdk.eav.records.list(entityId, {
|
|
|
328
360
|
filters?: AttributeFilter[];
|
|
329
361
|
sortBy?: string;
|
|
330
362
|
sortOrder?: "asc" | "desc";
|
|
363
|
+
select?: string[]; // 응답 record.values에 포함할 attribute ID만 지정
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
// 목록에 필요한 값만 받기 — pagination/filter/sort 결과는 동일
|
|
367
|
+
const summaries = await sdk.eav.records.list(entityId, {
|
|
368
|
+
limit: 100,
|
|
369
|
+
select: [titleAttributeId, statusAttributeId, updatedAtAttributeId],
|
|
331
370
|
});
|
|
332
371
|
const record = await sdk.eav.records.get(entityId, recordId);
|
|
333
372
|
const created = await sdk.eav.records.create(entityId, { values: { ... } });
|
package/docs/errors.md
CHANGED
|
@@ -45,6 +45,25 @@ treating a transient JWKS outage as a permanently bad token). See
|
|
|
45
45
|
> `"RateLimitError"`, `"CreditLimitError"`) so log aggregation / Sentry grouping
|
|
46
46
|
> can distinguish them. `instanceof`, `.code`, and `.status` work as before.
|
|
47
47
|
|
|
48
|
+
### Files-specific (3.5+)
|
|
49
|
+
|
|
50
|
+
`sdk.files.*` 도메인 코드. 409는 `ConflictError`로, 413/415는 base
|
|
51
|
+
`ReoptSDKError`로 도착한다 — `.code`/`.status`로 분기하면 된다. ⚠️ 402는 클래스
|
|
52
|
+
매핑이 status 단위라 저장공간 초과도 **`CreditLimitError` 클래스**로 도착한다
|
|
53
|
+
(이름과 달리 AI 크레딧이 아님) — `.code === "STORAGE_LIMIT"`으로 구분할 것.
|
|
54
|
+
|
|
55
|
+
| Code | Status | Class | When |
|
|
56
|
+
| -------------------------- | ------ | ------------------ | ------------------------------------------------------------------------ |
|
|
57
|
+
| `STORAGE_LIMIT` | 402 | `CreditLimitError` | 업로드 — 플랜 저장공간 한도 초과 (`sdk.files.usage()`로 사전 확인 가능) |
|
|
58
|
+
| `FILE_IN_USE` | 409 | `ConflictError` | 파일 삭제 — 브랜드프론트·이메일 등에서 사용 중 (메시지에 사용처 포함) |
|
|
59
|
+
| `FOLDER_NOT_EMPTY` | 409 | `ConflictError` | 폴더 삭제 — 파일/하위 폴더가 남아 있음 (메시지에 남은 개수 포함) |
|
|
60
|
+
| `CONFLICT` | 409 | `ConflictError` | 폴더 생성/이동 — 같은 위치에 동명 폴더 존재 |
|
|
61
|
+
| `CONTENT_TOO_LARGE` | 413 | `ReoptSDKError` | `readContent` — 1MB 초과 파일 |
|
|
62
|
+
| `UNSUPPORTED_CONTENT_TYPE` | 415 | `ReoptSDKError` | `readContent` — 텍스트 계열(`text/*`, `application/json` 등)이 아닌 파일 |
|
|
63
|
+
|
|
64
|
+
`STORAGE_LIMIT`·`FILE_IN_USE`·`FOLDER_NOT_EMPTY`의 메시지는 사람이 읽을 수 있는
|
|
65
|
+
형태라 UI에 그대로 표면화해도 된다.
|
|
66
|
+
|
|
48
67
|
### EAV-specific (1.9+)
|
|
49
68
|
|
|
50
69
|
These extend the general classes above so existing `instanceof ConflictError` /
|