@authhero/drizzle 0.54.0 → 0.54.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/drizzle-adapter.cjs +4 -4
- package/dist/drizzle-adapter.mjs +848 -811
- package/package.json +3 -3
package/dist/drizzle-adapter.mjs
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
//#region \0rolldown/runtime.js
|
|
2
|
-
var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, r = Object.prototype.hasOwnProperty, i = (e, t
|
|
2
|
+
var e = Object.defineProperty, t = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, r = Object.prototype.hasOwnProperty, i = (e, t, n) => () => {
|
|
3
|
+
if (n) throw n[0];
|
|
4
|
+
try {
|
|
5
|
+
return e && (t = e(e = 0)), t;
|
|
6
|
+
} catch (e) {
|
|
7
|
+
throw n = [e], e;
|
|
8
|
+
}
|
|
9
|
+
}, a = (t, n) => {
|
|
3
10
|
let r = {};
|
|
4
11
|
for (var i in t) e(r, i, {
|
|
5
12
|
get: t[i],
|
|
@@ -25,39 +32,8 @@ function l(e, t) {
|
|
|
25
32
|
return !1;
|
|
26
33
|
}
|
|
27
34
|
//#endregion
|
|
28
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/column.js
|
|
35
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/column-builder.js
|
|
29
36
|
var u = class {
|
|
30
|
-
constructor(e, t) {
|
|
31
|
-
this.table = e, this.config = t, this.name = t.name, this.keyAsName = t.keyAsName, this.notNull = t.notNull, this.default = t.default, this.defaultFn = t.defaultFn, this.onUpdateFn = t.onUpdateFn, this.hasDefault = t.hasDefault, this.primary = t.primaryKey, this.isUnique = t.isUnique, this.uniqueName = t.uniqueName, this.uniqueType = t.uniqueType, this.dataType = t.dataType, this.columnType = t.columnType, this.generated = t.generated, this.generatedIdentity = t.generatedIdentity;
|
|
32
|
-
}
|
|
33
|
-
static [c] = "Column";
|
|
34
|
-
name;
|
|
35
|
-
keyAsName;
|
|
36
|
-
primary;
|
|
37
|
-
notNull;
|
|
38
|
-
default;
|
|
39
|
-
defaultFn;
|
|
40
|
-
onUpdateFn;
|
|
41
|
-
hasDefault;
|
|
42
|
-
isUnique;
|
|
43
|
-
uniqueName;
|
|
44
|
-
uniqueType;
|
|
45
|
-
dataType;
|
|
46
|
-
columnType;
|
|
47
|
-
enumValues = void 0;
|
|
48
|
-
generated = void 0;
|
|
49
|
-
generatedIdentity = void 0;
|
|
50
|
-
config;
|
|
51
|
-
mapFromDriverValue(e) {
|
|
52
|
-
return e;
|
|
53
|
-
}
|
|
54
|
-
mapToDriverValue(e) {
|
|
55
|
-
return e;
|
|
56
|
-
}
|
|
57
|
-
shouldDisableInsert() {
|
|
58
|
-
return this.config.generated !== void 0 && this.config.generated.type !== "byDefault";
|
|
59
|
-
}
|
|
60
|
-
}, d = class {
|
|
61
37
|
static [c] = "ColumnBuilder";
|
|
62
38
|
config;
|
|
63
39
|
constructor(e, t, n) {
|
|
@@ -99,13 +75,68 @@ var u = class {
|
|
|
99
75
|
setName(e) {
|
|
100
76
|
this.config.name === "" && (this.config.name = e);
|
|
101
77
|
}
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
|
|
78
|
+
}, d = class {
|
|
79
|
+
constructor(e, t) {
|
|
80
|
+
this.table = e, this.config = t, this.name = t.name, this.keyAsName = t.keyAsName, this.notNull = t.notNull, this.default = t.default, this.defaultFn = t.defaultFn, this.onUpdateFn = t.onUpdateFn, this.hasDefault = t.hasDefault, this.primary = t.primaryKey, this.isUnique = t.isUnique, this.uniqueName = t.uniqueName, this.uniqueType = t.uniqueType, this.dataType = t.dataType, this.columnType = t.columnType, this.generated = t.generated, this.generatedIdentity = t.generatedIdentity;
|
|
81
|
+
}
|
|
82
|
+
static [c] = "Column";
|
|
83
|
+
name;
|
|
84
|
+
keyAsName;
|
|
85
|
+
primary;
|
|
86
|
+
notNull;
|
|
87
|
+
default;
|
|
88
|
+
defaultFn;
|
|
89
|
+
onUpdateFn;
|
|
90
|
+
hasDefault;
|
|
91
|
+
isUnique;
|
|
92
|
+
uniqueName;
|
|
93
|
+
uniqueType;
|
|
94
|
+
dataType;
|
|
95
|
+
columnType;
|
|
96
|
+
enumValues = void 0;
|
|
97
|
+
generated = void 0;
|
|
98
|
+
generatedIdentity = void 0;
|
|
99
|
+
config;
|
|
100
|
+
mapFromDriverValue(e) {
|
|
101
|
+
return e;
|
|
102
|
+
}
|
|
103
|
+
mapToDriverValue(e) {
|
|
104
|
+
return e;
|
|
105
|
+
}
|
|
106
|
+
shouldDisableInsert() {
|
|
107
|
+
return this.config.generated !== void 0 && this.config.generated.type !== "byDefault";
|
|
108
|
+
}
|
|
109
|
+
}, f = Symbol.for("drizzle:Name"), ee = Symbol.for("drizzle:Schema"), te = Symbol.for("drizzle:Columns"), ne = Symbol.for("drizzle:ExtraConfigColumns"), re = Symbol.for("drizzle:OriginalName"), ie = Symbol.for("drizzle:BaseName"), ae = Symbol.for("drizzle:IsAlias"), oe = Symbol.for("drizzle:ExtraConfigBuilder"), se = Symbol.for("drizzle:IsDrizzleTable"), ce = class {
|
|
110
|
+
static [c] = "Table";
|
|
111
|
+
static Symbol = {
|
|
112
|
+
Name: f,
|
|
113
|
+
Schema: ee,
|
|
114
|
+
OriginalName: re,
|
|
115
|
+
Columns: te,
|
|
116
|
+
ExtraConfigColumns: ne,
|
|
117
|
+
BaseName: ie,
|
|
118
|
+
IsAlias: ae,
|
|
119
|
+
ExtraConfigBuilder: oe
|
|
120
|
+
};
|
|
121
|
+
[f];
|
|
122
|
+
[re];
|
|
123
|
+
[ee];
|
|
124
|
+
[te];
|
|
125
|
+
[ne];
|
|
126
|
+
[ie];
|
|
127
|
+
[ae] = !1;
|
|
128
|
+
[se] = !0;
|
|
129
|
+
[oe] = void 0;
|
|
130
|
+
constructor(e, t, n) {
|
|
131
|
+
this[f] = this[re] = e, this[ee] = t, this[ie] = n;
|
|
132
|
+
}
|
|
133
|
+
}, le = Symbol.for("drizzle:isPgEnum");
|
|
134
|
+
function ue(e) {
|
|
135
|
+
return !!e && typeof e == "function" && le in e && e[le] === !0;
|
|
105
136
|
}
|
|
106
137
|
//#endregion
|
|
107
138
|
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/subquery.js
|
|
108
|
-
var
|
|
139
|
+
var de = class {
|
|
109
140
|
static [c] = "Subquery";
|
|
110
141
|
constructor(e, t, n, r = !1, i = []) {
|
|
111
142
|
this._ = {
|
|
@@ -117,33 +148,9 @@ var ne = class {
|
|
|
117
148
|
usedTables: i
|
|
118
149
|
};
|
|
119
150
|
}
|
|
120
|
-
},
|
|
151
|
+
}, fe = { startActiveSpan(e, t) {
|
|
121
152
|
return t();
|
|
122
|
-
} },
|
|
123
|
-
static [c] = "Table";
|
|
124
|
-
static Symbol = {
|
|
125
|
-
Name: f,
|
|
126
|
-
Schema: ae,
|
|
127
|
-
OriginalName: ce,
|
|
128
|
-
Columns: oe,
|
|
129
|
-
ExtraConfigColumns: se,
|
|
130
|
-
BaseName: le,
|
|
131
|
-
IsAlias: ue,
|
|
132
|
-
ExtraConfigBuilder: de
|
|
133
|
-
};
|
|
134
|
-
[f];
|
|
135
|
-
[ce];
|
|
136
|
-
[ae];
|
|
137
|
-
[oe];
|
|
138
|
-
[se];
|
|
139
|
-
[le];
|
|
140
|
-
[ue] = !1;
|
|
141
|
-
[fe] = !0;
|
|
142
|
-
[de] = void 0;
|
|
143
|
-
constructor(e, t, n) {
|
|
144
|
-
this[f] = this[ce] = e, this[ae] = t, this[le] = n;
|
|
145
|
-
}
|
|
146
|
-
};
|
|
153
|
+
} }, pe = Symbol.for("drizzle:ViewBaseConfig");
|
|
147
154
|
//#endregion
|
|
148
155
|
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/sql/sql.js
|
|
149
156
|
function me(e) {
|
|
@@ -169,9 +176,9 @@ var ge = class {
|
|
|
169
176
|
}, _e = class e {
|
|
170
177
|
constructor(e) {
|
|
171
178
|
this.queryChunks = e;
|
|
172
|
-
for (let t of e) if (l(t,
|
|
173
|
-
let e = t[
|
|
174
|
-
this.usedTables.push(e === void 0 ? t[
|
|
179
|
+
for (let t of e) if (l(t, ce)) {
|
|
180
|
+
let e = t[ce.Symbol.Schema];
|
|
181
|
+
this.usedTables.push(e === void 0 ? t[ce.Symbol.Name] : e + "." + t[ce.Symbol.Name]);
|
|
175
182
|
}
|
|
176
183
|
}
|
|
177
184
|
static [c] = "SQL";
|
|
@@ -182,7 +189,7 @@ var ge = class {
|
|
|
182
189
|
return this.queryChunks.push(...e.queryChunks), this;
|
|
183
190
|
}
|
|
184
191
|
toQuery(e) {
|
|
185
|
-
return
|
|
192
|
+
return fe.startActiveSpan("drizzle.buildSQL", (t) => {
|
|
186
193
|
let n = this.buildQueryFromSourceParams(this.queryChunks, e);
|
|
187
194
|
return t?.setAttributes({
|
|
188
195
|
"drizzle.query.text": n.sql,
|
|
@@ -194,7 +201,7 @@ var ge = class {
|
|
|
194
201
|
let r = Object.assign({}, n, {
|
|
195
202
|
inlineParams: n.inlineParams || this.shouldInlineParams,
|
|
196
203
|
paramStartIndex: n.paramStartIndex || { value: 0 }
|
|
197
|
-
}), { casing: i, escapeName: a, escapeParam: o, prepareTyping: s, inlineParams: c, paramStartIndex:
|
|
204
|
+
}), { casing: i, escapeName: a, escapeParam: o, prepareTyping: s, inlineParams: c, paramStartIndex: u } = r;
|
|
198
205
|
return he(t.map((t) => {
|
|
199
206
|
if (l(t, ge)) return {
|
|
200
207
|
sql: t.value.join(""),
|
|
@@ -217,35 +224,35 @@ var ge = class {
|
|
|
217
224
|
...r,
|
|
218
225
|
inlineParams: c || t.shouldInlineParams
|
|
219
226
|
});
|
|
220
|
-
if (l(t,
|
|
221
|
-
let e = t[
|
|
227
|
+
if (l(t, ce)) {
|
|
228
|
+
let e = t[ce.Symbol.Schema], n = t[ce.Symbol.Name];
|
|
222
229
|
return {
|
|
223
|
-
sql: e === void 0 || t[
|
|
230
|
+
sql: e === void 0 || t[ae] ? a(n) : a(e) + "." + a(n),
|
|
224
231
|
params: []
|
|
225
232
|
};
|
|
226
233
|
}
|
|
227
|
-
if (l(t,
|
|
234
|
+
if (l(t, d)) {
|
|
228
235
|
let e = i.getColumnCasing(t);
|
|
229
236
|
if (n.invokeSource === "indexes") return {
|
|
230
237
|
sql: a(e),
|
|
231
238
|
params: []
|
|
232
239
|
};
|
|
233
|
-
let r = t.table[
|
|
240
|
+
let r = t.table[ce.Symbol.Schema];
|
|
234
241
|
return {
|
|
235
|
-
sql: t.table[
|
|
242
|
+
sql: t.table[ae] || r === void 0 ? a(t.table[ce.Symbol.Name]) + "." + a(e) : a(r) + "." + a(t.table[ce.Symbol.Name]) + "." + a(e),
|
|
236
243
|
params: []
|
|
237
244
|
};
|
|
238
245
|
}
|
|
239
246
|
if (l(t, Te)) {
|
|
240
|
-
let e = t[
|
|
247
|
+
let e = t[pe].schema, n = t[pe].name;
|
|
241
248
|
return {
|
|
242
|
-
sql: e === void 0 || t[
|
|
249
|
+
sql: e === void 0 || t[pe].isAlias ? a(n) : a(e) + "." + a(n),
|
|
243
250
|
params: []
|
|
244
251
|
};
|
|
245
252
|
}
|
|
246
253
|
if (l(t, Se)) {
|
|
247
254
|
if (l(t.value, Ce)) return {
|
|
248
|
-
sql: o(
|
|
255
|
+
sql: o(u.value++, t),
|
|
249
256
|
params: [t],
|
|
250
257
|
typings: ["none"]
|
|
251
258
|
};
|
|
@@ -257,19 +264,19 @@ var ge = class {
|
|
|
257
264
|
};
|
|
258
265
|
let i = ["none"];
|
|
259
266
|
return s && (i = [s(t.encoder)]), {
|
|
260
|
-
sql: o(
|
|
267
|
+
sql: o(u.value++, n),
|
|
261
268
|
params: [n],
|
|
262
269
|
typings: i
|
|
263
270
|
};
|
|
264
271
|
}
|
|
265
272
|
return l(t, Ce) ? {
|
|
266
|
-
sql: o(
|
|
273
|
+
sql: o(u.value++, t),
|
|
267
274
|
params: [t],
|
|
268
275
|
typings: ["none"]
|
|
269
276
|
} : l(t, e.Aliased) && t.fieldAlias !== void 0 ? {
|
|
270
277
|
sql: a(t.fieldAlias),
|
|
271
278
|
params: []
|
|
272
|
-
} : l(t,
|
|
279
|
+
} : l(t, de) ? t._.isWith ? {
|
|
273
280
|
sql: a(t._.alias),
|
|
274
281
|
params: []
|
|
275
282
|
} : this.buildQueryFromSourceParams([
|
|
@@ -277,7 +284,7 @@ var ge = class {
|
|
|
277
284
|
t._.sql,
|
|
278
285
|
new ge(") "),
|
|
279
286
|
new ve(t._.alias)
|
|
280
|
-
], r) :
|
|
287
|
+
], r) : ue(t) ? t.schema ? {
|
|
281
288
|
sql: a(t.schema) + "." + a(t.enumName),
|
|
282
289
|
params: []
|
|
283
290
|
} : {
|
|
@@ -291,7 +298,7 @@ var ge = class {
|
|
|
291
298
|
sql: this.mapInlineParam(t, r),
|
|
292
299
|
params: []
|
|
293
300
|
} : {
|
|
294
|
-
sql: o(
|
|
301
|
+
sql: o(u.value++, t),
|
|
295
302
|
params: [t],
|
|
296
303
|
typings: ["none"]
|
|
297
304
|
};
|
|
@@ -413,10 +420,10 @@ var Ce = class {
|
|
|
413
420
|
}
|
|
414
421
|
}, we = Symbol.for("drizzle:IsDrizzleView"), Te = class {
|
|
415
422
|
static [c] = "View";
|
|
416
|
-
[
|
|
423
|
+
[pe];
|
|
417
424
|
[we] = !0;
|
|
418
425
|
constructor({ name: e, schema: t, selectedFields: n, query: r }) {
|
|
419
|
-
this[
|
|
426
|
+
this[pe] = {
|
|
420
427
|
name: e,
|
|
421
428
|
originalName: e,
|
|
422
429
|
schema: t,
|
|
@@ -430,28 +437,19 @@ var Ce = class {
|
|
|
430
437
|
return new _e([this]);
|
|
431
438
|
}
|
|
432
439
|
};
|
|
433
|
-
|
|
440
|
+
d.prototype.getSQL = function() {
|
|
434
441
|
return new _e([this]);
|
|
435
|
-
},
|
|
442
|
+
}, ce.prototype.getSQL = function() {
|
|
436
443
|
return new _e([this]);
|
|
437
|
-
},
|
|
444
|
+
}, de.prototype.getSQL = function() {
|
|
438
445
|
return new _e([this]);
|
|
439
446
|
};
|
|
440
447
|
//#endregion
|
|
441
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/utils.js
|
|
442
|
-
function Ee(e, t) {
|
|
443
|
-
return {
|
|
444
|
-
name: typeof e == "string" && e.length > 0 ? e : "",
|
|
445
|
-
config: typeof e == "object" ? e : t
|
|
446
|
-
};
|
|
447
|
-
}
|
|
448
|
-
var De = typeof TextDecoder > "u" ? null : new TextDecoder();
|
|
449
|
-
//#endregion
|
|
450
448
|
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/sql/expressions/conditions.js
|
|
451
|
-
function
|
|
452
|
-
return ye(t) && !me(e) && !l(e, Se) && !l(e, Ce) && !l(e,
|
|
449
|
+
function Ee(e, t) {
|
|
450
|
+
return ye(t) && !me(e) && !l(e, Se) && !l(e, Ce) && !l(e, d) && !l(e, ce) && !l(e, Te) ? new Se(e, t) : e;
|
|
453
451
|
}
|
|
454
|
-
var m = (e, t) => p`${e} = ${
|
|
452
|
+
var m = (e, t) => p`${e} = ${Ee(t, e)}`, De = (e, t) => p`${e} <> ${Ee(t, e)}`;
|
|
455
453
|
function h(...e) {
|
|
456
454
|
let t = e.filter((e) => e !== void 0);
|
|
457
455
|
if (t.length !== 0) return t.length === 1 ? new _e(t) : new _e([
|
|
@@ -460,7 +458,7 @@ function h(...e) {
|
|
|
460
458
|
new ge(")")
|
|
461
459
|
]);
|
|
462
460
|
}
|
|
463
|
-
function
|
|
461
|
+
function Oe(...e) {
|
|
464
462
|
let t = e.filter((e) => e !== void 0);
|
|
465
463
|
if (t.length !== 0) return t.length === 1 ? new _e(t) : new _e([
|
|
466
464
|
new ge("("),
|
|
@@ -468,38 +466,44 @@ function Ae(...e) {
|
|
|
468
466
|
new ge(")")
|
|
469
467
|
]);
|
|
470
468
|
}
|
|
471
|
-
var
|
|
472
|
-
function
|
|
473
|
-
return Array.isArray(t) ? t.length === 0 ? p`false` : p`${e} in ${t.map((t) =>
|
|
469
|
+
var ke = (e, t) => p`${e} > ${Ee(t, e)}`, Ae = (e, t) => p`${e} >= ${Ee(t, e)}`, je = (e, t) => p`${e} < ${Ee(t, e)}`, Me = (e, t) => p`${e} <= ${Ee(t, e)}`;
|
|
470
|
+
function Ne(e, t) {
|
|
471
|
+
return Array.isArray(t) ? t.length === 0 ? p`false` : p`${e} in ${t.map((t) => Ee(t, e))}` : p`${e} in ${Ee(t, e)}`;
|
|
474
472
|
}
|
|
475
|
-
function
|
|
473
|
+
function Pe(e) {
|
|
476
474
|
return p`${e} is null`;
|
|
477
475
|
}
|
|
478
|
-
function
|
|
476
|
+
function Fe(e) {
|
|
479
477
|
return p`${e} is not null`;
|
|
480
478
|
}
|
|
481
|
-
function
|
|
479
|
+
function Ie(e, t) {
|
|
482
480
|
return p`${e} like ${t}`;
|
|
483
481
|
}
|
|
484
|
-
function
|
|
482
|
+
function Le(e, t) {
|
|
485
483
|
return p`${e} not like ${t}`;
|
|
486
484
|
}
|
|
487
485
|
//#endregion
|
|
488
486
|
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/sql/expressions/select.js
|
|
489
|
-
function
|
|
487
|
+
function Re(e) {
|
|
490
488
|
return p`${e} asc`;
|
|
491
489
|
}
|
|
492
|
-
function
|
|
490
|
+
function ze(e) {
|
|
493
491
|
return p`${e} desc`;
|
|
494
492
|
}
|
|
495
493
|
//#endregion
|
|
496
494
|
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/sql/functions/aggregate.js
|
|
497
|
-
function
|
|
495
|
+
function Be(e) {
|
|
498
496
|
return p`count(${e || p.raw("*")})`.mapWith(Number);
|
|
499
497
|
}
|
|
500
498
|
//#endregion
|
|
501
|
-
//#region ../../node_modules/.pnpm/
|
|
502
|
-
|
|
499
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/utils.js
|
|
500
|
+
function Ve(e, t) {
|
|
501
|
+
return {
|
|
502
|
+
name: typeof e == "string" && e.length > 0 ? e : "",
|
|
503
|
+
config: typeof e == "object" ? e : t
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
var He = typeof TextDecoder > "u" ? null : new TextDecoder(), Ue, We = i((() => {
|
|
503
507
|
Ue = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
504
508
|
})), Ge = /* @__PURE__ */ a({
|
|
505
509
|
customAlphabet: () => Je,
|
|
@@ -585,7 +589,7 @@ function $e(e, t) {
|
|
|
585
589
|
}
|
|
586
590
|
//#endregion
|
|
587
591
|
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/sqlite-core/columns/common.js
|
|
588
|
-
var et = class extends
|
|
592
|
+
var et = class extends u {
|
|
589
593
|
static [c] = "SQLiteColumnBuilder";
|
|
590
594
|
foreignKeyConfigs = [];
|
|
591
595
|
references(e, t = {}) {
|
|
@@ -616,7 +620,7 @@ var et = class extends d {
|
|
|
616
620
|
return r.onUpdate && i.onUpdate(r.onUpdate), r.onDelete && i.onDelete(r.onDelete), i.build(t);
|
|
617
621
|
})(n, r));
|
|
618
622
|
}
|
|
619
|
-
}, tt = class extends
|
|
623
|
+
}, tt = class extends d {
|
|
620
624
|
constructor(e, t) {
|
|
621
625
|
t.uniqueName ||= $e(e, [t.name]), super(e, t), this.table = e;
|
|
622
626
|
}
|
|
@@ -639,7 +643,7 @@ var et = class extends d {
|
|
|
639
643
|
let t = Buffer.isBuffer(e) ? e : e instanceof ArrayBuffer ? Buffer.from(e) : e.buffer ? Buffer.from(e.buffer, e.byteOffset, e.byteLength) : Buffer.from(e);
|
|
640
644
|
return BigInt(t.toString("utf8"));
|
|
641
645
|
}
|
|
642
|
-
return BigInt(
|
|
646
|
+
return BigInt(He.decode(e));
|
|
643
647
|
}
|
|
644
648
|
mapToDriverValue(e) {
|
|
645
649
|
return Buffer.from(e.toString());
|
|
@@ -662,7 +666,7 @@ var et = class extends d {
|
|
|
662
666
|
let t = Buffer.isBuffer(e) ? e : e instanceof ArrayBuffer ? Buffer.from(e) : e.buffer ? Buffer.from(e.buffer, e.byteOffset, e.byteLength) : Buffer.from(e);
|
|
663
667
|
return JSON.parse(t.toString("utf8"));
|
|
664
668
|
}
|
|
665
|
-
return JSON.parse(
|
|
669
|
+
return JSON.parse(He.decode(e));
|
|
666
670
|
}
|
|
667
671
|
mapToDriverValue(e) {
|
|
668
672
|
return Buffer.from(JSON.stringify(e));
|
|
@@ -685,7 +689,7 @@ var et = class extends d {
|
|
|
685
689
|
}
|
|
686
690
|
};
|
|
687
691
|
function ct(e, t) {
|
|
688
|
-
let { name: n, config: r } =
|
|
692
|
+
let { name: n, config: r } = Ve(e, t);
|
|
689
693
|
return r?.mode === "json" ? new it(n) : r?.mode === "bigint" ? new nt(n) : new ot(n);
|
|
690
694
|
}
|
|
691
695
|
//#endregion
|
|
@@ -718,7 +722,7 @@ var lt = class extends et {
|
|
|
718
722
|
};
|
|
719
723
|
function dt(e) {
|
|
720
724
|
return (t, n) => {
|
|
721
|
-
let { name: r, config: i } =
|
|
725
|
+
let { name: r, config: i } = Ve(t, n);
|
|
722
726
|
return new lt(r, i, e);
|
|
723
727
|
};
|
|
724
728
|
}
|
|
@@ -788,7 +792,7 @@ var ft = class extends et {
|
|
|
788
792
|
}
|
|
789
793
|
};
|
|
790
794
|
function g(e, t) {
|
|
791
|
-
let { name: n, config: r } =
|
|
795
|
+
let { name: n, config: r } = Ve(e, t);
|
|
792
796
|
return r?.mode === "timestamp" || r?.mode === "timestamp_ms" ? new gt(n, r.mode) : r?.mode === "boolean" ? new vt(n, r.mode) : new mt(n);
|
|
793
797
|
}
|
|
794
798
|
//#endregion
|
|
@@ -843,7 +847,7 @@ var bt = class extends et {
|
|
|
843
847
|
}
|
|
844
848
|
};
|
|
845
849
|
function Et(e, t) {
|
|
846
|
-
let { name: n, config: r } =
|
|
850
|
+
let { name: n, config: r } = Ve(e, t), i = r?.mode;
|
|
847
851
|
return i === "number" ? new St(n) : i === "bigint" ? new wt(n) : new bt(n);
|
|
848
852
|
}
|
|
849
853
|
//#endregion
|
|
@@ -906,48 +910,20 @@ var At = class extends et {
|
|
|
906
910
|
}
|
|
907
911
|
};
|
|
908
912
|
function _(e, t = {}) {
|
|
909
|
-
let { name: n, config: r } =
|
|
913
|
+
let { name: n, config: r } = Ve(e, t);
|
|
910
914
|
return r.mode === "json" ? new Mt(n) : new At(n, r);
|
|
911
915
|
}
|
|
912
916
|
//#endregion
|
|
913
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/sqlite-core/
|
|
914
|
-
|
|
915
|
-
return {
|
|
916
|
-
blob: ct,
|
|
917
|
-
customType: dt,
|
|
918
|
-
integer: g,
|
|
919
|
-
numeric: Et,
|
|
920
|
-
real: kt,
|
|
921
|
-
text: _
|
|
922
|
-
};
|
|
923
|
-
}
|
|
924
|
-
//#endregion
|
|
925
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/sqlite-core/table.js
|
|
926
|
-
var Ft = Symbol.for("drizzle:SQLiteInlineForeignKeys"), It = class extends pe {
|
|
927
|
-
static [c] = "SQLiteTable";
|
|
928
|
-
static Symbol = Object.assign({}, pe.Symbol, { InlineForeignKeys: Ft });
|
|
929
|
-
[pe.Symbol.Columns];
|
|
930
|
-
[Ft] = [];
|
|
931
|
-
[pe.Symbol.ExtraConfigBuilder] = void 0;
|
|
932
|
-
};
|
|
933
|
-
function Lt(e, t, n, r, i = e) {
|
|
934
|
-
let a = new It(e, r, i), o = typeof t == "function" ? t(Pt()) : t, s = Object.fromEntries(Object.entries(o).map(([e, t]) => {
|
|
935
|
-
let n = t;
|
|
936
|
-
n.setName(e);
|
|
937
|
-
let r = n.build(a);
|
|
938
|
-
return a[Ft].push(...n.buildForeignKeys(r, a)), [e, r];
|
|
939
|
-
})), c = Object.assign(a, s);
|
|
940
|
-
return c[pe.Symbol.Columns] = s, c[pe.Symbol.ExtraConfigColumns] = s, n && (c[It.Symbol.ExtraConfigBuilder] = n), c;
|
|
941
|
-
}
|
|
942
|
-
var v = (e, t, n) => Lt(e, t, n), Rt = class {
|
|
917
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/sqlite-core/indexes.js
|
|
918
|
+
var Pt = class {
|
|
943
919
|
constructor(e, t) {
|
|
944
920
|
this.name = e, this.unique = t;
|
|
945
921
|
}
|
|
946
922
|
static [c] = "SQLiteIndexBuilderOn";
|
|
947
923
|
on(...e) {
|
|
948
|
-
return new
|
|
924
|
+
return new Ft(this.name, e, this.unique);
|
|
949
925
|
}
|
|
950
|
-
},
|
|
926
|
+
}, Ft = class {
|
|
951
927
|
static [c] = "SQLiteIndexBuilder";
|
|
952
928
|
config;
|
|
953
929
|
constructor(e, t, n) {
|
|
@@ -962,9 +938,9 @@ var v = (e, t, n) => Lt(e, t, n), Rt = class {
|
|
|
962
938
|
return this.config.where = e, this;
|
|
963
939
|
}
|
|
964
940
|
build(e) {
|
|
965
|
-
return new
|
|
941
|
+
return new It(this.config, e);
|
|
966
942
|
}
|
|
967
|
-
},
|
|
943
|
+
}, It = class {
|
|
968
944
|
static [c] = "SQLiteIndex";
|
|
969
945
|
config;
|
|
970
946
|
constructor(e, t) {
|
|
@@ -974,12 +950,43 @@ var v = (e, t, n) => Lt(e, t, n), Rt = class {
|
|
|
974
950
|
};
|
|
975
951
|
}
|
|
976
952
|
};
|
|
977
|
-
function
|
|
978
|
-
return new
|
|
953
|
+
function v(e) {
|
|
954
|
+
return new Pt(e, !1);
|
|
955
|
+
}
|
|
956
|
+
function Lt(e) {
|
|
957
|
+
return new Pt(e, !0);
|
|
958
|
+
}
|
|
959
|
+
//#endregion
|
|
960
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/sqlite-core/columns/all.js
|
|
961
|
+
function Rt() {
|
|
962
|
+
return {
|
|
963
|
+
blob: ct,
|
|
964
|
+
customType: dt,
|
|
965
|
+
integer: g,
|
|
966
|
+
numeric: Et,
|
|
967
|
+
real: kt,
|
|
968
|
+
text: _
|
|
969
|
+
};
|
|
979
970
|
}
|
|
980
|
-
|
|
981
|
-
|
|
971
|
+
//#endregion
|
|
972
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/sqlite-core/table.js
|
|
973
|
+
var zt = Symbol.for("drizzle:SQLiteInlineForeignKeys"), Bt = class extends ce {
|
|
974
|
+
static [c] = "SQLiteTable";
|
|
975
|
+
static Symbol = Object.assign({}, ce.Symbol, { InlineForeignKeys: zt });
|
|
976
|
+
[ce.Symbol.Columns];
|
|
977
|
+
[zt] = [];
|
|
978
|
+
[ce.Symbol.ExtraConfigBuilder] = void 0;
|
|
979
|
+
};
|
|
980
|
+
function Vt(e, t, n, r, i = e) {
|
|
981
|
+
let a = new Bt(e, r, i), o = typeof t == "function" ? t(Rt()) : t, s = Object.fromEntries(Object.entries(o).map(([e, t]) => {
|
|
982
|
+
let n = t;
|
|
983
|
+
n.setName(e);
|
|
984
|
+
let r = n.build(a);
|
|
985
|
+
return a[zt].push(...n.buildForeignKeys(r, a)), [e, r];
|
|
986
|
+
})), c = Object.assign(a, s);
|
|
987
|
+
return c[ce.Symbol.Columns] = s, c[ce.Symbol.ExtraConfigColumns] = s, n && (c[Bt.Symbol.ExtraConfigBuilder] = n), c;
|
|
982
988
|
}
|
|
989
|
+
var y = (e, t, n) => Vt(e, t, n);
|
|
983
990
|
//#endregion
|
|
984
991
|
//#region ../../node_modules/.pnpm/drizzle-orm@0.44.7_@types+better-sqlite3@7.6.13_better-sqlite3@11.10.0/node_modules/drizzle-orm/sqlite-core/primary-keys.js
|
|
985
992
|
function Ht(...e) {
|
|
@@ -1003,13 +1010,13 @@ var Ut = class {
|
|
|
1003
1010
|
columns;
|
|
1004
1011
|
name;
|
|
1005
1012
|
getName() {
|
|
1006
|
-
return this.name ?? `${this.table[
|
|
1013
|
+
return this.name ?? `${this.table[Bt.Symbol.Name]}_${this.columns.map((e) => e.name).join("_")}_pk`;
|
|
1007
1014
|
}
|
|
1008
1015
|
};
|
|
1009
1016
|
//#endregion
|
|
1010
1017
|
//#region src/schema/sqlite/tenants.ts
|
|
1011
1018
|
Xe();
|
|
1012
|
-
var b =
|
|
1019
|
+
var b = y("tenants", {
|
|
1013
1020
|
id: _("id", { length: 191 }).primaryKey(),
|
|
1014
1021
|
name: _("name", { length: 255 }),
|
|
1015
1022
|
audience: _("audience", { length: 255 }),
|
|
@@ -1063,7 +1070,7 @@ var b = v("tenants", {
|
|
|
1063
1070
|
worker_script_name: _("worker_script_name", { length: 255 }),
|
|
1064
1071
|
storage_kind: _("storage_kind", { length: 32 }),
|
|
1065
1072
|
d1_database_id: _("d1_database_id", { length: 64 })
|
|
1066
|
-
}), Gt =
|
|
1073
|
+
}), Gt = y("actions", {
|
|
1067
1074
|
id: _("id", { length: 255 }).notNull(),
|
|
1068
1075
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1069
1076
|
name: _("name", { length: 255 }).notNull(),
|
|
@@ -1083,9 +1090,9 @@ var b = v("tenants", {
|
|
|
1083
1090
|
columns: [e.tenant_id, e.id],
|
|
1084
1091
|
name: "actions_pk"
|
|
1085
1092
|
}),
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
]), Kt =
|
|
1093
|
+
v("idx_actions_tenant_id").on(e.tenant_id),
|
|
1094
|
+
v("idx_actions_name").on(e.tenant_id, e.name)
|
|
1095
|
+
]), Kt = y("action_versions", {
|
|
1089
1096
|
id: _("id", { length: 255 }).notNull(),
|
|
1090
1097
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1091
1098
|
action_id: _("action_id", { length: 255 }).notNull(),
|
|
@@ -1103,9 +1110,9 @@ var b = v("tenants", {
|
|
|
1103
1110
|
columns: [e.tenant_id, e.id],
|
|
1104
1111
|
name: "action_versions_pk"
|
|
1105
1112
|
}),
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
]), qt =
|
|
1113
|
+
Lt("uq_action_versions_number").on(e.tenant_id, e.action_id, e.number),
|
|
1114
|
+
v("idx_action_versions_action_id").on(e.tenant_id, e.action_id)
|
|
1115
|
+
]), qt = y("action_executions", {
|
|
1109
1116
|
id: _("id", { length: 255 }).notNull(),
|
|
1110
1117
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1111
1118
|
trigger_id: _("trigger_id", { length: 255 }).notNull(),
|
|
@@ -1117,7 +1124,7 @@ var b = v("tenants", {
|
|
|
1117
1124
|
}, (e) => [Ht({
|
|
1118
1125
|
columns: [e.tenant_id, e.id],
|
|
1119
1126
|
name: "action_executions_pk"
|
|
1120
|
-
})]), x =
|
|
1127
|
+
})]), x = y("users", {
|
|
1121
1128
|
user_id: _("user_id", { length: 255 }).notNull(),
|
|
1122
1129
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1123
1130
|
email: _("email", { length: 255 }),
|
|
@@ -1158,14 +1165,14 @@ var b = v("tenants", {
|
|
|
1158
1165
|
columns: [e.user_id, e.tenant_id],
|
|
1159
1166
|
name: "users_tenants"
|
|
1160
1167
|
}),
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
]), Jt =
|
|
1168
|
+
Lt("unique_email_provider").on(e.email, e.provider, e.tenant_id),
|
|
1169
|
+
Lt("unique_phone_provider").on(e.phone_number, e.provider, e.tenant_id),
|
|
1170
|
+
Lt("unique_username_provider").on(e.username, e.provider, e.tenant_id),
|
|
1171
|
+
v("users_email_index").on(e.email),
|
|
1172
|
+
v("users_linked_to_index").on(e.linked_to),
|
|
1173
|
+
v("users_name_index").on(e.name),
|
|
1174
|
+
v("users_phone_tenant_provider_index").on(e.tenant_id, e.phone_number, e.provider)
|
|
1175
|
+
]), Jt = y("passwords", {
|
|
1169
1176
|
id: _("id", { length: 21 }).primaryKey(),
|
|
1170
1177
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1171
1178
|
user_id: _("user_id", { length: 255 }).notNull(),
|
|
@@ -1174,7 +1181,7 @@ var b = v("tenants", {
|
|
|
1174
1181
|
password: _("password", { length: 255 }).notNull(),
|
|
1175
1182
|
algorithm: _("algorithm", { length: 16 }).notNull().default("bcrypt"),
|
|
1176
1183
|
is_current: g("is_current").notNull().default(1)
|
|
1177
|
-
}), Yt =
|
|
1184
|
+
}), Yt = y("sessions", {
|
|
1178
1185
|
id: _("id", { length: 21 }).notNull(),
|
|
1179
1186
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1180
1187
|
user_id: _("user_id", { length: 255 }),
|
|
@@ -1194,10 +1201,10 @@ var b = v("tenants", {
|
|
|
1194
1201
|
columns: [e.tenant_id, e.id],
|
|
1195
1202
|
name: "sessions_pk"
|
|
1196
1203
|
}),
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
]), S =
|
|
1204
|
+
v("IDX_sessions_login_session_id").on(e.login_session_id),
|
|
1205
|
+
v("idx_sessions_user_id").on(e.tenant_id, e.user_id),
|
|
1206
|
+
v("idx_sessions_expires_at_ts").on(e.expires_at_ts)
|
|
1207
|
+
]), S = y("refresh_tokens", {
|
|
1201
1208
|
id: _("id", { length: 26 }).notNull(),
|
|
1202
1209
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1203
1210
|
client_id: _("client_id", { length: 191 }).notNull(),
|
|
@@ -1221,12 +1228,12 @@ var b = v("tenants", {
|
|
|
1221
1228
|
columns: [e.tenant_id, e.id],
|
|
1222
1229
|
name: "refresh_tokens_pk"
|
|
1223
1230
|
}),
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
]), C =
|
|
1231
|
+
v("idx_refresh_tokens_user_id").on(e.tenant_id, e.user_id),
|
|
1232
|
+
v("idx_refresh_tokens_login_id").on(e.login_id),
|
|
1233
|
+
v("idx_refresh_tokens_expires_at_ts").on(e.expires_at_ts),
|
|
1234
|
+
v("idx_refresh_tokens_token_lookup").on(e.tenant_id, e.token_lookup),
|
|
1235
|
+
v("idx_refresh_tokens_family_id").on(e.tenant_id, e.family_id)
|
|
1236
|
+
]), C = y("login_sessions", {
|
|
1230
1237
|
id: _("id", { length: 21 }).notNull(),
|
|
1231
1238
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1232
1239
|
session_id: _("session_id", { length: 21 }),
|
|
@@ -1252,12 +1259,12 @@ var b = v("tenants", {
|
|
|
1252
1259
|
columns: [e.tenant_id, e.id],
|
|
1253
1260
|
name: "login_sessions_pk"
|
|
1254
1261
|
}),
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
]), Xt =
|
|
1262
|
+
v("login_sessions_id_index").on(e.id),
|
|
1263
|
+
v("login_sessions_state_idx").on(e.state),
|
|
1264
|
+
v("login_sessions_state_updated_idx").on(e.state, e.updated_at_ts),
|
|
1265
|
+
v("login_sessions_tenant_user_idx").on(e.tenant_id, e.user_id),
|
|
1266
|
+
v("idx_login_sessions_expires_at_ts").on(e.expires_at_ts)
|
|
1267
|
+
]), Xt = y("codes", {
|
|
1261
1268
|
code_id: _("code_id", { length: 191 }).notNull(),
|
|
1262
1269
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1263
1270
|
user_id: _("user_id", { length: 255 }),
|
|
@@ -1276,7 +1283,7 @@ var b = v("tenants", {
|
|
|
1276
1283
|
}, (e) => [Ht({
|
|
1277
1284
|
columns: [e.code_id, e.code_type],
|
|
1278
1285
|
name: "PK_codes_code_id_code_type"
|
|
1279
|
-
}),
|
|
1286
|
+
}), v("codes_expires_at_index").on(e.expires_at)]), Zt = y("authentication_codes", {
|
|
1280
1287
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1281
1288
|
code: _("code", { length: 255 }).primaryKey(),
|
|
1282
1289
|
client_id: _("client_id", { length: 255 }).notNull(),
|
|
@@ -1290,7 +1297,7 @@ var b = v("tenants", {
|
|
|
1290
1297
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
1291
1298
|
expires_at: _("expires_at", { length: 35 }).notNull(),
|
|
1292
1299
|
used_at: _("used_at", { length: 35 })
|
|
1293
|
-
}), Qt =
|
|
1300
|
+
}), Qt = y("otps", {
|
|
1294
1301
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1295
1302
|
id: _("id", { length: 255 }).primaryKey(),
|
|
1296
1303
|
client_id: _("client_id", { length: 255 }).notNull(),
|
|
@@ -1309,7 +1316,7 @@ var b = v("tenants", {
|
|
|
1309
1316
|
used_at: _("used_at", { length: 35 }),
|
|
1310
1317
|
audience: _("audience", { length: 255 }),
|
|
1311
1318
|
ip: _("ip", { length: 64 })
|
|
1312
|
-
}, (e) => [
|
|
1319
|
+
}, (e) => [v("otps_email_index").on(e.email), v("otps_expires_at_index").on(e.expires_at)]), $t = y("tickets", {
|
|
1313
1320
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1314
1321
|
id: _("id", { length: 255 }).primaryKey(),
|
|
1315
1322
|
client_id: _("client_id", { length: 255 }).notNull(),
|
|
@@ -1323,7 +1330,7 @@ var b = v("tenants", {
|
|
|
1323
1330
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
1324
1331
|
expires_at: _("expires_at", { length: 35 }).notNull(),
|
|
1325
1332
|
used_at: _("used_at", { length: 35 })
|
|
1326
|
-
}), w =
|
|
1333
|
+
}), w = y("clients", {
|
|
1327
1334
|
client_id: _("client_id", { length: 191 }).notNull(),
|
|
1328
1335
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1329
1336
|
name: _("name", { length: 255 }).notNull(),
|
|
@@ -1383,7 +1390,7 @@ var b = v("tenants", {
|
|
|
1383
1390
|
}, (e) => [Ht({
|
|
1384
1391
|
columns: [e.tenant_id, e.client_id],
|
|
1385
1392
|
name: "clients_tenant_id_client_id"
|
|
1386
|
-
}),
|
|
1393
|
+
}), v("idx_clients_owner_user_id").on(e.tenant_id, e.owner_user_id)]), T = y("client_registration_tokens", {
|
|
1387
1394
|
id: _("id", { length: 255 }).primaryKey(),
|
|
1388
1395
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1389
1396
|
token_hash: _("token_hash", { length: 64 }).notNull(),
|
|
@@ -1396,7 +1403,7 @@ var b = v("tenants", {
|
|
|
1396
1403
|
expires_at_ts: g("expires_at_ts"),
|
|
1397
1404
|
created_at_ts: g("created_at_ts").notNull(),
|
|
1398
1405
|
revoked_at_ts: g("revoked_at_ts")
|
|
1399
|
-
}, (e) => [
|
|
1406
|
+
}, (e) => [Lt("idx_client_registration_tokens_hash").on(e.tenant_id, e.token_hash), v("idx_client_registration_tokens_client").on(e.tenant_id, e.client_id)]), en = y("client_grants", {
|
|
1400
1407
|
id: _("id", { length: 21 }).notNull(),
|
|
1401
1408
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1402
1409
|
client_id: _("client_id", { length: 191 }).notNull(),
|
|
@@ -1412,7 +1419,7 @@ var b = v("tenants", {
|
|
|
1412
1419
|
}, (e) => [Ht({
|
|
1413
1420
|
columns: [e.tenant_id, e.id],
|
|
1414
1421
|
name: "pk_client_grants"
|
|
1415
|
-
}),
|
|
1422
|
+
}), v("idx_client_grants_audience").on(e.audience)]), tn = y("connections", {
|
|
1416
1423
|
id: _("id", { length: 255 }).notNull(),
|
|
1417
1424
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1418
1425
|
name: _("name", { length: 255 }).notNull(),
|
|
@@ -1429,9 +1436,9 @@ var b = v("tenants", {
|
|
|
1429
1436
|
metadata: _("metadata", { length: 4096 })
|
|
1430
1437
|
}, (e) => [
|
|
1431
1438
|
Ht({ columns: [e.tenant_id, e.id] }),
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
]), nn =
|
|
1439
|
+
v("connections_tenant_id_index").on(e.tenant_id),
|
|
1440
|
+
Lt("connections_id_unique").on(e.id)
|
|
1441
|
+
]), nn = y("custom_domains", {
|
|
1435
1442
|
custom_domain_id: _("custom_domain_id", { length: 256 }).primaryKey(),
|
|
1436
1443
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1437
1444
|
domain: _("domain", { length: 255 }).notNull(),
|
|
@@ -1445,7 +1452,7 @@ var b = v("tenants", {
|
|
|
1445
1452
|
domain_metadata: _("domain_metadata", { length: 2048 }),
|
|
1446
1453
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
1447
1454
|
updated_at: _("updated_at", { length: 35 }).notNull()
|
|
1448
|
-
}, (e) => [
|
|
1455
|
+
}, (e) => [Lt("custom_domains_domain_unique").on(e.domain)]), rn = y("domains", {
|
|
1449
1456
|
id: _("id", { length: 255 }).primaryKey(),
|
|
1450
1457
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1451
1458
|
domain: _("domain", { length: 255 }).notNull(),
|
|
@@ -1455,7 +1462,7 @@ var b = v("tenants", {
|
|
|
1455
1462
|
dkim_public_key: _("dkim_public_key", { length: 2048 }),
|
|
1456
1463
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
1457
1464
|
updated_at: _("updated_at", { length: 35 }).notNull()
|
|
1458
|
-
}), an =
|
|
1465
|
+
}), an = y("organizations", {
|
|
1459
1466
|
id: _("id", { length: 21 }).primaryKey(),
|
|
1460
1467
|
tenant_id: _("tenant_id", { length: 191 }).notNull(),
|
|
1461
1468
|
name: _("name", { length: 256 }).notNull(),
|
|
@@ -1466,7 +1473,7 @@ var b = v("tenants", {
|
|
|
1466
1473
|
token_quota: _("token_quota"),
|
|
1467
1474
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
1468
1475
|
updated_at: _("updated_at", { length: 35 }).notNull()
|
|
1469
|
-
}, (e) => [
|
|
1476
|
+
}, (e) => [v("idx_organizations_tenant_id").on(e.tenant_id)]), on = y("user_organizations", {
|
|
1470
1477
|
id: _("id", { length: 21 }).primaryKey(),
|
|
1471
1478
|
tenant_id: _("tenant_id", { length: 191 }).notNull(),
|
|
1472
1479
|
user_id: _("user_id", { length: 191 }).notNull(),
|
|
@@ -1474,11 +1481,11 @@ var b = v("tenants", {
|
|
|
1474
1481
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
1475
1482
|
updated_at: _("updated_at", { length: 35 }).notNull()
|
|
1476
1483
|
}, (e) => [
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
]), sn =
|
|
1484
|
+
Lt("user_organizations_unique").on(e.tenant_id, e.user_id, e.organization_id),
|
|
1485
|
+
v("idx_user_organizations_tenant_id").on(e.tenant_id),
|
|
1486
|
+
v("idx_user_organizations_user_id").on(e.user_id),
|
|
1487
|
+
v("idx_user_organizations_organization_id").on(e.organization_id)
|
|
1488
|
+
]), sn = y("invites", {
|
|
1482
1489
|
id: _("id", { length: 21 }).primaryKey(),
|
|
1483
1490
|
tenant_id: _("tenant_id", { length: 191 }).notNull(),
|
|
1484
1491
|
organization_id: _("organization_id", { length: 21 }).notNull(),
|
|
@@ -1496,11 +1503,11 @@ var b = v("tenants", {
|
|
|
1496
1503
|
ttl_sec: g("ttl_sec"),
|
|
1497
1504
|
send_invitation_email: g("send_invitation_email")
|
|
1498
1505
|
}, (e) => [
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
]), cn =
|
|
1506
|
+
v("idx_invites_tenant_id").on(e.tenant_id),
|
|
1507
|
+
v("idx_invites_organization_id").on(e.organization_id),
|
|
1508
|
+
v("idx_invites_expires_at").on(e.expires_at),
|
|
1509
|
+
v("idx_invites_tenant_created").on(e.tenant_id, e.created_at)
|
|
1510
|
+
]), cn = y("roles", {
|
|
1504
1511
|
id: _("id", { length: 21 }).notNull(),
|
|
1505
1512
|
tenant_id: _("tenant_id", { length: 191 }).notNull(),
|
|
1506
1513
|
name: _("name", { length: 50 }).notNull(),
|
|
@@ -1512,7 +1519,7 @@ var b = v("tenants", {
|
|
|
1512
1519
|
}, (e) => [Ht({
|
|
1513
1520
|
columns: [e.tenant_id, e.id],
|
|
1514
1521
|
name: "roles_pk"
|
|
1515
|
-
})]), ln =
|
|
1522
|
+
})]), ln = y("role_permissions", {
|
|
1516
1523
|
tenant_id: _("tenant_id", { length: 191 }).notNull(),
|
|
1517
1524
|
role_id: _("role_id", { length: 21 }).notNull(),
|
|
1518
1525
|
resource_server_identifier: _("resource_server_identifier", { length: 191 }).notNull(),
|
|
@@ -1528,9 +1535,9 @@ var b = v("tenants", {
|
|
|
1528
1535
|
],
|
|
1529
1536
|
name: "role_permissions_pk"
|
|
1530
1537
|
}),
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
]), un =
|
|
1538
|
+
v("role_permissions_role_fk").on(e.tenant_id, e.role_id),
|
|
1539
|
+
v("role_permissions_permission_fk").on(e.tenant_id, e.resource_server_identifier, e.permission_name)
|
|
1540
|
+
]), un = y("user_permissions", {
|
|
1534
1541
|
tenant_id: _("tenant_id", { length: 191 }).notNull(),
|
|
1535
1542
|
user_id: _("user_id", { length: 191 }).notNull(),
|
|
1536
1543
|
resource_server_identifier: _("resource_server_identifier", { length: 191 }).notNull(),
|
|
@@ -1548,10 +1555,10 @@ var b = v("tenants", {
|
|
|
1548
1555
|
],
|
|
1549
1556
|
name: "user_permissions_pk"
|
|
1550
1557
|
}),
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
]), dn =
|
|
1558
|
+
v("user_permissions_user_fk").on(e.tenant_id, e.user_id),
|
|
1559
|
+
v("user_permissions_permission_fk").on(e.tenant_id, e.resource_server_identifier, e.permission_name),
|
|
1560
|
+
v("user_permissions_organization_fk").on(e.organization_id)
|
|
1561
|
+
]), dn = y("user_roles", {
|
|
1555
1562
|
tenant_id: _("tenant_id", { length: 191 }).notNull(),
|
|
1556
1563
|
user_id: _("user_id", { length: 191 }).notNull(),
|
|
1557
1564
|
role_id: _("role_id", { length: 21 }).notNull(),
|
|
@@ -1567,10 +1574,10 @@ var b = v("tenants", {
|
|
|
1567
1574
|
],
|
|
1568
1575
|
name: "user_roles_pk"
|
|
1569
1576
|
}),
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
]), fn =
|
|
1577
|
+
v("user_roles_user_fk").on(e.tenant_id, e.user_id),
|
|
1578
|
+
v("user_roles_role_fk").on(e.tenant_id, e.role_id),
|
|
1579
|
+
v("user_roles_organization_fk").on(e.organization_id)
|
|
1580
|
+
]), fn = y("resource_servers", {
|
|
1574
1581
|
id: _("id", { length: 21 }).notNull(),
|
|
1575
1582
|
tenant_id: _("tenant_id", { length: 191 }).notNull(),
|
|
1576
1583
|
identifier: _("identifier", { length: 191 }).notNull(),
|
|
@@ -1591,7 +1598,7 @@ var b = v("tenants", {
|
|
|
1591
1598
|
}, (e) => [Ht({
|
|
1592
1599
|
columns: [e.tenant_id, e.id],
|
|
1593
1600
|
name: "resource_servers_pk"
|
|
1594
|
-
})]), pn =
|
|
1601
|
+
})]), pn = y("branding", {
|
|
1595
1602
|
tenant_id: _("tenant_id", { length: 191 }).primaryKey().references(() => b.id, { onDelete: "cascade" }),
|
|
1596
1603
|
logo_url: _("logo_url", { length: 512 }),
|
|
1597
1604
|
favicon_url: _("favicon_url", { length: 512 }),
|
|
@@ -1602,12 +1609,12 @@ var b = v("tenants", {
|
|
|
1602
1609
|
colors_page_background_end: _("colors_page_background_end", { length: 8 }),
|
|
1603
1610
|
colors_page_background_angle_dev: g("colors_page_background_angle_dev"),
|
|
1604
1611
|
dark_mode: _("dark_mode", { length: 8 })
|
|
1605
|
-
}), mn =
|
|
1612
|
+
}), mn = y("universal_login_templates", {
|
|
1606
1613
|
tenant_id: _("tenant_id", { length: 191 }).primaryKey().references(() => b.id, { onDelete: "cascade" }),
|
|
1607
1614
|
body: _("body").notNull(),
|
|
1608
1615
|
created_at_ts: g("created_at_ts").notNull(),
|
|
1609
1616
|
updated_at_ts: g("updated_at_ts").notNull()
|
|
1610
|
-
}), hn =
|
|
1617
|
+
}), hn = y("themes", {
|
|
1611
1618
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1612
1619
|
themeId: _("themeId", { length: 255 }).notNull(),
|
|
1613
1620
|
displayName: _("displayName", { length: 255 }).notNull(),
|
|
@@ -1667,7 +1674,7 @@ var b = v("tenants", {
|
|
|
1667
1674
|
}, (e) => [Ht({
|
|
1668
1675
|
columns: [e.tenant_id, e.themeId],
|
|
1669
1676
|
name: "themes_pkey"
|
|
1670
|
-
}),
|
|
1677
|
+
}), v("themes_tenant_id_idx").on(e.tenant_id)]), gn = y("forms", {
|
|
1671
1678
|
id: _("id", { length: 255 }).primaryKey(),
|
|
1672
1679
|
name: _("name", { length: 255 }).notNull(),
|
|
1673
1680
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
@@ -1680,20 +1687,20 @@ var b = v("tenants", {
|
|
|
1680
1687
|
style: _("style", { length: 1042 }),
|
|
1681
1688
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
1682
1689
|
updated_at: _("updated_at", { length: 35 }).notNull()
|
|
1683
|
-
}, (e) => [
|
|
1690
|
+
}, (e) => [v("forms_tenant_id_idx").on(e.tenant_id)]), _n = y("flows", {
|
|
1684
1691
|
id: _("id", { length: 24 }).primaryKey(),
|
|
1685
1692
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1686
1693
|
name: _("name", { length: 150 }).notNull(),
|
|
1687
1694
|
actions: _("actions"),
|
|
1688
1695
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
1689
1696
|
updated_at: _("updated_at", { length: 35 }).notNull()
|
|
1690
|
-
}, (e) => [
|
|
1697
|
+
}, (e) => [v("flows_tenant_id_idx").on(e.tenant_id)]), vn = y("prompt_settings", {
|
|
1691
1698
|
tenant_id: _("tenant_id", { length: 191 }).primaryKey(),
|
|
1692
1699
|
universal_login_experience: _("universal_login_experience", { length: 16 }).notNull().default("new"),
|
|
1693
1700
|
identifier_first: g("identifier_first", { mode: "boolean" }).notNull().default(!0),
|
|
1694
1701
|
password_first: g("password_first", { mode: "boolean" }).notNull().default(!1),
|
|
1695
1702
|
webauthn_platform_first_factor: g("webauthn_platform_first_factor", { mode: "boolean" }).notNull().default(!1)
|
|
1696
|
-
}), yn =
|
|
1703
|
+
}), yn = y("email_providers", {
|
|
1697
1704
|
tenant_id: _("tenant_id", { length: 191 }).primaryKey(),
|
|
1698
1705
|
name: _("name", { length: 255 }).notNull(),
|
|
1699
1706
|
enabled: g("enabled", { mode: "boolean" }).notNull(),
|
|
@@ -1702,7 +1709,7 @@ var b = v("tenants", {
|
|
|
1702
1709
|
settings: _("settings", { length: 2048 }).notNull().default("{}"),
|
|
1703
1710
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
1704
1711
|
updated_at: _("updated_at", { length: 35 }).notNull()
|
|
1705
|
-
}), bn =
|
|
1712
|
+
}), bn = y("email_templates", {
|
|
1706
1713
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1707
1714
|
template: _("template", { length: 64 }).notNull(),
|
|
1708
1715
|
body: _("body").notNull(),
|
|
@@ -1715,7 +1722,7 @@ var b = v("tenants", {
|
|
|
1715
1722
|
enabled: g("enabled", { mode: "boolean" }).notNull().default(!0),
|
|
1716
1723
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
1717
1724
|
updated_at: _("updated_at", { length: 35 }).notNull()
|
|
1718
|
-
}, (e) => [Ht({ columns: [e.tenant_id, e.template] })]), xn =
|
|
1725
|
+
}, (e) => [Ht({ columns: [e.tenant_id, e.template] })]), xn = y("hooks", {
|
|
1719
1726
|
hook_id: _("hook_id", { length: 21 }).primaryKey(),
|
|
1720
1727
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1721
1728
|
url: _("url", { length: 512 }),
|
|
@@ -1729,14 +1736,14 @@ var b = v("tenants", {
|
|
|
1729
1736
|
template_id: _("template_id", { length: 64 }),
|
|
1730
1737
|
code_id: _("code_id", { length: 21 }),
|
|
1731
1738
|
metadata: _("metadata")
|
|
1732
|
-
}, (e) => [
|
|
1739
|
+
}, (e) => [v("hooks_tenant_id_idx").on(e.tenant_id)]), Sn = y("hook_code", {
|
|
1733
1740
|
id: _("id", { length: 21 }).primaryKey(),
|
|
1734
1741
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1735
1742
|
code: _("code").notNull(),
|
|
1736
1743
|
secrets: _("secrets"),
|
|
1737
1744
|
created_at_ts: g("created_at_ts").notNull(),
|
|
1738
1745
|
updated_at_ts: g("updated_at_ts").notNull()
|
|
1739
|
-
}, (e) => [
|
|
1746
|
+
}, (e) => [v("hook_code_tenant_id_idx").on(e.tenant_id)]), Cn = y("keys", {
|
|
1740
1747
|
kid: _("kid", { length: 255 }).primaryKey(),
|
|
1741
1748
|
tenant_id: _("tenant_id", { length: 191 }).references(() => b.id, { onDelete: "cascade" }),
|
|
1742
1749
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
@@ -1749,7 +1756,7 @@ var b = v("tenants", {
|
|
|
1749
1756
|
current_until: _("current_until", { length: 35 }),
|
|
1750
1757
|
type: _("type", { length: 50 }).notNull().default("jwt_signing"),
|
|
1751
1758
|
connection: _("connection", { length: 255 }).references(() => tn.id, { onDelete: "cascade" })
|
|
1752
|
-
}), wn =
|
|
1759
|
+
}), wn = y("custom_text", {
|
|
1753
1760
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1754
1761
|
prompt: _("prompt", { length: 64 }).notNull(),
|
|
1755
1762
|
language: _("language", { length: 16 }).notNull(),
|
|
@@ -1760,7 +1767,7 @@ var b = v("tenants", {
|
|
|
1760
1767
|
e.tenant_id,
|
|
1761
1768
|
e.prompt,
|
|
1762
1769
|
e.language
|
|
1763
|
-
] })]), Tn =
|
|
1770
|
+
] })]), Tn = y("authentication_methods", {
|
|
1764
1771
|
id: _("id", { length: 26 }).primaryKey(),
|
|
1765
1772
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1766
1773
|
user_id: _("user_id", { length: 255 }).notNull(),
|
|
@@ -1776,7 +1783,7 @@ var b = v("tenants", {
|
|
|
1776
1783
|
confirmed: g("confirmed").notNull().default(0),
|
|
1777
1784
|
created_at_ts: g("created_at_ts").notNull(),
|
|
1778
1785
|
updated_at_ts: g("updated_at_ts").notNull()
|
|
1779
|
-
}, (e) => [
|
|
1786
|
+
}, (e) => [v("authentication_methods_tenant_user_idx").on(e.tenant_id, e.user_id), v("authentication_methods_credential_id_idx").on(e.credential_id)]), E = y("logs", {
|
|
1780
1787
|
log_id: _("log_id", { length: 21 }).primaryKey(),
|
|
1781
1788
|
category: _("category", { length: 255 }),
|
|
1782
1789
|
tenant_id: _("tenant_id", { length: 64 }),
|
|
@@ -1807,11 +1814,11 @@ var b = v("tenants", {
|
|
|
1807
1814
|
time_zone: _("time_zone", { length: 255 }),
|
|
1808
1815
|
continent_code: _("continent_code", { length: 2 })
|
|
1809
1816
|
}, (e) => [
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
]), D =
|
|
1817
|
+
v("logs_user_id").on(e.user_id),
|
|
1818
|
+
v("logs_tenant_id").on(e.tenant_id),
|
|
1819
|
+
v("logs_date").on(e.date),
|
|
1820
|
+
v("IDX_logs_tenant_date_type_user").on(e.tenant_id, e.date, e.type, e.user_id)
|
|
1821
|
+
]), D = y("outbox_events", {
|
|
1815
1822
|
id: _("id", { length: 26 }).primaryKey(),
|
|
1816
1823
|
tenant_id: _("tenant_id", { length: 191 }).notNull().references(() => b.id, { onDelete: "cascade" }),
|
|
1817
1824
|
event_type: _("event_type", { length: 64 }).notNull(),
|
|
@@ -1829,11 +1836,11 @@ var b = v("tenants", {
|
|
|
1829
1836
|
dead_lettered_at: _("dead_lettered_at", { length: 35 }),
|
|
1830
1837
|
final_error: _("final_error")
|
|
1831
1838
|
}, (e) => [
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
]), O =
|
|
1839
|
+
v("idx_outbox_events_tenant_id").on(e.tenant_id),
|
|
1840
|
+
v("idx_outbox_events_processed_at").on(e.processed_at),
|
|
1841
|
+
v("idx_outbox_events_claimed_by").on(e.claimed_by),
|
|
1842
|
+
v("idx_outbox_events_tenant_dead_lettered").on(e.tenant_id, e.dead_lettered_at)
|
|
1843
|
+
]), O = y("proxy_routes", {
|
|
1837
1844
|
id: _("id", { length: 64 }).primaryKey(),
|
|
1838
1845
|
tenant_id: _("tenant_id", { length: 255 }).notNull(),
|
|
1839
1846
|
custom_domain_id: _("custom_domain_id", { length: 256 }).notNull(),
|
|
@@ -1842,7 +1849,7 @@ var b = v("tenants", {
|
|
|
1842
1849
|
handlers: _("handlers", { length: 16384 }).notNull().default("[]"),
|
|
1843
1850
|
created_at: _("created_at", { length: 35 }).notNull(),
|
|
1844
1851
|
updated_at: _("updated_at", { length: 35 }).notNull()
|
|
1845
|
-
}, (e) => [
|
|
1852
|
+
}, (e) => [v("proxy_routes_tenant_id_idx").on(e.tenant_id), v("proxy_routes_custom_domain_id_idx").on(e.custom_domain_id)]), En = /* @__PURE__ */ a({
|
|
1846
1853
|
actionExecutions: () => qt,
|
|
1847
1854
|
actionVersions: () => Kt,
|
|
1848
1855
|
actions: () => Gt,
|
|
@@ -1972,11 +1979,11 @@ function Pn(e, t, n, r = []) {
|
|
|
1972
1979
|
let [, t, r] = n;
|
|
1973
1980
|
if (!t || !r) return null;
|
|
1974
1981
|
let a = t.trim(), o = r.replace(/^"(.*)"$/, "$1").trim(), s = e[a];
|
|
1975
|
-
return s ? i.has(a) ?
|
|
1982
|
+
return s ? i.has(a) ? Ie(s, `%${o}%`) : m(s, o) : null;
|
|
1976
1983
|
}
|
|
1977
1984
|
return null;
|
|
1978
1985
|
}).filter(Boolean);
|
|
1979
|
-
return t.length === 0 ? void 0 :
|
|
1986
|
+
return t.length === 0 ? void 0 : Oe(...t);
|
|
1980
1987
|
}
|
|
1981
1988
|
let o = [], s = "", c = !1;
|
|
1982
1989
|
for (let e = 0; e < t.length; e++) {
|
|
@@ -2006,44 +2013,44 @@ function Pn(e, t, n, r = []) {
|
|
|
2006
2013
|
o ? u.push(a ? p`${p.identifier(t)} IS NULL` : p`${p.identifier(t)} IS NOT NULL`) : u.push(p`${p.identifier(t)} ${p.raw(a ? "!=" : s ?? "=")} ${r}`);
|
|
2007
2014
|
continue;
|
|
2008
2015
|
}
|
|
2009
|
-
if (o) u.push(a ?
|
|
2010
|
-
else if (i.has(t) && s === "=") u.push(a ?
|
|
2016
|
+
if (o) u.push(a ? Pe(n) : Fe(n));
|
|
2017
|
+
else if (i.has(t) && s === "=") u.push(a ? Le(n, `%${r}%`) : Ie(n, `%${r}%`));
|
|
2011
2018
|
else if (a) switch (s) {
|
|
2012
2019
|
case ">":
|
|
2013
|
-
u.push(
|
|
2020
|
+
u.push(Me(n, r));
|
|
2014
2021
|
break;
|
|
2015
2022
|
case ">=":
|
|
2016
|
-
u.push(
|
|
2023
|
+
u.push(je(n, r));
|
|
2017
2024
|
break;
|
|
2018
2025
|
case "<":
|
|
2019
|
-
u.push(
|
|
2026
|
+
u.push(Ae(n, r));
|
|
2020
2027
|
break;
|
|
2021
2028
|
case "<=":
|
|
2022
|
-
u.push(
|
|
2029
|
+
u.push(ke(n, r));
|
|
2023
2030
|
break;
|
|
2024
|
-
default: u.push(
|
|
2031
|
+
default: u.push(De(n, r));
|
|
2025
2032
|
}
|
|
2026
2033
|
else switch (s) {
|
|
2027
2034
|
case ">":
|
|
2028
|
-
u.push(
|
|
2035
|
+
u.push(ke(n, r));
|
|
2029
2036
|
break;
|
|
2030
2037
|
case ">=":
|
|
2031
|
-
u.push(
|
|
2038
|
+
u.push(Ae(n, r));
|
|
2032
2039
|
break;
|
|
2033
2040
|
case "<":
|
|
2034
|
-
u.push(
|
|
2041
|
+
u.push(je(n, r));
|
|
2035
2042
|
break;
|
|
2036
2043
|
case "<=":
|
|
2037
|
-
u.push(
|
|
2044
|
+
u.push(Me(n, r));
|
|
2038
2045
|
break;
|
|
2039
2046
|
default: u.push(m(n, r));
|
|
2040
2047
|
}
|
|
2041
2048
|
} else if (r) {
|
|
2042
2049
|
let t = (r.includes("|") ? [...n, "user_id"] : n).map((t) => {
|
|
2043
2050
|
let n = e[t];
|
|
2044
|
-
return n ? t === "user_id" ? m(n, r) :
|
|
2051
|
+
return n ? t === "user_id" ? m(n, r) : Ie(n, `%${r}%`) : null;
|
|
2045
2052
|
}).filter(Boolean);
|
|
2046
|
-
t.length > 0 && u.push(
|
|
2053
|
+
t.length > 0 && u.push(Oe(...t));
|
|
2047
2054
|
}
|
|
2048
2055
|
if (u.length !== 0) return u.length === 1 ? u[0] : h(...u);
|
|
2049
2056
|
}
|
|
@@ -2117,7 +2124,7 @@ function Ln(e) {
|
|
|
2117
2124
|
let l = h(...c), u = e.select().from(Gt).where(l).$dynamic();
|
|
2118
2125
|
if (o?.sort_by) {
|
|
2119
2126
|
let e = Gt[o.sort_by];
|
|
2120
|
-
e && (u = u.orderBy(o.sort_order === "desc" ?
|
|
2127
|
+
e && (u = u.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
2121
2128
|
}
|
|
2122
2129
|
let d = (await u.offset(r * i).limit(i)).map(In);
|
|
2123
2130
|
if (!a) return {
|
|
@@ -2126,7 +2133,7 @@ function Ln(e) {
|
|
|
2126
2133
|
limit: 0,
|
|
2127
2134
|
length: 0
|
|
2128
2135
|
};
|
|
2129
|
-
let [f] = await e.select({ count:
|
|
2136
|
+
let [f] = await e.select({ count: Be() }).from(Gt).where(l);
|
|
2130
2137
|
return {
|
|
2131
2138
|
actions: d,
|
|
2132
2139
|
start: r * i,
|
|
@@ -2218,7 +2225,7 @@ function Bn(e) {
|
|
|
2218
2225
|
await e.run(p`BEGIN`);
|
|
2219
2226
|
let o;
|
|
2220
2227
|
try {
|
|
2221
|
-
o = ((await e.select({ number: Kt.number }).from(Kt).where(h(m(Kt.tenant_id, t), m(Kt.action_id, n.action_id))).orderBy(
|
|
2228
|
+
o = ((await e.select({ number: Kt.number }).from(Kt).where(h(m(Kt.tenant_id, t), m(Kt.action_id, n.action_id))).orderBy(ze(Kt.number)).limit(1).get())?.number ?? 0) + 1, a && await e.update(Kt).set({
|
|
2222
2229
|
deployed: 0,
|
|
2223
2230
|
updated_at_ts: r
|
|
2224
2231
|
}).where(h(m(Kt.tenant_id, t), m(Kt.action_id, n.action_id))), await e.insert(Kt).values({
|
|
@@ -2258,14 +2265,14 @@ function Bn(e) {
|
|
|
2258
2265
|
return i ? zn(i) : null;
|
|
2259
2266
|
},
|
|
2260
2267
|
async list(t, n, r = {}) {
|
|
2261
|
-
let { page: i = 0, per_page: a = 50, include_totals: o = !1 } = r, s = h(m(Kt.tenant_id, t), m(Kt.action_id, n)), c = (await e.select().from(Kt).where(s).orderBy(
|
|
2268
|
+
let { page: i = 0, per_page: a = 50, include_totals: o = !1 } = r, s = h(m(Kt.tenant_id, t), m(Kt.action_id, n)), c = (await e.select().from(Kt).where(s).orderBy(ze(Kt.number)).offset(i * a).limit(a)).map(zn);
|
|
2262
2269
|
if (!o) return {
|
|
2263
2270
|
versions: c,
|
|
2264
2271
|
start: 0,
|
|
2265
2272
|
limit: 0,
|
|
2266
2273
|
length: 0
|
|
2267
2274
|
};
|
|
2268
|
-
let [l] = await e.select({ count:
|
|
2275
|
+
let [l] = await e.select({ count: Be() }).from(Kt).where(s);
|
|
2269
2276
|
return {
|
|
2270
2277
|
versions: c,
|
|
2271
2278
|
start: i * a,
|
|
@@ -2326,7 +2333,7 @@ function Hn(e) {
|
|
|
2326
2333
|
};
|
|
2327
2334
|
}
|
|
2328
2335
|
//#endregion
|
|
2329
|
-
//#region ../../node_modules/.pnpm/hono@4.12.
|
|
2336
|
+
//#region ../../node_modules/.pnpm/hono@4.12.27/node_modules/hono/dist/http-exception.js
|
|
2330
2337
|
var Un = class extends Error {
|
|
2331
2338
|
res;
|
|
2332
2339
|
status;
|
|
@@ -2459,11 +2466,11 @@ function Yn(e) {
|
|
|
2459
2466
|
}
|
|
2460
2467
|
if (o?.sort_by) {
|
|
2461
2468
|
let e = w[o.sort_by];
|
|
2462
|
-
e && (c = c.orderBy(o.sort_order === "desc" ?
|
|
2469
|
+
e && (c = c.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
2463
2470
|
}
|
|
2464
2471
|
let l = (await c.offset(r * i).limit(i)).map(qn);
|
|
2465
2472
|
if (!a) return { clients: l };
|
|
2466
|
-
let [u] = await e.select({ count:
|
|
2473
|
+
let [u] = await e.select({ count: Be() }).from(w).where(m(w.tenant_id, t));
|
|
2467
2474
|
return {
|
|
2468
2475
|
clients: l,
|
|
2469
2476
|
start: r * i,
|
|
@@ -2494,7 +2501,7 @@ function Zn(e) {
|
|
|
2494
2501
|
if (!r) return [];
|
|
2495
2502
|
let i = A(r.connections, []) || [];
|
|
2496
2503
|
if (i.length === 0) return [];
|
|
2497
|
-
let a = (await e.select().from(tn).where(h(m(tn.tenant_id, t),
|
|
2504
|
+
let a = (await e.select().from(tn).where(h(m(tn.tenant_id, t), Ne(tn.id, i))).all()).map(Xn);
|
|
2498
2505
|
return i.map((e) => a.find((t) => t.id === e)).filter(Boolean);
|
|
2499
2506
|
},
|
|
2500
2507
|
async updateByClient(t, n, r) {
|
|
@@ -2579,11 +2586,11 @@ function $n(e) {
|
|
|
2579
2586
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = s ? Pn(en, s, ["client_id", "audience"]) : void 0, l = c ? h(m(en.tenant_id, t), c) : m(en.tenant_id, t), u = e.select().from(en).where(l).$dynamic();
|
|
2580
2587
|
if (o?.sort_by) {
|
|
2581
2588
|
let e = en[o.sort_by];
|
|
2582
|
-
e && (u = u.orderBy(o.sort_order === "desc" ?
|
|
2583
|
-
} else u = u.orderBy(
|
|
2589
|
+
e && (u = u.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
2590
|
+
} else u = u.orderBy(Re(en.created_at));
|
|
2584
2591
|
let d = (await u.offset(r * i).limit(i)).map(Qn);
|
|
2585
2592
|
if (!a) return { client_grants: d };
|
|
2586
|
-
let [f] = await e.select({ count:
|
|
2593
|
+
let [f] = await e.select({ count: Be() }).from(en).where(l);
|
|
2587
2594
|
return {
|
|
2588
2595
|
client_grants: d,
|
|
2589
2596
|
start: r * i,
|
|
@@ -3003,7 +3010,10 @@ function Fr(e, t, n) {
|
|
|
3003
3010
|
}
|
|
3004
3011
|
function Ir(...e) {
|
|
3005
3012
|
let t = {};
|
|
3006
|
-
for (let n of e)
|
|
3013
|
+
for (let n of e) {
|
|
3014
|
+
let e = Object.getOwnPropertyDescriptors(n);
|
|
3015
|
+
Object.assign(t, e);
|
|
3016
|
+
}
|
|
3007
3017
|
return Object.defineProperties({}, t);
|
|
3008
3018
|
}
|
|
3009
3019
|
function Lr(e) {
|
|
@@ -3420,7 +3430,7 @@ var Fi = (e) => (t, n, r, i) => {
|
|
|
3420
3430
|
}, a);
|
|
3421
3431
|
if (o instanceof Promise) throw new _r();
|
|
3422
3432
|
if (o.issues.length) {
|
|
3423
|
-
let t = new (i?.Err ?? e)(o.issues.map((e) => hi(e, a, br())));
|
|
3433
|
+
let t = new ((i?.Err) ?? e)(o.issues.map((e) => hi(e, a, br())));
|
|
3424
3434
|
throw Ur(t, i?.callee), t;
|
|
3425
3435
|
}
|
|
3426
3436
|
return o.value;
|
|
@@ -3433,7 +3443,7 @@ var Fi = (e) => (t, n, r, i) => {
|
|
|
3433
3443
|
issues: []
|
|
3434
3444
|
}, a);
|
|
3435
3445
|
if (o instanceof Promise && (o = await o), o.issues.length) {
|
|
3436
|
-
let t = new (i?.Err ?? e)(o.issues.map((e) => hi(e, a, br())));
|
|
3446
|
+
let t = new ((i?.Err) ?? e)(o.issues.map((e) => hi(e, a, br())));
|
|
3437
3447
|
throw Ur(t, i?.callee), t;
|
|
3438
3448
|
}
|
|
3439
3449
|
return o.value;
|
|
@@ -4338,7 +4348,7 @@ var gs = /*@__PURE__*/ j("$ZodJWT", (e, t) => {
|
|
|
4338
4348
|
}), t;
|
|
4339
4349
|
};
|
|
4340
4350
|
}), ws = /*@__PURE__*/ j("$ZodUndefined", (e, t) => {
|
|
4341
|
-
L.init(e, t), e._zod.pattern = Ya, e._zod.values = new Set([void 0]), e._zod.parse = (t, n) => {
|
|
4351
|
+
L.init(e, t), e._zod.pattern = Ya, e._zod.values = /* @__PURE__ */ new Set([void 0]), e._zod.parse = (t, n) => {
|
|
4342
4352
|
let r = t.value;
|
|
4343
4353
|
return r === void 0 || t.issues.push({
|
|
4344
4354
|
expected: "undefined",
|
|
@@ -4348,7 +4358,7 @@ var gs = /*@__PURE__*/ j("$ZodJWT", (e, t) => {
|
|
|
4348
4358
|
}), t;
|
|
4349
4359
|
};
|
|
4350
4360
|
}), Ts = /*@__PURE__*/ j("$ZodNull", (e, t) => {
|
|
4351
|
-
L.init(e, t), e._zod.pattern = Ja, e._zod.values = new Set([null]), e._zod.parse = (t, n) => {
|
|
4361
|
+
L.init(e, t), e._zod.pattern = Ja, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (t, n) => {
|
|
4352
4362
|
let r = t.value;
|
|
4353
4363
|
return r === null || t.issues.push({
|
|
4354
4364
|
expected: "null",
|
|
@@ -5070,7 +5080,7 @@ function ac(e, t) {
|
|
|
5070
5080
|
} : e;
|
|
5071
5081
|
}
|
|
5072
5082
|
var oc = /*@__PURE__*/ j("$ZodOptional", (e, t) => {
|
|
5073
|
-
L.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", N(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, void 0]) : void 0), N(e._zod, "pattern", () => {
|
|
5083
|
+
L.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", N(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), N(e._zod, "pattern", () => {
|
|
5074
5084
|
let e = t.innerType._zod.pattern;
|
|
5075
5085
|
return e ? RegExp(`^(${jr(e.source)})?$`) : void 0;
|
|
5076
5086
|
}), e._zod.parse = (e, n) => {
|
|
@@ -5086,7 +5096,7 @@ var oc = /*@__PURE__*/ j("$ZodOptional", (e, t) => {
|
|
|
5086
5096
|
L.init(e, t), N(e._zod, "optin", () => t.innerType._zod.optin), N(e._zod, "optout", () => t.innerType._zod.optout), N(e._zod, "pattern", () => {
|
|
5087
5097
|
let e = t.innerType._zod.pattern;
|
|
5088
5098
|
return e ? RegExp(`^(${jr(e.source)}|null)$`) : void 0;
|
|
5089
|
-
}), N(e._zod, "values", () => t.innerType._zod.values ? new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n);
|
|
5099
|
+
}), N(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n);
|
|
5090
5100
|
}), lc = /*@__PURE__*/ j("$ZodDefault", (e, t) => {
|
|
5091
5101
|
L.init(e, t), e._zod.optin = "optional", N(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
|
|
5092
5102
|
if (n.direction === "backward") return t.innerType._zod.run(e, n);
|
|
@@ -13863,7 +13873,7 @@ var T_ = /* @__PURE__ */ a({
|
|
|
13863
13873
|
xor: () => Xh
|
|
13864
13874
|
});
|
|
13865
13875
|
//#endregion
|
|
13866
|
-
//#region ../../node_modules/.pnpm/@hono+zod-openapi@1.4.0_hono@4.12.
|
|
13876
|
+
//#region ../../node_modules/.pnpm/@hono+zod-openapi@1.4.0_hono@4.12.27_zod@4.4.3/node_modules/@hono/zod-openapi/dist/index.js
|
|
13867
13877
|
br(Zc()), fr(T_);
|
|
13868
13878
|
//#endregion
|
|
13869
13879
|
//#region ../adapter-interfaces/dist/adapter-interfaces.mjs
|
|
@@ -14834,6 +14844,23 @@ var Ev = q({
|
|
|
14834
14844
|
default_value: Jh([V(), K(V())]).optional()
|
|
14835
14845
|
}).optional()
|
|
14836
14846
|
}), Wv = Bv.extend({
|
|
14847
|
+
type: X("CODE"),
|
|
14848
|
+
config: q({
|
|
14849
|
+
length: U().int().positive().max(100).optional(),
|
|
14850
|
+
mode: Y(["numeric", "alphanumeric"]).optional(),
|
|
14851
|
+
auto_submit: W().optional(),
|
|
14852
|
+
group_size: U().int().min(0).max(100).optional(),
|
|
14853
|
+
separator: V().optional(),
|
|
14854
|
+
placeholder: V().optional(),
|
|
14855
|
+
default_value: V().optional()
|
|
14856
|
+
}).refine((e) => e.group_size === void 0 || e.length === void 0 || e.group_size <= e.length, {
|
|
14857
|
+
message: "group_size cannot exceed length",
|
|
14858
|
+
path: ["group_size"]
|
|
14859
|
+
}).refine((e) => e.default_value === void 0 || e.length === void 0 || e.default_value.length <= e.length, {
|
|
14860
|
+
message: "default_value is longer than the configured length",
|
|
14861
|
+
path: ["default_value"]
|
|
14862
|
+
}).optional()
|
|
14863
|
+
}), Gv = Bv.extend({
|
|
14837
14864
|
type: X("CUSTOM"),
|
|
14838
14865
|
config: q({
|
|
14839
14866
|
component: V().optional(),
|
|
@@ -14841,7 +14868,7 @@ var Ev = q({
|
|
|
14841
14868
|
schema: J(V(), G()).optional(),
|
|
14842
14869
|
code: V().optional()
|
|
14843
14870
|
})
|
|
14844
|
-
}),
|
|
14871
|
+
}), Kv = Bv.extend({
|
|
14845
14872
|
type: X("DATE"),
|
|
14846
14873
|
config: q({
|
|
14847
14874
|
format: V().optional(),
|
|
@@ -14849,7 +14876,7 @@ var Ev = q({
|
|
|
14849
14876
|
max: V().optional(),
|
|
14850
14877
|
default_value: V().optional()
|
|
14851
14878
|
}).optional()
|
|
14852
|
-
}),
|
|
14879
|
+
}), qv = Bv.extend({
|
|
14853
14880
|
type: X("DROPDOWN"),
|
|
14854
14881
|
config: q({
|
|
14855
14882
|
options: K(q({
|
|
@@ -14861,26 +14888,26 @@ var Ev = q({
|
|
|
14861
14888
|
multiple: W().optional(),
|
|
14862
14889
|
default_value: Jh([V(), K(V())]).optional()
|
|
14863
14890
|
}).optional()
|
|
14864
|
-
}),
|
|
14891
|
+
}), Jv = Bv.extend({
|
|
14865
14892
|
type: X("EMAIL"),
|
|
14866
14893
|
config: q({
|
|
14867
14894
|
placeholder: V().optional(),
|
|
14868
14895
|
default_value: V().optional()
|
|
14869
14896
|
}).optional()
|
|
14870
|
-
}),
|
|
14897
|
+
}), Yv = Bv.extend({
|
|
14871
14898
|
type: X("FILE"),
|
|
14872
14899
|
config: q({
|
|
14873
14900
|
accept: V().optional(),
|
|
14874
14901
|
max_size: U().optional(),
|
|
14875
14902
|
multiple: W().optional()
|
|
14876
14903
|
}).optional()
|
|
14877
|
-
}),
|
|
14904
|
+
}), Xv = Bv.extend({
|
|
14878
14905
|
type: X("LEGAL"),
|
|
14879
14906
|
config: q({
|
|
14880
14907
|
text: V(),
|
|
14881
14908
|
html: W().optional()
|
|
14882
14909
|
}).optional()
|
|
14883
|
-
}),
|
|
14910
|
+
}), Zv = Bv.extend({
|
|
14884
14911
|
type: X("NUMBER"),
|
|
14885
14912
|
config: q({
|
|
14886
14913
|
placeholder: V().optional(),
|
|
@@ -14889,7 +14916,7 @@ var Ev = q({
|
|
|
14889
14916
|
step: U().optional(),
|
|
14890
14917
|
default_value: V().optional()
|
|
14891
14918
|
}).optional()
|
|
14892
|
-
}),
|
|
14919
|
+
}), Qv = Bv.extend({
|
|
14893
14920
|
type: X("PASSWORD"),
|
|
14894
14921
|
config: q({
|
|
14895
14922
|
placeholder: V().optional(),
|
|
@@ -14898,13 +14925,13 @@ var Ev = q({
|
|
|
14898
14925
|
forgot_password_link: V().optional(),
|
|
14899
14926
|
default_value: V().optional()
|
|
14900
14927
|
}).optional()
|
|
14901
|
-
}),
|
|
14928
|
+
}), $v = Bv.extend({
|
|
14902
14929
|
type: X("PAYMENT"),
|
|
14903
14930
|
config: q({
|
|
14904
14931
|
provider: V().optional(),
|
|
14905
14932
|
currency: V().optional()
|
|
14906
14933
|
}).optional()
|
|
14907
|
-
}),
|
|
14934
|
+
}), ey = Bv.extend({
|
|
14908
14935
|
type: X("SOCIAL"),
|
|
14909
14936
|
config: q({
|
|
14910
14937
|
providers: K(V()).optional(),
|
|
@@ -14916,7 +14943,7 @@ var Ev = q({
|
|
|
14916
14943
|
href: V().optional()
|
|
14917
14944
|
})).optional()
|
|
14918
14945
|
}).optional()
|
|
14919
|
-
}),
|
|
14946
|
+
}), ty = Bv.extend({
|
|
14920
14947
|
type: X("TEL"),
|
|
14921
14948
|
config: q({
|
|
14922
14949
|
placeholder: V().optional(),
|
|
@@ -14924,7 +14951,7 @@ var Ev = q({
|
|
|
14924
14951
|
default_value: V().optional(),
|
|
14925
14952
|
allow_email: W().optional()
|
|
14926
14953
|
}).optional()
|
|
14927
|
-
}),
|
|
14954
|
+
}), ny = Bv.extend({
|
|
14928
14955
|
type: X("TEXT"),
|
|
14929
14956
|
config: q({
|
|
14930
14957
|
placeholder: V().optional(),
|
|
@@ -14932,19 +14959,19 @@ var Ev = q({
|
|
|
14932
14959
|
max_length: U().optional(),
|
|
14933
14960
|
default_value: V().optional()
|
|
14934
14961
|
}).optional()
|
|
14935
|
-
}),
|
|
14962
|
+
}), ry = Bv.extend({
|
|
14936
14963
|
type: X("COUNTRY"),
|
|
14937
14964
|
config: q({
|
|
14938
14965
|
placeholder: V().optional(),
|
|
14939
14966
|
default_value: V().optional()
|
|
14940
14967
|
}).optional()
|
|
14941
|
-
}),
|
|
14968
|
+
}), iy = Bv.extend({
|
|
14942
14969
|
type: X("URL"),
|
|
14943
14970
|
config: q({
|
|
14944
14971
|
placeholder: V().optional(),
|
|
14945
14972
|
default_value: V().optional()
|
|
14946
14973
|
}).optional()
|
|
14947
|
-
}),
|
|
14974
|
+
}), ay = Jh([
|
|
14948
14975
|
Qh("type", [
|
|
14949
14976
|
Ov,
|
|
14950
14977
|
kv,
|
|
@@ -14964,8 +14991,8 @@ var Ev = q({
|
|
|
14964
14991
|
Vv,
|
|
14965
14992
|
Hv,
|
|
14966
14993
|
Uv,
|
|
14967
|
-
ny,
|
|
14968
14994
|
Wv,
|
|
14995
|
+
ry,
|
|
14969
14996
|
Gv,
|
|
14970
14997
|
Kv,
|
|
14971
14998
|
qv,
|
|
@@ -14977,24 +15004,11 @@ var Ev = q({
|
|
|
14977
15004
|
$v,
|
|
14978
15005
|
ey,
|
|
14979
15006
|
ty,
|
|
14980
|
-
|
|
15007
|
+
ny,
|
|
15008
|
+
iy
|
|
14981
15009
|
])
|
|
14982
15010
|
]);
|
|
14983
|
-
|
|
14984
|
-
"BOOLEAN",
|
|
14985
|
-
"CARDS",
|
|
14986
|
-
"CHOICE",
|
|
14987
|
-
"COUNTRY",
|
|
14988
|
-
"DATE",
|
|
14989
|
-
"DROPDOWN",
|
|
14990
|
-
"EMAIL",
|
|
14991
|
-
"LEGAL",
|
|
14992
|
-
"NUMBER",
|
|
14993
|
-
"PASSWORD",
|
|
14994
|
-
"TEL",
|
|
14995
|
-
"TEXT",
|
|
14996
|
-
"URL"
|
|
14997
|
-
]), q({
|
|
15011
|
+
q({
|
|
14998
15012
|
id: V(),
|
|
14999
15013
|
type: X("submit"),
|
|
15000
15014
|
label: V(),
|
|
@@ -15004,14 +15018,14 @@ new Set([
|
|
|
15004
15018
|
visible: W().optional().default(!0),
|
|
15005
15019
|
customizations: J(V(), G()).optional()
|
|
15006
15020
|
});
|
|
15007
|
-
var
|
|
15021
|
+
var oy = q({
|
|
15008
15022
|
x: U(),
|
|
15009
15023
|
y: U()
|
|
15010
|
-
}),
|
|
15024
|
+
}), sy = Qh("type", [
|
|
15011
15025
|
q({
|
|
15012
15026
|
id: V(),
|
|
15013
15027
|
type: X("FLOW"),
|
|
15014
|
-
coordinates:
|
|
15028
|
+
coordinates: oy,
|
|
15015
15029
|
alias: V().min(1).max(150).optional(),
|
|
15016
15030
|
config: q({
|
|
15017
15031
|
flow_id: V().max(30),
|
|
@@ -15021,7 +15035,7 @@ var ay = q({
|
|
|
15021
15035
|
q({
|
|
15022
15036
|
id: V(),
|
|
15023
15037
|
type: X("ROUTER"),
|
|
15024
|
-
coordinates:
|
|
15038
|
+
coordinates: oy,
|
|
15025
15039
|
alias: V().min(1).max(150),
|
|
15026
15040
|
config: q({
|
|
15027
15041
|
rules: K(q({
|
|
@@ -15036,14 +15050,14 @@ var ay = q({
|
|
|
15036
15050
|
q({
|
|
15037
15051
|
id: V(),
|
|
15038
15052
|
type: X("STEP"),
|
|
15039
|
-
coordinates:
|
|
15053
|
+
coordinates: oy,
|
|
15040
15054
|
alias: V().min(1).max(150).optional(),
|
|
15041
15055
|
config: q({
|
|
15042
|
-
components: K(
|
|
15056
|
+
components: K(ay),
|
|
15043
15057
|
next_node: V().optional()
|
|
15044
15058
|
})
|
|
15045
15059
|
})
|
|
15046
|
-
]),
|
|
15060
|
+
]), cy = q({
|
|
15047
15061
|
name: V().openapi({ description: "The name of the form" }),
|
|
15048
15062
|
messages: q({
|
|
15049
15063
|
errors: J(V(), G()).optional(),
|
|
@@ -15054,14 +15068,14 @@ var ay = q({
|
|
|
15054
15068
|
default: V().optional()
|
|
15055
15069
|
}).optional(),
|
|
15056
15070
|
translations: J(V(), G()).optional(),
|
|
15057
|
-
nodes: K(
|
|
15071
|
+
nodes: K(sy).optional(),
|
|
15058
15072
|
start: q({
|
|
15059
15073
|
hidden_fields: K(q({
|
|
15060
15074
|
key: V(),
|
|
15061
15075
|
value: V()
|
|
15062
15076
|
})).optional(),
|
|
15063
15077
|
next_node: V().optional(),
|
|
15064
|
-
coordinates:
|
|
15078
|
+
coordinates: oy.optional()
|
|
15065
15079
|
}).optional(),
|
|
15066
15080
|
ending: q({
|
|
15067
15081
|
redirection: q({
|
|
@@ -15069,7 +15083,7 @@ var ay = q({
|
|
|
15069
15083
|
target: V().optional()
|
|
15070
15084
|
}).optional(),
|
|
15071
15085
|
after_submit: q({ flow_id: V().optional() }).optional(),
|
|
15072
|
-
coordinates:
|
|
15086
|
+
coordinates: oy.optional(),
|
|
15073
15087
|
resume_flow: W().optional()
|
|
15074
15088
|
}).optional(),
|
|
15075
15089
|
style: q({ css: V().optional() }).optional(),
|
|
@@ -15078,8 +15092,8 @@ var ay = q({
|
|
|
15078
15092
|
sdk_src: V().optional()
|
|
15079
15093
|
}).optional()
|
|
15080
15094
|
}).openapi({ description: "Schema for flow-based forms (matches Auth0 Forms structure)" });
|
|
15081
|
-
E_.extend(
|
|
15082
|
-
var
|
|
15095
|
+
E_.extend(cy.shape).extend({ id: V() });
|
|
15096
|
+
var ly = q({
|
|
15083
15097
|
id: U().optional(),
|
|
15084
15098
|
text: V(),
|
|
15085
15099
|
type: Y([
|
|
@@ -15088,7 +15102,7 @@ var cy = q({
|
|
|
15088
15102
|
"success",
|
|
15089
15103
|
"warning"
|
|
15090
15104
|
])
|
|
15091
|
-
}),
|
|
15105
|
+
}), uy = q({
|
|
15092
15106
|
id: V().optional(),
|
|
15093
15107
|
text: V(),
|
|
15094
15108
|
href: V(),
|
|
@@ -15100,12 +15114,12 @@ q({
|
|
|
15100
15114
|
method: Y(["POST", "GET"]),
|
|
15101
15115
|
title: V().optional(),
|
|
15102
15116
|
description: V().optional(),
|
|
15103
|
-
components: K(
|
|
15104
|
-
messages: K(
|
|
15105
|
-
links: K(
|
|
15117
|
+
components: K(ay),
|
|
15118
|
+
messages: K(ly).optional(),
|
|
15119
|
+
links: K(uy).optional(),
|
|
15106
15120
|
footer: V().optional()
|
|
15107
15121
|
});
|
|
15108
|
-
var
|
|
15122
|
+
var dy = Y([
|
|
15109
15123
|
"pre-user-registration",
|
|
15110
15124
|
"post-user-registration",
|
|
15111
15125
|
"post-user-login",
|
|
@@ -15113,28 +15127,28 @@ var uy = Y([
|
|
|
15113
15127
|
"validate-registration-username",
|
|
15114
15128
|
"pre-user-deletion",
|
|
15115
15129
|
"post-user-deletion"
|
|
15116
|
-
]),
|
|
15130
|
+
]), fy = Y([
|
|
15117
15131
|
"pre-user-registration",
|
|
15118
15132
|
"post-user-registration",
|
|
15119
15133
|
"post-user-login",
|
|
15120
15134
|
"validate-registration-username",
|
|
15121
15135
|
"pre-user-deletion",
|
|
15122
15136
|
"post-user-deletion"
|
|
15123
|
-
]),
|
|
15137
|
+
]), py = Y([
|
|
15124
15138
|
"post-user-login",
|
|
15125
15139
|
"post-user-registration",
|
|
15126
15140
|
"post-user-update",
|
|
15127
15141
|
"credentials-exchange"
|
|
15128
|
-
]),
|
|
15142
|
+
]), my = Y([
|
|
15129
15143
|
"post-user-login",
|
|
15130
15144
|
"credentials-exchange",
|
|
15131
15145
|
"pre-user-registration",
|
|
15132
15146
|
"post-user-registration"
|
|
15133
|
-
]),
|
|
15147
|
+
]), hy = Y([
|
|
15134
15148
|
"ensure-username",
|
|
15135
15149
|
"set-preferred-username",
|
|
15136
15150
|
"account-linking"
|
|
15137
|
-
]),
|
|
15151
|
+
]), gy = {
|
|
15138
15152
|
enabled: W().default(!1),
|
|
15139
15153
|
synchronous: W().default(!1),
|
|
15140
15154
|
priority: U().optional(),
|
|
@@ -15143,50 +15157,50 @@ var uy = Y([
|
|
|
15143
15157
|
};
|
|
15144
15158
|
Jh([
|
|
15145
15159
|
q({
|
|
15146
|
-
...
|
|
15147
|
-
trigger_id:
|
|
15160
|
+
...gy,
|
|
15161
|
+
trigger_id: dy,
|
|
15148
15162
|
url: V()
|
|
15149
15163
|
}),
|
|
15150
15164
|
q({
|
|
15151
|
-
...
|
|
15152
|
-
trigger_id:
|
|
15165
|
+
...gy,
|
|
15166
|
+
trigger_id: fy,
|
|
15153
15167
|
form_id: V()
|
|
15154
15168
|
}),
|
|
15155
15169
|
q({
|
|
15156
|
-
...
|
|
15157
|
-
trigger_id:
|
|
15158
|
-
template_id:
|
|
15170
|
+
...gy,
|
|
15171
|
+
trigger_id: py,
|
|
15172
|
+
template_id: hy
|
|
15159
15173
|
}),
|
|
15160
15174
|
q({
|
|
15161
|
-
...
|
|
15162
|
-
trigger_id:
|
|
15175
|
+
...gy,
|
|
15176
|
+
trigger_id: my,
|
|
15163
15177
|
code_id: V()
|
|
15164
15178
|
})
|
|
15165
15179
|
]), Jh([
|
|
15166
15180
|
q({
|
|
15167
|
-
...
|
|
15168
|
-
trigger_id:
|
|
15181
|
+
...gy,
|
|
15182
|
+
trigger_id: dy
|
|
15169
15183
|
}).extend(E_.shape).extend({
|
|
15170
15184
|
hook_id: V(),
|
|
15171
15185
|
url: V()
|
|
15172
15186
|
}),
|
|
15173
15187
|
q({
|
|
15174
|
-
...
|
|
15175
|
-
trigger_id:
|
|
15188
|
+
...gy,
|
|
15189
|
+
trigger_id: fy
|
|
15176
15190
|
}).extend(E_.shape).extend({
|
|
15177
15191
|
hook_id: V(),
|
|
15178
15192
|
form_id: V()
|
|
15179
15193
|
}),
|
|
15180
15194
|
q({
|
|
15181
|
-
...
|
|
15182
|
-
trigger_id:
|
|
15195
|
+
...gy,
|
|
15196
|
+
trigger_id: py
|
|
15183
15197
|
}).extend(E_.shape).extend({
|
|
15184
15198
|
hook_id: V(),
|
|
15185
|
-
template_id:
|
|
15199
|
+
template_id: hy
|
|
15186
15200
|
}),
|
|
15187
15201
|
q({
|
|
15188
|
-
...
|
|
15189
|
-
trigger_id:
|
|
15202
|
+
...gy,
|
|
15203
|
+
trigger_id: my
|
|
15190
15204
|
}).extend(E_.shape).extend({
|
|
15191
15205
|
hook_id: V(),
|
|
15192
15206
|
code_id: V()
|
|
@@ -15198,11 +15212,11 @@ Jh([
|
|
|
15198
15212
|
id: V(),
|
|
15199
15213
|
tenant_id: V()
|
|
15200
15214
|
}).extend(E_.shape);
|
|
15201
|
-
var
|
|
15215
|
+
var _y = q({ name: V().optional() }), vy = q({ email: V().optional() }), yy = q({
|
|
15202
15216
|
id: V().optional(),
|
|
15203
15217
|
organization_id: V().max(50),
|
|
15204
|
-
inviter:
|
|
15205
|
-
invitee:
|
|
15218
|
+
inviter: _y,
|
|
15219
|
+
invitee: vy,
|
|
15206
15220
|
invitation_url: V().url(),
|
|
15207
15221
|
client_id: V(),
|
|
15208
15222
|
connection_id: V().optional(),
|
|
@@ -15218,7 +15232,7 @@ q({
|
|
|
15218
15232
|
created_at: V().datetime(),
|
|
15219
15233
|
expires_at: V().datetime(),
|
|
15220
15234
|
ticket_id: V().optional()
|
|
15221
|
-
}).extend(
|
|
15235
|
+
}).extend(yy.omit({ id: !0 }).shape), q({ keys: K(q({
|
|
15222
15236
|
alg: Y([
|
|
15223
15237
|
"RS256",
|
|
15224
15238
|
"RS384",
|
|
@@ -15284,9 +15298,9 @@ q({
|
|
|
15284
15298
|
token_endpoint_auth_signing_alg_values_supported: K(V()),
|
|
15285
15299
|
client_id_metadata_document_supported: W().optional()
|
|
15286
15300
|
});
|
|
15287
|
-
var
|
|
15301
|
+
var by = dg(/* @__PURE__ */ function(e) {
|
|
15288
15302
|
return e.PENDING = "pending", e.AUTHENTICATED = "authenticated", e.AWAITING_EMAIL_VERIFICATION = "awaiting_email_verification", e.AWAITING_MFA = "awaiting_mfa", e.AWAITING_HOOK = "awaiting_hook", e.AWAITING_CONTINUATION = "awaiting_continuation", e.AWAITING_CONSENT = "awaiting_consent", e.COMPLETED = "completed", e.FAILED = "failed", e.EXPIRED = "expired", e;
|
|
15289
|
-
}({})),
|
|
15303
|
+
}({})), xy = q({
|
|
15290
15304
|
strategy: V(),
|
|
15291
15305
|
strategy_type: V()
|
|
15292
15306
|
});
|
|
@@ -15300,12 +15314,12 @@ q({
|
|
|
15300
15314
|
useragent: V().optional(),
|
|
15301
15315
|
session_id: V().optional(),
|
|
15302
15316
|
authorization_url: V().optional(),
|
|
15303
|
-
state:
|
|
15317
|
+
state: by.optional().default("pending"),
|
|
15304
15318
|
state_data: V().optional(),
|
|
15305
15319
|
failure_reason: V().optional(),
|
|
15306
15320
|
user_id: V().optional(),
|
|
15307
15321
|
auth_connection: V().optional(),
|
|
15308
|
-
auth_strategy:
|
|
15322
|
+
auth_strategy: xy.optional(),
|
|
15309
15323
|
authenticated_at: V().optional()
|
|
15310
15324
|
}).openapi({ description: "This represents a login sesion" }).extend({
|
|
15311
15325
|
id: V().openapi({ description: "This is is used as the state in the universal login" }),
|
|
@@ -15472,17 +15486,17 @@ var Q = {
|
|
|
15472
15486
|
WARNING_DURING_LOGIN: "w",
|
|
15473
15487
|
WARNING_SENDING_NOTIFICATION: "wn",
|
|
15474
15488
|
WARNING_USER_MANAGEMENT: "wum"
|
|
15475
|
-
},
|
|
15489
|
+
}, Sy = V().refine((e) => Object.values(Q).includes(e), { message: "Invalid log type" });
|
|
15476
15490
|
Q.ACLS_SUMMARY, Q.ACTIONS_EXECUTION_FAILED, Q.API_LIMIT, Q.API_LIMIT_WARNING, Q.APPI, Q.CIBA_EXCHANGE_FAILED, Q.CIBA_EXCHANGE_SUCCEEDED, Q.CIBA_START_FAILED, Q.CIBA_START_SUCCEEDED, Q.CODE_LINK_SENT, Q.CODE_SENT, Q.DEPRECATION_NOTICE, Q.FAILED_LOGIN, Q.FAILED_BY_CONNECTOR, Q.FAILED_CHANGE_EMAIL, Q.FAILED_BY_CORS, Q.FAILED_CROSS_ORIGIN_AUTHENTICATION, Q.FAILED_CHANGE_PASSWORD, Q.FAILED_POST_CHANGE_PASSWORD_HOOK, Q.FAILED_CHANGE_PHONE_NUMBER, Q.FAILED_CHANGE_PASSWORD_REQUEST, Q.FAILED_CONNECTOR_PROVISIONING, Q.FAILED_CHANGE_USERNAME, Q.FAILED_DELEGATION, Q.FAILED_DEVICE_ACTIVATION, Q.FAILED_DEVICE_AUTHORIZATION_REQUEST, Q.USER_CANCELED_DEVICE_CONFIRMATION, Q.FAILED_USER_DELETION, Q.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, Q.FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, Q.FAILED_EXCHANGE_CUSTOM_TOKEN, Q.FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, Q.FAILED_FEDERATED_LOGOUT, Q.FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN, Q.FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, Q.FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, Q.FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, Q.FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, Q.FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, Q.FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN, Q.FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, Q.FAILED_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, Q.FAILED_HOOK, Q.FAILED_IMPERSONATION, Q.FAILED_INVITE_ACCEPT, Q.FAILED_LOGOUT, Q.FLOWS_EXECUTION_COMPLETED, Q.FLOWS_EXECUTION_FAILED, Q.FAILED_SENDING_NOTIFICATION, Q.FORMS_SUBMISSION_FAILED, Q.FORMS_SUBMISSION_SUCCEEDED, Q.FAILED_LOGIN_INCORRECT_PASSWORD, Q.FAILED_PUSHED_AUTHORIZATION_REQUEST, Q.FAILED_POST_USER_REGISTRATION_HOOK, Q.FAILED_SIGNUP, Q.FAILED_SILENT_AUTH, Q.FAILED_LOGIN_INVALID_EMAIL_USERNAME, Q.FAILED_USERS_IMPORT, Q.FAILED_VERIFICATION_EMAIL, Q.FAILED_VERIFICATION_EMAIL_REQUEST, Q.EMAIL_VERIFICATION_CONFIRMED, Q.EMAIL_VERIFICATION_FAILED, Q.MFA_AUTH_FAILED, Q.MFA_AUTH_REJECTED, Q.MFA_AUTH_SUCCESS, Q.MFA_ENROLLMENT_COMPLETE, Q.TOO_MANY_MFA_FAILURES, Q.MFA_RECOVERY_FAILED, Q.MFA_RECOVERY_RATE_LIMIT_EXCEED, Q.MFA_RECOVERY_SUCCESS, Q.MFA_EMAIL_SENT, Q.EMAIL_VERIFICATION_SENT, Q.EMAIL_VERIFICATION_SEND_FAILURE, Q.PUSH_NOTIFICATION_SENT, Q.ERROR_SENDING_MFA_PUSH_NOTIFICATION, Q.MFA_SMS_SENT, Q.ERROR_SENDING_MFA_SMS, Q.MFA_VOICE_CALL_SUCCESS, Q.MFA_VOICE_CALL_FAILED, Q.SECOND_FACTOR_STARTED, Q.MFA_ENROLL_STARTED, Q.MFA_ENROLLMENT_FAILED, Q.GUARDIAN_TENANT_UPDATE, Q.UNENROLL_DEVICE_ACCOUNT, Q.UPDATE_DEVICE_ACCOUNT, Q.WEBAUTHN_CHALLENGE_FAILED, Q.WEBAUTHN_ENROLLMENT_FAILED, Q.FAILED_KMS_API_OPERATION, Q.SUCCESS_KMS_API_OPERATION, Q.KMS_KEY_STATE_CHANGED, Q.TOO_MANY_CALLS_TO_DELEGATION, Q.BLOCKED_IP_ADDRESS, Q.BLOCKED_ACCOUNT_IP, Q.BLOCKED_ACCOUNT_EMAIL, Q.INFORMATION, Q.MFA_REQUIRED, Q.MANAGEMENT_API_READ_OPERATION, Q.FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, Q.SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT, Q.FAILED_OIDC_BACKCHANNEL_LOGOUT, Q.SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT, Q.ORGANIZATION_MEMBER_ADDED, Q.PASSKEY_CHALLENGE_FAILED, Q.PASSKEY_CHALLENGE_STARTED, Q.PRE_LOGIN_ASSESSMENT, Q.BREACHED_PASSWORD, Q.BREACHED_PASSWORD_ON_RESET, Q.SUCCESS_RESOURCE_CLEANUP, Q.RICH_CONSENTS_ACCESS_ERROR, Q.SUCCESS_LOGIN, Q.SUCCESS_API_OPERATION, Q.FAILED_API_OPERATION, Q.SUCCESS_CHANGE_EMAIL, Q.SUCCESS_CROSS_ORIGIN_AUTHENTICATION, Q.SUCCESS_CHANGE_PASSWORD, Q.SUCCESS_CHANGE_PHONE_NUMBER, Q.SUCCESS_CHANGE_PASSWORD_REQUEST, Q.SUCCESS_CHANGE_USERNAME, Q.SUCCESS_CREDENTIAL_VALIDATION, Q.SUCCESS_DELEGATION, Q.SUCCESS_USER_DELETION, Q.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN, Q.SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS, Q.SUCCESS_EXCHANGE_CUSTOM_TOKEN, Q.SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN, Q.SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN, Q.SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN, Q.SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN, Q.SUCCESS_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN, Q.SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN, Q.SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN, Q.SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN, Q.SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN, Q.SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN, Q.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN, Q.SUCCESS_EXCHANGE_SUBJECT_TOKEN_FOR_ACCESS_TOKEN, Q.SUCCESS_IMPERSONATION, Q.SUCCESSFULLY_ACCEPTED_USER_INVITE, Q.BREACHED_PASSWORD_ON_SIGNUP, Q.SUCCESS_LOGOUT, Q.SUCCESS_HOOK, Q.SUCCESS_PASSWORD_MIGRATION, Q.SUCCESS_REVOCATION, Q.SUCCESS_SIGNUP, Q.FAILED_SS_SSO_OPERATION, Q.INFORMATION_FROM_SS_SSO_OPERATION, Q.SUCCESS_SS_SSO_OPERATION, Q.SUCCESS_SILENT_AUTH, Q.SUCCESSFUL_SCIM_OPERATION, Q.SUCCESSFULLY_IMPORTED_USERS, Q.SUCCESS_VERIFICATION_EMAIL, Q.SUCCESS_VERIFICATION_EMAIL_REQUEST, Q.MAX_AMOUNT_OF_AUTHENTICATORS, Q.USER_LOGIN_BLOCK_RELEASED, Q.FAILED_UNIVERSAL_LOGOUT, Q.SUCCESSFUL_UNIVERSAL_LOGOUT, Q.WARNING_DURING_LOGIN, Q.WARNING_SENDING_NOTIFICATION, Q.WARNING_USER_MANAGEMENT, (() => {
|
|
15477
15491
|
let e = {};
|
|
15478
15492
|
for (let [t, n] of Object.entries(Q)) t.startsWith("SUCCESS_") || t.startsWith("SUCCESSFUL_") || t.startsWith("SUCCESSFULLY_") || t.endsWith("_SUCCEEDED") || t.endsWith("_COMPLETED") ? e[n] = "success" : t.startsWith("FAILED_") || t.startsWith("ERROR_") || t.startsWith("BREACHED_") || t.startsWith("BLOCKED_") || t === "MFA_AUTH_FAILED" || t === "MFA_AUTH_REJECTED" || t === "MFA_RECOVERY_FAILED" || t === "MFA_ENROLLMENT_FAILED" || t === "EMAIL_VERIFICATION_FAILED" || t === "WEBAUTHN_CHALLENGE_FAILED" || t === "WEBAUTHN_ENROLLMENT_FAILED" || t === "PASSKEY_CHALLENGE_FAILED" || t === "FLOWS_EXECUTION_FAILED" || t === "FORMS_SUBMISSION_FAILED" || t === "CIBA_EXCHANGE_FAILED" || t === "CIBA_START_FAILED" || t === "ACTIONS_EXECUTION_FAILED" || t === "RICH_CONSENTS_ACCESS_ERROR" || t === "USER_CANCELED_DEVICE_CONFIRMATION" || t === "TOO_MANY_MFA_FAILURES" || t === "MFA_RECOVERY_RATE_LIMIT_EXCEED" || t === "API_LIMIT" || t === "MAX_AMOUNT_OF_AUTHENTICATORS" ? e[n] = "failure" : t.startsWith("WARNING_") || t === "API_LIMIT_WARNING" || t === "DEPRECATION_NOTICE" || t === "PRE_LOGIN_ASSESSMENT" ? e[n] = "warning" : t === "CODE_SENT" || t === "CODE_LINK_SENT" || t === "MFA_EMAIL_SENT" || t === "MFA_SMS_SENT" || t === "EMAIL_VERIFICATION_SENT" || t === "PUSH_NOTIFICATION_SENT" ? e[n] = "code_sent" : t === "INFORMATION" || t === "INFORMATION_FROM_SS_SSO_OPERATION" || t === "MANAGEMENT_API_READ_OPERATION" || t === "APPI" || t === "ACLS_SUMMARY" || t === "ORGANIZATION_MEMBER_ADDED" ? e[n] = "info" : e[n] = "other";
|
|
15479
15493
|
return e;
|
|
15480
15494
|
})();
|
|
15481
|
-
var
|
|
15495
|
+
var Cy = q({
|
|
15482
15496
|
name: V(),
|
|
15483
15497
|
version: V(),
|
|
15484
15498
|
env: q({ node: V().optional() }).optional()
|
|
15485
|
-
}),
|
|
15499
|
+
}), wy = q({
|
|
15486
15500
|
country_code: V().length(2),
|
|
15487
15501
|
city_name: V(),
|
|
15488
15502
|
latitude: V(),
|
|
@@ -15491,7 +15505,7 @@ var Sy = q({
|
|
|
15491
15505
|
continent_code: V()
|
|
15492
15506
|
});
|
|
15493
15507
|
q({
|
|
15494
|
-
type:
|
|
15508
|
+
type: Sy,
|
|
15495
15509
|
date: V(),
|
|
15496
15510
|
description: V().optional(),
|
|
15497
15511
|
ip: V().optional(),
|
|
@@ -15509,63 +15523,63 @@ q({
|
|
|
15509
15523
|
strategy: V().optional(),
|
|
15510
15524
|
strategy_type: V().optional(),
|
|
15511
15525
|
hostname: V().optional(),
|
|
15512
|
-
auth0_client:
|
|
15526
|
+
auth0_client: Cy.optional(),
|
|
15513
15527
|
log_id: V().optional(),
|
|
15514
|
-
location_info:
|
|
15528
|
+
location_info: wy.optional()
|
|
15515
15529
|
}).extend({ log_id: V() });
|
|
15516
|
-
var
|
|
15530
|
+
var Ty = Y([
|
|
15517
15531
|
"http",
|
|
15518
15532
|
"eventbridge",
|
|
15519
15533
|
"eventgrid",
|
|
15520
15534
|
"splunk",
|
|
15521
15535
|
"datadog",
|
|
15522
15536
|
"sumo"
|
|
15523
|
-
]),
|
|
15537
|
+
]), Ey = Y([
|
|
15524
15538
|
"active",
|
|
15525
15539
|
"paused",
|
|
15526
15540
|
"suspended"
|
|
15527
|
-
]),
|
|
15541
|
+
]), Dy = q({
|
|
15528
15542
|
type: V(),
|
|
15529
15543
|
name: V()
|
|
15530
15544
|
});
|
|
15531
15545
|
q({
|
|
15532
15546
|
name: V(),
|
|
15533
|
-
type:
|
|
15534
|
-
status:
|
|
15547
|
+
type: Ty,
|
|
15548
|
+
status: Ey.optional(),
|
|
15535
15549
|
sink: J(V(), Fh()),
|
|
15536
|
-
filters: K(
|
|
15550
|
+
filters: K(Dy).optional(),
|
|
15537
15551
|
isPriority: W().optional()
|
|
15538
15552
|
}).extend({
|
|
15539
15553
|
id: V(),
|
|
15540
|
-
status:
|
|
15554
|
+
status: Ey,
|
|
15541
15555
|
created_at: V().optional(),
|
|
15542
15556
|
updated_at: V().optional()
|
|
15543
15557
|
});
|
|
15544
|
-
var
|
|
15558
|
+
var Oy = Y([
|
|
15545
15559
|
"auth0",
|
|
15546
15560
|
"cognito",
|
|
15547
15561
|
"okta",
|
|
15548
15562
|
"oidc"
|
|
15549
|
-
]),
|
|
15563
|
+
]), ky = q({
|
|
15550
15564
|
domain: V(),
|
|
15551
15565
|
client_id: V(),
|
|
15552
15566
|
client_secret: V(),
|
|
15553
15567
|
audience: V().optional(),
|
|
15554
15568
|
scope: V().optional()
|
|
15555
|
-
}),
|
|
15569
|
+
}), Ay = q({
|
|
15556
15570
|
id: V().optional(),
|
|
15557
15571
|
name: V(),
|
|
15558
|
-
provider:
|
|
15572
|
+
provider: Oy,
|
|
15559
15573
|
connection: V(),
|
|
15560
15574
|
enabled: W().default(!0),
|
|
15561
|
-
credentials:
|
|
15575
|
+
credentials: ky
|
|
15562
15576
|
});
|
|
15563
15577
|
q({
|
|
15564
15578
|
id: V(),
|
|
15565
15579
|
created_at: V(),
|
|
15566
15580
|
updated_at: V()
|
|
15567
|
-
}).extend(
|
|
15568
|
-
var
|
|
15581
|
+
}).extend(Ay.shape);
|
|
15582
|
+
var jy = q({
|
|
15569
15583
|
enabled: W().optional(),
|
|
15570
15584
|
shields: K(V()).optional(),
|
|
15571
15585
|
admin_notification_frequency: K(V()).optional(),
|
|
@@ -15574,13 +15588,13 @@ var Ay = q({
|
|
|
15574
15588
|
"pre-user-registration": q({ shields: K(V()).optional() }).optional(),
|
|
15575
15589
|
"pre-change-password": q({ shields: K(V()).optional() }).optional()
|
|
15576
15590
|
}).optional()
|
|
15577
|
-
}),
|
|
15591
|
+
}), My = q({
|
|
15578
15592
|
enabled: W().optional(),
|
|
15579
15593
|
shields: K(V()).optional(),
|
|
15580
15594
|
allowlist: K(V()).optional(),
|
|
15581
15595
|
mode: V().optional(),
|
|
15582
15596
|
max_attempts: U().optional()
|
|
15583
|
-
}),
|
|
15597
|
+
}), Ny = q({
|
|
15584
15598
|
enabled: W().optional(),
|
|
15585
15599
|
shields: K(V()).optional(),
|
|
15586
15600
|
allowlist: K(V()).optional(),
|
|
@@ -15594,10 +15608,10 @@ var Ay = q({
|
|
|
15594
15608
|
rate: U().optional()
|
|
15595
15609
|
}).optional()
|
|
15596
15610
|
}).optional()
|
|
15597
|
-
}),
|
|
15598
|
-
breached_password_detection:
|
|
15599
|
-
brute_force_protection:
|
|
15600
|
-
suspicious_ip_throttling:
|
|
15611
|
+
}), Py = q({
|
|
15612
|
+
breached_password_detection: jy.optional(),
|
|
15613
|
+
brute_force_protection: My.optional(),
|
|
15614
|
+
suspicious_ip_throttling: Ny.optional()
|
|
15601
15615
|
});
|
|
15602
15616
|
q({
|
|
15603
15617
|
id: V().optional(),
|
|
@@ -15610,14 +15624,14 @@ q({
|
|
|
15610
15624
|
created_at: V(),
|
|
15611
15625
|
updated_at: V()
|
|
15612
15626
|
});
|
|
15613
|
-
var
|
|
15627
|
+
var Fy = q({
|
|
15614
15628
|
initial_user_agent: V().describe("First user agent of the device from which this user logged in"),
|
|
15615
15629
|
initial_ip: V().describe("First IP address associated with this session"),
|
|
15616
15630
|
initial_asn: V().describe("First autonomous system number associated with this session"),
|
|
15617
15631
|
last_user_agent: V().describe("Last user agent of the device from which this user logged in"),
|
|
15618
15632
|
last_ip: V().describe("Last IP address from which this user logged in"),
|
|
15619
15633
|
last_asn: V().describe("Last autonomous system number from which this user logged in")
|
|
15620
|
-
}),
|
|
15634
|
+
}), Iy = q({
|
|
15621
15635
|
id: V(),
|
|
15622
15636
|
revoked_at: V().optional(),
|
|
15623
15637
|
used_at: V().optional(),
|
|
@@ -15625,7 +15639,7 @@ var Py = q({
|
|
|
15625
15639
|
expires_at: V().optional(),
|
|
15626
15640
|
login_session_id: V(),
|
|
15627
15641
|
idle_expires_at: V().optional(),
|
|
15628
|
-
device:
|
|
15642
|
+
device: Fy.describe("Metadata related to the device used in the session"),
|
|
15629
15643
|
clients: K(V()).describe("List of client details for the session")
|
|
15630
15644
|
});
|
|
15631
15645
|
q({
|
|
@@ -15633,7 +15647,7 @@ q({
|
|
|
15633
15647
|
updated_at: V(),
|
|
15634
15648
|
authenticated_at: V(),
|
|
15635
15649
|
last_interaction_at: V()
|
|
15636
|
-
}).extend(
|
|
15650
|
+
}).extend(Iy.shape), q({
|
|
15637
15651
|
kid: V().openapi({ description: "The key id of the signing key" }),
|
|
15638
15652
|
tenant_id: V().optional().openapi({ description: "The tenant the key belongs to. Omitted means the key is shared / control-plane scoped." }),
|
|
15639
15653
|
cert: V().openapi({ description: "The public certificate of the signing key" }),
|
|
@@ -15650,7 +15664,7 @@ q({
|
|
|
15650
15664
|
connection: V().optional().openapi({ description: "The connection identifier associated with the key" }),
|
|
15651
15665
|
type: Y(["jwt_signing", "saml_encryption"]).openapi({ description: "The type of the signing key" })
|
|
15652
15666
|
});
|
|
15653
|
-
var
|
|
15667
|
+
var Ly = q({
|
|
15654
15668
|
id: V().optional(),
|
|
15655
15669
|
audience: V().optional(),
|
|
15656
15670
|
friendly_name: V(),
|
|
@@ -15767,7 +15781,7 @@ var Iy = q({
|
|
|
15767
15781
|
"shared_planetscale"
|
|
15768
15782
|
]).optional(),
|
|
15769
15783
|
d1_database_id: V().max(64).optional(),
|
|
15770
|
-
attack_protection:
|
|
15784
|
+
attack_protection: Py.optional(),
|
|
15771
15785
|
mfa: q({
|
|
15772
15786
|
policy: Y(["never", "always"]).default("never").optional(),
|
|
15773
15787
|
factors: q({
|
|
@@ -15798,7 +15812,7 @@ var Iy = q({
|
|
|
15798
15812
|
q({
|
|
15799
15813
|
created_at: V().nullable().transform((e) => e ?? ""),
|
|
15800
15814
|
updated_at: V().nullable().transform((e) => e ?? "")
|
|
15801
|
-
}).extend(
|
|
15815
|
+
}).extend(Ly.shape).extend({
|
|
15802
15816
|
id: V(),
|
|
15803
15817
|
is_control_plane: W().optional()
|
|
15804
15818
|
}), q({
|
|
@@ -15813,7 +15827,7 @@ q({
|
|
|
15813
15827
|
code: V(),
|
|
15814
15828
|
state: V().optional()
|
|
15815
15829
|
});
|
|
15816
|
-
var
|
|
15830
|
+
var Ry = q({
|
|
15817
15831
|
button_border_radius: U(),
|
|
15818
15832
|
button_border_weight: U(),
|
|
15819
15833
|
buttons_style: Y([
|
|
@@ -15831,7 +15845,7 @@ var Ly = q({
|
|
|
15831
15845
|
show_widget_shadow: W(),
|
|
15832
15846
|
widget_border_weight: U(),
|
|
15833
15847
|
widget_corner_radius: U()
|
|
15834
|
-
}),
|
|
15848
|
+
}), zy = q({
|
|
15835
15849
|
base_focus_color: V(),
|
|
15836
15850
|
base_hover_color: V(),
|
|
15837
15851
|
body_text: V(),
|
|
@@ -15855,20 +15869,20 @@ var Ly = q({
|
|
|
15855
15869
|
success: V(),
|
|
15856
15870
|
widget_background: V(),
|
|
15857
15871
|
widget_border: V()
|
|
15858
|
-
}),
|
|
15872
|
+
}), By = q({
|
|
15859
15873
|
bold: W(),
|
|
15860
15874
|
size: U()
|
|
15861
|
-
}),
|
|
15862
|
-
body_text:
|
|
15863
|
-
buttons_text:
|
|
15875
|
+
}), Vy = q({
|
|
15876
|
+
body_text: By,
|
|
15877
|
+
buttons_text: By,
|
|
15864
15878
|
font_url: V(),
|
|
15865
|
-
input_labels:
|
|
15866
|
-
links:
|
|
15879
|
+
input_labels: By,
|
|
15880
|
+
links: By,
|
|
15867
15881
|
links_style: Y(["normal", "underlined"]),
|
|
15868
15882
|
reference_text_size: U(),
|
|
15869
|
-
subtitle:
|
|
15870
|
-
title:
|
|
15871
|
-
}),
|
|
15883
|
+
subtitle: By,
|
|
15884
|
+
title: By
|
|
15885
|
+
}), Hy = q({
|
|
15872
15886
|
background_color: V(),
|
|
15873
15887
|
background_image_url: V(),
|
|
15874
15888
|
page_layout: Y([
|
|
@@ -15881,7 +15895,7 @@ var Ly = q({
|
|
|
15881
15895
|
"chip",
|
|
15882
15896
|
"none"
|
|
15883
15897
|
]).optional()
|
|
15884
|
-
}),
|
|
15898
|
+
}), Uy = q({
|
|
15885
15899
|
header_text_alignment: Y([
|
|
15886
15900
|
"center",
|
|
15887
15901
|
"left",
|
|
@@ -15898,40 +15912,40 @@ var Ly = q({
|
|
|
15898
15912
|
social_buttons_layout: Y(["bottom", "top"])
|
|
15899
15913
|
});
|
|
15900
15914
|
q({
|
|
15901
|
-
borders:
|
|
15902
|
-
colors:
|
|
15915
|
+
borders: Ry,
|
|
15916
|
+
colors: zy,
|
|
15903
15917
|
displayName: V(),
|
|
15904
|
-
fonts:
|
|
15905
|
-
page_background:
|
|
15906
|
-
widget:
|
|
15918
|
+
fonts: Vy,
|
|
15919
|
+
page_background: Hy,
|
|
15920
|
+
widget: Uy
|
|
15907
15921
|
}).extend({ themeId: V() }), q({
|
|
15908
15922
|
universal_login_experience: Y(["new", "classic"]).default("new"),
|
|
15909
15923
|
identifier_first: W().default(!0),
|
|
15910
15924
|
password_first: W().default(!1),
|
|
15911
15925
|
webauthn_platform_first_factor: W()
|
|
15912
15926
|
});
|
|
15913
|
-
var
|
|
15927
|
+
var Wy = q({
|
|
15914
15928
|
hosts: K(V()).optional(),
|
|
15915
15929
|
methods: K(V()).optional(),
|
|
15916
15930
|
path: V().default("/*"),
|
|
15917
15931
|
headers: J(V(), V()).optional(),
|
|
15918
15932
|
query: J(V(), V()).optional()
|
|
15919
|
-
}),
|
|
15933
|
+
}), Gy = q({
|
|
15920
15934
|
type: V(),
|
|
15921
15935
|
options: J(V(), Fh()).default({})
|
|
15922
|
-
}),
|
|
15936
|
+
}), Ky = q({
|
|
15923
15937
|
id: V().optional(),
|
|
15924
15938
|
custom_domain_id: V(),
|
|
15925
15939
|
priority: U().int().default(100),
|
|
15926
|
-
match:
|
|
15927
|
-
handlers: K(
|
|
15940
|
+
match: Wy,
|
|
15941
|
+
handlers: K(Gy).min(1)
|
|
15928
15942
|
});
|
|
15929
|
-
|
|
15943
|
+
Ky.extend({
|
|
15930
15944
|
id: V(),
|
|
15931
15945
|
tenant_id: V(),
|
|
15932
15946
|
created_at: V(),
|
|
15933
15947
|
updated_at: V()
|
|
15934
|
-
}),
|
|
15948
|
+
}), Ky.partial().omit({
|
|
15935
15949
|
id: !0,
|
|
15936
15950
|
custom_domain_id: !0
|
|
15937
15951
|
}), q({
|
|
@@ -15971,7 +15985,7 @@ Gy.extend({
|
|
|
15971
15985
|
expires_at: V().optional(),
|
|
15972
15986
|
idle_expires_at: V().optional(),
|
|
15973
15987
|
last_exchanged_at: V().optional(),
|
|
15974
|
-
device:
|
|
15988
|
+
device: Fy,
|
|
15975
15989
|
resource_servers: K(q({
|
|
15976
15990
|
audience: V(),
|
|
15977
15991
|
scopes: V()
|
|
@@ -15992,10 +16006,10 @@ Gy.extend({
|
|
|
15992
16006
|
name: V(),
|
|
15993
16007
|
options: q({})
|
|
15994
16008
|
});
|
|
15995
|
-
var
|
|
16009
|
+
var qy = q({
|
|
15996
16010
|
value: V(),
|
|
15997
16011
|
description: V().optional()
|
|
15998
|
-
}),
|
|
16012
|
+
}), Jy = q({
|
|
15999
16013
|
token_dialect: Y(["access_token", "access_token_authz"]).optional(),
|
|
16000
16014
|
enforce_policies: W().optional(),
|
|
16001
16015
|
allow_skipping_userinfo: W().optional(),
|
|
@@ -16008,7 +16022,7 @@ q({
|
|
|
16008
16022
|
id: V().optional(),
|
|
16009
16023
|
name: V(),
|
|
16010
16024
|
identifier: V(),
|
|
16011
|
-
scopes: K(
|
|
16025
|
+
scopes: K(qy).optional(),
|
|
16012
16026
|
signing_alg: V().optional(),
|
|
16013
16027
|
signing_secret: V().optional(),
|
|
16014
16028
|
token_lifetime: U().default(86400),
|
|
@@ -16016,7 +16030,7 @@ q({
|
|
|
16016
16030
|
skip_consent_for_verifiable_first_party_clients: W().optional(),
|
|
16017
16031
|
allow_offline_access: W().optional(),
|
|
16018
16032
|
verificationKey: V().optional(),
|
|
16019
|
-
options:
|
|
16033
|
+
options: Jy.optional(),
|
|
16020
16034
|
is_system: W().optional(),
|
|
16021
16035
|
metadata: J(V(), G()).optional()
|
|
16022
16036
|
}).extend({
|
|
@@ -16065,18 +16079,18 @@ q({
|
|
|
16065
16079
|
created_at: V().optional(),
|
|
16066
16080
|
updated_at: V().optional()
|
|
16067
16081
|
});
|
|
16068
|
-
var
|
|
16082
|
+
var Yy = q({
|
|
16069
16083
|
logo_url: V().optional().openapi({ description: "URL of the organization's logo" }),
|
|
16070
16084
|
colors: q({
|
|
16071
16085
|
primary: V().optional().openapi({ description: "Primary color in hex format (e.g., #FF0000)" }),
|
|
16072
16086
|
page_background: V().optional().openapi({ description: "Page background color in hex format (e.g., #FFFFFF)" })
|
|
16073
16087
|
}).optional()
|
|
16074
|
-
}).optional(),
|
|
16088
|
+
}).optional(), Xy = q({
|
|
16075
16089
|
connection_id: V().openapi({ description: "ID of the connection" }),
|
|
16076
16090
|
assign_membership_on_login: W().default(!1).openapi({ description: "Whether to assign membership to the organization on login" }),
|
|
16077
16091
|
show_as_button: W().default(!0).openapi({ description: "Whether to show this connection as a button in the login screen" }),
|
|
16078
16092
|
is_signup_enabled: W().default(!0).openapi({ description: "Whether signup is enabled for this connection" })
|
|
16079
|
-
}),
|
|
16093
|
+
}), Zy = q({ client_credentials: q({
|
|
16080
16094
|
enforce: W().default(!1).openapi({ description: "Whether to enforce token quota limits" }),
|
|
16081
16095
|
per_day: U().min(0).default(0).openapi({ description: "Maximum tokens per day (0 = unlimited)" }),
|
|
16082
16096
|
per_hour: U().min(0).default(0).openapi({ description: "Maximum tokens per hour (0 = unlimited)" })
|
|
@@ -16085,10 +16099,10 @@ q({
|
|
|
16085
16099
|
id: V().optional(),
|
|
16086
16100
|
name: V().min(1).regex(/^[a-z0-9_-]+$/, { message: "Organization name must be lowercase and can only contain letters, numbers, hyphens, and underscores" }).openapi({ description: "The name of the organization. Must be lowercase and can only contain letters, numbers, hyphens, and underscores." }),
|
|
16087
16101
|
display_name: V().optional().openapi({ description: "The display name of the organization" }),
|
|
16088
|
-
branding:
|
|
16102
|
+
branding: Yy,
|
|
16089
16103
|
metadata: J(V(), G()).default({}).optional().openapi({ description: "Custom metadata for the organization" }),
|
|
16090
|
-
enabled_connections: K(
|
|
16091
|
-
token_quota:
|
|
16104
|
+
enabled_connections: K(Xy).default([]).optional().openapi({ description: "List of enabled connections for the organization" }),
|
|
16105
|
+
token_quota: Zy
|
|
16092
16106
|
}).extend(E_.shape).extend({
|
|
16093
16107
|
id: V(),
|
|
16094
16108
|
name: V().min(1).openapi({ description: "The name of the organization" })
|
|
@@ -16237,22 +16251,22 @@ q({
|
|
|
16237
16251
|
"passwordless",
|
|
16238
16252
|
"enterprise"
|
|
16239
16253
|
]);
|
|
16240
|
-
var
|
|
16254
|
+
var Qy = q({
|
|
16241
16255
|
name: V(),
|
|
16242
16256
|
type: V()
|
|
16243
|
-
}),
|
|
16257
|
+
}), $y = q({
|
|
16244
16258
|
elapsed: U(),
|
|
16245
16259
|
rows_read: U().optional(),
|
|
16246
16260
|
bytes_read: U().optional()
|
|
16247
16261
|
});
|
|
16248
16262
|
q({
|
|
16249
|
-
meta: K(
|
|
16263
|
+
meta: K(Qy),
|
|
16250
16264
|
data: K(J(V(), G())),
|
|
16251
16265
|
rows: U(),
|
|
16252
16266
|
rows_before_limit_at_least: U().optional(),
|
|
16253
|
-
statistics:
|
|
16267
|
+
statistics: $y.optional()
|
|
16254
16268
|
});
|
|
16255
|
-
var
|
|
16269
|
+
var eb = Y(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.signup-password.reset-password.consent.mfa.mfa-push.mfa-otp.mfa-voice.mfa-phone.mfa-webauthn.mfa-email.mfa-recovery-code.status.device-flow.email-verification.email-otp-challenge.organizations.invitation.common.passkeys.captcha.custom-form.login-passwordless.mfa-login-options".split(".")), tb = J(V(), J(V(), V())).openapi({
|
|
16256
16270
|
type: "object",
|
|
16257
16271
|
additionalProperties: {
|
|
16258
16272
|
type: "object",
|
|
@@ -16260,11 +16274,11 @@ var $y = Y(/* @__PURE__ */ "login.login-id.login-password.signup.signup-id.signu
|
|
|
16260
16274
|
}
|
|
16261
16275
|
});
|
|
16262
16276
|
q({
|
|
16263
|
-
prompt:
|
|
16277
|
+
prompt: eb,
|
|
16264
16278
|
language: V(),
|
|
16265
|
-
custom_text:
|
|
16279
|
+
custom_text: tb
|
|
16266
16280
|
});
|
|
16267
|
-
var
|
|
16281
|
+
var nb = Y([
|
|
16268
16282
|
"phone",
|
|
16269
16283
|
"totp",
|
|
16270
16284
|
"email",
|
|
@@ -16272,9 +16286,9 @@ var tb = Y([
|
|
|
16272
16286
|
"webauthn-roaming",
|
|
16273
16287
|
"webauthn-platform",
|
|
16274
16288
|
"passkey"
|
|
16275
|
-
]),
|
|
16289
|
+
]), rb = q({
|
|
16276
16290
|
user_id: V(),
|
|
16277
|
-
type:
|
|
16291
|
+
type: nb,
|
|
16278
16292
|
phone_number: V().optional(),
|
|
16279
16293
|
totp_secret: V().optional(),
|
|
16280
16294
|
credential_id: V().optional(),
|
|
@@ -16285,7 +16299,7 @@ var tb = Y([
|
|
|
16285
16299
|
friendly_name: V().optional(),
|
|
16286
16300
|
confirmed: W().default(!1)
|
|
16287
16301
|
});
|
|
16288
|
-
function
|
|
16302
|
+
function ib(e, t) {
|
|
16289
16303
|
e.type === "phone" && !e.phone_number && t.addIssue({
|
|
16290
16304
|
code: l_.custom,
|
|
16291
16305
|
message: "phone_number is required when type is 'phone'",
|
|
@@ -16308,30 +16322,30 @@ function rb(e, t) {
|
|
|
16308
16322
|
path: ["public_key"]
|
|
16309
16323
|
}));
|
|
16310
16324
|
}
|
|
16311
|
-
|
|
16325
|
+
rb.superRefine(ib), rb.extend({
|
|
16312
16326
|
id: V(),
|
|
16313
16327
|
created_at: V(),
|
|
16314
16328
|
updated_at: V()
|
|
16315
|
-
}).superRefine(
|
|
16316
|
-
function
|
|
16329
|
+
}).superRefine(ib);
|
|
16330
|
+
function ab(e) {
|
|
16317
16331
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
16318
16332
|
}
|
|
16319
16333
|
//#endregion
|
|
16320
16334
|
//#region src/adapters/clientRegistrationTokens.ts
|
|
16321
|
-
function
|
|
16335
|
+
function ob(e) {
|
|
16322
16336
|
if (!e) return;
|
|
16323
16337
|
let t = JSON.parse(e);
|
|
16324
|
-
return
|
|
16338
|
+
return ab(t) ? t : void 0;
|
|
16325
16339
|
}
|
|
16326
|
-
function
|
|
16340
|
+
function sb(e) {
|
|
16327
16341
|
return e == null ? void 0 : new Date(e).toISOString();
|
|
16328
16342
|
}
|
|
16329
|
-
function
|
|
16343
|
+
function cb(e) {
|
|
16330
16344
|
if (!e) return null;
|
|
16331
16345
|
let t = new Date(e);
|
|
16332
16346
|
return isNaN(t.getTime()) ? null : t.getTime();
|
|
16333
16347
|
}
|
|
16334
|
-
function
|
|
16348
|
+
function lb(e) {
|
|
16335
16349
|
let t = rv.parse(e.type);
|
|
16336
16350
|
return {
|
|
16337
16351
|
id: e.id,
|
|
@@ -16339,15 +16353,15 @@ function cb(e) {
|
|
|
16339
16353
|
type: t,
|
|
16340
16354
|
client_id: e.client_id ?? void 0,
|
|
16341
16355
|
sub: e.sub ?? void 0,
|
|
16342
|
-
constraints:
|
|
16356
|
+
constraints: ob(e.constraints),
|
|
16343
16357
|
single_use: !!e.single_use,
|
|
16344
|
-
expires_at:
|
|
16345
|
-
used_at:
|
|
16346
|
-
revoked_at:
|
|
16358
|
+
expires_at: sb(e.expires_at_ts),
|
|
16359
|
+
used_at: sb(e.used_at_ts),
|
|
16360
|
+
revoked_at: sb(e.revoked_at_ts),
|
|
16347
16361
|
created_at: new Date(e.created_at_ts).toISOString()
|
|
16348
16362
|
};
|
|
16349
16363
|
}
|
|
16350
|
-
function
|
|
16364
|
+
function ub(e) {
|
|
16351
16365
|
return {
|
|
16352
16366
|
async create(t, n) {
|
|
16353
16367
|
let r = Date.now();
|
|
@@ -16360,7 +16374,7 @@ function lb(e) {
|
|
|
16360
16374
|
sub: n.sub ?? null,
|
|
16361
16375
|
constraints: n.constraints ? JSON.stringify(n.constraints) : null,
|
|
16362
16376
|
single_use: +!!n.single_use,
|
|
16363
|
-
expires_at_ts:
|
|
16377
|
+
expires_at_ts: cb(n.expires_at),
|
|
16364
16378
|
created_at_ts: r
|
|
16365
16379
|
}), {
|
|
16366
16380
|
id: n.id,
|
|
@@ -16376,23 +16390,23 @@ function lb(e) {
|
|
|
16376
16390
|
},
|
|
16377
16391
|
async get(t, n) {
|
|
16378
16392
|
let r = await e.select().from(T).where(h(m(T.tenant_id, t), m(T.id, n))).get();
|
|
16379
|
-
return r ?
|
|
16393
|
+
return r ? lb(r) : null;
|
|
16380
16394
|
},
|
|
16381
16395
|
async getByHash(t, n) {
|
|
16382
16396
|
let r = await e.select().from(T).where(h(m(T.tenant_id, t), m(T.token_hash, n))).get();
|
|
16383
|
-
return r ?
|
|
16397
|
+
return r ? lb(r) : null;
|
|
16384
16398
|
},
|
|
16385
16399
|
async listByClient(t, n) {
|
|
16386
|
-
return (await e.select().from(T).where(h(m(T.tenant_id, t), m(T.client_id, n))).orderBy(
|
|
16400
|
+
return (await e.select().from(T).where(h(m(T.tenant_id, t), m(T.client_id, n))).orderBy(ze(T.created_at_ts))).map(lb);
|
|
16387
16401
|
},
|
|
16388
16402
|
async markUsed(t, n, r) {
|
|
16389
|
-
return (await e.update(T).set({ used_at_ts:
|
|
16403
|
+
return (await e.update(T).set({ used_at_ts: cb(r) }).where(h(m(T.tenant_id, t), m(T.id, n), Pe(T.used_at_ts))).returning()).length > 0;
|
|
16390
16404
|
},
|
|
16391
16405
|
async revoke(t, n, r) {
|
|
16392
|
-
return (await e.update(T).set({ revoked_at_ts:
|
|
16406
|
+
return (await e.update(T).set({ revoked_at_ts: cb(r) }).where(h(m(T.tenant_id, t), m(T.id, n), Pe(T.revoked_at_ts))).returning()).length > 0;
|
|
16393
16407
|
},
|
|
16394
16408
|
async revokeByClient(t, n, r) {
|
|
16395
|
-
return (await e.update(T).set({ revoked_at_ts:
|
|
16409
|
+
return (await e.update(T).set({ revoked_at_ts: cb(r) }).where(h(m(T.tenant_id, t), m(T.client_id, n), Pe(T.revoked_at_ts))).returning()).length;
|
|
16396
16410
|
},
|
|
16397
16411
|
async remove(t, n) {
|
|
16398
16412
|
return (await e.delete(T).where(h(m(T.tenant_id, t), m(T.id, n))).returning()).length > 0;
|
|
@@ -16401,12 +16415,12 @@ function lb(e) {
|
|
|
16401
16415
|
}
|
|
16402
16416
|
//#endregion
|
|
16403
16417
|
//#region src/adapters/codes.ts
|
|
16404
|
-
var
|
|
16405
|
-
function
|
|
16418
|
+
var db = ["code_id", "login_id"];
|
|
16419
|
+
function fb(e) {
|
|
16406
16420
|
let { tenant_id: t, ...n } = e;
|
|
16407
16421
|
return k(n);
|
|
16408
16422
|
}
|
|
16409
|
-
function
|
|
16423
|
+
function pb(e) {
|
|
16410
16424
|
return {
|
|
16411
16425
|
async create(t, n) {
|
|
16412
16426
|
let r = {
|
|
@@ -16415,29 +16429,29 @@ function fb(e) {
|
|
|
16415
16429
|
created_at: n.created_at || (/* @__PURE__ */ new Date()).toISOString(),
|
|
16416
16430
|
expires_at: n.expires_at
|
|
16417
16431
|
};
|
|
16418
|
-
return await e.insert(Xt).values(r),
|
|
16432
|
+
return await e.insert(Xt).values(r), fb(r);
|
|
16419
16433
|
},
|
|
16420
16434
|
async get(t, n, r) {
|
|
16421
16435
|
let i = t ? h(m(Xt.tenant_id, t), m(Xt.code_id, n), m(Xt.code_type, r)) : h(m(Xt.code_id, n), m(Xt.code_type, r)), a = await e.select().from(Xt).where(i).get();
|
|
16422
|
-
return a ?
|
|
16436
|
+
return a ? fb(a) : null;
|
|
16423
16437
|
},
|
|
16424
16438
|
async list(t, n) {
|
|
16425
16439
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = [m(Xt.tenant_id, t)];
|
|
16426
16440
|
if (s) {
|
|
16427
|
-
let e = Nn(s,
|
|
16441
|
+
let e = Nn(s, db);
|
|
16428
16442
|
if (e) {
|
|
16429
|
-
let t = Pn(Xt, e,
|
|
16443
|
+
let t = Pn(Xt, e, db);
|
|
16430
16444
|
t && c.push(t);
|
|
16431
16445
|
}
|
|
16432
16446
|
}
|
|
16433
16447
|
let l = h(...c), u = e.select().from(Xt).where(l).$dynamic();
|
|
16434
16448
|
if (o?.sort_by) {
|
|
16435
16449
|
let e = Xt[o.sort_by];
|
|
16436
|
-
e && (u = u.orderBy(o.sort_order === "desc" ?
|
|
16450
|
+
e && (u = u.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
16437
16451
|
}
|
|
16438
|
-
let d = (await u.offset(r * i).limit(i)).map(
|
|
16452
|
+
let d = (await u.offset(r * i).limit(i)).map(fb);
|
|
16439
16453
|
if (!a) return { codes: d };
|
|
16440
|
-
let [f] = await e.select({ count:
|
|
16454
|
+
let [f] = await e.select({ count: Be() }).from(Xt).where(l);
|
|
16441
16455
|
return {
|
|
16442
16456
|
codes: d,
|
|
16443
16457
|
start: r * i,
|
|
@@ -16449,7 +16463,7 @@ function fb(e) {
|
|
|
16449
16463
|
return (await e.update(Xt).set({ used_at: (/* @__PURE__ */ new Date()).toISOString() }).where(h(m(Xt.tenant_id, t), m(Xt.code_id, n))).returning()).length > 0;
|
|
16450
16464
|
},
|
|
16451
16465
|
async consume(t, n) {
|
|
16452
|
-
return (await e.update(Xt).set({ used_at: (/* @__PURE__ */ new Date()).toISOString() }).where(h(m(Xt.tenant_id, t), m(Xt.code_id, n),
|
|
16466
|
+
return (await e.update(Xt).set({ used_at: (/* @__PURE__ */ new Date()).toISOString() }).where(h(m(Xt.tenant_id, t), m(Xt.code_id, n), Pe(Xt.used_at))).returning()).length > 0;
|
|
16453
16467
|
},
|
|
16454
16468
|
async remove(t, n) {
|
|
16455
16469
|
return (await e.delete(Xt).where(h(m(Xt.tenant_id, t), m(Xt.code_id, n))).returning()).length > 0;
|
|
@@ -16458,11 +16472,11 @@ function fb(e) {
|
|
|
16458
16472
|
}
|
|
16459
16473
|
//#endregion
|
|
16460
16474
|
//#region src/adapters/connections.ts
|
|
16461
|
-
function
|
|
16475
|
+
function mb() {
|
|
16462
16476
|
let { customAlphabet: e } = (Xe(), s(Ge));
|
|
16463
16477
|
return `con_${e("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
|
|
16464
16478
|
}
|
|
16465
|
-
function
|
|
16479
|
+
function hb(e) {
|
|
16466
16480
|
let { tenant_id: t, is_system: n, options: r, metadata: i, ...a } = e;
|
|
16467
16481
|
return k({
|
|
16468
16482
|
...a,
|
|
@@ -16471,11 +16485,11 @@ function mb(e) {
|
|
|
16471
16485
|
is_system: n ? !0 : void 0
|
|
16472
16486
|
});
|
|
16473
16487
|
}
|
|
16474
|
-
function
|
|
16488
|
+
function gb(e) {
|
|
16475
16489
|
return {
|
|
16476
16490
|
async create(t, n) {
|
|
16477
16491
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
16478
|
-
id: n.id ||
|
|
16492
|
+
id: n.id || mb(),
|
|
16479
16493
|
...n,
|
|
16480
16494
|
tenant_id: t,
|
|
16481
16495
|
options: JSON.stringify(n.options || {}),
|
|
@@ -16489,11 +16503,11 @@ function hb(e) {
|
|
|
16489
16503
|
} catch (e) {
|
|
16490
16504
|
throw e?.message?.includes("UNIQUE constraint failed") || e?.message?.includes("duplicate key") ? new Un(409, { message: "Connection already exists" }) : e;
|
|
16491
16505
|
}
|
|
16492
|
-
return
|
|
16506
|
+
return hb(i);
|
|
16493
16507
|
},
|
|
16494
16508
|
async get(t, n) {
|
|
16495
16509
|
let r = await e.select().from(tn).where(h(m(tn.tenant_id, t), m(tn.id, n))).get();
|
|
16496
|
-
return r ?
|
|
16510
|
+
return r ? hb(r) : null;
|
|
16497
16511
|
},
|
|
16498
16512
|
async update(t, n, r) {
|
|
16499
16513
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
@@ -16508,11 +16522,11 @@ function hb(e) {
|
|
|
16508
16522
|
let l = e.select().from(tn).where(c).$dynamic();
|
|
16509
16523
|
if (o?.sort_by) {
|
|
16510
16524
|
let e = tn[o.sort_by];
|
|
16511
|
-
e && (l = l.orderBy(o.sort_order === "desc" ?
|
|
16525
|
+
e && (l = l.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
16512
16526
|
}
|
|
16513
|
-
let u = (await l.offset(r * i).limit(i)).map(
|
|
16527
|
+
let u = (await l.offset(r * i).limit(i)).map(hb);
|
|
16514
16528
|
if (!a) return { connections: u };
|
|
16515
|
-
let [d] = await e.select({ count:
|
|
16529
|
+
let [d] = await e.select({ count: Be() }).from(tn).where(c);
|
|
16516
16530
|
return {
|
|
16517
16531
|
connections: u,
|
|
16518
16532
|
start: r * i,
|
|
@@ -16528,7 +16542,7 @@ function hb(e) {
|
|
|
16528
16542
|
//#endregion
|
|
16529
16543
|
//#region src/adapters/customDomains.ts
|
|
16530
16544
|
Xe();
|
|
16531
|
-
function
|
|
16545
|
+
function _b(e) {
|
|
16532
16546
|
let { tenant_id: t, domain_metadata: n, ...r } = e;
|
|
16533
16547
|
return k({
|
|
16534
16548
|
...r,
|
|
@@ -16536,7 +16550,7 @@ function gb(e) {
|
|
|
16536
16550
|
domain_metadata: A(n)
|
|
16537
16551
|
});
|
|
16538
16552
|
}
|
|
16539
|
-
function
|
|
16553
|
+
function vb(e) {
|
|
16540
16554
|
return {
|
|
16541
16555
|
async create(t, n) {
|
|
16542
16556
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
@@ -16554,24 +16568,24 @@ function _b(e) {
|
|
|
16554
16568
|
created_at: r,
|
|
16555
16569
|
updated_at: r
|
|
16556
16570
|
};
|
|
16557
|
-
return await e.insert(nn).values(i),
|
|
16571
|
+
return await e.insert(nn).values(i), _b({
|
|
16558
16572
|
...i,
|
|
16559
16573
|
tenant_id: t
|
|
16560
16574
|
});
|
|
16561
16575
|
},
|
|
16562
16576
|
async get(t, n) {
|
|
16563
16577
|
let r = await e.select().from(nn).where(h(m(nn.tenant_id, t), m(nn.custom_domain_id, n))).get();
|
|
16564
|
-
return r ?
|
|
16578
|
+
return r ? _b(r) : null;
|
|
16565
16579
|
},
|
|
16566
16580
|
async getByDomain(t) {
|
|
16567
16581
|
let n = await e.select().from(nn).where(m(nn.domain, t)).get();
|
|
16568
16582
|
return n ? {
|
|
16569
|
-
...
|
|
16583
|
+
..._b(n),
|
|
16570
16584
|
tenant_id: n.tenant_id
|
|
16571
16585
|
} : null;
|
|
16572
16586
|
},
|
|
16573
16587
|
async list(t) {
|
|
16574
|
-
return (await e.select().from(nn).where(m(nn.tenant_id, t)).all()).map(
|
|
16588
|
+
return (await e.select().from(nn).where(m(nn.tenant_id, t)).all()).map(_b);
|
|
16575
16589
|
},
|
|
16576
16590
|
async update(t, n, r) {
|
|
16577
16591
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
@@ -16584,7 +16598,7 @@ function _b(e) {
|
|
|
16584
16598
|
}
|
|
16585
16599
|
//#endregion
|
|
16586
16600
|
//#region src/adapters/customText.ts
|
|
16587
|
-
function
|
|
16601
|
+
function yb(e) {
|
|
16588
16602
|
return {
|
|
16589
16603
|
async get(t, n, r) {
|
|
16590
16604
|
let i = await e.select().from(wn).where(h(m(wn.tenant_id, t), m(wn.prompt, n), m(wn.language, r))).get();
|
|
@@ -16629,7 +16643,7 @@ function vb(e) {
|
|
|
16629
16643
|
}
|
|
16630
16644
|
//#endregion
|
|
16631
16645
|
//#region src/adapters/emailProviders.ts
|
|
16632
|
-
function
|
|
16646
|
+
function bb(e) {
|
|
16633
16647
|
return {
|
|
16634
16648
|
async create(t, n) {
|
|
16635
16649
|
let r = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -16666,7 +16680,7 @@ function yb(e) {
|
|
|
16666
16680
|
}
|
|
16667
16681
|
//#endregion
|
|
16668
16682
|
//#region src/adapters/emailTemplates.ts
|
|
16669
|
-
function
|
|
16683
|
+
function xb(e) {
|
|
16670
16684
|
return k({
|
|
16671
16685
|
template: e.template,
|
|
16672
16686
|
body: e.body,
|
|
@@ -16679,14 +16693,14 @@ function bb(e) {
|
|
|
16679
16693
|
urlLifetimeInSeconds: e.url_lifetime_in_seconds ?? void 0
|
|
16680
16694
|
});
|
|
16681
16695
|
}
|
|
16682
|
-
function
|
|
16696
|
+
function Sb(e) {
|
|
16683
16697
|
return {
|
|
16684
16698
|
async get(t, n) {
|
|
16685
16699
|
let r = await e.select().from(bn).where(h(m(bn.tenant_id, t), m(bn.template, n))).get();
|
|
16686
|
-
return r ?
|
|
16700
|
+
return r ? xb(r) : null;
|
|
16687
16701
|
},
|
|
16688
16702
|
async list(t) {
|
|
16689
|
-
return (await e.select().from(bn).where(m(bn.tenant_id, t)).all()).map(
|
|
16703
|
+
return (await e.select().from(bn).where(m(bn.tenant_id, t)).all()).map(xb);
|
|
16690
16704
|
},
|
|
16691
16705
|
async create(t, n) {
|
|
16692
16706
|
let r = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -16720,8 +16734,8 @@ function xb(e) {
|
|
|
16720
16734
|
//#endregion
|
|
16721
16735
|
//#region src/adapters/flows.ts
|
|
16722
16736
|
Xe();
|
|
16723
|
-
var
|
|
16724
|
-
function
|
|
16737
|
+
var Cb = ["id", "name"];
|
|
16738
|
+
function wb(e) {
|
|
16725
16739
|
return {
|
|
16726
16740
|
async create(t, n) {
|
|
16727
16741
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = `af_${Ye()}`;
|
|
@@ -16756,7 +16770,7 @@ function Cb(e) {
|
|
|
16756
16770
|
async list(t, n) {
|
|
16757
16771
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = [m(_n.tenant_id, t)];
|
|
16758
16772
|
if (s) {
|
|
16759
|
-
let e = Nn(s,
|
|
16773
|
+
let e = Nn(s, Cb);
|
|
16760
16774
|
if (e) {
|
|
16761
16775
|
let t = Pn(_n, e, []);
|
|
16762
16776
|
t && c.push(t);
|
|
@@ -16765,7 +16779,7 @@ function Cb(e) {
|
|
|
16765
16779
|
let l = h(...c), u = e.select().from(_n).where(l).$dynamic();
|
|
16766
16780
|
if (o?.sort_by) {
|
|
16767
16781
|
let e = _n[o.sort_by];
|
|
16768
|
-
e && (u = u.orderBy(o.sort_order === "desc" ?
|
|
16782
|
+
e && (u = u.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
16769
16783
|
}
|
|
16770
16784
|
let d = (await u.offset(r * i).limit(i)).map((e) => {
|
|
16771
16785
|
let { tenant_id: t, actions: n, ...r } = e;
|
|
@@ -16775,7 +16789,7 @@ function Cb(e) {
|
|
|
16775
16789
|
});
|
|
16776
16790
|
});
|
|
16777
16791
|
if (!a) return { flows: d };
|
|
16778
|
-
let [f] = await e.select({ count:
|
|
16792
|
+
let [f] = await e.select({ count: Be() }).from(_n).where(l);
|
|
16779
16793
|
return {
|
|
16780
16794
|
flows: d,
|
|
16781
16795
|
start: r * i,
|
|
@@ -16791,12 +16805,12 @@ function Cb(e) {
|
|
|
16791
16805
|
//#endregion
|
|
16792
16806
|
//#region src/adapters/forms.ts
|
|
16793
16807
|
Xe();
|
|
16794
|
-
var
|
|
16808
|
+
var Tb = [
|
|
16795
16809
|
"nodes",
|
|
16796
16810
|
"start",
|
|
16797
16811
|
"ending"
|
|
16798
|
-
],
|
|
16799
|
-
function
|
|
16812
|
+
], Eb = ["name"];
|
|
16813
|
+
function Db(e) {
|
|
16800
16814
|
return {
|
|
16801
16815
|
async create(t, n) {
|
|
16802
16816
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = Ye(), a = {
|
|
@@ -16810,7 +16824,7 @@ function Eb(e) {
|
|
|
16810
16824
|
created_at: r,
|
|
16811
16825
|
updated_at: r
|
|
16812
16826
|
};
|
|
16813
|
-
for (let e of
|
|
16827
|
+
for (let e of Tb) a[e] = JSON.stringify(n[e] || (e === "nodes" ? [] : {}));
|
|
16814
16828
|
return await e.insert(gn).values(a), {
|
|
16815
16829
|
id: i,
|
|
16816
16830
|
...n,
|
|
@@ -16822,35 +16836,35 @@ function Eb(e) {
|
|
|
16822
16836
|
let r = await e.select().from(gn).where(h(m(gn.tenant_id, t), m(gn.id, n))).get();
|
|
16823
16837
|
if (!r) return null;
|
|
16824
16838
|
let { tenant_id: i, ...a } = r, o = { ...a };
|
|
16825
|
-
for (let e of
|
|
16839
|
+
for (let e of Tb) o[e] = A(a[e]);
|
|
16826
16840
|
return k(o);
|
|
16827
16841
|
},
|
|
16828
16842
|
async update(t, n, r) {
|
|
16829
16843
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
16830
|
-
for (let [e, t] of Object.entries(r)) t !== void 0 && (
|
|
16844
|
+
for (let [e, t] of Object.entries(r)) t !== void 0 && (Tb.includes(e) ? i[e] = JSON.stringify(t) : i[e] = t);
|
|
16831
16845
|
return (await e.update(gn).set(i).where(h(m(gn.tenant_id, t), m(gn.id, n))).returning()).length > 0;
|
|
16832
16846
|
},
|
|
16833
16847
|
async list(t, n) {
|
|
16834
16848
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = [m(gn.tenant_id, t)];
|
|
16835
16849
|
if (s) {
|
|
16836
|
-
let e = Nn(s,
|
|
16850
|
+
let e = Nn(s, Eb);
|
|
16837
16851
|
if (e) {
|
|
16838
|
-
let t = Pn(gn, e,
|
|
16852
|
+
let t = Pn(gn, e, Eb);
|
|
16839
16853
|
t && c.push(t);
|
|
16840
16854
|
}
|
|
16841
16855
|
}
|
|
16842
16856
|
let l = h(...c), u = e.select().from(gn).where(l).$dynamic();
|
|
16843
16857
|
if (o?.sort_by) {
|
|
16844
16858
|
let e = gn[o.sort_by];
|
|
16845
|
-
e && (u = u.orderBy(o.sort_order === "desc" ?
|
|
16859
|
+
e && (u = u.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
16846
16860
|
}
|
|
16847
16861
|
let d = (await u.offset(r * i).limit(i)).map((e) => {
|
|
16848
16862
|
let { tenant_id: t, ...n } = e, r = { ...n };
|
|
16849
|
-
for (let e of
|
|
16863
|
+
for (let e of Tb) r[e] = A(n[e]);
|
|
16850
16864
|
return k(r);
|
|
16851
16865
|
});
|
|
16852
16866
|
if (!a) return { forms: d };
|
|
16853
|
-
let [f] = await e.select({ count:
|
|
16867
|
+
let [f] = await e.select({ count: Be() }).from(gn).where(l);
|
|
16854
16868
|
return {
|
|
16855
16869
|
forms: d,
|
|
16856
16870
|
start: r * i,
|
|
@@ -16865,7 +16879,7 @@ function Eb(e) {
|
|
|
16865
16879
|
}
|
|
16866
16880
|
//#endregion
|
|
16867
16881
|
//#region src/helpers/dates.ts
|
|
16868
|
-
function
|
|
16882
|
+
function Ob(e) {
|
|
16869
16883
|
if (e != null) {
|
|
16870
16884
|
if (typeof e == "number") return new Date(e).toISOString();
|
|
16871
16885
|
if (typeof e == "string") {
|
|
@@ -16875,35 +16889,35 @@ function Db(e) {
|
|
|
16875
16889
|
}
|
|
16876
16890
|
}
|
|
16877
16891
|
}
|
|
16878
|
-
function
|
|
16879
|
-
return
|
|
16892
|
+
function kb(e, t = (/* @__PURE__ */ new Date(0)).toISOString()) {
|
|
16893
|
+
return Ob(e) ?? t;
|
|
16880
16894
|
}
|
|
16881
16895
|
function $(e) {
|
|
16882
16896
|
if (!e || e === "") return null;
|
|
16883
16897
|
let t = new Date(e);
|
|
16884
16898
|
return isNaN(t.getTime()) ? null : t.getTime();
|
|
16885
16899
|
}
|
|
16886
|
-
function
|
|
16900
|
+
function Ab(e, t, n = []) {
|
|
16887
16901
|
let r = {};
|
|
16888
16902
|
for (let n of t) {
|
|
16889
16903
|
let t = n.replace(/_ts$/, "");
|
|
16890
|
-
r[t] =
|
|
16904
|
+
r[t] = kb(e[n]);
|
|
16891
16905
|
}
|
|
16892
16906
|
for (let t of n) {
|
|
16893
16907
|
let n = t.replace(/_ts$/, "");
|
|
16894
|
-
r[n] =
|
|
16908
|
+
r[n] = Ob(e[t]);
|
|
16895
16909
|
}
|
|
16896
16910
|
return r;
|
|
16897
16911
|
}
|
|
16898
16912
|
//#endregion
|
|
16899
16913
|
//#region src/adapters/hookCode.ts
|
|
16900
16914
|
Xe();
|
|
16901
|
-
var
|
|
16902
|
-
function
|
|
16903
|
-
return `hc_${
|
|
16915
|
+
var jb = Je("0123456789abcdefghijklmnopqrstuvwxyz", 17);
|
|
16916
|
+
function Mb() {
|
|
16917
|
+
return `hc_${jb()}`;
|
|
16904
16918
|
}
|
|
16905
|
-
function
|
|
16906
|
-
let { created_at_ts: t, updated_at_ts: n, secrets: r, ...i } = e, a =
|
|
16919
|
+
function Nb(e) {
|
|
16920
|
+
let { created_at_ts: t, updated_at_ts: n, secrets: r, ...i } = e, a = Ab({
|
|
16907
16921
|
created_at_ts: t,
|
|
16908
16922
|
updated_at_ts: n
|
|
16909
16923
|
}, ["created_at_ts", "updated_at_ts"]);
|
|
@@ -16913,25 +16927,25 @@ function Mb(e) {
|
|
|
16913
16927
|
secrets: r ? JSON.parse(r) : void 0
|
|
16914
16928
|
};
|
|
16915
16929
|
}
|
|
16916
|
-
function
|
|
16930
|
+
function Pb(e) {
|
|
16917
16931
|
return {
|
|
16918
16932
|
async create(t, n) {
|
|
16919
16933
|
let r = Date.now(), i = {
|
|
16920
|
-
id:
|
|
16934
|
+
id: Mb(),
|
|
16921
16935
|
tenant_id: t,
|
|
16922
16936
|
code: n.code,
|
|
16923
16937
|
secrets: n.secrets ? JSON.stringify(n.secrets) : null,
|
|
16924
16938
|
created_at_ts: r,
|
|
16925
16939
|
updated_at_ts: r
|
|
16926
16940
|
};
|
|
16927
|
-
return await e.insert(Sn).values(i),
|
|
16941
|
+
return await e.insert(Sn).values(i), Nb({
|
|
16928
16942
|
...i,
|
|
16929
16943
|
tenant_id: t
|
|
16930
16944
|
});
|
|
16931
16945
|
},
|
|
16932
16946
|
async get(t, n) {
|
|
16933
16947
|
let r = await e.select().from(Sn).where(h(m(Sn.tenant_id, t), m(Sn.id, n))).get();
|
|
16934
|
-
return r ?
|
|
16948
|
+
return r ? Nb(r) : null;
|
|
16935
16949
|
},
|
|
16936
16950
|
async update(t, n, r) {
|
|
16937
16951
|
let i = { updated_at_ts: Date.now() };
|
|
@@ -16944,11 +16958,11 @@ function Nb(e) {
|
|
|
16944
16958
|
}
|
|
16945
16959
|
//#endregion
|
|
16946
16960
|
//#region src/adapters/hooks.ts
|
|
16947
|
-
function
|
|
16961
|
+
function Fb() {
|
|
16948
16962
|
let { customAlphabet: e } = (Xe(), s(Ge));
|
|
16949
16963
|
return `h_${e("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
|
|
16950
16964
|
}
|
|
16951
|
-
function
|
|
16965
|
+
function Ib(e) {
|
|
16952
16966
|
if (!(typeof e != "string" || !e)) try {
|
|
16953
16967
|
let t = JSON.parse(e);
|
|
16954
16968
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
@@ -16956,8 +16970,8 @@ function Fb(e) {
|
|
|
16956
16970
|
return;
|
|
16957
16971
|
}
|
|
16958
16972
|
}
|
|
16959
|
-
function
|
|
16960
|
-
let { tenant_id: t, created_at_ts: n, updated_at_ts: r, metadata: i, ...a } = e, o =
|
|
16973
|
+
function Lb(e) {
|
|
16974
|
+
let { tenant_id: t, created_at_ts: n, updated_at_ts: r, metadata: i, ...a } = e, o = Ab({
|
|
16961
16975
|
created_at_ts: n,
|
|
16962
16976
|
updated_at_ts: r
|
|
16963
16977
|
}, ["created_at_ts", "updated_at_ts"]);
|
|
@@ -16965,15 +16979,15 @@ function Ib(e) {
|
|
|
16965
16979
|
...a,
|
|
16966
16980
|
enabled: !!a.enabled,
|
|
16967
16981
|
synchronous: !!a.synchronous,
|
|
16968
|
-
metadata:
|
|
16982
|
+
metadata: Ib(i),
|
|
16969
16983
|
...o
|
|
16970
16984
|
});
|
|
16971
16985
|
}
|
|
16972
|
-
function
|
|
16986
|
+
function Rb(e) {
|
|
16973
16987
|
return {
|
|
16974
16988
|
async create(t, n) {
|
|
16975
16989
|
let r = Date.now(), i = {
|
|
16976
|
-
hook_id: n.hook_id ||
|
|
16990
|
+
hook_id: n.hook_id || Fb(),
|
|
16977
16991
|
tenant_id: t,
|
|
16978
16992
|
trigger_id: n.trigger_id,
|
|
16979
16993
|
url: n.url,
|
|
@@ -16987,14 +17001,14 @@ function Lb(e) {
|
|
|
16987
17001
|
created_at_ts: r,
|
|
16988
17002
|
updated_at_ts: r
|
|
16989
17003
|
};
|
|
16990
|
-
return await e.insert(xn).values(i),
|
|
17004
|
+
return await e.insert(xn).values(i), Lb({
|
|
16991
17005
|
...i,
|
|
16992
17006
|
tenant_id: t
|
|
16993
17007
|
});
|
|
16994
17008
|
},
|
|
16995
17009
|
async get(t, n) {
|
|
16996
17010
|
let r = await e.select().from(xn).where(h(m(xn.tenant_id, t), m(xn.hook_id, n))).get();
|
|
16997
|
-
return r ?
|
|
17011
|
+
return r ? Lb(r) : null;
|
|
16998
17012
|
},
|
|
16999
17013
|
async update(t, n, r) {
|
|
17000
17014
|
let i = { updated_at_ts: Date.now() };
|
|
@@ -17007,10 +17021,10 @@ function Lb(e) {
|
|
|
17007
17021
|
"template_id",
|
|
17008
17022
|
"code_id"
|
|
17009
17023
|
]) : void 0, l = c ? h(m(xn.tenant_id, t), c) : m(xn.tenant_id, t), u = e.select().from(xn).where(l).$dynamic(), d = o?.sort_by ? xn[o.sort_by] : void 0;
|
|
17010
|
-
u = d ? u.orderBy(o?.sort_order === "desc" ?
|
|
17011
|
-
let f = (await u.offset(r * i).limit(i)).map(
|
|
17024
|
+
u = d ? u.orderBy(o?.sort_order === "desc" ? ze(d) : Re(d)) : u.orderBy(ze(xn.priority), Re(xn.created_at_ts));
|
|
17025
|
+
let f = (await u.offset(r * i).limit(i)).map(Lb);
|
|
17012
17026
|
if (!a) return { hooks: f };
|
|
17013
|
-
let [ee] = await e.select({ count:
|
|
17027
|
+
let [ee] = await e.select({ count: Be() }).from(xn).where(l);
|
|
17014
17028
|
return {
|
|
17015
17029
|
hooks: f,
|
|
17016
17030
|
start: r * i,
|
|
@@ -17025,26 +17039,26 @@ function Lb(e) {
|
|
|
17025
17039
|
}
|
|
17026
17040
|
//#endregion
|
|
17027
17041
|
//#region src/adapters/invites.ts
|
|
17028
|
-
function
|
|
17042
|
+
function zb() {
|
|
17029
17043
|
let { customAlphabet: e } = (Xe(), s(Ge));
|
|
17030
17044
|
return `inv_${e("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
|
|
17031
17045
|
}
|
|
17032
|
-
var
|
|
17046
|
+
var Bb = [
|
|
17033
17047
|
"inviter",
|
|
17034
17048
|
"invitee",
|
|
17035
17049
|
"app_metadata",
|
|
17036
17050
|
"user_metadata",
|
|
17037
17051
|
"roles"
|
|
17038
17052
|
];
|
|
17039
|
-
function
|
|
17053
|
+
function Vb(e) {
|
|
17040
17054
|
let { tenant_id: t, send_invitation_email: n, ...r } = e, i = { ...r };
|
|
17041
|
-
for (let e of
|
|
17055
|
+
for (let e of Bb) i[e] = A(r[e], e === "roles" ? [] : {});
|
|
17042
17056
|
return i.send_invitation_email = !!n, k(i);
|
|
17043
17057
|
}
|
|
17044
|
-
function
|
|
17058
|
+
function Hb(e) {
|
|
17045
17059
|
return {
|
|
17046
17060
|
async create(t, n) {
|
|
17047
|
-
let r = n.id ||
|
|
17061
|
+
let r = n.id || zb(), i = n.ttl_sec || 604800, a = /* @__PURE__ */ new Date(), o = new Date(a.getTime() + i * 1e3).toISOString(), s = {
|
|
17048
17062
|
id: r,
|
|
17049
17063
|
tenant_id: t,
|
|
17050
17064
|
organization_id: n.organization_id,
|
|
@@ -17057,35 +17071,35 @@ function Vb(e) {
|
|
|
17057
17071
|
created_at: a.toISOString(),
|
|
17058
17072
|
expires_at: o
|
|
17059
17073
|
};
|
|
17060
|
-
for (let e of
|
|
17074
|
+
for (let e of Bb) n[e] !== void 0 && (s[e] = JSON.stringify(n[e]));
|
|
17061
17075
|
try {
|
|
17062
17076
|
await e.insert(sn).values(s);
|
|
17063
17077
|
} catch (e) {
|
|
17064
17078
|
throw e?.message?.includes("UNIQUE constraint failed") || e?.message?.includes("duplicate key") ? new Un(409, { message: "Invite already exists" }) : e;
|
|
17065
17079
|
}
|
|
17066
|
-
return
|
|
17080
|
+
return Vb({
|
|
17067
17081
|
...s,
|
|
17068
17082
|
tenant_id: t
|
|
17069
17083
|
});
|
|
17070
17084
|
},
|
|
17071
17085
|
async get(t, n) {
|
|
17072
17086
|
let r = await e.select().from(sn).where(h(m(sn.tenant_id, t), m(sn.id, n))).get();
|
|
17073
|
-
return r ?
|
|
17087
|
+
return r ? Vb(r) : null;
|
|
17074
17088
|
},
|
|
17075
17089
|
async update(t, n, r) {
|
|
17076
17090
|
let i = {};
|
|
17077
|
-
for (let e of
|
|
17091
|
+
for (let e of Bb) r[e] !== void 0 && (i[e] = JSON.stringify(r[e]));
|
|
17078
17092
|
return r.connection_id !== void 0 && (i.connection_id = r.connection_id), r.ttl_sec !== void 0 && (i.ttl_sec = r.ttl_sec, i.expires_at = new Date(Date.now() + r.ttl_sec * 1e3).toISOString()), (await e.update(sn).set(i).where(h(m(sn.tenant_id, t), m(sn.id, n))).returning()).length > 0;
|
|
17079
17093
|
},
|
|
17080
17094
|
async list(t, n) {
|
|
17081
17095
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o } = n || {}, s = e.select().from(sn).where(m(sn.tenant_id, t)).$dynamic();
|
|
17082
17096
|
if (o?.sort_by) {
|
|
17083
17097
|
let e = sn[o.sort_by];
|
|
17084
|
-
e && (s = s.orderBy(o.sort_order === "desc" ?
|
|
17098
|
+
e && (s = s.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
17085
17099
|
}
|
|
17086
|
-
let c = (await s.offset(r * i).limit(i)).map(
|
|
17100
|
+
let c = (await s.offset(r * i).limit(i)).map(Vb);
|
|
17087
17101
|
if (!a) return { invites: c };
|
|
17088
|
-
let [l] = await e.select({ count:
|
|
17102
|
+
let [l] = await e.select({ count: Be() }).from(sn).where(m(sn.tenant_id, t));
|
|
17089
17103
|
return {
|
|
17090
17104
|
invites: c,
|
|
17091
17105
|
start: r * i,
|
|
@@ -17100,14 +17114,14 @@ function Vb(e) {
|
|
|
17100
17114
|
}
|
|
17101
17115
|
//#endregion
|
|
17102
17116
|
//#region src/adapters/keys.ts
|
|
17103
|
-
var
|
|
17117
|
+
var Ub = [
|
|
17104
17118
|
"kid",
|
|
17105
17119
|
"connection",
|
|
17106
17120
|
"fingerprint",
|
|
17107
17121
|
"thumbprint",
|
|
17108
17122
|
"type"
|
|
17109
17123
|
];
|
|
17110
|
-
function
|
|
17124
|
+
function Wb(e) {
|
|
17111
17125
|
return {
|
|
17112
17126
|
async create(t) {
|
|
17113
17127
|
await e.insert(Cn).values({
|
|
@@ -17116,25 +17130,25 @@ function Ub(e) {
|
|
|
17116
17130
|
});
|
|
17117
17131
|
},
|
|
17118
17132
|
async list(t) {
|
|
17119
|
-
let { page: n = 0, per_page: r = 50, include_totals: i = !1, sort: a, q: o } = t || {}, s = (/* @__PURE__ */ new Date()).toISOString(), c = [
|
|
17133
|
+
let { page: n = 0, per_page: r = 50, include_totals: i = !1, sort: a, q: o } = t || {}, s = (/* @__PURE__ */ new Date()).toISOString(), c = [Oe(ke(Cn.revoked_at, s), Pe(Cn.revoked_at))];
|
|
17120
17134
|
if (o) {
|
|
17121
|
-
let e = Nn(o,
|
|
17135
|
+
let e = Nn(o, Ub);
|
|
17122
17136
|
if (e) {
|
|
17123
|
-
let t = Pn(Cn, e,
|
|
17137
|
+
let t = Pn(Cn, e, Ub);
|
|
17124
17138
|
t && c.push(t);
|
|
17125
17139
|
}
|
|
17126
17140
|
}
|
|
17127
17141
|
let l = h(...c), u = e.select().from(Cn).where(l).$dynamic();
|
|
17128
17142
|
if (a?.sort_by) {
|
|
17129
17143
|
let e = Cn[a.sort_by];
|
|
17130
|
-
e && (u = u.orderBy(a.sort_order === "desc" ?
|
|
17144
|
+
e && (u = u.orderBy(a.sort_order === "desc" ? ze(e) : Re(e)));
|
|
17131
17145
|
}
|
|
17132
17146
|
let d = (await u.offset(n * r).limit(r)).map((e) => {
|
|
17133
17147
|
let { created_at: t, ...n } = e;
|
|
17134
17148
|
return k(n);
|
|
17135
17149
|
});
|
|
17136
17150
|
if (!i) return { signingKeys: d };
|
|
17137
|
-
let [f] = await e.select({ count:
|
|
17151
|
+
let [f] = await e.select({ count: Be() }).from(Cn).where(l);
|
|
17138
17152
|
return {
|
|
17139
17153
|
signingKeys: d,
|
|
17140
17154
|
start: n * r,
|
|
@@ -17149,17 +17163,17 @@ function Ub(e) {
|
|
|
17149
17163
|
}
|
|
17150
17164
|
//#endregion
|
|
17151
17165
|
//#region src/adapters/loginSessions.ts
|
|
17152
|
-
var
|
|
17153
|
-
function
|
|
17166
|
+
var Gb = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", Kb = 32;
|
|
17167
|
+
function qb() {
|
|
17154
17168
|
let e = Date.now(), t = "";
|
|
17155
|
-
for (let n = 10; n > 0; n--) t =
|
|
17156
|
-
let n = new Uint8Array(16);
|
|
17169
|
+
for (let n = 10; n > 0; n--) t = Gb.charAt(e % Kb) + t, e = Math.floor(e / Kb);
|
|
17170
|
+
let n = /* @__PURE__ */ new Uint8Array(16);
|
|
17157
17171
|
crypto.getRandomValues(n);
|
|
17158
|
-
for (let e = 0; e < 16; e++) t +=
|
|
17172
|
+
for (let e = 0; e < 16; e++) t += Gb.charAt(n[e] % Kb);
|
|
17159
17173
|
return t;
|
|
17160
17174
|
}
|
|
17161
|
-
function
|
|
17162
|
-
let { tenant_id: t, created_at_ts: n, updated_at_ts: r, expires_at_ts: i, state_data: a, auth_params: o, ...s } = e, c =
|
|
17175
|
+
function Jb(e) {
|
|
17176
|
+
let { tenant_id: t, created_at_ts: n, updated_at_ts: r, expires_at_ts: i, state_data: a, auth_params: o, ...s } = e, c = Ab({
|
|
17163
17177
|
created_at_ts: n,
|
|
17164
17178
|
updated_at_ts: r,
|
|
17165
17179
|
expires_at_ts: i
|
|
@@ -17176,11 +17190,11 @@ function qb(e) {
|
|
|
17176
17190
|
state_data: A(a)
|
|
17177
17191
|
});
|
|
17178
17192
|
}
|
|
17179
|
-
function
|
|
17193
|
+
function Yb(e) {
|
|
17180
17194
|
return {
|
|
17181
17195
|
async create(t, n) {
|
|
17182
17196
|
let r = Date.now(), i = {
|
|
17183
|
-
id:
|
|
17197
|
+
id: qb(),
|
|
17184
17198
|
tenant_id: t,
|
|
17185
17199
|
session_id: n.session_id,
|
|
17186
17200
|
csrf_token: n.csrf_token,
|
|
@@ -17201,14 +17215,14 @@ function Jb(e) {
|
|
|
17201
17215
|
updated_at_ts: r,
|
|
17202
17216
|
expires_at_ts: n.expires_at ? $(n.expires_at) : r + 1e3 * 60 * 60 * 24
|
|
17203
17217
|
};
|
|
17204
|
-
return await e.insert(C).values(i),
|
|
17218
|
+
return await e.insert(C).values(i), Jb({
|
|
17205
17219
|
...i,
|
|
17206
17220
|
tenant_id: t
|
|
17207
17221
|
});
|
|
17208
17222
|
},
|
|
17209
17223
|
async get(t, n) {
|
|
17210
17224
|
let r = t ? h(m(C.tenant_id, t), m(C.id, n)) : m(C.id, n), i = await e.select().from(C).where(r).get();
|
|
17211
|
-
return i ?
|
|
17225
|
+
return i ? Jb(i) : null;
|
|
17212
17226
|
},
|
|
17213
17227
|
async update(t, n, r) {
|
|
17214
17228
|
let i = { updated_at_ts: Date.now() };
|
|
@@ -17229,7 +17243,7 @@ function Jb(e) {
|
|
|
17229
17243
|
//#endregion
|
|
17230
17244
|
//#region src/adapters/logs.ts
|
|
17231
17245
|
Xe();
|
|
17232
|
-
function
|
|
17246
|
+
function Xb(e) {
|
|
17233
17247
|
let { tenant_id: t, isMobile: n, auth0_client: r, details: i, country_code: a, city_name: o, latitude: s, longitude: c, time_zone: l, continent_code: u, scope: d, ...f } = e, ee = {
|
|
17234
17248
|
...f,
|
|
17235
17249
|
isMobile: !!n,
|
|
@@ -17246,7 +17260,7 @@ function Yb(e) {
|
|
|
17246
17260
|
continent_code: u
|
|
17247
17261
|
})), k(ee);
|
|
17248
17262
|
}
|
|
17249
|
-
function
|
|
17263
|
+
function Zb(e) {
|
|
17250
17264
|
return {
|
|
17251
17265
|
async create(t, n) {
|
|
17252
17266
|
let r = {
|
|
@@ -17272,7 +17286,7 @@ function Xb(e) {
|
|
|
17272
17286
|
hostname: n.hostname,
|
|
17273
17287
|
session_connection: n.session_connection
|
|
17274
17288
|
};
|
|
17275
|
-
return n.auth0_client && (r.auth0_client = JSON.stringify(n.auth0_client)), n.details && (r.details = JSON.stringify(n.details).substring(0, 8192)), n.location_info && (r.country_code = n.location_info.country_code, r.city_name = n.location_info.city_name, r.latitude = n.location_info.latitude, r.longitude = n.location_info.longitude, r.time_zone = n.location_info.time_zone, r.continent_code = n.location_info.continent_code), await e.insert(E).values(r),
|
|
17289
|
+
return n.auth0_client && (r.auth0_client = JSON.stringify(n.auth0_client)), n.details && (r.details = JSON.stringify(n.details).substring(0, 8192)), n.location_info && (r.country_code = n.location_info.country_code, r.city_name = n.location_info.city_name, r.latitude = n.location_info.latitude, r.longitude = n.location_info.longitude, r.time_zone = n.location_info.time_zone, r.continent_code = n.location_info.continent_code), await e.insert(E).values(r), Xb({
|
|
17276
17290
|
...r,
|
|
17277
17291
|
tenant_id: t
|
|
17278
17292
|
});
|
|
@@ -17288,15 +17302,15 @@ function Xb(e) {
|
|
|
17288
17302
|
], ["description"]);
|
|
17289
17303
|
e && u.push(e);
|
|
17290
17304
|
}
|
|
17291
|
-
typeof c == "number" && Number.isFinite(c) && u.push(
|
|
17305
|
+
typeof c == "number" && Number.isFinite(c) && u.push(Ae(E.date, (/* @__PURE__ */ new Date(Math.floor(c) * 1e3)).toISOString())), typeof l == "number" && Number.isFinite(l) && u.push(je(E.date, (/* @__PURE__ */ new Date((Math.floor(l) + 1) * 1e3)).toISOString()));
|
|
17292
17306
|
let d = h(...u), f = e.select().from(E).where(d).$dynamic();
|
|
17293
17307
|
if (o?.sort_by) {
|
|
17294
17308
|
let e = E[o.sort_by];
|
|
17295
|
-
e && (f = f.orderBy(o.sort_order === "desc" ?
|
|
17296
|
-
} else f = f.orderBy(
|
|
17297
|
-
let ee = (await f.offset(r * i).limit(i)).map(
|
|
17309
|
+
e && (f = f.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
17310
|
+
} else f = f.orderBy(ze(E.date));
|
|
17311
|
+
let ee = (await f.offset(r * i).limit(i)).map(Xb);
|
|
17298
17312
|
if (!a) return { logs: ee };
|
|
17299
|
-
let [te] = await e.select({ count:
|
|
17313
|
+
let [te] = await e.select({ count: Be() }).from(E).where(d);
|
|
17300
17314
|
return {
|
|
17301
17315
|
logs: ee,
|
|
17302
17316
|
start: r * i,
|
|
@@ -17306,37 +17320,37 @@ function Xb(e) {
|
|
|
17306
17320
|
},
|
|
17307
17321
|
async get(t, n) {
|
|
17308
17322
|
let r = await e.select().from(E).where(h(m(E.tenant_id, t), m(E.log_id, n))).get();
|
|
17309
|
-
return r ?
|
|
17323
|
+
return r ? Xb(r) : null;
|
|
17310
17324
|
}
|
|
17311
17325
|
};
|
|
17312
17326
|
}
|
|
17313
17327
|
//#endregion
|
|
17314
17328
|
//#region src/adapters/authenticationMethods.ts
|
|
17315
|
-
var
|
|
17316
|
-
function
|
|
17329
|
+
var Qb = "0123456789ABCDEFGHJKMNPQRSTVWXYZ", $b = 32;
|
|
17330
|
+
function ex() {
|
|
17317
17331
|
let e = Date.now(), t = "";
|
|
17318
|
-
for (let n = 10; n > 0; n--) t =
|
|
17319
|
-
let n = new Uint8Array(16);
|
|
17332
|
+
for (let n = 10; n > 0; n--) t = Qb.charAt(e % $b) + t, e = Math.floor(e / $b);
|
|
17333
|
+
let n = /* @__PURE__ */ new Uint8Array(16);
|
|
17320
17334
|
crypto.getRandomValues(n);
|
|
17321
|
-
for (let e = 0; e < 16; e++) t +=
|
|
17335
|
+
for (let e = 0; e < 16; e++) t += Qb.charAt(n[e] % $b);
|
|
17322
17336
|
return t;
|
|
17323
17337
|
}
|
|
17324
|
-
function
|
|
17338
|
+
function tx(e) {
|
|
17325
17339
|
let { tenant_id: t, created_at_ts: n, updated_at_ts: r, credential_backed_up: i, confirmed: a, transports: o, ...s } = e;
|
|
17326
17340
|
return k({
|
|
17327
17341
|
...s,
|
|
17328
17342
|
confirmed: !!a,
|
|
17329
17343
|
credential_backed_up: i == null ? void 0 : !!i,
|
|
17330
17344
|
transports: A(o),
|
|
17331
|
-
created_at:
|
|
17332
|
-
updated_at:
|
|
17345
|
+
created_at: kb(n),
|
|
17346
|
+
updated_at: kb(r)
|
|
17333
17347
|
});
|
|
17334
17348
|
}
|
|
17335
|
-
function
|
|
17349
|
+
function nx(e) {
|
|
17336
17350
|
return {
|
|
17337
17351
|
async create(t, n) {
|
|
17338
17352
|
let r = Date.now(), i = {
|
|
17339
|
-
id: n.id ||
|
|
17353
|
+
id: n.id || ex(),
|
|
17340
17354
|
tenant_id: t,
|
|
17341
17355
|
user_id: n.user_id,
|
|
17342
17356
|
type: n.type,
|
|
@@ -17352,21 +17366,21 @@ function tx(e) {
|
|
|
17352
17366
|
created_at_ts: r,
|
|
17353
17367
|
updated_at_ts: r
|
|
17354
17368
|
};
|
|
17355
|
-
return await e.insert(Tn).values(i),
|
|
17369
|
+
return await e.insert(Tn).values(i), tx({
|
|
17356
17370
|
...i,
|
|
17357
17371
|
tenant_id: t
|
|
17358
17372
|
});
|
|
17359
17373
|
},
|
|
17360
17374
|
async get(t, n) {
|
|
17361
17375
|
let r = await e.select().from(Tn).where(h(m(Tn.tenant_id, t), m(Tn.id, n))).get();
|
|
17362
|
-
return r ?
|
|
17376
|
+
return r ? tx(r) : null;
|
|
17363
17377
|
},
|
|
17364
17378
|
async getByCredentialId(t, n) {
|
|
17365
17379
|
let r = await e.select().from(Tn).where(h(m(Tn.tenant_id, t), m(Tn.credential_id, n))).get();
|
|
17366
|
-
return r ?
|
|
17380
|
+
return r ? tx(r) : null;
|
|
17367
17381
|
},
|
|
17368
17382
|
async list(t, n) {
|
|
17369
|
-
return (await e.select().from(Tn).where(h(m(Tn.tenant_id, t), m(Tn.user_id, n))).all()).map(
|
|
17383
|
+
return (await e.select().from(Tn).where(h(m(Tn.tenant_id, t), m(Tn.user_id, n))).all()).map(tx);
|
|
17370
17384
|
},
|
|
17371
17385
|
async update(t, n, r) {
|
|
17372
17386
|
let i = { updated_at_ts: Date.now() };
|
|
@@ -17382,12 +17396,12 @@ function tx(e) {
|
|
|
17382
17396
|
}
|
|
17383
17397
|
//#endregion
|
|
17384
17398
|
//#region src/adapters/organizations.ts
|
|
17385
|
-
var
|
|
17386
|
-
function
|
|
17399
|
+
var rx = ["name", "display_name"];
|
|
17400
|
+
function ix() {
|
|
17387
17401
|
let { customAlphabet: e } = (Xe(), s(Ge));
|
|
17388
17402
|
return `org_${e("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
|
|
17389
17403
|
}
|
|
17390
|
-
function
|
|
17404
|
+
function ax(e) {
|
|
17391
17405
|
let { tenant_id: t, branding: n, metadata: r, enabled_connections: i, token_quota: a, ...o } = e;
|
|
17392
17406
|
return k({
|
|
17393
17407
|
...o,
|
|
@@ -17397,11 +17411,11 @@ function ix(e) {
|
|
|
17397
17411
|
token_quota: A(a, {})
|
|
17398
17412
|
});
|
|
17399
17413
|
}
|
|
17400
|
-
function
|
|
17414
|
+
function ox(e) {
|
|
17401
17415
|
return {
|
|
17402
17416
|
async create(t, n) {
|
|
17403
17417
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
17404
|
-
id: n.id ||
|
|
17418
|
+
id: n.id || ix(),
|
|
17405
17419
|
tenant_id: t,
|
|
17406
17420
|
name: n.name,
|
|
17407
17421
|
display_name: n.display_name,
|
|
@@ -17417,14 +17431,14 @@ function ax(e) {
|
|
|
17417
17431
|
} catch (e) {
|
|
17418
17432
|
throw e?.message?.includes("UNIQUE constraint failed") || e?.message?.includes("AlreadyExists") ? new Un(409, { message: "Organization already exists" }) : e;
|
|
17419
17433
|
}
|
|
17420
|
-
return
|
|
17434
|
+
return ax({
|
|
17421
17435
|
...i,
|
|
17422
17436
|
tenant_id: t
|
|
17423
17437
|
});
|
|
17424
17438
|
},
|
|
17425
17439
|
async get(t, n) {
|
|
17426
17440
|
let r = await e.select().from(an).where(h(m(an.tenant_id, t), m(an.id, n))).get();
|
|
17427
|
-
return r ||= await e.select().from(an).where(h(m(an.tenant_id, t), m(an.name, n))).get(), r ?
|
|
17441
|
+
return r ||= await e.select().from(an).where(h(m(an.tenant_id, t), m(an.name, n))).get(), r ? ax(r) : null;
|
|
17428
17442
|
},
|
|
17429
17443
|
async update(t, n, r) {
|
|
17430
17444
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
@@ -17433,20 +17447,20 @@ function ax(e) {
|
|
|
17433
17447
|
async list(t, n) {
|
|
17434
17448
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = [m(an.tenant_id, t)];
|
|
17435
17449
|
if (s) {
|
|
17436
|
-
let e = Nn(s,
|
|
17450
|
+
let e = Nn(s, rx);
|
|
17437
17451
|
if (e) {
|
|
17438
|
-
let t = Pn(an, e,
|
|
17452
|
+
let t = Pn(an, e, rx);
|
|
17439
17453
|
t && c.push(t);
|
|
17440
17454
|
}
|
|
17441
17455
|
}
|
|
17442
17456
|
let l = h(...c), u = e.select().from(an).where(l).$dynamic();
|
|
17443
17457
|
if (o?.sort_by) {
|
|
17444
17458
|
let e = an[o.sort_by];
|
|
17445
|
-
e && (u = u.orderBy(o.sort_order === "desc" ?
|
|
17459
|
+
e && (u = u.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
17446
17460
|
}
|
|
17447
|
-
let d = (await u.offset(r * i).limit(i)).map(
|
|
17461
|
+
let d = (await u.offset(r * i).limit(i)).map(ax);
|
|
17448
17462
|
if (!a) return { organizations: d };
|
|
17449
|
-
let [f] = await e.select({ count:
|
|
17463
|
+
let [f] = await e.select({ count: Be() }).from(an).where(l);
|
|
17450
17464
|
return {
|
|
17451
17465
|
organizations: d,
|
|
17452
17466
|
start: r * i,
|
|
@@ -17462,14 +17476,14 @@ function ax(e) {
|
|
|
17462
17476
|
//#endregion
|
|
17463
17477
|
//#region src/adapters/passwords.ts
|
|
17464
17478
|
Xe();
|
|
17465
|
-
function
|
|
17479
|
+
function sx(e) {
|
|
17466
17480
|
let { tenant_id: t, is_current: n, ...r } = e;
|
|
17467
17481
|
return {
|
|
17468
17482
|
...r,
|
|
17469
17483
|
is_current: !!n
|
|
17470
17484
|
};
|
|
17471
17485
|
}
|
|
17472
|
-
function
|
|
17486
|
+
function cx(e) {
|
|
17473
17487
|
return {
|
|
17474
17488
|
async create(t, n) {
|
|
17475
17489
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = n.id || Ye();
|
|
@@ -17484,18 +17498,18 @@ function sx(e) {
|
|
|
17484
17498
|
created_at: r,
|
|
17485
17499
|
updated_at: r
|
|
17486
17500
|
};
|
|
17487
|
-
return await e.insert(Jt).values(a),
|
|
17501
|
+
return await e.insert(Jt).values(a), sx({
|
|
17488
17502
|
...a,
|
|
17489
17503
|
tenant_id: t
|
|
17490
17504
|
});
|
|
17491
17505
|
},
|
|
17492
17506
|
async get(t, n) {
|
|
17493
17507
|
let r = await e.select().from(Jt).where(h(m(Jt.tenant_id, t), m(Jt.user_id, n), m(Jt.is_current, 1))).get();
|
|
17494
|
-
return r ?
|
|
17508
|
+
return r ? sx(r) : null;
|
|
17495
17509
|
},
|
|
17496
17510
|
async list(t, n, r) {
|
|
17497
|
-
let i = e.select().from(Jt).where(h(m(Jt.tenant_id, t), m(Jt.user_id, n))).orderBy(
|
|
17498
|
-
return r && (i = i.limit(r)), (await i).map(
|
|
17511
|
+
let i = e.select().from(Jt).where(h(m(Jt.tenant_id, t), m(Jt.user_id, n))).orderBy(ze(Jt.created_at)).$dynamic();
|
|
17512
|
+
return r && (i = i.limit(r)), (await i).map(sx);
|
|
17499
17513
|
},
|
|
17500
17514
|
async update(t, n) {
|
|
17501
17515
|
let r = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
@@ -17505,7 +17519,7 @@ function sx(e) {
|
|
|
17505
17519
|
}
|
|
17506
17520
|
//#endregion
|
|
17507
17521
|
//#region src/adapters/promptSettings.ts
|
|
17508
|
-
function
|
|
17522
|
+
function lx(e) {
|
|
17509
17523
|
return {
|
|
17510
17524
|
async get(t) {
|
|
17511
17525
|
let n = await e.select().from(vn).where(m(vn.tenant_id, t)).get();
|
|
@@ -17543,22 +17557,22 @@ function cx(e) {
|
|
|
17543
17557
|
//#endregion
|
|
17544
17558
|
//#region src/adapters/proxyRoutes.ts
|
|
17545
17559
|
Xe();
|
|
17546
|
-
function
|
|
17560
|
+
function ux(e) {
|
|
17547
17561
|
if (!e) return { path: "/*" };
|
|
17548
17562
|
try {
|
|
17549
|
-
let t = JSON.parse(e), n =
|
|
17563
|
+
let t = JSON.parse(e), n = Wy.safeParse(t);
|
|
17550
17564
|
if (n.success) return n.data;
|
|
17551
17565
|
} catch {}
|
|
17552
17566
|
return { path: "/*" };
|
|
17553
17567
|
}
|
|
17554
|
-
function
|
|
17568
|
+
function dx(e) {
|
|
17555
17569
|
if (!e) return [];
|
|
17556
17570
|
try {
|
|
17557
17571
|
let t = JSON.parse(e);
|
|
17558
17572
|
if (!Array.isArray(t)) return [];
|
|
17559
17573
|
let n = [];
|
|
17560
17574
|
for (let e of t) {
|
|
17561
|
-
let t =
|
|
17575
|
+
let t = Gy.safeParse(e);
|
|
17562
17576
|
t.success && n.push(t.data);
|
|
17563
17577
|
}
|
|
17564
17578
|
return n;
|
|
@@ -17566,19 +17580,19 @@ function ux(e) {
|
|
|
17566
17580
|
return [];
|
|
17567
17581
|
}
|
|
17568
17582
|
}
|
|
17569
|
-
function
|
|
17583
|
+
function fx(e) {
|
|
17570
17584
|
return {
|
|
17571
17585
|
id: e.id,
|
|
17572
17586
|
tenant_id: e.tenant_id,
|
|
17573
17587
|
custom_domain_id: e.custom_domain_id,
|
|
17574
17588
|
priority: e.priority,
|
|
17575
|
-
match:
|
|
17576
|
-
handlers:
|
|
17589
|
+
match: ux(e.match),
|
|
17590
|
+
handlers: dx(e.handlers),
|
|
17577
17591
|
created_at: e.created_at,
|
|
17578
17592
|
updated_at: e.updated_at
|
|
17579
17593
|
};
|
|
17580
17594
|
}
|
|
17581
|
-
function
|
|
17595
|
+
function px(e) {
|
|
17582
17596
|
return {
|
|
17583
17597
|
async create(t, n) {
|
|
17584
17598
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
@@ -17604,14 +17618,14 @@ function fx(e) {
|
|
|
17604
17618
|
},
|
|
17605
17619
|
async get(t, n) {
|
|
17606
17620
|
let r = await e.select().from(O).where(h(m(O.tenant_id, t), m(O.id, n))).limit(1);
|
|
17607
|
-
return r[0] ?
|
|
17621
|
+
return r[0] ? fx(r[0]) : null;
|
|
17608
17622
|
},
|
|
17609
17623
|
async list(t, n = {}) {
|
|
17610
17624
|
let r = n.page ?? 0, i = n.per_page ?? 50, a = [m(O.tenant_id, t)];
|
|
17611
17625
|
n.custom_domain_id && a.push(m(O.custom_domain_id, n.custom_domain_id));
|
|
17612
|
-
let o = await e.select().from(O).where(h(...a)).orderBy(
|
|
17626
|
+
let o = await e.select().from(O).where(h(...a)).orderBy(Re(O.priority), Re(O.created_at)).offset(r * i).limit(i);
|
|
17613
17627
|
return {
|
|
17614
|
-
proxy_routes: o.map(
|
|
17628
|
+
proxy_routes: o.map(fx),
|
|
17615
17629
|
start: r * i,
|
|
17616
17630
|
limit: i,
|
|
17617
17631
|
length: o.length
|
|
@@ -17631,8 +17645,8 @@ function fx(e) {
|
|
|
17631
17645
|
//#endregion
|
|
17632
17646
|
//#region src/adapters/refreshTokens.ts
|
|
17633
17647
|
Xe();
|
|
17634
|
-
function
|
|
17635
|
-
let { tenant_id: t, created_at_ts: n, expires_at_ts: r, idle_expires_at_ts: i, last_exchanged_at_ts: a, revoked_at_ts: o, rotated_at_ts: s, device: c, resource_servers: l, rotating: u, ...d } = e, f =
|
|
17648
|
+
function mx(e) {
|
|
17649
|
+
let { tenant_id: t, created_at_ts: n, expires_at_ts: r, idle_expires_at_ts: i, last_exchanged_at_ts: a, revoked_at_ts: o, rotated_at_ts: s, device: c, resource_servers: l, rotating: u, ...d } = e, f = Ab({
|
|
17636
17650
|
created_at_ts: n,
|
|
17637
17651
|
expires_at_ts: r,
|
|
17638
17652
|
idle_expires_at_ts: i,
|
|
@@ -17654,10 +17668,10 @@ function px(e) {
|
|
|
17654
17668
|
resource_servers: A(l, [])
|
|
17655
17669
|
});
|
|
17656
17670
|
}
|
|
17657
|
-
function
|
|
17671
|
+
function hx(e, t) {
|
|
17658
17672
|
return Math.max(e ?? 0, t ?? 0);
|
|
17659
17673
|
}
|
|
17660
|
-
function
|
|
17674
|
+
function gx(e) {
|
|
17661
17675
|
return {
|
|
17662
17676
|
async create(t, n) {
|
|
17663
17677
|
let r = Date.now(), i = {
|
|
@@ -17682,26 +17696,26 @@ function hx(e) {
|
|
|
17682
17696
|
await e.run(p`BEGIN`);
|
|
17683
17697
|
try {
|
|
17684
17698
|
await e.insert(S).values(i);
|
|
17685
|
-
let n =
|
|
17699
|
+
let n = hx(i.expires_at_ts, i.idle_expires_at_ts);
|
|
17686
17700
|
n > 0 && i.login_id && await e.update(C).set({
|
|
17687
17701
|
expires_at_ts: n,
|
|
17688
17702
|
updated_at_ts: r
|
|
17689
|
-
}).where(h(m(C.tenant_id, t), m(C.id, i.login_id),
|
|
17703
|
+
}).where(h(m(C.tenant_id, t), m(C.id, i.login_id), je(C.expires_at_ts, n))), await e.run(p`COMMIT`);
|
|
17690
17704
|
} catch (t) {
|
|
17691
17705
|
throw await e.run(p`ROLLBACK`), t;
|
|
17692
17706
|
}
|
|
17693
|
-
return
|
|
17707
|
+
return mx({
|
|
17694
17708
|
...i,
|
|
17695
17709
|
tenant_id: t
|
|
17696
17710
|
});
|
|
17697
17711
|
},
|
|
17698
17712
|
async get(t, n) {
|
|
17699
17713
|
let r = await e.select().from(S).where(h(m(S.tenant_id, t), m(S.id, n))).get();
|
|
17700
|
-
return r ?
|
|
17714
|
+
return r ? mx(r) : null;
|
|
17701
17715
|
},
|
|
17702
17716
|
async getByLookup(t, n) {
|
|
17703
17717
|
let r = await e.select().from(S).where(h(m(S.tenant_id, t), m(S.token_lookup, n))).get();
|
|
17704
|
-
return r ?
|
|
17718
|
+
return r ? mx(r) : null;
|
|
17705
17719
|
},
|
|
17706
17720
|
async update(t, n, r, i) {
|
|
17707
17721
|
let a = {};
|
|
@@ -17710,7 +17724,7 @@ function hx(e) {
|
|
|
17710
17724
|
return o?.login_id && s && s > 0 && await e.update(C).set({
|
|
17711
17725
|
expires_at_ts: s,
|
|
17712
17726
|
updated_at_ts: Date.now()
|
|
17713
|
-
}).where(h(m(C.tenant_id, t), m(C.id, o.login_id),
|
|
17727
|
+
}).where(h(m(C.tenant_id, t), m(C.id, o.login_id), je(C.expires_at_ts, s))).catch(() => {}), c.length > 0;
|
|
17714
17728
|
},
|
|
17715
17729
|
async list(t, n) {
|
|
17716
17730
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = e.select().from(S).where(m(S.tenant_id, t)).$dynamic();
|
|
@@ -17720,11 +17734,11 @@ function hx(e) {
|
|
|
17720
17734
|
}
|
|
17721
17735
|
if (o?.sort_by) {
|
|
17722
17736
|
let e = S[o.sort_by];
|
|
17723
|
-
e && (c = c.orderBy(o.sort_order === "desc" ?
|
|
17737
|
+
e && (c = c.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
17724
17738
|
}
|
|
17725
|
-
let l = (await c.offset(r * i).limit(i)).map(
|
|
17739
|
+
let l = (await c.offset(r * i).limit(i)).map(mx);
|
|
17726
17740
|
if (!a) return { refresh_tokens: l };
|
|
17727
|
-
let [u] = await e.select({ count:
|
|
17741
|
+
let [u] = await e.select({ count: Be() }).from(S).where(m(S.tenant_id, t));
|
|
17728
17742
|
return {
|
|
17729
17743
|
refresh_tokens: l,
|
|
17730
17744
|
start: r * i,
|
|
@@ -17736,25 +17750,25 @@ function hx(e) {
|
|
|
17736
17750
|
return (await e.delete(S).where(h(m(S.tenant_id, t), m(S.id, n))).returning()).length > 0;
|
|
17737
17751
|
},
|
|
17738
17752
|
async revokeByLoginSession(t, n, r) {
|
|
17739
|
-
return (await e.update(S).set({ revoked_at_ts: $(r) }).where(h(m(S.tenant_id, t), m(S.login_id, n),
|
|
17753
|
+
return (await e.update(S).set({ revoked_at_ts: $(r) }).where(h(m(S.tenant_id, t), m(S.login_id, n), Pe(S.revoked_at_ts))).returning()).length;
|
|
17740
17754
|
},
|
|
17741
17755
|
async revokeFamily(t, n, r) {
|
|
17742
|
-
return (await e.update(S).set({ revoked_at_ts: $(r) }).where(h(m(S.tenant_id, t), m(S.family_id, n),
|
|
17756
|
+
return (await e.update(S).set({ revoked_at_ts: $(r) }).where(h(m(S.tenant_id, t), m(S.family_id, n), Pe(S.revoked_at_ts))).returning()).length;
|
|
17743
17757
|
}
|
|
17744
17758
|
};
|
|
17745
17759
|
}
|
|
17746
17760
|
//#endregion
|
|
17747
17761
|
//#region src/adapters/resourceServers.ts
|
|
17748
|
-
var
|
|
17749
|
-
function
|
|
17762
|
+
var _x = ["name", "identifier"];
|
|
17763
|
+
function vx() {
|
|
17750
17764
|
let { customAlphabet: e } = (Xe(), s(Ge));
|
|
17751
17765
|
return `api_${e("0123456789abcdefghijklmnopqrstuvwxyz", 17)()}`;
|
|
17752
17766
|
}
|
|
17753
|
-
var
|
|
17767
|
+
var yx = [
|
|
17754
17768
|
"skip_consent_for_verifiable_first_party_clients",
|
|
17755
17769
|
"allow_offline_access",
|
|
17756
17770
|
"is_system"
|
|
17757
|
-
],
|
|
17771
|
+
], bx = /* @__PURE__ */ new Set([
|
|
17758
17772
|
"id",
|
|
17759
17773
|
"tenant_id",
|
|
17760
17774
|
"identifier",
|
|
@@ -17773,17 +17787,17 @@ var vx = [
|
|
|
17773
17787
|
"created_at",
|
|
17774
17788
|
"updated_at"
|
|
17775
17789
|
]);
|
|
17776
|
-
function
|
|
17790
|
+
function xx(e) {
|
|
17777
17791
|
let { tenant_id: t, verification_key: n, scopes: r, options: i, metadata: a, ...o } = e, s = { ...o };
|
|
17778
17792
|
s.scopes = A(r, []), s.options = A(i, {}), s.metadata = A(a), n !== void 0 && (s.verificationKey = n);
|
|
17779
|
-
for (let e of
|
|
17793
|
+
for (let e of yx) o[e] !== void 0 && o[e] !== null && (s[e] = !!o[e]);
|
|
17780
17794
|
return k(s);
|
|
17781
17795
|
}
|
|
17782
|
-
function
|
|
17796
|
+
function Sx(e) {
|
|
17783
17797
|
return {
|
|
17784
17798
|
async create(t, n) {
|
|
17785
17799
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
17786
|
-
id: n.id ||
|
|
17800
|
+
id: n.id || vx(),
|
|
17787
17801
|
tenant_id: t,
|
|
17788
17802
|
identifier: n.identifier,
|
|
17789
17803
|
name: n.name,
|
|
@@ -17798,39 +17812,39 @@ function xx(e) {
|
|
|
17798
17812
|
created_at: r,
|
|
17799
17813
|
updated_at: r
|
|
17800
17814
|
};
|
|
17801
|
-
for (let e of
|
|
17802
|
-
return i.is_system === void 0 && (i.is_system = 0), await e.insert(fn).values(i),
|
|
17815
|
+
for (let e of yx) n[e] !== void 0 && (i[e] = +!!n[e]);
|
|
17816
|
+
return i.is_system === void 0 && (i.is_system = 0), await e.insert(fn).values(i), xx({
|
|
17803
17817
|
...i,
|
|
17804
17818
|
tenant_id: t
|
|
17805
17819
|
});
|
|
17806
17820
|
},
|
|
17807
17821
|
async get(t, n) {
|
|
17808
17822
|
let r = await e.select().from(fn).where(h(m(fn.tenant_id, t), m(fn.id, n))).get();
|
|
17809
|
-
return r ?
|
|
17823
|
+
return r ? xx(r) : null;
|
|
17810
17824
|
},
|
|
17811
17825
|
async update(t, n, r) {
|
|
17812
17826
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
17813
17827
|
r.name !== void 0 && (i.name = r.name), r.identifier !== void 0 && (i.identifier = r.identifier), r.signing_alg !== void 0 && (i.signing_alg = r.signing_alg), r.signing_secret !== void 0 && (i.signing_secret = r.signing_secret), r.token_lifetime !== void 0 && (i.token_lifetime = r.token_lifetime), r.token_lifetime_for_web !== void 0 && (i.token_lifetime_for_web = r.token_lifetime_for_web), r.scopes !== void 0 && (i.scopes = JSON.stringify(r.scopes)), r.options !== void 0 && (i.options = p`json_patch(COALESCE(${fn.options}, '{}'), ${JSON.stringify(r.options)})`), r.metadata !== void 0 && (i.metadata = JSON.stringify(r.metadata)), r.verificationKey !== void 0 && (i.verification_key = r.verificationKey);
|
|
17814
|
-
for (let e of
|
|
17828
|
+
for (let e of yx) r[e] !== void 0 && (i[e] = +!!r[e]);
|
|
17815
17829
|
return (await e.update(fn).set(i).where(h(m(fn.tenant_id, t), m(fn.id, n))).returning()).length > 0;
|
|
17816
17830
|
},
|
|
17817
17831
|
async list(t, n) {
|
|
17818
17832
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = Math.max(0, Math.floor(Number(r) || 0)), l = Math.min(Math.max(1, Math.floor(Number(i) || 50)), 500), u = [m(fn.tenant_id, t)];
|
|
17819
17833
|
if (s) {
|
|
17820
|
-
let e = Nn(s,
|
|
17834
|
+
let e = Nn(s, _x);
|
|
17821
17835
|
if (e) {
|
|
17822
|
-
let t = Pn(fn, e,
|
|
17836
|
+
let t = Pn(fn, e, _x, ["name", "identifier"]);
|
|
17823
17837
|
t && u.push(t);
|
|
17824
17838
|
}
|
|
17825
17839
|
}
|
|
17826
17840
|
let d = e.select().from(fn).where(h(...u)).$dynamic();
|
|
17827
|
-
if (o?.sort_by &&
|
|
17841
|
+
if (o?.sort_by && bx.has(o.sort_by)) {
|
|
17828
17842
|
let e = fn[o.sort_by];
|
|
17829
|
-
d = d.orderBy(o.sort_order === "desc" ?
|
|
17843
|
+
d = d.orderBy(o.sort_order === "desc" ? ze(e) : Re(e));
|
|
17830
17844
|
}
|
|
17831
|
-
let f = (await d.offset(c * l).limit(l)).map(
|
|
17845
|
+
let f = (await d.offset(c * l).limit(l)).map(xx);
|
|
17832
17846
|
if (!a) return { resource_servers: f };
|
|
17833
|
-
let [ee] = await e.select({ count:
|
|
17847
|
+
let [ee] = await e.select({ count: Be() }).from(fn).where(h(...u));
|
|
17834
17848
|
return {
|
|
17835
17849
|
resource_servers: f,
|
|
17836
17850
|
start: c * l,
|
|
@@ -17845,7 +17859,7 @@ function xx(e) {
|
|
|
17845
17859
|
}
|
|
17846
17860
|
//#endregion
|
|
17847
17861
|
//#region src/adapters/rolePermissions.ts
|
|
17848
|
-
function
|
|
17862
|
+
function Cx(e) {
|
|
17849
17863
|
return {
|
|
17850
17864
|
async assign(t, n, r) {
|
|
17851
17865
|
let i = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -17867,7 +17881,7 @@ function Sx(e) {
|
|
|
17867
17881
|
let n = await e.select({
|
|
17868
17882
|
identifier: fn.identifier,
|
|
17869
17883
|
name: fn.name
|
|
17870
|
-
}).from(fn).where(h(m(fn.tenant_id, t),
|
|
17884
|
+
}).from(fn).where(h(m(fn.tenant_id, t), Ne(fn.identifier, a))).all();
|
|
17871
17885
|
for (let e of n) o.set(e.identifier, e.name);
|
|
17872
17886
|
}
|
|
17873
17887
|
return i.map((e) => ({
|
|
@@ -17877,13 +17891,13 @@ function Sx(e) {
|
|
|
17877
17891
|
},
|
|
17878
17892
|
async remove(t, n, r) {
|
|
17879
17893
|
let i = r.map((e) => h(m(ln.resource_server_identifier, e.resource_server_identifier), m(ln.permission_name, e.permission_name)));
|
|
17880
|
-
return (await e.delete(ln).where(h(m(ln.tenant_id, t), m(ln.role_id, n),
|
|
17894
|
+
return (await e.delete(ln).where(h(m(ln.tenant_id, t), m(ln.role_id, n), Oe(...i))).returning()).length > 0;
|
|
17881
17895
|
}
|
|
17882
17896
|
};
|
|
17883
17897
|
}
|
|
17884
17898
|
//#endregion
|
|
17885
17899
|
//#region src/adapters/userPermissions.ts
|
|
17886
|
-
function
|
|
17900
|
+
function wx(e) {
|
|
17887
17901
|
return {
|
|
17888
17902
|
async create(t, n, r, i) {
|
|
17889
17903
|
try {
|
|
@@ -17923,7 +17937,7 @@ function Cx(e) {
|
|
|
17923
17937
|
//#endregion
|
|
17924
17938
|
//#region src/adapters/roles.ts
|
|
17925
17939
|
Xe();
|
|
17926
|
-
function
|
|
17940
|
+
function Tx(e) {
|
|
17927
17941
|
let { tenant_id: t, is_system: n, metadata: r, ...i } = e;
|
|
17928
17942
|
return k({
|
|
17929
17943
|
...i,
|
|
@@ -17931,7 +17945,7 @@ function wx(e) {
|
|
|
17931
17945
|
metadata: A(r)
|
|
17932
17946
|
});
|
|
17933
17947
|
}
|
|
17934
|
-
function
|
|
17948
|
+
function Ex(e) {
|
|
17935
17949
|
return {
|
|
17936
17950
|
async create(t, n) {
|
|
17937
17951
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
@@ -17944,14 +17958,14 @@ function Tx(e) {
|
|
|
17944
17958
|
created_at: r,
|
|
17945
17959
|
updated_at: r
|
|
17946
17960
|
};
|
|
17947
|
-
return await e.insert(cn).values(i),
|
|
17961
|
+
return await e.insert(cn).values(i), Tx({
|
|
17948
17962
|
...i,
|
|
17949
17963
|
tenant_id: t
|
|
17950
17964
|
});
|
|
17951
17965
|
},
|
|
17952
17966
|
async get(t, n) {
|
|
17953
17967
|
let r = await e.select().from(cn).where(h(m(cn.tenant_id, t), m(cn.id, n))).get();
|
|
17954
|
-
return r ?
|
|
17968
|
+
return r ? Tx(r) : null;
|
|
17955
17969
|
},
|
|
17956
17970
|
async update(t, n, r) {
|
|
17957
17971
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
@@ -17961,11 +17975,11 @@ function Tx(e) {
|
|
|
17961
17975
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = s ? Pn(cn, s, ["name"]) : void 0, l = c ? h(m(cn.tenant_id, t), c) : m(cn.tenant_id, t), u = e.select().from(cn).where(l).$dynamic();
|
|
17962
17976
|
if (o?.sort_by) {
|
|
17963
17977
|
let e = cn[o.sort_by];
|
|
17964
|
-
e && (u = u.orderBy(o.sort_order === "desc" ?
|
|
17978
|
+
e && (u = u.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
17965
17979
|
}
|
|
17966
|
-
let d = (await u.offset(r * i).limit(i)).map(
|
|
17980
|
+
let d = (await u.offset(r * i).limit(i)).map(Tx);
|
|
17967
17981
|
if (!a) return { roles: d };
|
|
17968
|
-
let [f] = await e.select({ count:
|
|
17982
|
+
let [f] = await e.select({ count: Be() }).from(cn).where(l);
|
|
17969
17983
|
return {
|
|
17970
17984
|
roles: d,
|
|
17971
17985
|
start: r * i,
|
|
@@ -17981,7 +17995,7 @@ function Tx(e) {
|
|
|
17981
17995
|
//#endregion
|
|
17982
17996
|
//#region src/adapters/sessions.ts
|
|
17983
17997
|
Xe();
|
|
17984
|
-
var
|
|
17998
|
+
var Dx = ["created_at_ts", "updated_at_ts"], Ox = [
|
|
17985
17999
|
"expires_at_ts",
|
|
17986
18000
|
"idle_expires_at_ts",
|
|
17987
18001
|
"authenticated_at_ts",
|
|
@@ -17989,8 +18003,8 @@ var Ex = ["created_at_ts", "updated_at_ts"], Dx = [
|
|
|
17989
18003
|
"used_at_ts",
|
|
17990
18004
|
"revoked_at_ts"
|
|
17991
18005
|
];
|
|
17992
|
-
function
|
|
17993
|
-
let { tenant_id: t, created_at_ts: n, updated_at_ts: r, expires_at_ts: i, idle_expires_at_ts: a, authenticated_at_ts: o, last_interaction_at_ts: s, used_at_ts: c, revoked_at_ts: l, device: u, clients: d, ...f } = e, ee =
|
|
18006
|
+
function kx(e) {
|
|
18007
|
+
let { tenant_id: t, created_at_ts: n, updated_at_ts: r, expires_at_ts: i, idle_expires_at_ts: a, authenticated_at_ts: o, last_interaction_at_ts: s, used_at_ts: c, revoked_at_ts: l, device: u, clients: d, ...f } = e, ee = Ab({
|
|
17994
18008
|
created_at_ts: n,
|
|
17995
18009
|
updated_at_ts: r,
|
|
17996
18010
|
expires_at_ts: i,
|
|
@@ -17999,7 +18013,7 @@ function Ox(e) {
|
|
|
17999
18013
|
last_interaction_at_ts: s,
|
|
18000
18014
|
used_at_ts: c,
|
|
18001
18015
|
revoked_at_ts: l
|
|
18002
|
-
}, [...
|
|
18016
|
+
}, [...Dx], [...Ox]);
|
|
18003
18017
|
return k({
|
|
18004
18018
|
...f,
|
|
18005
18019
|
...ee,
|
|
@@ -18007,7 +18021,10 @@ function Ox(e) {
|
|
|
18007
18021
|
clients: A(d, [])
|
|
18008
18022
|
});
|
|
18009
18023
|
}
|
|
18010
|
-
function
|
|
18024
|
+
function Ax(e, t) {
|
|
18025
|
+
return Math.max(e ?? 0, t ?? 0);
|
|
18026
|
+
}
|
|
18027
|
+
function jx(e) {
|
|
18011
18028
|
return {
|
|
18012
18029
|
async create(t, n) {
|
|
18013
18030
|
let r = Date.now(), i = {
|
|
@@ -18026,28 +18043,48 @@ function kx(e) {
|
|
|
18026
18043
|
used_at_ts: $(n.used_at),
|
|
18027
18044
|
revoked_at_ts: $(n.revoked_at)
|
|
18028
18045
|
};
|
|
18029
|
-
|
|
18046
|
+
await e.run(p`BEGIN`);
|
|
18047
|
+
try {
|
|
18048
|
+
await e.insert(Yt).values(i);
|
|
18049
|
+
let n = Ax(i.expires_at_ts, i.idle_expires_at_ts);
|
|
18050
|
+
n > 0 && i.login_session_id && await e.update(C).set({
|
|
18051
|
+
expires_at_ts: n,
|
|
18052
|
+
updated_at_ts: r
|
|
18053
|
+
}).where(h(m(C.tenant_id, t), m(C.id, i.login_session_id), je(C.expires_at_ts, n))), await e.run(p`COMMIT`);
|
|
18054
|
+
} catch (t) {
|
|
18055
|
+
throw await e.run(p`ROLLBACK`), t;
|
|
18056
|
+
}
|
|
18057
|
+
return kx({
|
|
18030
18058
|
...i,
|
|
18031
18059
|
tenant_id: t
|
|
18032
18060
|
});
|
|
18033
18061
|
},
|
|
18034
18062
|
async get(t, n) {
|
|
18035
18063
|
let r = await e.select().from(Yt).where(h(m(Yt.tenant_id, t), m(Yt.id, n))).get();
|
|
18036
|
-
return r ?
|
|
18064
|
+
return r ? kx(r) : null;
|
|
18037
18065
|
},
|
|
18038
18066
|
async update(t, n, r) {
|
|
18039
18067
|
let i = { updated_at_ts: Date.now() };
|
|
18040
|
-
|
|
18068
|
+
r.user_id !== void 0 && (i.user_id = r.user_id), r.login_session_id !== void 0 && (i.login_session_id = r.login_session_id), r.device !== void 0 && (i.device = JSON.stringify(r.device)), r.clients !== void 0 && (i.clients = JSON.stringify(r.clients)), r.expires_at !== void 0 && (i.expires_at_ts = $(r.expires_at)), r.idle_expires_at !== void 0 && (i.idle_expires_at_ts = $(r.idle_expires_at)), r.authenticated_at !== void 0 && (i.authenticated_at_ts = $(r.authenticated_at)), r.last_interaction_at !== void 0 && (i.last_interaction_at_ts = $(r.last_interaction_at)), r.used_at !== void 0 && (i.used_at_ts = $(r.used_at)), r.revoked_at !== void 0 && (i.revoked_at_ts = $(r.revoked_at));
|
|
18069
|
+
let a = await e.update(Yt).set(i).where(h(m(Yt.tenant_id, t), m(Yt.id, n))).returning(), o = Ax(i.expires_at_ts, i.idle_expires_at_ts), s = a[0];
|
|
18070
|
+
if (o > 0 && s) {
|
|
18071
|
+
let n = r.login_session_id ?? s.login_session_id;
|
|
18072
|
+
n && await e.update(C).set({
|
|
18073
|
+
expires_at_ts: o,
|
|
18074
|
+
updated_at_ts: Date.now()
|
|
18075
|
+
}).where(h(m(C.tenant_id, t), m(C.id, n), je(C.expires_at_ts, o))).catch(() => {});
|
|
18076
|
+
}
|
|
18077
|
+
return a.length > 0;
|
|
18041
18078
|
},
|
|
18042
18079
|
async list(t, n) {
|
|
18043
18080
|
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = s ? Pn(Yt, s, ["user_id", "id"]) : void 0, l = c ? h(m(Yt.tenant_id, t), c) : m(Yt.tenant_id, t), u = e.select().from(Yt).where(l).$dynamic();
|
|
18044
18081
|
if (o?.sort_by) {
|
|
18045
18082
|
let e = Yt[o.sort_by];
|
|
18046
|
-
e && (u = u.orderBy(o.sort_order === "desc" ?
|
|
18083
|
+
e && (u = u.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
18047
18084
|
}
|
|
18048
|
-
let d = (await u.offset(r * i).limit(i)).map(
|
|
18085
|
+
let d = (await u.offset(r * i).limit(i)).map(kx);
|
|
18049
18086
|
if (!a) return { sessions: d };
|
|
18050
|
-
let [f] = await e.select({ count:
|
|
18087
|
+
let [f] = await e.select({ count: Be() }).from(Yt).where(l);
|
|
18051
18088
|
return {
|
|
18052
18089
|
sessions: d,
|
|
18053
18090
|
start: r * i,
|
|
@@ -18063,7 +18100,7 @@ function kx(e) {
|
|
|
18063
18100
|
//#endregion
|
|
18064
18101
|
//#region src/adapters/tenants.ts
|
|
18065
18102
|
Xe();
|
|
18066
|
-
var
|
|
18103
|
+
var Mx = [
|
|
18067
18104
|
"session_cookie",
|
|
18068
18105
|
"enabled_locales",
|
|
18069
18106
|
"error_page",
|
|
@@ -18079,25 +18116,25 @@ var Ax = [
|
|
|
18079
18116
|
"acr_values_supported",
|
|
18080
18117
|
"mtls",
|
|
18081
18118
|
"mfa"
|
|
18082
|
-
],
|
|
18119
|
+
], Nx = [
|
|
18083
18120
|
"allow_organization_name_in_authentication_api",
|
|
18084
18121
|
"customize_mfa_in_postlogin_action",
|
|
18085
18122
|
"pushed_authorization_requests_supported",
|
|
18086
18123
|
"authorization_response_iss_parameter_supported"
|
|
18087
18124
|
];
|
|
18088
|
-
function
|
|
18125
|
+
function Px(e) {
|
|
18089
18126
|
let t = { ...e };
|
|
18090
|
-
for (let e of
|
|
18091
|
-
for (let e of
|
|
18127
|
+
for (let e of Mx) typeof t[e] == "string" && (t[e] = A(t[e]));
|
|
18128
|
+
for (let e of Nx) t[e] !== void 0 && t[e] !== null && (t[e] = t[e] === 1);
|
|
18092
18129
|
return k(t);
|
|
18093
18130
|
}
|
|
18094
|
-
function
|
|
18131
|
+
function Fx(e) {
|
|
18095
18132
|
let t = { ...e };
|
|
18096
|
-
Dn(e,
|
|
18097
|
-
for (let n of
|
|
18133
|
+
Dn(e, Mx, t);
|
|
18134
|
+
for (let n of Nx) e[n] !== void 0 && (t[n] = +!!e[n]);
|
|
18098
18135
|
return kn(t);
|
|
18099
18136
|
}
|
|
18100
|
-
function
|
|
18137
|
+
function Ix(e) {
|
|
18101
18138
|
return {
|
|
18102
18139
|
async create(t) {
|
|
18103
18140
|
let n = {
|
|
@@ -18105,7 +18142,7 @@ function Px(e) {
|
|
|
18105
18142
|
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
18106
18143
|
updated_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
18107
18144
|
...t
|
|
18108
|
-
}, r =
|
|
18145
|
+
}, r = Fx(n);
|
|
18109
18146
|
try {
|
|
18110
18147
|
await e.insert(b).values(r);
|
|
18111
18148
|
} catch (e) {
|
|
@@ -18116,7 +18153,7 @@ function Px(e) {
|
|
|
18116
18153
|
},
|
|
18117
18154
|
async get(t) {
|
|
18118
18155
|
let n = await e.select().from(b).where(m(b.id, t)).get();
|
|
18119
|
-
return n ?
|
|
18156
|
+
return n ? Px(n) : null;
|
|
18120
18157
|
},
|
|
18121
18158
|
async list(t) {
|
|
18122
18159
|
let { page: n = 0, per_page: r = 50, include_totals: i = !1, sort: a, q: o } = t || {}, s = e.select().from(b).$dynamic();
|
|
@@ -18126,11 +18163,11 @@ function Px(e) {
|
|
|
18126
18163
|
}
|
|
18127
18164
|
if (a?.sort_by) {
|
|
18128
18165
|
let e = b[a.sort_by];
|
|
18129
|
-
e && (s = s.orderBy(a.sort_order === "desc" ?
|
|
18166
|
+
e && (s = s.orderBy(a.sort_order === "desc" ? ze(e) : Re(e)));
|
|
18130
18167
|
}
|
|
18131
|
-
let c = (await s.offset(n * r).limit(r)).map(
|
|
18168
|
+
let c = (await s.offset(n * r).limit(r)).map(Px);
|
|
18132
18169
|
if (!i) return { tenants: c };
|
|
18133
|
-
let [l] = await e.select({ count:
|
|
18170
|
+
let [l] = await e.select({ count: Be() }).from(b);
|
|
18134
18171
|
return {
|
|
18135
18172
|
tenants: c,
|
|
18136
18173
|
start: n * r,
|
|
@@ -18139,7 +18176,7 @@ function Px(e) {
|
|
|
18139
18176
|
};
|
|
18140
18177
|
},
|
|
18141
18178
|
async update(t, n) {
|
|
18142
|
-
let r =
|
|
18179
|
+
let r = Fx({
|
|
18143
18180
|
...n,
|
|
18144
18181
|
id: t,
|
|
18145
18182
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -18154,18 +18191,18 @@ function Px(e) {
|
|
|
18154
18191
|
//#endregion
|
|
18155
18192
|
//#region src/adapters/themes.ts
|
|
18156
18193
|
Xe();
|
|
18157
|
-
var
|
|
18194
|
+
var Lx = [
|
|
18158
18195
|
"colors",
|
|
18159
18196
|
"borders",
|
|
18160
18197
|
"fonts",
|
|
18161
18198
|
"page_background",
|
|
18162
18199
|
"widget"
|
|
18163
18200
|
];
|
|
18164
|
-
function
|
|
18165
|
-
let { tenant_id: t, ...n } = e, r = jn(n,
|
|
18201
|
+
function Rx(e) {
|
|
18202
|
+
let { tenant_id: t, ...n } = e, r = jn(n, Lx);
|
|
18166
18203
|
return r.borders && (r.borders.show_widget_shadow = !!r.borders.show_widget_shadow), r.fonts && (r.fonts.links_bold = !!r.fonts.links_bold, r.fonts.subtitle_bold = !!r.fonts.subtitle_bold, r.fonts.title_bold = !!r.fonts.title_bold), k(r);
|
|
18167
18204
|
}
|
|
18168
|
-
function
|
|
18205
|
+
function zx(e) {
|
|
18169
18206
|
return {
|
|
18170
18207
|
async create(t, n, r) {
|
|
18171
18208
|
let i = (/* @__PURE__ */ new Date()).toISOString(), a = r || Ye(), o = {
|
|
@@ -18175,14 +18212,14 @@ function Lx(e) {
|
|
|
18175
18212
|
created_at: i,
|
|
18176
18213
|
updated_at: i
|
|
18177
18214
|
};
|
|
18178
|
-
return await e.insert(hn).values(o),
|
|
18215
|
+
return await e.insert(hn).values(o), Rx({
|
|
18179
18216
|
...o,
|
|
18180
18217
|
tenant_id: t
|
|
18181
18218
|
});
|
|
18182
18219
|
},
|
|
18183
18220
|
async get(t, n) {
|
|
18184
18221
|
let r = await e.select().from(hn).where(h(m(hn.tenant_id, t), m(hn.themeId, n))).get();
|
|
18185
|
-
return r ?
|
|
18222
|
+
return r ? Rx(r) : null;
|
|
18186
18223
|
},
|
|
18187
18224
|
async update(t, n, r) {
|
|
18188
18225
|
let i = An(r);
|
|
@@ -18195,7 +18232,7 @@ function Lx(e) {
|
|
|
18195
18232
|
}
|
|
18196
18233
|
//#endregion
|
|
18197
18234
|
//#region src/adapters/universalLoginTemplates.ts
|
|
18198
|
-
function
|
|
18235
|
+
function Bx(e) {
|
|
18199
18236
|
return {
|
|
18200
18237
|
async get(t) {
|
|
18201
18238
|
let n = await e.select({ body: mn.body }).from(mn).where(m(mn.tenant_id, t)).get();
|
|
@@ -18224,7 +18261,7 @@ function Rx(e) {
|
|
|
18224
18261
|
//#endregion
|
|
18225
18262
|
//#region src/adapters/users.ts
|
|
18226
18263
|
Xe();
|
|
18227
|
-
var
|
|
18264
|
+
var Vx = [
|
|
18228
18265
|
"user_id",
|
|
18229
18266
|
"email",
|
|
18230
18267
|
"email_verified",
|
|
@@ -18246,13 +18283,13 @@ var zx = [
|
|
|
18246
18283
|
"login_count",
|
|
18247
18284
|
"created_at",
|
|
18248
18285
|
"updated_at"
|
|
18249
|
-
],
|
|
18286
|
+
], Hx = [
|
|
18250
18287
|
"email",
|
|
18251
18288
|
"name",
|
|
18252
18289
|
"phone_number",
|
|
18253
18290
|
"user_id"
|
|
18254
18291
|
];
|
|
18255
|
-
function
|
|
18292
|
+
function Ux(e, t) {
|
|
18256
18293
|
let n = {
|
|
18257
18294
|
connection: e.connection,
|
|
18258
18295
|
provider: e.provider,
|
|
@@ -18265,8 +18302,8 @@ function Vx(e, t) {
|
|
|
18265
18302
|
...typeof e.profileData == "string" ? A(e.profileData, {}) : {}
|
|
18266
18303
|
}, n;
|
|
18267
18304
|
}
|
|
18268
|
-
function
|
|
18269
|
-
let { tenant_id: n, app_metadata: r, user_metadata: i, address: a, email_verified: o, phone_verified: s, is_social: c, linked_to: l, profileData: u, ...d } = e, f =
|
|
18305
|
+
function Wx(e, t = []) {
|
|
18306
|
+
let { tenant_id: n, app_metadata: r, user_metadata: i, address: a, email_verified: o, phone_verified: s, is_social: c, linked_to: l, profileData: u, ...d } = e, f = Ux(e, !0), ee = t.map((e) => Ux(e, !1));
|
|
18270
18307
|
return k({
|
|
18271
18308
|
...d,
|
|
18272
18309
|
email: e.email || "",
|
|
@@ -18279,7 +18316,7 @@ function Hx(e, t = []) {
|
|
|
18279
18316
|
identities: [f, ...ee]
|
|
18280
18317
|
});
|
|
18281
18318
|
}
|
|
18282
|
-
function
|
|
18319
|
+
function Gx(e) {
|
|
18283
18320
|
let t = async (t, n) => {
|
|
18284
18321
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
18285
18322
|
user_id: n.user_id,
|
|
@@ -18338,14 +18375,14 @@ function Ux(e) {
|
|
|
18338
18375
|
} catch (e) {
|
|
18339
18376
|
throw e?.message?.includes("UNIQUE constraint") || e?.message?.includes("AlreadyExists") ? new Un(409, { message: "User already exists" }) : (console.error("User upsert failed:", e?.code, e?.message), new Un(500, { message: "Internal server error" }));
|
|
18340
18377
|
}
|
|
18341
|
-
return
|
|
18378
|
+
return Wx(i);
|
|
18342
18379
|
};
|
|
18343
18380
|
return {
|
|
18344
18381
|
create: t,
|
|
18345
18382
|
rawCreate: t,
|
|
18346
18383
|
async get(t, n) {
|
|
18347
18384
|
let r = await e.select().from(x).where(h(m(x.tenant_id, t), m(x.user_id, n))).get();
|
|
18348
|
-
return r ?
|
|
18385
|
+
return r ? Wx(r, await e.select().from(x).where(h(m(x.tenant_id, t), m(x.linked_to, n))).all()) : null;
|
|
18349
18386
|
},
|
|
18350
18387
|
async update(t, n, r) {
|
|
18351
18388
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
@@ -18377,24 +18414,24 @@ function Ux(e) {
|
|
|
18377
18414
|
return r.email_verified !== void 0 && (i.email_verified = r.email_verified), r.phone_verified !== void 0 && (i.phone_verified = r.phone_verified), r.is_social !== void 0 && (i.is_social = r.is_social), r.app_metadata !== void 0 && (i.app_metadata = JSON.stringify(r.app_metadata)), r.user_metadata !== void 0 && (i.user_metadata = JSON.stringify(r.user_metadata)), r.address !== void 0 && (i.address = JSON.stringify(r.address)), r.profileData !== void 0 && (i.profileData = JSON.stringify(r.profileData)), (await e.update(x).set(i).where(h(m(x.tenant_id, t), m(x.user_id, n))).returning()).length > 0;
|
|
18378
18415
|
},
|
|
18379
18416
|
async list(t, n) {
|
|
18380
|
-
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = [m(x.tenant_id, t),
|
|
18417
|
+
let { page: r = 0, per_page: i = 50, include_totals: a = !1, sort: o, q: s } = n || {}, c = [m(x.tenant_id, t), Pe(x.linked_to)];
|
|
18381
18418
|
if (s) {
|
|
18382
|
-
let e = Nn(s,
|
|
18419
|
+
let e = Nn(s, Vx);
|
|
18383
18420
|
if (e) {
|
|
18384
|
-
let t = Pn(x, e,
|
|
18421
|
+
let t = Pn(x, e, Hx);
|
|
18385
18422
|
t && c.push(t);
|
|
18386
18423
|
}
|
|
18387
18424
|
}
|
|
18388
18425
|
let l = h(...c), u = e.select().from(x).where(l).$dynamic();
|
|
18389
18426
|
if (o?.sort_by) {
|
|
18390
18427
|
let e = x[o.sort_by];
|
|
18391
|
-
e && (u = u.orderBy(o.sort_order === "desc" ?
|
|
18428
|
+
e && (u = u.orderBy(o.sort_order === "desc" ? ze(e) : Re(e)));
|
|
18392
18429
|
}
|
|
18393
18430
|
let d = await u.offset(r * i).limit(i), f = d.map((e) => e.user_id), ee = [];
|
|
18394
|
-
f.length > 0 && (ee = await e.select().from(x).where(h(m(x.tenant_id, t),
|
|
18395
|
-
let te = d.map((e) =>
|
|
18431
|
+
f.length > 0 && (ee = await e.select().from(x).where(h(m(x.tenant_id, t), Ne(x.linked_to, f))));
|
|
18432
|
+
let te = d.map((e) => Wx(e, ee.filter((t) => t.linked_to === e.user_id)));
|
|
18396
18433
|
if (!a) return { users: te };
|
|
18397
|
-
let [ne] = await e.select({ count:
|
|
18434
|
+
let [ne] = await e.select({ count: Be() }).from(x).where(l);
|
|
18398
18435
|
return {
|
|
18399
18436
|
users: te,
|
|
18400
18437
|
start: r * i,
|
|
@@ -18406,7 +18443,7 @@ function Ux(e) {
|
|
|
18406
18443
|
await e.run(p`BEGIN`);
|
|
18407
18444
|
try {
|
|
18408
18445
|
let r = [n, ...(await e.select({ user_id: x.user_id }).from(x).where(h(m(x.tenant_id, t), m(x.linked_to, n)))).map((e) => e.user_id)];
|
|
18409
|
-
await e.delete(Tn).where(h(m(Tn.tenant_id, t),
|
|
18446
|
+
await e.delete(Tn).where(h(m(Tn.tenant_id, t), Ne(Tn.user_id, r))), await e.delete(Jt).where(h(m(Jt.tenant_id, t), Ne(Jt.user_id, r))), await e.delete(x).where(h(m(x.tenant_id, t), m(x.linked_to, n)));
|
|
18410
18447
|
let i = await e.delete(x).where(h(m(x.tenant_id, t), m(x.user_id, n))).returning();
|
|
18411
18448
|
return await e.run(p`COMMIT`), i.length > 0;
|
|
18412
18449
|
} catch (t) {
|
|
@@ -18421,7 +18458,7 @@ function Ux(e) {
|
|
|
18421
18458
|
}
|
|
18422
18459
|
//#endregion
|
|
18423
18460
|
//#region src/adapters/userRoles.ts
|
|
18424
|
-
function
|
|
18461
|
+
function Kx(e) {
|
|
18425
18462
|
return {
|
|
18426
18463
|
async create(t, n, r, i) {
|
|
18427
18464
|
try {
|
|
@@ -18461,7 +18498,7 @@ function Wx(e) {
|
|
|
18461
18498
|
//#endregion
|
|
18462
18499
|
//#region src/adapters/userOrganizations.ts
|
|
18463
18500
|
Xe();
|
|
18464
|
-
function
|
|
18501
|
+
function qx(e) {
|
|
18465
18502
|
return {
|
|
18466
18503
|
async create(t, n) {
|
|
18467
18504
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
@@ -18501,7 +18538,7 @@ function Gx(e) {
|
|
|
18501
18538
|
return n;
|
|
18502
18539
|
});
|
|
18503
18540
|
if (!a) return { userOrganizations: l };
|
|
18504
|
-
let [u] = await e.select({ count:
|
|
18541
|
+
let [u] = await e.select({ count: Be() }).from(on).where(c);
|
|
18505
18542
|
return {
|
|
18506
18543
|
userOrganizations: l,
|
|
18507
18544
|
start: r * i,
|
|
@@ -18523,7 +18560,7 @@ function Gx(e) {
|
|
|
18523
18560
|
});
|
|
18524
18561
|
}))).filter(Boolean);
|
|
18525
18562
|
if (!o) return { organizations: c };
|
|
18526
|
-
let [l] = await e.select({ count:
|
|
18563
|
+
let [l] = await e.select({ count: Be() }).from(on).where(h(m(on.tenant_id, t), m(on.user_id, n)));
|
|
18527
18564
|
return {
|
|
18528
18565
|
organizations: c,
|
|
18529
18566
|
start: i * a,
|
|
@@ -18538,20 +18575,20 @@ function Gx(e) {
|
|
|
18538
18575
|
}
|
|
18539
18576
|
//#endregion
|
|
18540
18577
|
//#region src/adapters/stats.ts
|
|
18541
|
-
var
|
|
18542
|
-
function
|
|
18578
|
+
var Jx = ["s"], Yx = ["pwd_leak"];
|
|
18579
|
+
function Xx(e) {
|
|
18543
18580
|
return /^\d{8}$/.test(e) ? `${e.slice(0, 4)}-${e.slice(4, 6)}-${e.slice(6, 8)}` : e;
|
|
18544
18581
|
}
|
|
18545
|
-
function
|
|
18582
|
+
function Zx(e) {
|
|
18546
18583
|
return {
|
|
18547
18584
|
async getDaily(t, n) {
|
|
18548
|
-
let r = /* @__PURE__ */ new Date(), i = n?.from ?
|
|
18585
|
+
let r = /* @__PURE__ */ new Date(), i = n?.from ? Xx(n.from) : (/* @__PURE__ */ new Date(r.getTime() - 720 * 60 * 60 * 1e3)).toISOString().split("T")[0], a = n?.to ? Xx(n.to) : r.toISOString().split("T")[0];
|
|
18549
18586
|
return (await e.select({
|
|
18550
18587
|
date: p`substr(${E.date}, 1, 10)`.as("date"),
|
|
18551
|
-
logins: p`SUM(CASE WHEN ${E.type} IN (${p.join(
|
|
18588
|
+
logins: p`SUM(CASE WHEN ${E.type} IN (${p.join(Jx.map((e) => p`${e}`), p`, `)}) THEN 1 ELSE 0 END)`.as("logins"),
|
|
18552
18589
|
signups: p`SUM(CASE WHEN ${E.type} = 'ss' THEN 1 ELSE 0 END)`.as("signups"),
|
|
18553
|
-
leaked_passwords: p`SUM(CASE WHEN ${E.type} IN (${p.join(
|
|
18554
|
-
}).from(E).where(h(m(E.tenant_id, t),
|
|
18590
|
+
leaked_passwords: p`SUM(CASE WHEN ${E.type} IN (${p.join(Yx.map((e) => p`${e}`), p`, `)}) THEN 1 ELSE 0 END)`.as("leaked_passwords")
|
|
18591
|
+
}).from(E).where(h(m(E.tenant_id, t), Ae(E.date, i), Me(E.date, `${a}T23:59:59.999Z`))).groupBy(p`substr(${E.date}, 1, 10)`).orderBy(p`substr(${E.date}, 1, 10)`).all()).map((e) => ({
|
|
18555
18592
|
date: e.date,
|
|
18556
18593
|
logins: Number(e.logins) || 0,
|
|
18557
18594
|
signups: Number(e.signups) || 0,
|
|
@@ -18561,14 +18598,14 @@ function Yx(e) {
|
|
|
18561
18598
|
}));
|
|
18562
18599
|
},
|
|
18563
18600
|
async getActiveUsers(t) {
|
|
18564
|
-
let n = (/* @__PURE__ */ new Date(Date.now() - 720 * 60 * 60 * 1e3)).toISOString(), [r] = await e.select({ count: p`COUNT(DISTINCT ${E.user_id})`.as("count") }).from(E).where(h(m(E.tenant_id, t),
|
|
18601
|
+
let n = (/* @__PURE__ */ new Date(Date.now() - 720 * 60 * 60 * 1e3)).toISOString(), [r] = await e.select({ count: p`COUNT(DISTINCT ${E.user_id})`.as("count") }).from(E).where(h(m(E.tenant_id, t), Ae(E.date, n), p`${E.type} IN (${p.join(Jx.map((e) => p`${e}`), p`, `)})`));
|
|
18565
18602
|
return Number(r?.count) || 0;
|
|
18566
18603
|
}
|
|
18567
18604
|
};
|
|
18568
18605
|
}
|
|
18569
18606
|
//#endregion
|
|
18570
18607
|
//#region src/adapters/analytics.ts
|
|
18571
|
-
var
|
|
18608
|
+
var Qx = {
|
|
18572
18609
|
"active-users": ["s", "seacft"],
|
|
18573
18610
|
logins: [
|
|
18574
18611
|
"s",
|
|
@@ -18578,7 +18615,7 @@ var Xx = {
|
|
|
18578
18615
|
signups: ["ss", "fs"],
|
|
18579
18616
|
"refresh-tokens": ["seacft", "fertft"],
|
|
18580
18617
|
sessions: ["slo"]
|
|
18581
|
-
},
|
|
18618
|
+
}, $x = {
|
|
18582
18619
|
"active-users": {
|
|
18583
18620
|
alias: "active_users",
|
|
18584
18621
|
type: "UInt64",
|
|
@@ -18605,7 +18642,7 @@ var Xx = {
|
|
|
18605
18642
|
agg: "count"
|
|
18606
18643
|
}
|
|
18607
18644
|
};
|
|
18608
|
-
function
|
|
18645
|
+
function eS(e) {
|
|
18609
18646
|
switch (e) {
|
|
18610
18647
|
case "hour": return p`substr(${E.date}, 1, 13)`;
|
|
18611
18648
|
case "month": return p`substr(${E.date}, 1, 7)`;
|
|
@@ -18614,10 +18651,10 @@ function Qx(e) {
|
|
|
18614
18651
|
default: throw Error(`Unsupported interval '${e}' for SQL analytics adapter`);
|
|
18615
18652
|
}
|
|
18616
18653
|
}
|
|
18617
|
-
function
|
|
18654
|
+
function tS(e) {
|
|
18618
18655
|
return `"${e.replace(/"/g, "\"\"")}"`;
|
|
18619
18656
|
}
|
|
18620
|
-
function
|
|
18657
|
+
function nS(e) {
|
|
18621
18658
|
switch (e) {
|
|
18622
18659
|
case "connection": return E.connection;
|
|
18623
18660
|
case "client_id": return E.client_id;
|
|
@@ -18626,24 +18663,24 @@ function eS(e) {
|
|
|
18626
18663
|
case "time": throw Error("time dimension handled separately");
|
|
18627
18664
|
}
|
|
18628
18665
|
}
|
|
18629
|
-
function
|
|
18666
|
+
function rS(e) {
|
|
18630
18667
|
return { async query(t, n, r) {
|
|
18631
|
-
let i = Date.now(), a =
|
|
18668
|
+
let i = Date.now(), a = Qx[n], o = $x[n], s = [
|
|
18632
18669
|
m(E.tenant_id, t),
|
|
18633
|
-
|
|
18634
|
-
|
|
18635
|
-
|
|
18670
|
+
Ae(E.date, r.from),
|
|
18671
|
+
je(E.date, r.to),
|
|
18672
|
+
Ne(E.type, a)
|
|
18636
18673
|
];
|
|
18637
|
-
r.filters.connection?.length && s.push(
|
|
18674
|
+
r.filters.connection?.length && s.push(Ne(E.connection, r.filters.connection)), r.filters.client_id?.length && s.push(Ne(E.client_id, r.filters.client_id)), r.filters.user_type?.length && s.push(Ne(E.strategy_type, r.filters.user_type)), r.filters.user_id?.length && s.push(Ne(E.user_id, r.filters.user_id));
|
|
18638
18675
|
let c = {}, l = [], u = [];
|
|
18639
18676
|
for (let e of r.group_by) if (e === "time") {
|
|
18640
|
-
let e =
|
|
18677
|
+
let e = eS(r.interval);
|
|
18641
18678
|
c.time = e, l.push(e), u.push({
|
|
18642
18679
|
name: "time",
|
|
18643
18680
|
type: r.interval === "hour" ? "DateTime" : "Date"
|
|
18644
18681
|
});
|
|
18645
18682
|
} else {
|
|
18646
|
-
let t =
|
|
18683
|
+
let t = nS(e);
|
|
18647
18684
|
c[e] = t, l.push(t), u.push({
|
|
18648
18685
|
name: e,
|
|
18649
18686
|
type: "String"
|
|
@@ -18655,13 +18692,13 @@ function tS(e) {
|
|
|
18655
18692
|
});
|
|
18656
18693
|
let d = e.select(c).from(E).where(h(...s));
|
|
18657
18694
|
l.length > 0 && (d = d.groupBy(...l));
|
|
18658
|
-
let f = new Set([...Object.keys(c)]);
|
|
18695
|
+
let f = /* @__PURE__ */ new Set([...Object.keys(c)]);
|
|
18659
18696
|
if (r.order_by) {
|
|
18660
18697
|
let e = r.order_by.startsWith("-"), t = e ? r.order_by.slice(1) : r.order_by;
|
|
18661
18698
|
if (!f.has(t)) throw Error(`Invalid order_by column '${t}' for analytics query`);
|
|
18662
|
-
let n =
|
|
18699
|
+
let n = tS(t);
|
|
18663
18700
|
d = d.orderBy(p.raw(`${n} ${e ? "DESC" : "ASC"}`));
|
|
18664
|
-
} else d = r.group_by[0] === "time" ? d.orderBy(p.raw(`${
|
|
18701
|
+
} else d = r.group_by[0] === "time" ? d.orderBy(p.raw(`${tS("time")} ASC`)) : d.orderBy(p.raw(`${tS(o.alias)} DESC`));
|
|
18665
18702
|
d = d.limit(r.limit).offset(r.offset);
|
|
18666
18703
|
let ee = (await d.all()).map((e) => {
|
|
18667
18704
|
let t = {};
|
|
@@ -18683,13 +18720,13 @@ function tS(e) {
|
|
|
18683
18720
|
//#endregion
|
|
18684
18721
|
//#region src/adapters/outbox.ts
|
|
18685
18722
|
Xe();
|
|
18686
|
-
function
|
|
18723
|
+
function iS(e) {
|
|
18687
18724
|
return {
|
|
18688
18725
|
...e,
|
|
18689
18726
|
payload: A(e.payload, {})
|
|
18690
18727
|
};
|
|
18691
18728
|
}
|
|
18692
|
-
function
|
|
18729
|
+
function aS(e) {
|
|
18693
18730
|
return {
|
|
18694
18731
|
async create(t, n) {
|
|
18695
18732
|
let r = Ye(), i = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -18714,11 +18751,11 @@ function rS(e) {
|
|
|
18714
18751
|
}), r;
|
|
18715
18752
|
},
|
|
18716
18753
|
async getByIds(t) {
|
|
18717
|
-
return t.length === 0 ? [] : (await e.select().from(D).where(
|
|
18754
|
+
return t.length === 0 ? [] : (await e.select().from(D).where(Ne(D.id, t)).all()).map(iS);
|
|
18718
18755
|
},
|
|
18719
18756
|
async getUnprocessed(t) {
|
|
18720
18757
|
let n = (/* @__PURE__ */ new Date()).toISOString();
|
|
18721
|
-
return (await e.select().from(D).where(h(
|
|
18758
|
+
return (await e.select().from(D).where(h(Pe(D.processed_at), Oe(Pe(D.next_retry_at), Me(D.next_retry_at, n)), Oe(Pe(D.claimed_by), Me(D.claim_expires_at, n)))).orderBy(D.created_at, D.id).limit(t).all()).map(iS);
|
|
18722
18759
|
},
|
|
18723
18760
|
async claimEvents(t, n, r) {
|
|
18724
18761
|
if (t.length === 0) return [];
|
|
@@ -18726,10 +18763,10 @@ function rS(e) {
|
|
|
18726
18763
|
return await e.update(D).set({
|
|
18727
18764
|
claimed_by: n,
|
|
18728
18765
|
claim_expires_at: a
|
|
18729
|
-
}).where(h(
|
|
18766
|
+
}).where(h(Ne(D.id, t), Pe(D.processed_at), Oe(Pe(D.claimed_by), Me(D.claim_expires_at, i)))), (await e.select({ id: D.id }).from(D).where(h(Ne(D.id, t), m(D.claimed_by, n))).all()).map((e) => e.id);
|
|
18730
18767
|
},
|
|
18731
18768
|
async markProcessed(t) {
|
|
18732
|
-
t.length !== 0 && await e.update(D).set({ processed_at: (/* @__PURE__ */ new Date()).toISOString() }).where(
|
|
18769
|
+
t.length !== 0 && await e.update(D).set({ processed_at: (/* @__PURE__ */ new Date()).toISOString() }).where(Ne(D.id, t));
|
|
18733
18770
|
},
|
|
18734
18771
|
async markRetry(t, n, r) {
|
|
18735
18772
|
await e.update(D).set({
|
|
@@ -18741,7 +18778,7 @@ function rS(e) {
|
|
|
18741
18778
|
}).where(m(D.id, t));
|
|
18742
18779
|
},
|
|
18743
18780
|
async cleanup(t) {
|
|
18744
|
-
return (await e.delete(D).where(h(p`${D.processed_at} IS NOT NULL`,
|
|
18781
|
+
return (await e.delete(D).where(h(p`${D.processed_at} IS NOT NULL`, Me(D.processed_at, t))).returning()).length;
|
|
18745
18782
|
},
|
|
18746
18783
|
async deadLetter(t, n) {
|
|
18747
18784
|
let r = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -18752,7 +18789,7 @@ function rS(e) {
|
|
|
18752
18789
|
}).where(m(D.id, t));
|
|
18753
18790
|
},
|
|
18754
18791
|
async listFailed(t, n = {}) {
|
|
18755
|
-
let { page: r = 0, per_page: i = 50, include_totals: a = !1 } = n, o = (await e.select().from(D).where(h(m(D.tenant_id, t),
|
|
18792
|
+
let { page: r = 0, per_page: i = 50, include_totals: a = !1 } = n, o = (await e.select().from(D).where(h(m(D.tenant_id, t), Fe(D.dead_lettered_at))).orderBy(ze(D.dead_lettered_at), Re(D.id)).offset(r * i).limit(i).all()).map((e) => ({
|
|
18756
18793
|
...A(e.payload, {}),
|
|
18757
18794
|
id: e.id,
|
|
18758
18795
|
created_at: e.created_at,
|
|
@@ -18764,7 +18801,7 @@ function rS(e) {
|
|
|
18764
18801
|
final_error: e.final_error
|
|
18765
18802
|
})), s = o.length;
|
|
18766
18803
|
if (a) {
|
|
18767
|
-
let [n] = await e.select({ total:
|
|
18804
|
+
let [n] = await e.select({ total: Be() }).from(D).where(h(m(D.tenant_id, t), Fe(D.dead_lettered_at)));
|
|
18768
18805
|
s = Number(n?.total ?? o.length);
|
|
18769
18806
|
}
|
|
18770
18807
|
return {
|
|
@@ -18782,19 +18819,19 @@ function rS(e) {
|
|
|
18782
18819
|
retry_count: 0,
|
|
18783
18820
|
next_retry_at: null,
|
|
18784
18821
|
error: null
|
|
18785
|
-
}).where(h(m(D.id, t), m(D.tenant_id, n),
|
|
18822
|
+
}).where(h(m(D.id, t), m(D.tenant_id, n), Fe(D.dead_lettered_at))).returning()).length > 0;
|
|
18786
18823
|
}
|
|
18787
18824
|
};
|
|
18788
18825
|
}
|
|
18789
18826
|
//#endregion
|
|
18790
18827
|
//#region src/adapters/cleanup.ts
|
|
18791
|
-
var
|
|
18792
|
-
function
|
|
18828
|
+
var oS = 10080 * 60 * 1e3;
|
|
18829
|
+
function sS(e) {
|
|
18793
18830
|
return async (t) => {
|
|
18794
|
-
let n = Date.now() -
|
|
18831
|
+
let n = Date.now() - oS;
|
|
18795
18832
|
try {
|
|
18796
|
-
let r = [
|
|
18797
|
-
t?.tenant_id && r.push(m(S.tenant_id, t.tenant_id)), await e.delete(S).where(h(...r)), r = [
|
|
18833
|
+
let r = [Oe(je(S.expires_at_ts, n), je(S.idle_expires_at_ts, n))];
|
|
18834
|
+
t?.tenant_id && r.push(m(S.tenant_id, t.tenant_id)), await e.delete(S).where(h(...r)), r = [Oe(je(Yt.expires_at_ts, n), je(Yt.idle_expires_at_ts, n))], t?.tenant_id && r.push(m(Yt.tenant_id, t.tenant_id)), t?.user_id && r.push(m(Yt.user_id, t.user_id)), await e.delete(Yt).where(h(...r)), r = [je(C.expires_at_ts, n)], t?.tenant_id && r.push(m(C.tenant_id, t.tenant_id)), await e.delete(C).where(h(...r));
|
|
18798
18835
|
} catch (e) {
|
|
18799
18836
|
console.error("Session cleanup error:", e);
|
|
18800
18837
|
}
|
|
@@ -18802,7 +18839,7 @@ function aS(e) {
|
|
|
18802
18839
|
}
|
|
18803
18840
|
//#endregion
|
|
18804
18841
|
//#region src/adapters/index.ts
|
|
18805
|
-
function
|
|
18842
|
+
function cS(e, t = { useTransactions: !0 }) {
|
|
18806
18843
|
let n = {
|
|
18807
18844
|
actions: Ln(e),
|
|
18808
18845
|
actionExecutions: Rn(e),
|
|
@@ -18811,42 +18848,42 @@ function oS(e, t = { useTransactions: !0 }) {
|
|
|
18811
18848
|
clients: Yn(e),
|
|
18812
18849
|
clientConnections: Zn(e),
|
|
18813
18850
|
clientGrants: $n(e),
|
|
18814
|
-
clientRegistrationTokens:
|
|
18815
|
-
codes:
|
|
18816
|
-
connections:
|
|
18817
|
-
customDomains:
|
|
18818
|
-
customText:
|
|
18819
|
-
emailProviders:
|
|
18820
|
-
emailTemplates:
|
|
18821
|
-
flows:
|
|
18822
|
-
forms:
|
|
18823
|
-
hookCode:
|
|
18824
|
-
hooks:
|
|
18825
|
-
invites:
|
|
18826
|
-
keys:
|
|
18827
|
-
loginSessions:
|
|
18828
|
-
logs:
|
|
18829
|
-
authenticationMethods:
|
|
18830
|
-
organizations:
|
|
18831
|
-
passwords:
|
|
18832
|
-
promptSettings:
|
|
18833
|
-
proxyRoutes:
|
|
18834
|
-
refreshTokens:
|
|
18835
|
-
resourceServers:
|
|
18836
|
-
rolePermissions:
|
|
18837
|
-
userPermissions:
|
|
18838
|
-
roles:
|
|
18839
|
-
sessions:
|
|
18840
|
-
sessionCleanup:
|
|
18841
|
-
tenants:
|
|
18842
|
-
themes:
|
|
18843
|
-
universalLoginTemplates:
|
|
18844
|
-
users:
|
|
18845
|
-
userRoles:
|
|
18846
|
-
userOrganizations:
|
|
18847
|
-
stats:
|
|
18848
|
-
analytics:
|
|
18849
|
-
outbox:
|
|
18851
|
+
clientRegistrationTokens: ub(e),
|
|
18852
|
+
codes: pb(e),
|
|
18853
|
+
connections: gb(e),
|
|
18854
|
+
customDomains: vb(e),
|
|
18855
|
+
customText: yb(e),
|
|
18856
|
+
emailProviders: bb(e),
|
|
18857
|
+
emailTemplates: Sb(e),
|
|
18858
|
+
flows: wb(e),
|
|
18859
|
+
forms: Db(e),
|
|
18860
|
+
hookCode: Pb(e),
|
|
18861
|
+
hooks: Rb(e),
|
|
18862
|
+
invites: Hb(e),
|
|
18863
|
+
keys: Wb(e),
|
|
18864
|
+
loginSessions: Yb(e),
|
|
18865
|
+
logs: Zb(e),
|
|
18866
|
+
authenticationMethods: nx(e),
|
|
18867
|
+
organizations: ox(e),
|
|
18868
|
+
passwords: cx(e),
|
|
18869
|
+
promptSettings: lx(e),
|
|
18870
|
+
proxyRoutes: px(e),
|
|
18871
|
+
refreshTokens: gx(e),
|
|
18872
|
+
resourceServers: Sx(e),
|
|
18873
|
+
rolePermissions: Cx(e),
|
|
18874
|
+
userPermissions: wx(e),
|
|
18875
|
+
roles: Ex(e),
|
|
18876
|
+
sessions: jx(e),
|
|
18877
|
+
sessionCleanup: sS(e),
|
|
18878
|
+
tenants: Ix(e),
|
|
18879
|
+
themes: zx(e),
|
|
18880
|
+
universalLoginTemplates: Bx(e),
|
|
18881
|
+
users: Gx(e),
|
|
18882
|
+
userRoles: Kx(e),
|
|
18883
|
+
userOrganizations: qx(e),
|
|
18884
|
+
stats: Zx(e),
|
|
18885
|
+
analytics: rS(e),
|
|
18886
|
+
outbox: aS(e),
|
|
18850
18887
|
async transaction(r) {
|
|
18851
18888
|
if (t.useTransactions === !1) return r(n);
|
|
18852
18889
|
await e.run(p`BEGIN`);
|
|
@@ -18862,22 +18899,22 @@ function oS(e, t = { useTransactions: !0 }) {
|
|
|
18862
18899
|
}
|
|
18863
18900
|
//#endregion
|
|
18864
18901
|
//#region src/adapters/resolveHost.ts
|
|
18865
|
-
function
|
|
18902
|
+
function lS(e) {
|
|
18866
18903
|
if (!e) return { path: "/*" };
|
|
18867
18904
|
try {
|
|
18868
|
-
let t = JSON.parse(e), n =
|
|
18905
|
+
let t = JSON.parse(e), n = Wy.safeParse(t);
|
|
18869
18906
|
if (n.success) return n.data;
|
|
18870
18907
|
} catch {}
|
|
18871
18908
|
return { path: "/*" };
|
|
18872
18909
|
}
|
|
18873
|
-
function
|
|
18910
|
+
function uS(e) {
|
|
18874
18911
|
if (!e) return [];
|
|
18875
18912
|
try {
|
|
18876
18913
|
let t = JSON.parse(e);
|
|
18877
18914
|
if (!Array.isArray(t)) return [];
|
|
18878
18915
|
let n = [];
|
|
18879
18916
|
for (let e of t) {
|
|
18880
|
-
let t =
|
|
18917
|
+
let t = Gy.safeParse(e);
|
|
18881
18918
|
t.success && n.push(t.data);
|
|
18882
18919
|
}
|
|
18883
18920
|
return n;
|
|
@@ -18885,20 +18922,20 @@ function cS(e) {
|
|
|
18885
18922
|
return [];
|
|
18886
18923
|
}
|
|
18887
18924
|
}
|
|
18888
|
-
async function
|
|
18925
|
+
async function dS(e, t) {
|
|
18889
18926
|
let n = t.toLowerCase(), r = (await e.select({
|
|
18890
18927
|
custom_domain_id: nn.custom_domain_id,
|
|
18891
18928
|
tenant_id: nn.tenant_id,
|
|
18892
18929
|
domain: nn.domain
|
|
18893
18930
|
}).from(nn).where(m(nn.domain, n)).limit(1))[0];
|
|
18894
18931
|
if (!r) return null;
|
|
18895
|
-
let i = (await e.select().from(O).where(h(m(O.tenant_id, r.tenant_id), m(O.custom_domain_id, r.custom_domain_id))).orderBy(
|
|
18932
|
+
let i = (await e.select().from(O).where(h(m(O.tenant_id, r.tenant_id), m(O.custom_domain_id, r.custom_domain_id))).orderBy(Re(O.priority), Re(O.created_at))).map((e) => ({
|
|
18896
18933
|
id: e.id,
|
|
18897
18934
|
tenant_id: e.tenant_id,
|
|
18898
18935
|
custom_domain_id: e.custom_domain_id,
|
|
18899
18936
|
priority: e.priority,
|
|
18900
|
-
match:
|
|
18901
|
-
handlers:
|
|
18937
|
+
match: lS(e.match),
|
|
18938
|
+
handlers: uS(e.handlers),
|
|
18902
18939
|
created_at: e.created_at,
|
|
18903
18940
|
updated_at: e.updated_at
|
|
18904
18941
|
}));
|
|
@@ -18911,11 +18948,11 @@ async function lS(e, t) {
|
|
|
18911
18948
|
}
|
|
18912
18949
|
//#endregion
|
|
18913
18950
|
//#region src/adapters/proxyData.ts
|
|
18914
|
-
function
|
|
18951
|
+
function fS(e) {
|
|
18915
18952
|
return {
|
|
18916
|
-
proxyRoutes:
|
|
18917
|
-
resolveHost: (t) =>
|
|
18953
|
+
proxyRoutes: px(e),
|
|
18954
|
+
resolveHost: (t) => dS(e, t)
|
|
18918
18955
|
};
|
|
18919
18956
|
}
|
|
18920
18957
|
//#endregion
|
|
18921
|
-
export {
|
|
18958
|
+
export { fS as createProxyDataAdapter, px as createProxyRoutesAdapter, cS as default, En as sqlite };
|