appos 0.1.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 (156) hide show
  1. package/README.md +399 -0
  2. package/build/client/assets/IconMail-BZadZvAd.js +1 -0
  3. package/build/client/assets/_-CgPm6_fJ.js +1 -0
  4. package/build/client/assets/_index-BCLDp_mg.js +1 -0
  5. package/build/client/assets/_layout-CTmjtKOZ.js +1 -0
  6. package/build/client/assets/_layout-HsJ3Zu5t.js +1 -0
  7. package/build/client/assets/_layout-OcS85aOt.js +1 -0
  8. package/build/client/assets/app-sidebar-Bm6e4kn_.js +1 -0
  9. package/build/client/assets/app-sidebar-D2Nsi85j.js +1 -0
  10. package/build/client/assets/auth-provider-rkzBVtYX.js +1 -0
  11. package/build/client/assets/brand-CbTWw97e.js +1 -0
  12. package/build/client/assets/browser-ponyfill-D3yQFvRu.js +2 -0
  13. package/build/client/assets/button-DtZhoqpk.js +1 -0
  14. package/build/client/assets/check-D5D2EGI4.js +1 -0
  15. package/build/client/assets/checkbox-B35Nn166.js +1 -0
  16. package/build/client/assets/chunk-JG3XND5A-BetDbdG0.js +1 -0
  17. package/build/client/assets/chunk-UIGDSWPH-DeiamgQc.js +26 -0
  18. package/build/client/assets/chunk-vBKQ29Cd.js +1 -0
  19. package/build/client/assets/circle-alert-DB4JluX5.js +1 -0
  20. package/build/client/assets/compare-Br3z3FUS-BXkA2ojG.js +2 -0
  21. package/build/client/assets/compiler-runtime-Co9svCia.js +1 -0
  22. package/build/client/assets/config-ChcA_Pkv.js +1 -0
  23. package/build/client/assets/createReactComponent-C2TSpqC7.js +1 -0
  24. package/build/client/assets/dialog-CQrpvURm.js +1 -0
  25. package/build/client/assets/dist-B6TkSbxV.js +1 -0
  26. package/build/client/assets/dist-BNO39Rfs.js +1 -0
  27. package/build/client/assets/dist-BWnI-4xl.js +1 -0
  28. package/build/client/assets/dist-CA21wN5I.js +1 -0
  29. package/build/client/assets/dist-CBNvQRbZ.js +1 -0
  30. package/build/client/assets/dist-CYRPrwOb.js +1 -0
  31. package/build/client/assets/dist-DKtC0FSi.js +1 -0
  32. package/build/client/assets/dist-DhfcebhF.js +1 -0
  33. package/build/client/assets/dist-VqaKdvZu.js +1 -0
  34. package/build/client/assets/dist-Yn6lj8QC.js +5 -0
  35. package/build/client/assets/dropdown-menu-CbzduuDa.js +1 -0
  36. package/build/client/assets/empty-DQRarCKT.js +1 -0
  37. package/build/client/assets/entry.client-BN1GPjAL.js +10 -0
  38. package/build/client/assets/es2015-BJguufLZ.js +41 -0
  39. package/build/client/assets/eye-Ctrln70x.js +1 -0
  40. package/build/client/assets/file-preview-dialog-BRkWSRN4.js +14 -0
  41. package/build/client/assets/index-Del2yBnb.js +1 -0
  42. package/build/client/assets/initReactI18next-CyHiepAw.js +1 -0
  43. package/build/client/assets/input-V1lM1yoz.js +1 -0
  44. package/build/client/assets/jsx-runtime-SCjaiuzT.js +1 -0
  45. package/build/client/assets/lock-Bj7dxHab.js +1 -0
  46. package/build/client/assets/manifest-ca813980.js +1 -0
  47. package/build/client/assets/nav-user-BqPUBe9x.js +1 -0
  48. package/build/client/assets/nav-user-Yu7wt7b_.js +1 -0
  49. package/build/client/assets/org-switcher-BIuearbE.js +1 -0
  50. package/build/client/assets/password-input-bor7e4TM.js +1 -0
  51. package/build/client/assets/react-dom-Bhi-1tDD.js +1 -0
  52. package/build/client/assets/realtime-BmU1LPhx.js +1 -0
  53. package/build/client/assets/root-CS5YIV-V.js +3 -0
  54. package/build/client/assets/root-D0CFuQYc.css +2 -0
  55. package/build/client/assets/route-B9cwW-UK.js +1 -0
  56. package/build/client/assets/route-BD2nV1q2.js +1 -0
  57. package/build/client/assets/route-BEnDcljt.js +1 -0
  58. package/build/client/assets/route-BR4LdxHR.js +1 -0
  59. package/build/client/assets/route-BU5TYmVE.js +0 -0
  60. package/build/client/assets/route-BVmIPEvK.js +11 -0
  61. package/build/client/assets/route-BY244T48.js +1 -0
  62. package/build/client/assets/route-Bwd903CU.js +1 -0
  63. package/build/client/assets/route-CN9iChOk.js +1 -0
  64. package/build/client/assets/route-CQ3p9Qb1.js +1 -0
  65. package/build/client/assets/route-CVLnTONw.js +1 -0
  66. package/build/client/assets/route-CoMZag4T.js +1 -0
  67. package/build/client/assets/route-CsYSLbnx.js +1 -0
  68. package/build/client/assets/route-DWNrq2GE.js +1 -0
  69. package/build/client/assets/route-Dxfmap_u.js +1 -0
  70. package/build/client/assets/route-Gnx1fkRX.js +0 -0
  71. package/build/client/assets/route-NduA4SS_.js +1 -0
  72. package/build/client/assets/route-u2hskgE_.js +1 -0
  73. package/build/client/assets/route-v9Jwv-AW.js +1 -0
  74. package/build/client/assets/select-DATRE76_.js +1 -0
  75. package/build/client/assets/separator-Cla0V581.js +1 -0
  76. package/build/client/assets/shim-TRiHENXu.js +1 -0
  77. package/build/client/assets/sidebar-CqrdL512.js +1 -0
  78. package/build/client/assets/site-header-CZO3qBhf.js +1 -0
  79. package/build/client/assets/site-header-CwidwSv1.js +1 -0
  80. package/build/client/assets/social-providers-Bz7f1_yd.js +1 -0
  81. package/build/client/assets/test-WdoqKbLa.js +1 -0
  82. package/build/client/assets/tooltip-BeDraHQn.js +1 -0
  83. package/build/client/assets/trpc-C1CjVipH.js +6 -0
  84. package/build/client/assets/trust-indicator-D4tEs4Dr.js +20 -0
  85. package/build/client/assets/use-file-upload-CNPfWC6W.js +1 -0
  86. package/build/client/assets/useTranslation-Bz7VuQ7j.js +1 -0
  87. package/build/client/assets/utils-InBzhUf_.js +1 -0
  88. package/build/client/assets/x-4CC8aqOW.js +1 -0
  89. package/build/client/favicon.ico +0 -0
  90. package/build/client/locales/en/emails.json +11 -0
  91. package/build/client/locales/en/translation.json +411 -0
  92. package/build/client/locales/zh-CN/emails.json +11 -0
  93. package/build/client/locales/zh-CN/translation.json +1 -0
  94. package/build/client/locales/zh-TW/emails.json +11 -0
  95. package/build/client/locales/zh-TW/translation.json +1 -0
  96. package/build/client/logo-invert.png +0 -0
  97. package/build/client/logo.png +0 -0
  98. package/build/lib/adapter-factory-CLtf7vT5-CTKiMV2u.mjs +19675 -0
  99. package/build/lib/bun-sqlite-dialect-DN7EKoIB-0pWIoG0L.mjs +155 -0
  100. package/build/lib/chunk-BYI67GdN.mjs +1 -0
  101. package/build/lib/chunk-CkKlU7xI.mjs +44 -0
  102. package/build/lib/client-BtuhFgvy.mjs +65 -0
  103. package/build/lib/client.d.ts +2272 -0
  104. package/build/lib/client.js +24 -0
  105. package/build/lib/date.d.ts +1 -0
  106. package/build/lib/date.js +1 -0
  107. package/build/lib/dialect-BeMwdQoz-D41NdSow.mjs +72 -0
  108. package/build/lib/dist-cjs-B43A5HXv.mjs +169 -0
  109. package/build/lib/dist-cjs-B_wkbabY.mjs +214 -0
  110. package/build/lib/dist-cjs-BmbYbMhp.mjs +143 -0
  111. package/build/lib/dist-cjs-Cc337rwW.mjs +7 -0
  112. package/build/lib/dist-cjs-CgzfN8xY.mjs +4974 -0
  113. package/build/lib/dist-cjs-DBFcizQf.mjs +50 -0
  114. package/build/lib/dist-cjs-DC-UL-xx.mjs +97 -0
  115. package/build/lib/dist-cjs-DHlTgXUO.mjs +6975 -0
  116. package/build/lib/dist-cjs-DYAmJYzN.mjs +323 -0
  117. package/build/lib/dist-cjs-Ddm6Stp9.mjs +1294 -0
  118. package/build/lib/dist-cjs-GFGBhaZg.mjs +84 -0
  119. package/build/lib/dist-cjs-ieCOxrOi.mjs +181 -0
  120. package/build/lib/dist-cjs-nbOGa7i_.mjs +47 -0
  121. package/build/lib/dist-cjs-pN6ekzMW.mjs +66 -0
  122. package/build/lib/dist-cjs-yYlQ1OiO.mjs +102 -0
  123. package/build/lib/esm-DPet4lFW.mjs +15816 -0
  124. package/build/lib/event-streams-x9fP9BzF.mjs +185 -0
  125. package/build/lib/file-preview-dialog-Cugg8tEc.mjs +59 -0
  126. package/build/lib/kysely-adapter-BTWfu5rn.mjs +183 -0
  127. package/build/lib/magic-string.es-jZcifc5m.mjs +1013 -0
  128. package/build/lib/memory-adapter-DiU519m9.mjs +147 -0
  129. package/build/lib/node-ponyfill-Dmm1SWTU.mjs +38212 -0
  130. package/build/lib/node-sqlite-dialect-BqISUSC3-DYvTLBpY.mjs +155 -0
  131. package/build/lib/package-DfozRyK6.mjs +5 -0
  132. package/build/lib/react-dom-CPjM_WCt.mjs +42 -0
  133. package/build/lib/server.d.mts +76273 -0
  134. package/build/lib/server.mjs +325 -0
  135. package/build/lib/sso-oidc-Qom0PEDW.mjs +1036 -0
  136. package/build/lib/sts-CLRaHSW_.mjs +13 -0
  137. package/build/lib/sts-Dl7yZqX1.mjs +1405 -0
  138. package/build/lib/test.d.mts +8922 -0
  139. package/build/lib/test.mjs +175650 -0
  140. package/build/lib/ui/index.d.ts +1643 -0
  141. package/build/lib/ui/index.js +160 -0
  142. package/build/lib/utils.d.ts +21 -0
  143. package/build/lib/utils.js +1 -0
  144. package/build/lib/zod.d.ts +1 -0
  145. package/build/lib/zod.js +23 -0
  146. package/build/main.js +2383 -0
  147. package/build/server/assets/context-BoNg86Eh.js +35 -0
  148. package/build/server/assets/dialog-B8YbGNaz.js +54 -0
  149. package/build/server/assets/file-preview-dialog-qWSViOWQ.js +15 -0
  150. package/build/server/assets/react-CFQ4y0AA.js +13 -0
  151. package/build/server/assets/react-dom-Ca1YUVo2.js +5 -0
  152. package/build/server/assets/server-build-BMOfm0ad.js +118 -0
  153. package/build/server/assets/server.node-B2oksIp8.js +196 -0
  154. package/build/server/assets/server.node-VQzoub0A.js +1 -0
  155. package/build/server/index.js +123 -0
  156. package/package.json +224 -0
