@reopt-ai/brandapp-sdk 4.6.0 → 4.7.0-rc.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.
Files changed (76) hide show
  1. package/CHANGELOG.md +49 -1
  2. package/README.md +13 -13
  3. package/dist/ai/index.d.ts +1 -1
  4. package/dist/ai/index.js +1 -1
  5. package/dist/ai-provider/index.d.ts +1 -1
  6. package/dist/ai-provider/index.js +1 -1
  7. package/dist/analytics/index.d.ts +1 -1
  8. package/dist/analytics/index.js +1 -1
  9. package/dist/auth/index.d.ts +1 -1
  10. package/dist/auth/index.js +1 -1
  11. package/dist/better-auth/index.d.ts +8 -2
  12. package/dist/better-auth/index.js +19 -5
  13. package/dist/{client-CI2Y00Qx.js → client-BFl6cDAE.js} +23 -2
  14. package/dist/{client-tJq0U_jn.js → client-BJQzInqD.js} +4 -4
  15. package/dist/{client-IUSZDJio.d.ts → client-BQJepjoD.d.ts} +44 -4
  16. package/dist/{client-C2xE9HGZ.js → client-BZ8-vFjk.js} +4 -4
  17. package/dist/{client-DjLhTNsZ.js → client-Bf8mW6uO.js} +3 -3
  18. package/dist/client-C-LdW4gY.js +194 -0
  19. package/dist/{client-C6OXGMMV.d.ts → client-C2W4RAZV.d.ts} +2 -2
  20. package/dist/{client-7I-mz3Dw.d.ts → client-C6lx3RUQ.d.ts} +2 -2
  21. package/dist/{client-Ce0gs5Ma.js → client-CLZie3Ym.js} +2 -2
  22. package/dist/{client-yKeRJnIB.d.ts → client-CSl3o0s3.d.ts} +2 -2
  23. package/dist/{client-D1AFtJRw.d.ts → client-Cnq_X3Wp.d.ts} +2 -2
  24. package/dist/{client-Bfutv3LK.d.ts → client-Cod87ThY.d.ts} +2 -2
  25. package/dist/{client-BSW0Ncjj.d.ts → client-CsWSxMhB.d.ts} +2 -2
  26. package/dist/{client-eDd4aWDs.js → client-CslasnqK.js} +2 -2
  27. package/dist/{client-FM6_YJbr.js → client-DGKq4Ml5.js} +3 -3
  28. package/dist/{client-BzAgabAs.js → client-Db6Etco9.js} +2 -2
  29. package/dist/{client-Dmvtr1nS.d.ts → client-DfnaH99z.d.ts} +2 -2
  30. package/dist/{client-COKDtHO9.d.ts → client-MDNS9Ubf.d.ts} +2 -2
  31. package/dist/{client-DCqp0Bis.js → client-VKEJtLH0.js} +2 -2
  32. package/dist/{client-DeC127BD.js → client-_2Avom0q.js} +2 -2
  33. package/dist/{client-CniCGdmi.d.ts → client-xblzWFAL.d.ts} +2 -2
  34. package/dist/cms/index.d.ts +1 -1
  35. package/dist/cms/index.js +1 -1
  36. package/dist/{config-D3SblxWt.d.ts → config-CnFnzh7Q.d.ts} +21 -6
  37. package/dist/{config-BeOelISH.js → config-Dy2oBn1a.js} +13 -10
  38. package/dist/dev/index.d.ts +1 -1
  39. package/dist/eav/index.d.ts +2 -2
  40. package/dist/eav/index.js +2 -2
  41. package/dist/eav/migrate.d.ts +2 -2
  42. package/dist/eav/schema.d.ts +2 -2
  43. package/dist/feedback/index.d.ts +1 -1
  44. package/dist/feedback/index.js +1 -1
  45. package/dist/files/index.d.ts +1 -1
  46. package/dist/files/index.js +1 -1
  47. package/dist/{http-client-Bl8u1vHN.js → http-client-CW9wXANY.js} +9 -3
  48. package/dist/{index-BnAYxnwq.d.ts → index-Bkci7euU.d.ts} +14 -12
  49. package/dist/{index-C6fyJTud.d.ts → index-Dh8XMVFF.d.ts} +2 -2
  50. package/dist/index.d.ts +4 -4
  51. package/dist/index.js +12 -12
  52. package/dist/keys-B2pA8EkU.d.ts +44 -0
  53. package/dist/keys-B_R_lsyF.js +102 -0
  54. package/dist/logout/index.d.ts +1 -1
  55. package/dist/logout/index.js +1 -1
  56. package/dist/machine/index.d.ts +72 -0
  57. package/dist/machine/index.js +4 -0
  58. package/dist/machine/keygen-cli.d.ts +7 -0
  59. package/dist/machine/keygen-cli.js +57 -0
  60. package/dist/plans/index.d.ts +2 -2
  61. package/dist/plans/index.js +1 -1
  62. package/dist/push/index.d.ts +1 -1
  63. package/dist/push/index.js +1 -1
  64. package/dist/{query-JPVK_8N5.js → query-DPD0WYlB.js} +2 -2
  65. package/dist/react/hooks.d.ts +4 -4
  66. package/dist/terms/index.d.ts +1 -1
  67. package/dist/terms/index.js +1 -1
  68. package/dist/testing/index.d.ts +2 -2
  69. package/dist/workspace/index.d.ts +39 -9
  70. package/dist/workspace/index.js +51 -9
  71. package/docs/api-reference.md +43 -24
  72. package/docs/dev-server.md +2 -2
  73. package/docs/environment.md +4 -4
  74. package/docs/machine.md +104 -0
  75. package/docs/workspace.md +12 -0
  76. package/package.json +17 -3
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-Bl8u1vHN.js";
1
+ import { t as BaseHttpClient } from "./http-client-CW9wXANY.js";
2
2
 
3
3
  //#region src/feedback/client.ts
