@reopt-ai/brandapp-sdk 3.0.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.
Files changed (76) hide show
  1. package/CHANGELOG.md +574 -0
  2. package/LICENSE +21 -0
  3. package/README.md +468 -0
  4. package/dist/ai/index.d.ts +314 -0
  5. package/dist/ai/index.js +7 -0
  6. package/dist/ai-provider/index.d.ts +196 -0
  7. package/dist/ai-provider/index.js +703 -0
  8. package/dist/auth/index.d.ts +76 -0
  9. package/dist/auth/index.js +40 -0
  10. package/dist/better-auth/client.d.ts +29 -0
  11. package/dist/better-auth/client.js +10 -0
  12. package/dist/better-auth/index.d.ts +82 -0
  13. package/dist/better-auth/index.js +145 -0
  14. package/dist/chunk-6FLYVNZI.js +32 -0
  15. package/dist/chunk-6KPKZ7ZB.js +49 -0
  16. package/dist/chunk-DI6QJPTQ.js +449 -0
  17. package/dist/chunk-E457LO5A.js +599 -0
  18. package/dist/chunk-F7BXBTZI.js +54 -0
  19. package/dist/chunk-J5Y2GSJF.js +443 -0
  20. package/dist/chunk-K3YVJE6E.js +96 -0
  21. package/dist/chunk-KU2LN5SE.js +350 -0
  22. package/dist/chunk-L4DHB36G.js +75 -0
  23. package/dist/chunk-PJZB4VP7.js +63 -0
  24. package/dist/chunk-REIKXSMY.js +7 -0
  25. package/dist/chunk-T2WXHAAC.js +54 -0
  26. package/dist/chunk-TUKIYH4Q.js +112 -0
  27. package/dist/chunk-WSEROZVO.js +81 -0
  28. package/dist/chunk-YRGLBM6V.js +157 -0
  29. package/dist/client-BkcO-0C2.d.ts +216 -0
  30. package/dist/client-CN5_tNOC.d.ts +147 -0
  31. package/dist/client-DttyeM_h.d.ts +102 -0
  32. package/dist/cms/index.d.ts +137 -0
  33. package/dist/cms/index.js +101 -0
  34. package/dist/config-CtxyJsDR.d.ts +397 -0
  35. package/dist/dev/index.d.ts +509 -0
  36. package/dist/dev/index.js +3071 -0
  37. package/dist/eav/coerce.d.ts +42 -0
  38. package/dist/eav/coerce.js +65 -0
  39. package/dist/eav/index.d.ts +214 -0
  40. package/dist/eav/index.js +147 -0
  41. package/dist/eav/migrate.d.ts +236 -0
  42. package/dist/eav/migrate.js +219 -0
  43. package/dist/eav/schema.d.ts +260 -0
  44. package/dist/eav/schema.js +656 -0
  45. package/dist/errors-5hd5ZR-M.d.ts +158 -0
  46. package/dist/feedback/index.d.ts +132 -0
  47. package/dist/feedback/index.js +5 -0
  48. package/dist/files/index.d.ts +54 -0
  49. package/dist/files/index.js +31 -0
  50. package/dist/index.d.ts +221 -0
  51. package/dist/index.js +84 -0
  52. package/dist/plans/index.d.ts +140 -0
  53. package/dist/plans/index.js +5 -0
  54. package/dist/push/index.d.ts +79 -0
  55. package/dist/push/index.js +5 -0
  56. package/dist/react/hooks.d.ts +376 -0
  57. package/dist/react/hooks.js +421 -0
  58. package/dist/terms/index.d.ts +79 -0
  59. package/dist/terms/index.js +5 -0
  60. package/dist/testing/index.d.ts +154 -0
  61. package/dist/testing/index.js +81 -0
  62. package/dist/typed-client-BxOVIiMU.d.ts +40 -0
  63. package/dist/types-6E3ZLL9X.d.ts +24 -0
  64. package/dist/types-DskYLVb8.d.ts +104 -0
  65. package/dist/types-ckmDDW3N.d.ts +129 -0
  66. package/dist/webhooks/index.d.ts +140 -0
  67. package/dist/webhooks/index.js +142 -0
  68. package/docs/api-reference.md +557 -0
  69. package/docs/cms.md +318 -0
  70. package/docs/dev-server.md +164 -0
  71. package/docs/environment.md +211 -0
  72. package/docs/errors.md +290 -0
  73. package/docs/files.md +272 -0
  74. package/docs/migration.md +315 -0
  75. package/docs/testing.md +163 -0
  76. package/package.json +173 -0
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Type coercion utilities for EAV record values.
3
+ *
4
+ * Useful when working with the untyped `Record<string, unknown>` values
5
+ * from EavRecord. Each function returns `undefined` for null/undefined input.
6
+ */
7
+ /** Coerce a value to string. Returns undefined for null/undefined. */
8
+ declare function asString(value: unknown): string | undefined;
9
+ /** Coerce a value to number. Returns undefined for null/undefined/NaN. */
10
+ declare function asNumber(value: unknown): number | undefined;
11
+ /** Coerce a value to boolean. Returns undefined for null/undefined. */
12
+ declare function asBoolean(value: unknown): boolean | undefined;
13
+ /** Coerce a value to Date. Returns undefined for null/undefined/invalid. */
14
+ declare function asDate(value: unknown): Date | undefined;
15
+ /** Parse a JSON string or return the value if already an object. Returns undefined for null/undefined. */
16
+ declare function asJson<T = unknown>(value: unknown): T | undefined;
17
+ /** Coerce a value to string array. Returns undefined for null/undefined. */
18
+ declare function asStringArray(value: unknown): string[] | undefined;
19
+ /**
20
+ * Coerce a value to a specific enum type.
21
+ * Returns the fallback if the value is not in the allowed set.
22
+ *
23
+ * @example
24
+ * ```ts
25
+ * const status = asEnum(record.values.status, ['active', 'inactive'] as const, 'active');
26
+ * // status: "active" | "inactive"
27
+ * ```
28
+ */
29
+ declare function asEnum<T extends string>(value: unknown, allowed: readonly T[], fallback: T): T;
30
+ /**
31
+ * Coerce a value to an optional enum type.
32
+ * Returns undefined if null/undefined, the value if valid, otherwise undefined.
33
+ *
34
+ * @example
35
+ * ```ts
36
+ * const role = asEnumOrUndefined(record.values.role, ['admin', 'member', 'guest'] as const);
37
+ * // role: "admin" | "member" | "guest" | undefined
38
+ * ```
39
+ */
40
+ declare function asEnumOrUndefined<T extends string>(value: unknown, allowed: readonly T[]): T | undefined;
41
+
42
+ export { asBoolean, asDate, asEnum, asEnumOrUndefined, asJson, asNumber, asString, asStringArray };
@@ -0,0 +1,65 @@
1
+ // src/eav/coerce.ts
2
+ function asString(value) {
3
+ if (value == null) return void 0;
4
+ return String(value);
5
+ }
6
+ function asNumber(value) {
7
+ if (value == null) return void 0;
8
+ const n = Number(value);
9
+ return Number.isNaN(n) ? void 0 : n;
10
+ }
11
+ function asBoolean(value) {
12
+ if (value == null) return void 0;
13
+ if (typeof value === "boolean") return value;
14
+ if (typeof value === "string") {
15
+ if (value === "true" || value === "1") return true;
16
+ if (value === "false" || value === "0") return false;
17
+ }
18
+ if (typeof value === "number") return value !== 0;
19
+ return void 0;
20
+ }
21
+ function asDate(value) {
22
+ if (value == null) return void 0;
23
+ if (value instanceof Date) return value;
24
+ const d = new Date(value);
25
+ return Number.isNaN(d.getTime()) ? void 0 : d;
26
+ }
27
+ function asJson(value) {
28
+ if (value == null) return void 0;
29
+ if (typeof value === "object") return value;
30
+ if (typeof value === "string") {
31
+ try {
32
+ return JSON.parse(value);
33
+ } catch {
34
+ return void 0;
35
+ }
36
+ }
37
+ return void 0;
38
+ }
39
+ function asStringArray(value) {
40
+ if (value == null) return void 0;
41
+ if (Array.isArray(value)) return value.map(String);
42
+ if (typeof value === "string") {
43
+ try {
44
+ const parsed = JSON.parse(value);
45
+ if (Array.isArray(parsed)) return parsed.map(String);
46
+ } catch {
47
+ }
48
+ return [value];
49
+ }
50
+ return void 0;
51
+ }
52
+ function asEnum(value, allowed, fallback) {
53
+ if (value == null) return fallback;
54
+ const str = String(value);
55
+ return allowed.includes(str) ? str : fallback;
56
+ }
57
+ function asEnumOrUndefined(value, allowed) {
58
+ if (value == null) return void 0;
59
+ const str = String(value);
60
+ return allowed.includes(str) ? str : void 0;
61
+ }
62
+
63
+ export { asBoolean, asDate, asEnum, asEnumOrUndefined, asJson, asNumber, asString, asStringArray };
64
+ //# sourceMappingURL=coerce.js.map
65
+ //# sourceMappingURL=coerce.js.map
@@ -0,0 +1,214 @@
1
+ import { R as ReoptEavClient } from '../client-BkcO-0C2.js';
2
+ export { c as createReoptEavClient } from '../client-BkcO-0C2.js';
3
+ import { a as AttributeFilter } from '../config-CtxyJsDR.js';
4
+ export { b as AttributeFilterOperator, d as BulkUpdateItem, C as CountRecordsQuery, e as CreateAttributeInput, f as CreateEntityInput, g as CreateRecordInput, i as DeleteWhereInput, E as EavAttribute, j as EavAttributeOption, k as EavDataType, l as EavEntity, m as EavRecord, n as EavSchemaLinkedTo, o as EavValidation, L as ListRecordsQuery, P as PaginatedResponse, q as ReoptSDKConfig, U as UpdateAttributeInput, r as UpdateEntityInput, s as UpdateRecordInput, t as UpsertRecordInput, u as UpsertRecordResult } from '../config-CtxyJsDR.js';
5
+ export { E as EntityClient, T as TypedEavRecord } from '../typed-client-BxOVIiMU.js';
6
+ export { a as AuthUserNotFoundError, b as AuthUserRecordExistsError, D as DuplicateAuthUserError, L as LimitExceededError } from '../errors-5hd5ZR-M.js';
7
+
8
+ /**
9
+ * Runtime drift check between a deployed bundle and the live server schema
10
+ * (Phase C, RFC-0005).
11
+ *
12
+ * Typical usage in a consumer's `/api/health` route:
13
+ *
14
+ * ```ts
15
+ * import { createReoptEavClient, verifyEavSchema } from "@reopt-ai/brandapp-sdk/eav";
16
+ *
17
+ * const eav = createReoptEavClient({ ... });
18
+ * const localHash = process.env.NEXT_PUBLIC_BRANDAPP_EAV_HASH ?? "missing";
19
+ *
20
+ * export async function GET() {
21
+ * const result = await verifyEavSchema({ client: eav, localHash });
22
+ * return Response.json({ eav: result }, { status: result.ok ? 200 : 503 });
23
+ * }
24
+ * ```
25
+ *
26
+ * `localHash` is expected to be produced at build time from the same canonical
27
+ * algorithm the server uses (see `./hash.ts`'s `computeEavSchemaHash`). The
28
+ * caller is responsible for embedding it — typical patterns:
29
+ * - Next.js: write the hash into `NEXT_PUBLIC_BRANDAPP_EAV_HASH` during the build
30
+ * step so it's inlined into the client bundle.
31
+ * - Vercel / monorepo: a `prebuild` script computes it from `eav.schema.ts`
32
+ * and exports the env var.
33
+ *
34
+ * When the hashes diverge the result contains a one-line `drift` summary
35
+ * that's safe to log + a non-200 response from the health endpoint will
36
+ * be picked up by your monitoring.
37
+ */
38
+ type VerifyEavSchemaInput = {
39
+ /** SDK client that knows how to reach the server. */
40
+ client: Pick<ReoptEavClient, "schemaHash">;
41
+ /**
42
+ * Pre-computed local hash. Pass the same string the build step embedded,
43
+ * or `""` to surface a non-OK result that the operator can act on.
44
+ */
45
+ localHash: string;
46
+ };
47
+ type VerifyEavSchemaResult = {
48
+ /** True when local matches remote. */
49
+ ok: boolean;
50
+ localHash: string;
51
+ remoteHash: string;
52
+ /** One-line summary present only when `ok === false`. */
53
+ drift?: string;
54
+ /** Server fingerprint metadata — useful for dashboards. */
55
+ schemaCount: number;
56
+ fieldCount: number;
57
+ generatedAt: string;
58
+ };
59
+ declare function verifyEavSchema(input: VerifyEavSchemaInput): Promise<VerifyEavSchemaResult>;
60
+
61
+ /**
62
+ * Stable EAV schema fingerprinting (Phase C, RFC-0005).
63
+ *
64
+ * The hash is computed identically on both ends:
65
+ * - Server: takes Prisma `EavSchema` + `EavSchemaField` rows, maps them
66
+ * onto the canonical shape below, and SHA-256s the canonical JSON.
67
+ * - Consumer: builds the same canonical shape from `eav.schema.ts` at
68
+ * build time (or from the local lockfile) and SHA-256s it.
69
+ *
70
+ * A mismatch means the deployed code is expecting a different schema than
71
+ * the server currently has — typically a forgotten `eav migrate` or a hot
72
+ * patch on the wrong environment. Surface this as a 503 from `/health`
73
+ * and your monitoring catches it before users do.
74
+ *
75
+ * Why a freshly-stated canonical type rather than `defineSchema`'s output:
76
+ * - `defineSchema` carries TypeScript inference machinery that we don't
77
+ * want to ship over the wire.
78
+ * - The server side cannot import the schema definition (no DOM, no
79
+ * `as const` literal inference for record `options`).
80
+ * - Both sides agree on a small, JSON-serializable shape, and `JSON.stringify`
81
+ * over keys inserted in a fixed order gives a deterministic string under
82
+ * V8 / modern engines.
83
+ */
84
+ type CanonicalEavField = {
85
+ name: string;
86
+ label: string;
87
+ dataType: string;
88
+ isRequired: boolean;
89
+ isUnique: boolean;
90
+ defaultValue: string | null;
91
+ /** JSON-serialized validation rules, or `null` when unset. */
92
+ validation: string | null;
93
+ /** JSON-serialized options array, or `null` when unset. */
94
+ options: string | null;
95
+ sortOrder: number;
96
+ };
97
+ type CanonicalEavSchema = {
98
+ name: string;
99
+ description: string | null;
100
+ icon: string | null;
101
+ /** `"brandapp"` or `"brandappAuthUser"` — matches the server enum. */
102
+ linkedTo: string;
103
+ fields: CanonicalEavField[];
104
+ };
105
+ /**
106
+ * Sort entities by name and fields by `(sortOrder, name)`, then return the
107
+ * canonical JSON string. This is the *only* place ordering and field selection
108
+ * are decided — keep the rules in this file when extending.
109
+ */
110
+ declare function canonicalizeEavSchemas(schemas: CanonicalEavSchema[]): string;
111
+ /**
112
+ * SHA-256 of the canonical string. Uses Web Crypto so the same call works in
113
+ * Node 20+, browsers, and Vercel edge runtime without extra deps.
114
+ */
115
+ declare function hashCanonicalString(canonical: string): Promise<string>;
116
+ /** Convenience wrapper — canonicalize, then hash. */
117
+ declare function computeEavSchemaHash(schemas: CanonicalEavSchema[]): Promise<string>;
118
+
119
+ /**
120
+ * Collect all items from an async generator into an array.
121
+ *
122
+ * @example
123
+ * ```ts
124
+ * const allRecords = await collectAll(sdk.eav.records.listAll("entity-id"));
125
+ * ```
126
+ */
127
+ declare function collectAll<T>(gen: AsyncIterable<T>): Promise<T[]>;
128
+
129
+ /**
130
+ * 타입 안전 필터 빌더
131
+ *
132
+ * attribute ID를 직접 조회하지 않고 스키마에서 타입 안전하게 필터를 생성합니다.
133
+ *
134
+ * @example
135
+ * ```ts
136
+ * import { where } from "@reopt-ai/brandapp-sdk/eav";
137
+ *
138
+ * // 기본 사용 (attribute name 기반 — ID는 런타임 해석)
139
+ * const filters = [
140
+ * where("status").eq("active"),
141
+ * where("age").gte(18),
142
+ * where("email").isNotNull(),
143
+ * ];
144
+ *
145
+ * // 스키마 기반 타입 안전 사용
146
+ * import { createFilterBuilder } from "@reopt-ai/brandapp-sdk/eav";
147
+ * const w = createFilterBuilder(ATTRIBUTE_IDS.contacts);
148
+ * const filters = [
149
+ * w("status").eq("active"), // attribute ID 자동 매핑
150
+ * w("email").contains("@"),
151
+ * ];
152
+ *
153
+ * // SDK에서 사용
154
+ * const records = await sdk.eav.records.list(entityId, { filters });
155
+ * ```
156
+ */
157
+
158
+ declare class FilterExpression {
159
+ private readonly attributeId;
160
+ constructor(attributeId: string);
161
+ private make;
162
+ /** 값이 같은 레코드 */
163
+ eq(value: unknown): AttributeFilter;
164
+ /** 값이 다른 레코드 */
165
+ neq(value: unknown): AttributeFilter;
166
+ /** 값에 문자열을 포함하는 레코드 */
167
+ contains(value: string): AttributeFilter;
168
+ /** 값이 큰 레코드 (숫자) */
169
+ gt(value: number): AttributeFilter;
170
+ /** 값이 작은 레코드 (숫자) */
171
+ lt(value: number): AttributeFilter;
172
+ /** 값이 크거나 같은 레코드 (숫자) */
173
+ gte(value: number): AttributeFilter;
174
+ /** 값이 작거나 같은 레코드 (숫자) */
175
+ lte(value: number): AttributeFilter;
176
+ /** 값이 null인 레코드 */
177
+ isNull(): AttributeFilter;
178
+ /** 값이 null이 아닌 레코드 */
179
+ isNotNull(): AttributeFilter;
180
+ /** 날짜 이후 레코드 */
181
+ after(value: string | Date): AttributeFilter;
182
+ /** 날짜 이전 레코드 */
183
+ before(value: string | Date): AttributeFilter;
184
+ }
185
+ /**
186
+ * 필터 표현식 생성 — attribute name을 ID로 직접 사용
187
+ *
188
+ * @example
189
+ * ```ts
190
+ * where("status").eq("active")
191
+ * where("age").gte(18)
192
+ * where("deletedAt").isNull()
193
+ * ```
194
+ */
195
+ declare function where(attributeNameOrId: string): FilterExpression;
196
+ /**
197
+ * 스키마에서 생성된 ATTRIBUTE_IDS 맵 기반의 타입 안전 필터 빌더
198
+ *
199
+ * @example
200
+ * ```ts
201
+ * // lib/generated/eav.ts에서 생성된 상수
202
+ * const ATTRIBUTE_IDS = {
203
+ * contacts: { name: "attr-uuid-1", email: "attr-uuid-2", status: "attr-uuid-3" }
204
+ * };
205
+ *
206
+ * const w = createFilterBuilder(ATTRIBUTE_IDS.contacts);
207
+ * w("status").eq("active") // attributeId: "attr-uuid-3"
208
+ * w("email").contains("@") // attributeId: "attr-uuid-2"
209
+ * w("unknown") // TypeScript 에러!
210
+ * ```
211
+ */
212
+ declare function createFilterBuilder<T extends Record<string, string>>(attributeIdMap: T): (name: keyof T & string) => FilterExpression;
213
+
214
+ export { AttributeFilter, type CanonicalEavField, type CanonicalEavSchema, FilterExpression, ReoptEavClient, type VerifyEavSchemaInput, type VerifyEavSchemaResult, canonicalizeEavSchemas, collectAll, computeEavSchemaHash, createFilterBuilder, hashCanonicalString, verifyEavSchema, where };
@@ -0,0 +1,147 @@
1
+ export { createReoptEavClient } from '../chunk-E457LO5A.js';
2
+ import '../chunk-6FLYVNZI.js';
3
+ import '../chunk-DI6QJPTQ.js';
4
+ export { AuthUserNotFoundError, AuthUserRecordExistsError, DuplicateAuthUserError, LimitExceededError } from '../chunk-J5Y2GSJF.js';
5
+
6
+ // src/eav/verify.ts
7
+ async function verifyEavSchema(input) {
8
+ const remote = await input.client.schemaHash();
9
+ const ok = remote.hash === input.localHash && input.localHash.length > 0;
10
+ return {
11
+ ok,
12
+ localHash: input.localHash,
13
+ remoteHash: remote.hash,
14
+ schemaCount: remote.schemaCount,
15
+ fieldCount: remote.fieldCount,
16
+ generatedAt: remote.generatedAt,
17
+ ...ok ? {} : {
18
+ drift: !input.localHash ? `EAV health check could not run: localHash is empty. Set NEXT_PUBLIC_BRANDAPP_EAV_HASH (or your build's equivalent) so this route has something to compare.` : `EAV schema drift detected: local ${input.localHash.slice(0, 12)}... \u2260 server ${remote.hash.slice(0, 12)}... Re-deploy after running pending migrations.`
19
+ }
20
+ };
21
+ }
22
+
23
+ // src/eav/hash.ts
24
+ function canonicalizeEavSchemas(schemas) {
25
+ const sortedSchemas = schemas.slice().sort((a, b) => a.name.localeCompare(b.name)).map((s) => ({
26
+ name: s.name,
27
+ description: s.description ?? null,
28
+ icon: s.icon ?? null,
29
+ linkedTo: s.linkedTo,
30
+ fields: s.fields.slice().sort((a, b) => {
31
+ if (a.sortOrder !== b.sortOrder) return a.sortOrder - b.sortOrder;
32
+ return a.name.localeCompare(b.name);
33
+ }).map((f) => ({
34
+ name: f.name,
35
+ label: f.label,
36
+ dataType: f.dataType,
37
+ isRequired: f.isRequired,
38
+ isUnique: f.isUnique,
39
+ defaultValue: f.defaultValue ?? null,
40
+ validation: f.validation ?? null,
41
+ options: f.options ?? null,
42
+ sortOrder: f.sortOrder
43
+ }))
44
+ }));
45
+ return JSON.stringify(sortedSchemas);
46
+ }
47
+ async function hashCanonicalString(canonical) {
48
+ const data = new TextEncoder().encode(canonical);
49
+ const buf = await globalThis.crypto.subtle.digest("SHA-256", data);
50
+ const bytes = new Uint8Array(buf);
51
+ let hex = "";
52
+ for (let i = 0; i < bytes.length; i++) {
53
+ hex += bytes[i].toString(16).padStart(2, "0");
54
+ }
55
+ return hex;
56
+ }
57
+ async function computeEavSchemaHash(schemas) {
58
+ return hashCanonicalString(canonicalizeEavSchemas(schemas));
59
+ }
60
+
61
+ // src/eav/helpers.ts
62
+ async function collectAll(gen) {
63
+ const items = [];
64
+ for await (const item of gen) {
65
+ items.push(item);
66
+ }
67
+ return items;
68
+ }
69
+
70
+ // src/eav/filter-builder.ts
71
+ var FilterExpression = class {
72
+ constructor(attributeId) {
73
+ this.attributeId = attributeId;
74
+ }
75
+ attributeId;
76
+ make(operator, value) {
77
+ return { attributeId: this.attributeId, operator, value };
78
+ }
79
+ /** 값이 같은 레코드 */
80
+ eq(value) {
81
+ return this.make("eq", value);
82
+ }
83
+ /** 값이 다른 레코드 */
84
+ neq(value) {
85
+ return this.make("neq", value);
86
+ }
87
+ /** 값에 문자열을 포함하는 레코드 */
88
+ contains(value) {
89
+ return this.make("contains", value);
90
+ }
91
+ /** 값이 큰 레코드 (숫자) */
92
+ gt(value) {
93
+ return this.make("gt", value);
94
+ }
95
+ /** 값이 작은 레코드 (숫자) */
96
+ lt(value) {
97
+ return this.make("lt", value);
98
+ }
99
+ /** 값이 크거나 같은 레코드 (숫자) */
100
+ gte(value) {
101
+ return this.make("gte", value);
102
+ }
103
+ /** 값이 작거나 같은 레코드 (숫자) */
104
+ lte(value) {
105
+ return this.make("lte", value);
106
+ }
107
+ /** 값이 null인 레코드 */
108
+ isNull() {
109
+ return this.make("is_null");
110
+ }
111
+ /** 값이 null이 아닌 레코드 */
112
+ isNotNull() {
113
+ return this.make("is_not_null");
114
+ }
115
+ /** 날짜 이후 레코드 */
116
+ after(value) {
117
+ return this.make(
118
+ "after",
119
+ value instanceof Date ? value.toISOString() : value
120
+ );
121
+ }
122
+ /** 날짜 이전 레코드 */
123
+ before(value) {
124
+ return this.make(
125
+ "before",
126
+ value instanceof Date ? value.toISOString() : value
127
+ );
128
+ }
129
+ };
130
+ function where(attributeNameOrId) {
131
+ return new FilterExpression(attributeNameOrId);
132
+ }
133
+ function createFilterBuilder(attributeIdMap) {
134
+ return (name) => {
135
+ const id = attributeIdMap[name];
136
+ if (!id) {
137
+ throw new Error(
138
+ `Unknown attribute: "${name}". Available: ${Object.keys(attributeIdMap).join(", ")}`
139
+ );
140
+ }
141
+ return new FilterExpression(id);
142
+ };
143
+ }
144
+
145
+ export { FilterExpression, canonicalizeEavSchemas, collectAll, computeEavSchemaHash, createFilterBuilder, hashCanonicalString, verifyEavSchema, where };
146
+ //# sourceMappingURL=index.js.map
147
+ //# sourceMappingURL=index.js.map