@@ -0,0 +1,183 @@
1
+ import "./esm-DPet4lFW.mjs";
2
+ import { n as getKyselyDatabaseType, t as createKyselyAdapter } from "./dialect-BeMwdQoz-D41NdSow.mjs";
3
+ import { t as createAdapterFactory } from "./adapter-factory-CLtf7vT5-CTKiMV2u.mjs";
4
+
5
+ //#region node_modules/better-auth/dist/adapters/kysely-adapter/index.mjs
6
+ const kyselyAdapter = (db, config) => {
7
+ let lazyOptions = null;
8
+ const createCustomAdapter = (db$1) => {
9
+ return ({ getFieldName }) => {
10
+ const withReturning = async (values, builder, model, where) => {
11
+ let res;
12
+ if (config?.type === "mysql") {
13
+ await builder.execute();
14
+ const field = values.id ? "id" : where.length > 0 && where[0]?.field ? where[0].field : "id";
15
+ if (!values.id && where.length === 0) {
16
+ res = await db$1.selectFrom(model).selectAll().orderBy(getFieldName({
17
+ model,
18
+ field
19
+ }), "desc").limit(1).executeTakeFirst();
20
+ return res;
21
+ }
22
+ const value = values[field] || where[0]?.value;
23
+ res = await db$1.selectFrom(model).selectAll().orderBy(getFieldName({
24
+ model,
25
+ field
26
+ }), "desc").where(getFieldName({
27
+ model,
28
+ field
29
+ }), "=", value).limit(1).executeTakeFirst();
30
+ return res;
31
+ }
32
+ if (config?.type === "mssql") {
33
+ res = await builder.outputAll("inserted").executeTakeFirst();
34
+ return res;
35
+ }
36
+ res = await builder.returningAll().executeTakeFirst();
37
+ return res;
38
+ };
39
+ function convertWhereClause(model, w) {
40
+ if (!w) return {
41
+ and: null,
42
+ or: null
43
+ };
44
+ const conditions = {
45
+ and: [],
46
+ or: []
47
+ };
48
+ w.forEach((condition) => {
49
+ let { field: _field, value: _value, operator = "=", connector = "AND" } = condition;
50
+ let value = _value;
51
+ let field = getFieldName({
52
+ model,
53
+ field: _field
54
+ });
55
+ const expr = (eb) => {
56
+ if (operator.toLowerCase() === "in") return eb(field, "in", Array.isArray(value) ? value : [value]);
57
+ if (operator.toLowerCase() === "not_in") return eb(field, "not in", Array.isArray(value) ? value : [value]);
58
+ if (operator === "contains") return eb(field, "like", `%${value}%`);
59
+ if (operator === "starts_with") return eb(field, "like", `${value}%`);
60
+ if (operator === "ends_with") return eb(field, "like", `%${value}`);
61
+ if (operator === "eq") return eb(field, "=", value);
62
+ if (operator === "ne") return eb(field, "<>", value);
63
+ if (operator === "gt") return eb(field, ">", value);
64
+ if (operator === "gte") return eb(field, ">=", value);
65
+ if (operator === "lt") return eb(field, "<", value);
66
+ if (operator === "lte") return eb(field, "<=", value);
67
+ return eb(field, operator, value);
68
+ };
69
+ if (connector === "OR") conditions.or.push(expr);
70
+ else conditions.and.push(expr);
71
+ });
72
+ return {
73
+ and: conditions.and.length ? conditions.and : null,
74
+ or: conditions.or.length ? conditions.or : null
75
+ };
76
+ }
77
+ return {
78
+ async create({ data, model }) {
79
+ return await withReturning(data, db$1.insertInto(model).values(data), model, []);
80
+ },
81
+ async findOne({ model, where, select }) {
82
+ const { and, or } = convertWhereClause(model, where);
83
+ let query = db$1.selectFrom(model).selectAll();
84
+ if (and) query = query.where((eb) => eb.and(and.map((expr) => expr(eb))));
85
+ if (or) query = query.where((eb) => eb.or(or.map((expr) => expr(eb))));
86
+ const res = await query.executeTakeFirst();
87
+ if (!res) return null;
88
+ return res;
89
+ },
90
+ async findMany({ model, where, limit, offset, sortBy }) {
91
+ const { and, or } = convertWhereClause(model, where);
92
+ let query = db$1.selectFrom(model);
93
+ if (and) query = query.where((eb) => eb.and(and.map((expr) => expr(eb))));
94
+ if (or) query = query.where((eb) => eb.or(or.map((expr) => expr(eb))));
95
+ if (config?.type === "mssql") {
96
+ if (!offset) query = query.top(limit || 100);
97
+ } else query = query.limit(limit || 100);
98
+ if (sortBy) query = query.orderBy(getFieldName({
99
+ model,
100
+ field: sortBy.field
101
+ }), sortBy.direction);
102
+ if (offset) if (config?.type === "mssql") {
103
+ if (!sortBy) query = query.orderBy(getFieldName({
104
+ model,
105
+ field: "id"
106
+ }));
107
+ query = query.offset(offset).fetch(limit || 100);
108
+ } else query = query.offset(offset);
109
+ const res = await query.selectAll().execute();
110
+ if (!res) return [];
111
+ return res;
112
+ },
113
+ async update({ model, where, update: values }) {
114
+ const { and, or } = convertWhereClause(model, where);
115
+ let query = db$1.updateTable(model).set(values);
116
+ if (and) query = query.where((eb) => eb.and(and.map((expr) => expr(eb))));
117
+ if (or) query = query.where((eb) => eb.or(or.map((expr) => expr(eb))));
118
+ return await withReturning(values, query, model, where);
119
+ },
120
+ async updateMany({ model, where, update: values }) {
121
+ const { and, or } = convertWhereClause(model, where);
122
+ let query = db$1.updateTable(model).set(values);
123
+ if (and) query = query.where((eb) => eb.and(and.map((expr) => expr(eb))));
124
+ if (or) query = query.where((eb) => eb.or(or.map((expr) => expr(eb))));
125
+ return (await query.execute()).length;
126
+ },
127
+ async count({ model, where }) {
128
+ const { and, or } = convertWhereClause(model, where);
129
+ let query = db$1.selectFrom(model).select(db$1.fn.count("id").as("count"));
130
+ if (and) query = query.where((eb) => eb.and(and.map((expr) => expr(eb))));
131
+ if (or) query = query.where((eb) => eb.or(or.map((expr) => expr(eb))));
132
+ const res = await query.execute();
133
+ if (typeof res[0].count === "number") return res[0].count;
134
+ if (typeof res[0].count === "bigint") return Number(res[0].count);
135
+ return parseInt(res[0].count);
136
+ },
137
+ async delete({ model, where }) {
138
+ const { and, or } = convertWhereClause(model, where);
139
+ let query = db$1.deleteFrom(model);
140
+ if (and) query = query.where((eb) => eb.and(and.map((expr) => expr(eb))));
141
+ if (or) query = query.where((eb) => eb.or(or.map((expr) => expr(eb))));
142
+ await query.execute();
143
+ },
144
+ async deleteMany({ model, where }) {
145
+ const { and, or } = convertWhereClause(model, where);
146
+ let query = db$1.deleteFrom(model);
147
+ if (and) query = query.where((eb) => eb.and(and.map((expr) => expr(eb))));
148
+ if (or) query = query.where((eb) => eb.or(or.map((expr) => expr(eb))));
149
+ return (await query.execute()).length;
150
+ },
151
+ options: config
152
+ };
153
+ };
154
+ };
155
+ let adapterOptions = null;
156
+ adapterOptions = {
157
+ config: {
158
+ adapterId: "kysely",
159
+ adapterName: "Kysely Adapter",
160
+ usePlural: config?.usePlural,
161
+ debugLogs: config?.debugLogs,
162
+ supportsBooleans: config?.type === "sqlite" || config?.type === "mssql" || config?.type === "mysql" || !config?.type ? false : true,
163
+ supportsDates: config?.type === "sqlite" || config?.type === "mssql" || !config?.type ? false : true,
164
+ supportsJSON: false,
165
+ supportsUUIDs: config?.type === "postgres" ? true : false,
166
+ transaction: config?.transaction ? (cb) => db.transaction().execute((trx) => {
167
+ return cb(createAdapterFactory({
168
+ config: adapterOptions.config,
169
+ adapter: createCustomAdapter(trx)
170
+ })(lazyOptions));
171
+ }) : false
172
+ },
173
+ adapter: createCustomAdapter(db)
174
+ };
175
+ const adapter = createAdapterFactory(adapterOptions);
176
+ return (options) => {
177
+ lazyOptions = options;
178
+ return adapter(options);
179
+ };
180
+ };
181
+
182
+ //#endregion
183
+ export { createKyselyAdapter, kyselyAdapter };