4
4
  function buildListQuery(query) {
@@ -83,4 +83,4 @@ function createReoptFeedbackClient(config) {
83
83
 
84
84
  //#endregion
85
85
  export { createReoptFeedbackClient as n, ReoptFeedbackClient as t };
86
- //# sourceMappingURL=client-Ce0gs5Ma.js.map
86
+ //# sourceMappingURL=client-CLZie3Ym.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
1
+ import { n as ReoptSDKConfig } from "./config-CnFnzh7Q.js";
2
2
  import { a as CreateConsentsResult, f as WithdrawConsentResult, i as CreateConsentsRequest, l as TermsListResponse, n as ConsentRecord, o as ListTermsOptions, s as TermsItem } from "./types-C69OzBn6.js";
3
3
  //#region src/terms/client.d.ts
4
4
  declare class ReoptTermsClient {
@@ -45,4 +45,4 @@ declare class ReoptTermsClient {
45
45
  declare function createReoptTermsClient(config: ReoptSDKConfig): ReoptTermsClient;
46
46
  //#endregion
47
47
  export { createReoptTermsClient as n, ReoptTermsClient as t };
48
- //# sourceMappingURL=client-yKeRJnIB.d.ts.map
48
+ //# sourceMappingURL=client-CSl3o0s3.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
1
+ import { n as ReoptSDKConfig } from "./config-CnFnzh7Q.js";
2
2
  //#region src/ai/types.d.ts
3
3
  /** 메시지 역할 */
4
4
  type MessageRole = "system" | "user" | "assistant";
@@ -281,4 +281,4 @@ declare class ReoptAiClient {
281
281
  declare function createReoptAiClient(config: ReoptSDKConfig): ReoptAiClient;
282
282
  //#endregion
283
283
  export { CompletionOptions as a, FinishReason as c, MessageRole as d, ModelInfo as f, ChatMessage as i, ImageGenerateOptions as l, StreamEvent as m, createReoptAiClient as n, CompletionResult as o, StreamDoneData as p, AgentInfo as r, CreditInfo as s, ReoptAiClient as t, ImageGenerateResult as u };
284
- //# sourceMappingURL=client-D1AFtJRw.d.ts.map
284
+ //# sourceMappingURL=client-Cnq_X3Wp.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
1
+ import { n as ReoptSDKConfig } from "./config-CnFnzh7Q.js";
2
2
  //#region src/auth/types.d.ts
3
3
  /**
4
4
  * User-scoped auth types.
@@ -68,4 +68,4 @@ declare class ReoptAuthClient {
68
68
  declare function createReoptAuthClient(config: ReoptSDKConfig): ReoptAuthClient;
69
69
  //#endregion
70
70
  export { UserInfoClaims as i, createReoptAuthClient as n, LinkCurrentUserResult as r, ReoptAuthClient as t };
71
- //# sourceMappingURL=client-Bfutv3LK.d.ts.map
71
+ //# sourceMappingURL=client-Cod87ThY.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
1
+ import { n as ReoptSDKConfig } from "./config-CnFnzh7Q.js";
2
2
  //#region src/push/types.d.ts
3
3
  /** Push provider — native token kind. */
4
4
  type PushProvider = "fcm" | "apns";
@@ -50,4 +50,4 @@ declare class ReoptPushClient {
50
50
  declare function createReoptPushClient(config: ReoptSDKConfig): ReoptPushClient;
51
51
  //#endregion
52
52
  export { RegisterPushTokenInput as a, UnregisterPushTokenInput as c, PushProvider as i, UnregisterPushTokenResult as l, createReoptPushClient as n, RegisterPushTokenResult as o, PushPlatform as r, RegisteredPushDevice as s, ReoptPushClient as t };
53
- //# sourceMappingURL=client-BSW0Ncjj.d.ts.map
53
+ //# sourceMappingURL=client-CsWSxMhB.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-Bl8u1vHN.js";
1
+ import { t as BaseHttpClient } from "./http-client-CW9wXANY.js";
2
2
 
3
3
  //#region src/auth/client.ts
4
4
  function unwrap(body) {
@@ -50,4 +50,4 @@ function createReoptAuthClient(config) {
50
50
 
51
51
  //#endregion
52
52
  export { createReoptAuthClient as n, ReoptAuthClient as t };
53
- //# sourceMappingURL=client-eDd4aWDs.js.map
53
+ //# sourceMappingURL=client-CslasnqK.js.map
@@ -1,5 +1,5 @@
1
- import { t as BaseHttpClient } from "./http-client-Bl8u1vHN.js";
2
- import { t as buildQuery } from "./query-JPVK_8N5.js";
1
+ import { t as BaseHttpClient } from "./http-client-CW9wXANY.js";
2
+ import { t as buildQuery } from "./query-DPD0WYlB.js";
3
3
 
4
4
  //#region src/cms/client.ts
5
5
  function createReoptCmsClient(config) {
@@ -52,4 +52,4 @@ async list(query) {
52
52
 
53
53
  //#endregion
54
54
  export { createReoptCmsClient as t };
55
- //# sourceMappingURL=client-FM6_YJbr.js.map
55
+ //# sourceMappingURL=client-DGKq4Ml5.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-Bl8u1vHN.js";
1
+ import { t as BaseHttpClient } from "./http-client-CW9wXANY.js";
2
2
 
3
3
  //#region src/analytics/client.ts
4
4
  var ReoptAnalyticsClient = class {
@@ -17,4 +17,4 @@ function createReoptAnalyticsClient(config) {
17
17
 
18
18
  //#endregion
19
19
  export { createReoptAnalyticsClient as n, ReoptAnalyticsClient as t };
20
- //# sourceMappingURL=client-BzAgabAs.js.map
20
+ //# sourceMappingURL=client-Db6Etco9.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
1
+ import { n as ReoptSDKConfig } from "./config-CnFnzh7Q.js";
2
2
  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";
3
3
  //#region src/cms/client.d.ts
4
4
  /**
@@ -50,4 +50,4 @@ declare function createReoptCmsClient(config: ReoptSDKConfig): {
50
50
  };
51
51
  //#endregion
52
52
  export { createReoptCmsClient as n, ReoptCmsClient as t };
53
- //# sourceMappingURL=client-Dmvtr1nS.d.ts.map
53
+ //# sourceMappingURL=client-DfnaH99z.d.ts.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
1
+ import { n as ReoptSDKConfig } from "./config-CnFnzh7Q.js";
2
2
  //#region src/feedback/types.d.ts
3
3
  /**
4
4
  * Feedback processing status. `responded` means staff have answered but the
@@ -146,4 +146,4 @@ declare class ReoptFeedbackClient {
146
146
  declare function createReoptFeedbackClient(config: ReoptSDKConfig): ReoptFeedbackClient;
147
147
  //#endregion
148
148
  export { CreateFeedbackResult as a, FeedbackListMeta as c, FeedbackReplyAuthor as d, FeedbackStatus as f, CreateFeedbackReplyResult as i, FeedbackListResult as l, RateFeedbackReplyResult as m, createReoptFeedbackClient as n, Feedback as o, ListFeedbackQuery as p, CreateFeedbackInput as r, FeedbackDetail as s, ReoptFeedbackClient as t, FeedbackReply as u };
149
- //# sourceMappingURL=client-COKDtHO9.d.ts.map
149
+ //# sourceMappingURL=client-MDNS9Ubf.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-Bl8u1vHN.js";
1
+ import { t as BaseHttpClient } from "./http-client-CW9wXANY.js";
2
2
 
3
3
  //#region src/terms/client.ts
4
4
  function unwrap(body) {
@@ -80,4 +80,4 @@ function createReoptTermsClient(config) {
80
80
 
81
81
  //#endregion
82
82
  export { createReoptTermsClient as n, ReoptTermsClient as t };
83
- //# sourceMappingURL=client-DCqp0Bis.js.map
83
+ //# sourceMappingURL=client-VKEJtLH0.js.map
@@ -1,4 +1,4 @@
1
- import { t as BaseHttpClient } from "./http-client-Bl8u1vHN.js";
1
+ import { t as BaseHttpClient } from "./http-client-CW9wXANY.js";
2
2
 
3
3
  //#region src/push/client.ts
4
4
  var ReoptPushClient = class {
@@ -25,4 +25,4 @@ function createReoptPushClient(config) {
25
25
 
26
26
  //#endregion
27
27
  export { createReoptPushClient as n, ReoptPushClient as t };
28
- //# sourceMappingURL=client-DeC127BD.js.map
28
+ //# sourceMappingURL=client-_2Avom0q.js.map
@@ -1,4 +1,4 @@
1
- import { n as ReoptSDKConfig } from "./config-D3SblxWt.js";
1
+ import { n as ReoptSDKConfig } from "./config-CnFnzh7Q.js";
2
2
  //#region src/files/types.d.ts
3
3
  /** 파일 정보 */
4
4
  type FileInfo = {
@@ -269,4 +269,4 @@ declare class ReoptFileClient {
269
269
  declare function createReoptFileClient(config: ReoptSDKConfig): ReoptFileClient;
270
270
  //#endregion
271
271
  export { FileListQuery as a, FolderInfo as c, UpdateFolderInput as d, UploadOptions as f, FileInfo as i, FolderListQuery as l, createReoptFileClient as n, FileListResponse as o, CreateFolderInput as r, FileUsageInfo as s, ReoptFileClient as t, UpdateFileInput as u };
272
- //# sourceMappingURL=client-CniCGdmi.d.ts.map
272
+ //# sourceMappingURL=client-xblzWFAL.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { a as ListTagsQuery, c as PostGroup, d as Tag, i as ListPostsQuery, l as PostSeo, n as EditorSpec, o as Post, r as ListPostGroupsQuery, s as PostDetail, t as CmsPaginatedResponse, u as PostStatus } from "../types-BXDcoJHG.js";
2
- import { n as createReoptCmsClient, t as ReoptCmsClient } from "../client-Dmvtr1nS.js";
2
+ import { n as createReoptCmsClient, t as ReoptCmsClient } from "../client-DfnaH99z.js";
3
3
  //#region src/cms/helpers.d.ts
4
4
  type SeoMetadata = {
5
5
  title?: string;
package/dist/cms/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as createReoptCmsClient } from "../client-FM6_YJbr.js";
1
+ import { t as createReoptCmsClient } from "../client-DGKq4Ml5.js";
2
2
 
3
3
  //#region src/cms/helpers.ts
4
4
  function joinUrl(siteUrl, path) {
@@ -351,11 +351,11 @@ type DebugLogger = {
351
351
  * host stays served indefinitely as a backward-compat alias, so SDK builds
352
352
  * published before this change keep working. ⚠️ Flip takes effect only on
353
353
  * re-publish — republish after `brandapp.reopt.ai` is live on Vercel.
354
- * (dev host stays `brand.reopt.de:3443` — bound to the local hosts file + cert.)
354
+ * (dev host stays `brand.local.reopt.io` — public wildcard DNS to the dev-proxy machine.)
355
355
  */
356
356
  declare const REOPT_BASE_URLS: {
357
357
  readonly production: "https://brandapp.reopt.ai";
358
- readonly development: "https://brand.reopt.de:3443";
358
+ readonly development: "https://brand.local.reopt.io";
359
359
  };
360
360
  type ReoptSDKConfig<S extends SchemaDef = SchemaDef> = {
361
361
  /**
@@ -384,9 +384,24 @@ type ReoptSDKConfig<S extends SchemaDef = SchemaDef> = {
384
384
  * via `FetchOptions.bearerToken` still take precedence.
385
385
  */
386
386
  token?: string;
387
+ /**
388
+ * RFC-0034 — 요청마다 인증 헤더를 만드는 제공자. 기계 클라이언트(`@reopt-ai/brandapp-sdk/machine`)의
389
+ * `headers`를 넘기면 모든 요청이 `Authorization: DPoP <token>` + `DPoP` 증명으로 나가고 Basic은 쓰이지
390
+ * 않는다(clientSecret 불필요). per-call `FetchOptions.bearerToken`이 여전히 우선한다.
391
+ *
392
+ * @example
393
+ * ```ts
394
+ * const machine = createMachineClient({ clientId, resource: "https://brandapp.reopt.ai", scopes: ["brandapp:read"] });
395
+ * const sdk = createReoptSDK({ brandappId, clientId, authorization: machine.headers });
396
+ * ```
397
+ */
398
+ authorization?: (request: {
399
+ method: string;
400
+ url: string;
401
+ }) => Promise<Record<string, string>>;
387
402
  /**
388
403
  * true: production (https://brandapp.reopt.ai)
389
- * false: development (https://brand.reopt.de:3443)
404
+ * false: development (https://brand.local.reopt.io)
390
405
  * undefined (default): auto-detect from `NODE_ENV === "production"`
391
406
  */
392
407
  isProduction?: boolean;
@@ -401,7 +416,7 @@ type ReoptSDKConfig<S extends SchemaDef = SchemaDef> = {
401
416
  * Custom id (auth) base URL — overrides `REOPT_ID_BASE_URL` env and the URL
402
417
  * derived from `baseUrl` / `REOPT_BASE_URL` / `isProduction`. Set this when
403
418
  * the Better Auth handler is hosted at a non-standard origin (custom dev
404
- * cluster, on-prem deploy, etc.). For standard reopt.{ai,io,de} hosts you
419
+ * cluster, on-prem deploy, etc.). For standard reopt.{ai,io} / local.reopt.io hosts you
405
420
  * can omit both this and the env var — it's auto-derived from the API host.
406
421
  */
407
422
  idBaseUrl?: string;
@@ -443,9 +458,9 @@ type ReoptSDKConfig<S extends SchemaDef = SchemaDef> = {
443
458
  * 2. `REOPT_BASE_URL` env var — set this once and skip threading
444
459
  * `baseUrl` through every `createReoptSDK()` call
445
460
  * 3. default by `isProduction` / `NODE_ENV` (production →
446
- * `brandapp.reopt.ai`, otherwise → `brand.reopt.de:3443`)
461
+ * `brandapp.reopt.ai`, otherwise → `brand.local.reopt.io`)
447
462
  */
448
463
  declare function resolveBaseUrl(config: ReoptSDKConfig): string;
449
464
  //#endregion
450
465
  export { ListRecordsQuery as A, EavAttribute as C, EavRecord as D, EavEntity as E, UpdateRecordInput as F, UpsertRecordInput as I, UpsertRecordResult as L, RECORDS_PAGE_LIMIT_MAX as M, UpdateAttributeInput as N, EavSchemaLinkedTo as O, UpdateEntityInput as P, DeleteWhereInput as S, EavDataType as T, BulkUpdateItem as _, DebugLogger as a, CreateEntityInput as b, InferValues as c, ATTRIBUTE_FILTER_OPERATORS as d, AttributeFilter as f, BackfillResult as g, BackfillOptions as h, DebugLevel as i, PaginatedResponse as j, EavValidation as k, SchemaDef as l, AttributeFilterOperator as m, ReoptSDKConfig as n, AttributeDef as o, AttributeFilterListValue as p, resolveBaseUrl as r, EntityDef as s, REOPT_BASE_URLS as t, ATTRIBUTE_FILTER_LIST_MAX as u, CountRecordsQuery as v, EavAttributeOption as w, CreateRecordInput as x, CreateAttributeInput as y };
451
- //# sourceMappingURL=config-D3SblxWt.d.ts.map
466
+ //# sourceMappingURL=config-CnFnzh7Q.d.ts.map
@@ -319,7 +319,7 @@ function mapHttpStatusToError(status, code, message, ctx, fieldErrors) {
319
319
 
320
320
  //#endregion
321
321
  //#region src/core/config.ts
322
- const SDK_VERSION = "4.6.0";
322
+ const SDK_VERSION = "4.7.0-rc.1";
323
323
  /**
324
324
  * Default API host for EAV / AI / Files / CMS / Terms. Consumers can override
325
325
  * via `config.baseUrl` or the `REOPT_BASE_URL` env var.
@@ -329,11 +329,11 @@ const SDK_VERSION = "4.6.0";
329
329
  * host stays served indefinitely as a backward-compat alias, so SDK builds
330
330
  * published before this change keep working. ⚠️ Flip takes effect only on
331
331
  * re-publish — republish after `brandapp.reopt.ai` is live on Vercel.
332
- * (dev host stays `brand.reopt.de:3443` — bound to the local hosts file + cert.)
332
+ * (dev host stays `brand.local.reopt.io` — public wildcard DNS to the dev-proxy machine.)
333
333
  */
334
334
  const REOPT_BASE_URLS = {
335
335
  production: "https://brandapp.reopt.ai",
336
- development: "https://brand.reopt.de:3443"
336
+ development: "https://brand.local.reopt.io"
337
337
  };
338
338
  /**
339
339
  * Better Auth handler (`/api/auth/*`) and CLI device-flow endpoints live on
@@ -343,15 +343,18 @@ const REOPT_BASE_URLS = {
343
343
  * Override via `config.idBaseUrl` or the `REOPT_ID_BASE_URL` env var. If only
344
344
  * the main host is overridden (`config.baseUrl` or `REOPT_BASE_URL`), the id
345
345
  * host is auto-derived via {@link deriveIdFromBaseUrl} — e.g. setting
346
- * `REOPT_BASE_URL=https://brand.reopt.de:3443` is enough; `id.reopt.de:3443` is
346
+ * `REOPT_BASE_URL=https://brand.local.reopt.io` is enough; `id.local.reopt.io` is
347
347
  * inferred automatically.
348
348
  */
349
349
  const REOPT_ID_BASE_URLS = {
350
350
  production: "https://id.reopt.ai",
351
- development: "https://id.reopt.de:3443"
351
+ development: "https://id.local.reopt.io"
352
352
  };
353
353
  function validateConfig(config) {
354
- if (!!!config.token?.trim()) {
354
+ const hasToken = !!config.token?.trim();
355
+ const hasAuthorizationProvider = typeof config.authorization === "function";
356
+ if (hasAuthorizationProvider && !config.clientId?.trim()) throw new ConfigError("ReoptSDK: clientId is required alongside `authorization`. Set BRANDAPP_CLIENT_ID environment variable.", "BRANDAPP_CLIENT_ID");
357
+ if (!hasToken && !hasAuthorizationProvider) {
355
358
  if (!config.clientId?.trim()) throw new ConfigError("ReoptSDK: clientId is required (or pass a short-lived `token`). Set BRANDAPP_CLIENT_ID environment variable.", "BRANDAPP_CLIENT_ID");
356
359
  if (!config.clientSecret?.trim()) throw new ConfigError("ReoptSDK: clientSecret is required (or pass a short-lived `token`). Set BRANDAPP_CLIENT_SECRET environment variable.", "BRANDAPP_CLIENT_SECRET");
357
360
  }
@@ -444,7 +447,7 @@ function readEnvUrl(name) {
444
447
  * 2. `REOPT_BASE_URL` env var — set this once and skip threading
445
448
  * `baseUrl` through every `createReoptSDK()` call
446
449
  * 3. default by `isProduction` / `NODE_ENV` (production →
447
- * `brandapp.reopt.ai`, otherwise → `brand.reopt.de:3443`)
450
+ * `brandapp.reopt.ai`, otherwise → `brand.local.reopt.io`)
448
451
  */
449
452
  function resolveBaseUrl(config) {
450
453
  if (config.baseUrl) return config.baseUrl.replace(/\/$/, "");
@@ -476,7 +479,7 @@ function resolveIdBaseUrl(config) {
476
479
  return config.isProduction ?? (typeof process !== "undefined" && process.env?.NODE_ENV === "production") ? REOPT_ID_BASE_URLS.production : REOPT_ID_BASE_URLS.development;
477
480
  }
478
481
  /**
479
- * Best-effort host transform — any reopt.{ai,io,de} subdomain folds to the
482
+ * Best-effort host transform — any reopt.{ai,io} / local.reopt.io subdomain folds to the
480
483
  * shared id host for that environment. Custom hosts fall back to prepending
481
484
  * `id.` (with a leading `www.` stripped).
482
485
  */
@@ -486,8 +489,8 @@ function deriveIdFromBaseUrl(baseUrl) {
486
489
  const url = new URL(clean);
487
490
  const { hostname } = url;
488
491
  if (hostname === "reopt.ai" || hostname.endsWith(".reopt.ai")) return REOPT_ID_BASE_URLS.production;
492
+ if (hostname === "local.reopt.io" || hostname.endsWith(".local.reopt.io")) return REOPT_ID_BASE_URLS.development;
489
493
  if (hostname === "reopt.io" || hostname.endsWith(".reopt.io")) return "https://id.reopt.io";
490
- if (hostname === "reopt.de" || hostname.endsWith(".reopt.de")) return REOPT_ID_BASE_URLS.development;
491
494
  if (hostname.startsWith("id.")) return url.origin;
492
495
  url.hostname = `id.${hostname.replace(/^www\./, "")}`;
493
496
  return url.origin;
@@ -498,4 +501,4 @@ function deriveIdFromBaseUrl(baseUrl) {
498
501
 
499
502
  //#endregion
500
503
  export { isValidationError as A, RequiredTermsError as C, isModelAccessError as D, isCreditLimitError as E, isReoptSDKError as O, ReoptSDKError as S, ValidationError as T, ModelAccessError as _, resolveIdBaseUrl as a, PreconditionFailedError as b, AuthUserNotFoundError as c, ConflictError as d, ContentFilterError as f, LimitExceededError as g, ForbiddenError as h, resolveBaseUrl as i, mapHttpStatusToError as j, isRequiredTermsError as k, AuthUserRecordExistsError as l, DuplicateAuthUserError as m, SDK_VERSION as n, validateConfig as o, CreditLimitError as p, assertBrowserSafe as r, AuthError as s, REOPT_BASE_URLS as t, BadRequestError as u, ModelNotFoundError as v, ServerError as w, RateLimitError as x, NotFoundError as y };
501
- //# sourceMappingURL=config-BeOelISH.js.map
504
+ //# sourceMappingURL=config-Dy2oBn1a.js.map
@@ -1,2 +1,2 @@
1
- import { _ as DevPost, a as SeedAllInput, b as InMemoryStore, c as SeedPostGroupInput, d as SeedTermsItem, f as createDevServer, g as DevEntity, h as DevAttribute, i as ProxyConfig, l as SeedPostInput, m as markdownToEditorSpecMany, n as DevServer, o as SeedData, p as markdownToEditorSpec, r as DevServerOptions, s as SeedOptions, t as DevSchema, u as SeedRecordInput, v as DevPostGroup, x as StoreSnapshot, y as DevRecord } from "../index-C6fyJTud.js";
1
+ import { _ as DevPost, a as SeedAllInput, b as InMemoryStore, c as SeedPostGroupInput, d as SeedTermsItem, f as createDevServer, g as DevEntity, h as DevAttribute, i as ProxyConfig, l as SeedPostInput, m as markdownToEditorSpecMany, n as DevServer, o as SeedData, p as markdownToEditorSpec, r as DevServerOptions, s as SeedOptions, t as DevSchema, u as SeedRecordInput, v as DevPostGroup, x as StoreSnapshot, y as DevRecord } from "../index-Dh8XMVFF.js";
2
2
  export { type DevAttribute, type DevEntity, type DevPost, type DevPostGroup, type DevRecord, DevSchema, DevServer, DevServerOptions, InMemoryStore, ProxyConfig, SeedAllInput, SeedData, SeedOptions, SeedPostGroupInput, SeedPostInput, SeedRecordInput, SeedTermsItem, type StoreSnapshot, createDevServer, markdownToEditorSpec, markdownToEditorSpecMany };
@@ -1,6 +1,6 @@
1
- import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpdateRecordInput, I as UpsertRecordInput, L as UpsertRecordResult, M as RECORDS_PAGE_LIMIT_MAX, N as UpdateAttributeInput, O as EavSchemaLinkedTo, P as UpdateEntityInput, S as DeleteWhereInput, T as EavDataType, _ as BulkUpdateItem, b as CreateEntityInput, d as ATTRIBUTE_FILTER_OPERATORS, f as AttributeFilter, j as PaginatedResponse, k as EavValidation, m as AttributeFilterOperator, n as ReoptSDKConfig, p as AttributeFilterListValue, u as ATTRIBUTE_FILTER_LIST_MAX, v as CountRecordsQuery, w as EavAttributeOption, x as CreateRecordInput, y as CreateAttributeInput } from "../config-D3SblxWt.js";
1
+ import { A as ListRecordsQuery, C as EavAttribute, D as EavRecord, E as EavEntity, F as UpdateRecordInput, I as UpsertRecordInput, L as UpsertRecordResult, M as RECORDS_PAGE_LIMIT_MAX, N as UpdateAttributeInput, O as EavSchemaLinkedTo, P as UpdateEntityInput, S as DeleteWhereInput, T as EavDataType, _ as BulkUpdateItem, b as CreateEntityInput, d as ATTRIBUTE_FILTER_OPERATORS, f as AttributeFilter, j as PaginatedResponse, k as EavValidation, m as AttributeFilterOperator, n as ReoptSDKConfig, p as AttributeFilterListValue, u as ATTRIBUTE_FILTER_LIST_MAX, v as CountRecordsQuery, w as EavAttributeOption, x as CreateRecordInput, y as CreateAttributeInput } from "../config-CnFnzh7Q.js";
2
2
  import { c as DuplicateAuthUserError, f as LimitExceededError, n as AuthUserNotFoundError, r as AuthUserRecordExistsError } from "../errors-U3TsyWVq.js";
3
- import { i as TypedEavRecord, n as createReoptEavClient, r as EntityClient, t as ReoptEavClient } from "../client-C6OXGMMV.js";
3
+ import { i as TypedEavRecord, n as createReoptEavClient, r as EntityClient, t as ReoptEavClient } from "../client-C2W4RAZV.js";
4
4
  //#region src/eav/verify.d.ts
5
5
  /**
6
6
  * Runtime drift check between a deployed bundle and the live server schema
package/dist/eav/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { c as AuthUserNotFoundError, g as LimitExceededError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError } from "../config-BeOelISH.js";
2
- import { i as RECORDS_PAGE_LIMIT_MAX, n as ATTRIBUTE_FILTER_LIST_MAX, r as ATTRIBUTE_FILTER_OPERATORS, t as createReoptEavClient } from "../client-tJq0U_jn.js";
1
+ import { c as AuthUserNotFoundError, g as LimitExceededError, l as AuthUserRecordExistsError, m as DuplicateAuthUserError } from "../config-Dy2oBn1a.js";
2
+ import { i as RECORDS_PAGE_LIMIT_MAX, n as ATTRIBUTE_FILTER_LIST_MAX, r as ATTRIBUTE_FILTER_OPERATORS, t as createReoptEavClient } from "../client-BJQzInqD.js";
3
3
 
4
4
  //#region src/eav/verify.ts
5
5
  async function verifyEavSchema(input) {
@@ -1,5 +1,5 @@
1
- import { o as AttributeDef, s as EntityDef } from "../config-D3SblxWt.js";
2
- import { t as ReoptEavClient } from "../client-C6OXGMMV.js";
1
+ import { o as AttributeDef, s as EntityDef } from "../config-CnFnzh7Q.js";
2
+ import { t as ReoptEavClient } from "../client-C2W4RAZV.js";
3
3
  //#region src/eav/migrate/types.d.ts
4
4
  /**
5
5
  * Subset of `ReoptEavClient.records` exposed inside a migration's `up`/`down`.
@@ -1,5 +1,5 @@
1
- import { C as EavAttribute, E as EavEntity, T as EavDataType, c as InferValues, l as SchemaDef, o as AttributeDef, s as EntityDef } from "../config-D3SblxWt.js";
2
- import { t as ReoptEavClient } from "../client-C6OXGMMV.js";
1
+ import { C as EavAttribute, E as EavEntity, T as EavDataType, c as InferValues, l as SchemaDef, o as AttributeDef, s as EntityDef } from "../config-CnFnzh7Q.js";
2
+ import { t as ReoptEavClient } from "../client-C2W4RAZV.js";
3
3
  //#region src/eav/schema/define.d.ts
4
4
  declare function defineEntity<const A extends Record<string, AttributeDef>>(def: EntityDef<A>): EntityDef<A>;
5
5
  declare function defineSchema<const E extends Record<string, EntityDef>>(def: SchemaDef<E>): SchemaDef<E>;
@@ -1,2 +1,2 @@
1
- import { a as CreateFeedbackResult, c as FeedbackListMeta, d as FeedbackReplyAuthor, f as FeedbackStatus, i as CreateFeedbackReplyResult, l as FeedbackListResult, m as RateFeedbackReplyResult, n as createReoptFeedbackClient, o as Feedback, p as ListFeedbackQuery, r as CreateFeedbackInput, s as FeedbackDetail, t as ReoptFeedbackClient, u as FeedbackReply } from "../client-COKDtHO9.js";
1
+ import { a as CreateFeedbackResult, c as FeedbackListMeta, d as FeedbackReplyAuthor, f as FeedbackStatus, i as CreateFeedbackReplyResult, l as FeedbackListResult, m as RateFeedbackReplyResult, n as createReoptFeedbackClient, o as Feedback, p as ListFeedbackQuery, r as CreateFeedbackInput, s as FeedbackDetail, t as ReoptFeedbackClient, u as FeedbackReply } from "../client-MDNS9Ubf.js";
2
2
  export { type CreateFeedbackInput, type CreateFeedbackReplyResult, type CreateFeedbackResult, type Feedback, type FeedbackDetail, type FeedbackListMeta, type FeedbackListResult, type FeedbackReply, type FeedbackReplyAuthor, type FeedbackStatus, type ListFeedbackQuery, type RateFeedbackReplyResult, ReoptFeedbackClient, createReoptFeedbackClient };
@@ -1,3 +1,3 @@
1
- import { n as createReoptFeedbackClient, t as ReoptFeedbackClient } from "../client-Ce0gs5Ma.js";
1
+ import { n as createReoptFeedbackClient, t as ReoptFeedbackClient } from "../client-CLZie3Ym.js";
2
2
 
3
3
  export { ReoptFeedbackClient, createReoptFeedbackClient };
@@ -1,4 +1,4 @@
1
- import { a as FileListQuery, c as FolderInfo, d as UpdateFolderInput, f as UploadOptions, i as FileInfo, l as FolderListQuery, n as createReoptFileClient, o as FileListResponse, r as CreateFolderInput, s as FileUsageInfo, t as ReoptFileClient, u as UpdateFileInput } from "../client-CniCGdmi.js";
1
+ import { a as FileListQuery, c as FolderInfo, d as UpdateFolderInput, f as UploadOptions, i as FileInfo, l as FolderListQuery, n as createReoptFileClient, o as FileListResponse, r as CreateFolderInput, s as FileUsageInfo, t as ReoptFileClient, u as UpdateFileInput } from "../client-xblzWFAL.js";
2
2
  //#region src/files/helpers.d.ts
3
3
  /**
4
4
  * 이미지 URL 헬퍼 — Next.js `<Image>`와 결합해 사용.
@@ -1,4 +1,4 @@
1
- import { n as createReoptFileClient, t as ReoptFileClient } from "../client-DjLhTNsZ.js";
1
+ import { n as createReoptFileClient, t as ReoptFileClient } from "../client-Bf8mW6uO.js";
2
2
 
3
3
  //#region src/files/helpers.ts
4
4
  const REOPT_IMAGE_REMOTE_PATTERNS = [{
@@ -1,4 +1,4 @@
1
- import { S as ReoptSDKError, a as resolveIdBaseUrl, i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, w as ServerError, x as RateLimitError } from "./config-BeOelISH.js";
1
+ import { S as ReoptSDKError, a as resolveIdBaseUrl, i as resolveBaseUrl, j as mapHttpStatusToError, n as SDK_VERSION, o as validateConfig, w as ServerError, x as RateLimitError } from "./config-Dy2oBn1a.js";
2
2
  import { t as createAuthHeader } from "./encoding-Bwfm3iaE.js";
3
3
 
4
4
  //#region src/core/debug.ts
@@ -220,6 +220,8 @@ function parseErrorBody(errorBody) {
220
220
  var BaseHttpClient = class {
221
221
  baseUrl;
222
222
  authHeader;
223
+ /** RFC-0034 — 요청별 인증 헤더 제공자(기계 클라이언트 DPoP). 있으면 정적 Basic/Bearer 대신 쓴다. */
224
+ authorization;
223
225
  timeout;
224
226
  maxRetries;
225
227
  retryNonIdempotent;
@@ -229,6 +231,7 @@ var BaseHttpClient = class {
229
231
  const base = options?.useIdServer ? resolveIdBaseUrl(config) : resolveBaseUrl(config);
230
232
  this.baseUrl = base + pathPrefix;
231
233
  this.authHeader = createAuthHeader(config);
234
+ this.authorization = config.authorization;
232
235
  this.timeout = config.timeout ?? DEFAULT_TIMEOUT;
233
236
  this.maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES;
234
237
  this.retryNonIdempotent = config.retryNonIdempotent ?? false;
@@ -275,7 +278,10 @@ var BaseHttpClient = class {
275
278
  else externalSignal.addEventListener("abort", onExternalAbort, { once: true });
276
279
  try {
277
280
  const headers = {
278
- Authorization: options?.bearerToken ? `Bearer ${options.bearerToken}` : this.authHeader,
281
+ ...(!options?.bearerToken && this.authorization ? await this.authorization({
282
+ method,
283
+ url
284
+ }) : null) ?? { Authorization: options?.bearerToken ? `Bearer ${options.bearerToken}` : this.authHeader },
279
285
  "X-SDK-Version": `brandapp-sdk/${SDK_VERSION}`,
280
286
  "X-SDK-Runtime": RUNTIME,
281
287
  "X-Request-Id": requestId
@@ -383,4 +389,4 @@ function parseFieldErrors(body) {
383
389
 
384
390
  //#endregion
385
391
  export { parseFieldErrors as n, BaseHttpClient as t };
386
- //# sourceMappingURL=http-client-Bl8u1vHN.js.map
392
+ //# sourceMappingURL=http-client-CW9wXANY.js.map
@@ -1,14 +1,14 @@
1
- import { l as SchemaDef, n as ReoptSDKConfig } from "./config-D3SblxWt.js";
2
- import { t as ReoptAiClient } from "./client-D1AFtJRw.js";
3
- import { t as ReoptAnalyticsClient } from "./client-7I-mz3Dw.js";
4
- import { t as ReoptAuthClient } from "./client-Bfutv3LK.js";
5
- import { t as ReoptCmsClient } from "./client-Dmvtr1nS.js";
6
- import { t as ReoptEavClient } from "./client-C6OXGMMV.js";
7
- import { t as ReoptFeedbackClient } from "./client-COKDtHO9.js";
8
- import { t as ReoptFileClient } from "./client-CniCGdmi.js";
9
- import { t as ReoptPlansClient } from "./client-IUSZDJio.js";
10
- import { t as ReoptPushClient } from "./client-BSW0Ncjj.js";
11
- import { t as ReoptTermsClient } from "./client-yKeRJnIB.js";
1
+ import { l as SchemaDef, n as ReoptSDKConfig } from "./config-CnFnzh7Q.js";
2
+ import { t as ReoptAiClient } from "./client-Cnq_X3Wp.js";
3
+ import { t as ReoptAnalyticsClient } from "./client-C6lx3RUQ.js";
4
+ import { t as ReoptAuthClient } from "./client-Cod87ThY.js";
5
+ import { t as ReoptCmsClient } from "./client-DfnaH99z.js";
6
+ import { t as ReoptEavClient } from "./client-C2W4RAZV.js";
7
+ import { t as ReoptFeedbackClient } from "./client-MDNS9Ubf.js";
8
+ import { t as ReoptFileClient } from "./client-xblzWFAL.js";
9
+ import { t as ReoptPlansClient } from "./client-BQJepjoD.js";
10
+ import { t as ReoptPushClient } from "./client-CsWSxMhB.js";
11
+ import { t as ReoptTermsClient } from "./client-CSl3o0s3.js";
12
12
  //#region src/core/http-client.d.ts
13
13
  type FetchOptions = {
14
14
  /** Abort the request via an external AbortSignal (merged with timeout signal). */
@@ -43,6 +43,8 @@ type BaseHttpClientOptions = {
43
43
  declare class BaseHttpClient {
44
44
  private readonly baseUrl;
45
45
  private readonly authHeader;
46
+ /** RFC-0034 — 요청별 인증 헤더 제공자(기계 클라이언트 DPoP). 있으면 정적 Basic/Bearer 대신 쓴다. */
47
+ private readonly authorization;
46
48
  private readonly timeout;
47
49
  private readonly maxRetries;
48
50
  private readonly retryNonIdempotent;
@@ -168,4 +170,4 @@ type ReoptSDK<S extends SchemaDef = SchemaDef> = {
168
170
  declare function createReoptSDK<S extends SchemaDef = SchemaDef>(config: ReoptSDKConfig<S>): ReoptSDK<S>;
169
171
  //#endregion
170
172
  export { initReoptSDK as a, getReoptSDK as i, createReoptSDK as n, resetSDK as o, createLazySDK as r, BaseHttpClient as s, ReoptSDK as t };
171
- //# sourceMappingURL=index-BnAYxnwq.d.ts.map
173
+ //# sourceMappingURL=index-Bkci7euU.d.ts.map
@@ -292,7 +292,7 @@ declare function markdownToEditorSpecMany(markdowns: string[]): Promise<EditorSp
292
292
  //#endregion
293
293
  //#region src/dev/index.d.ts
294
294
  type ProxyConfig = {
295
- /** Remote Reopt server URL (e.g. "https://brand.reopt.de:3443") */
295
+ /** Remote Reopt server URL (e.g. "https://brand.local.reopt.io") */
296
296
  remoteUrl: string;
297
297
  /** Remote OAuth credentials */
298
298
  remoteCredentials: {
@@ -473,4 +473,4 @@ type DevServer = {
473
473
  declare function createDevServer(options?: DevServerOptions): Promise<DevServer>;
474
474
  //#endregion
475
475
  export { DevPost as _, SeedAllInput as a, InMemoryStore as b, SeedPostGroupInput as c, SeedTermsItem as d, createDevServer as f, DevEntity as g, DevAttribute as h, ProxyConfig as i, SeedPostInput as l, markdownToEditorSpecMany as m, DevServer as n, SeedData as o, markdownToEditorSpec as p, DevServerOptions as r, SeedOptions as s, DevSchema as t, SeedRecordInput as u, DevPostGroup as v, StoreSnapshot as x, DevRecord as y };
476
- //# sourceMappingURL=index-C6fyJTud.d.ts.map
476
+ //# sourceMappingURL=index-Dh8XMVFF.d.ts.map
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-D3SblxWt.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-D1AFtJRw.js";
1
+ import { a as DebugLogger, i as DebugLevel, n as ReoptSDKConfig, r as resolveBaseUrl, t as REOPT_BASE_URLS } from "./config-CnFnzh7Q.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-Cnq_X3Wp.js";
3
3
  import { C as isCreditLimitError, D as isValidationError, E as isRequiredTermsError, O as mapHttpStatusToError, S as ValidationError, T as isReoptSDKError, _ as RateLimitError, a as ConflictError, b as RequiredTermsError, c as DuplicateAuthUserError, d as ForbiddenError, f as LimitExceededError, g as PreconditionFailedError, 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 ReoptSDKError, w as isModelAccessError, x as ServerError, y as ReoptSDKErrorContext } from "./errors-U3TsyWVq.js";
4
- import { i as TypedEavRecord, r as EntityClient } from "./client-C6OXGMMV.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-BnAYxnwq.js";
4
+ import { i as TypedEavRecord, r as EntityClient } from "./client-C2W4RAZV.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-Bkci7euU.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, PreconditionFailedError, 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,15 +1,15 @@
1
- import { A as isValidationError, C as RequiredTermsError, D as isModelAccessError, E as isCreditLimitError, O as isReoptSDKError, S as ReoptSDKError, T as ValidationError, _ as ModelAccessError, b as PreconditionFailedError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, j as mapHttpStatusToError, k as isRequiredTermsError, 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 ServerError, x as RateLimitError, y as NotFoundError } from "./config-BeOelISH.js";
2
- import { t as BaseHttpClient } from "./http-client-Bl8u1vHN.js";
3
- import { n as createReoptAiClient } from "./client-C2xE9HGZ.js";
4
- import { n as createReoptAuthClient } from "./client-eDd4aWDs.js";
5
- import { t as createReoptCmsClient } from "./client-FM6_YJbr.js";
6
- import { t as createReoptEavClient } from "./client-tJq0U_jn.js";
7
- import { n as createReoptFeedbackClient } from "./client-Ce0gs5Ma.js";
8
- import { n as createReoptFileClient } from "./client-DjLhTNsZ.js";
9
- import { n as createReoptAnalyticsClient } from "./client-BzAgabAs.js";
10
- import { n as createReoptPlansClient } from "./client-CI2Y00Qx.js";
11
- import { n as createReoptPushClient } from "./client-DeC127BD.js";
12
- import { n as createReoptTermsClient } from "./client-DCqp0Bis.js";
1
+ import { A as isValidationError, C as RequiredTermsError, D as isModelAccessError, E as isCreditLimitError, O as isReoptSDKError, S as ReoptSDKError, T as ValidationError, _ as ModelAccessError, b as PreconditionFailedError, c as AuthUserNotFoundError, d as ConflictError, f as ContentFilterError, g as LimitExceededError, h as ForbiddenError, i as resolveBaseUrl, j as mapHttpStatusToError, k as isRequiredTermsError, 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 ServerError, x as RateLimitError, y as NotFoundError } from "./config-Dy2oBn1a.js";
2
+ import { t as BaseHttpClient } from "./http-client-CW9wXANY.js";
3
+ import { n as createReoptAiClient } from "./client-BZ8-vFjk.js";
4
+ import { n as createReoptAuthClient } from "./client-CslasnqK.js";
5
+ import { t as createReoptCmsClient } from "./client-DGKq4Ml5.js";
6
+ import { t as createReoptEavClient } from "./client-BJQzInqD.js";
7
+ import { n as createReoptFeedbackClient } from "./client-CLZie3Ym.js";
8
+ import { n as createReoptFileClient } from "./client-Bf8mW6uO.js";
9
+ import { n as createReoptAnalyticsClient } from "./client-Db6Etco9.js";
10
+ import { n as createReoptPlansClient } from "./client-BFl6cDAE.js";
11
+ import { n as createReoptPushClient } from "./client-_2Avom0q.js";
12
+ import { n as createReoptTermsClient } from "./client-VKEJtLH0.js";
13
13
 
14
14
  //#region src/singleton.ts
15
15
  let _instance;
@@ -0,0 +1,44 @@
1
+ import * as jose from "jose";
2
+ //#region src/machine/keys.d.ts
3
+ declare const DEFAULT_CLIENT_KEY_ALGORITHM: "EdDSA";
4
+ type ClientKeyAlgorithm = "EdDSA" | "ES256" | "RS256";
5
+ type ClientPrivateJwk = jose.JWK & {
6
+ kid: string;
7
+ alg: ClientKeyAlgorithm;
8
+ };
9
+ type ClientPublicJwk = Omit<ClientPrivateJwk, "d" | "p" | "q" | "dp" | "dq" | "qi" | "oth">;
10
+ /** 새 키쌍 — 개인키 JWK(kid·alg 포함)와 공개키 JWK. 개인키는 env로만 가고 로그에 찍지 않는다. */
11
+ declare function generateClientKeyPair(options?: {
12
+ algorithm?: ClientKeyAlgorithm;
13
+ }): Promise<{
14
+ privateKeyJwk: ClientPrivateJwk;
15
+ publicKeyJwk: ClientPublicJwk;
16
+ kid: string;
17
+ }>;
18
+ /** 개인키 JWK에서 공개키만 — JWKS 응답·DPoP 증명 헤더(`jwk`)에 싣는 값. */
19
+ declare function toPublicJwk(privateKeyJwk: ClientPrivateJwk): ClientPublicJwk;
20
+ /** JSON 문자열(env 값)을 개인키 JWK로 — 모양이 틀리면 **어디가** 틀렸는지 말하고 값은 절대 되풀이하지 않는다. */
21
+ declare function parseClientPrivateJwk(raw: string, envName?: string): ClientPrivateJwk;
22
+ type ClientKeyRing = {
23
+ /** 서명에 쓰는 키 — NEXT가 있으면 NEXT(회전 ①). */
24
+ signing: ClientPrivateJwk;
25
+ /** JWKS에 실을 키 전부(현재 + NEXT). */
26
+ published: ClientPrivateJwk[];
27
+ };
28
+ /**
29
+ * env에서 키 링을 읽는다 — `REOPT_CLIENT_PRIVATE_KEY_JWK`(필수) + `REOPT_CLIENT_PRIVATE_KEY_JWK_NEXT`(회전 중에만).
30
+ * 없으면 null(호출자가 "설정 안 됨"을 fail-closed로 다룬다).
31
+ */
32
+ declare function readClientKeyRing(env?: Record<string, string | undefined>, names?: {
33
+ current?: string;
34
+ next?: string;
35
+ }): ClientKeyRing | null;
36
+ /** `/.well-known/reopt-client-jwks.json` 응답 본문 — 공개키만. */
37
+ declare function buildClientJwks(keys: readonly ClientPrivateJwk[]): {
38
+ keys: ClientPublicJwk[];
39
+ };
40
+ /** JWKS 응답의 정본 경로 — 리옵트에 등록하는 `jwksUri`는 `${origin}${CLIENT_JWKS_PATH}`다. */
41
+ declare const CLIENT_JWKS_PATH = "/.well-known/reopt-client-jwks.json";
42
+ //#endregion
43
+ export { ClientPublicJwk as a, generateClientKeyPair as c, toPublicJwk as d, ClientPrivateJwk as i, parseClientPrivateJwk as l, ClientKeyAlgorithm as n, DEFAULT_CLIENT_KEY_ALGORITHM as o, ClientKeyRing as r, buildClientJwks as s, CLIENT_JWKS_PATH as t, readClientKeyRing as u };
44
+ //# sourceMappingURL=keys-B2pA8EkU.d.ts.map