@authhero/aws-adapter 1.3.1 → 1.3.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/aws-adapter.cjs +1 -1
- package/dist/aws-adapter.d.ts +28 -2
- package/dist/aws-adapter.mjs +925 -925
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +3 -0
- package/package.json +3 -3
package/dist/aws-adapter.mjs
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { FeatureNotSupportedError as e, LoginSessionState as t, authenticationMethodSchema as n, brandingSchema as r, clientGrantSchema as i, clientRegistrationTokenSchema as a, clientSchema as o, codeSchema as s, connectionSchema as c, customDomainSchema as l, customDomainWithTenantIdSchema as u, decodeBase64UrlString as ee, emailProviderSchema as te, emailTemplateSchema as ne, encodeBase64UrlString as re, flowSchema as ie, formSchema as ae, handlerConfigSchema as oe, hookSchema as se, inviteSchema as ce, logSchema as le, loginSessionSchema as ue, matchSchema as de, organizationSchema as fe, parseUserId as pe, passwordSchema as me, promptSettingSchema as he, refreshTokenSchema as ge, resourceServerSchema as _e, rolePermissionSchema as ve, roleSchema as ye, sessionSchema as be, signingKeySchema as xe, tenantSchema as Se, themeSchema as Ce, userOrganizationSchema as we, userPermissionWithDetailsSchema as Te, userSchema as Ee } from "@authhero/adapter-interfaces";
|
|
2
|
+
import { nanoid as d } from "nanoid";
|
|
3
3
|
import { BatchWriteCommand as De, DeleteCommand as Oe, GetCommand as ke, PutCommand as Ae, QueryCommand as je, TransactWriteCommand as Me, UpdateCommand as Ne } from "@aws-sdk/lib-dynamodb";
|
|
4
4
|
import { HTTPException as Pe } from "hono/http-exception";
|
|
5
5
|
//#region src/adapters/actions.ts
|
|
6
6
|
function Fe() {
|
|
7
|
-
let
|
|
8
|
-
throw
|
|
7
|
+
let t = (t) => {
|
|
8
|
+
throw new e("actions", "AWS DynamoDB", `Called ${t}. Use a SQL-backed adapter (kysely or drizzle) for tenants that require actions.`);
|
|
9
9
|
};
|
|
10
10
|
return {
|
|
11
|
-
create: () =>
|
|
12
|
-
get: () =>
|
|
13
|
-
list: () =>
|
|
14
|
-
update: () =>
|
|
15
|
-
remove: () =>
|
|
11
|
+
create: () => t("create"),
|
|
12
|
+
get: () => t("get"),
|
|
13
|
+
list: () => t("list"),
|
|
14
|
+
update: () => t("update"),
|
|
15
|
+
remove: () => t("remove")
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/adapters/actionExecutions.ts
|
|
20
20
|
function Ie() {
|
|
21
|
-
let
|
|
22
|
-
throw
|
|
21
|
+
let t = (t) => {
|
|
22
|
+
throw new e("action executions", "AWS DynamoDB", `Called ${t}. Use a SQL-backed adapter (kysely or drizzle) for tenants that require actions.`);
|
|
23
23
|
};
|
|
24
24
|
return {
|
|
25
|
-
create: () =>
|
|
26
|
-
get: () =>
|
|
25
|
+
create: () => t("create"),
|
|
26
|
+
get: () => t("get")
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region src/adapters/actionVersions.ts
|
|
31
31
|
function Le() {
|
|
32
|
-
let
|
|
33
|
-
throw
|
|
32
|
+
let t = (t) => {
|
|
33
|
+
throw new e("action versions", "AWS DynamoDB", `Called ${t}. Use a SQL-backed adapter (kysely or drizzle) for tenants that require actions.`);
|
|
34
34
|
};
|
|
35
35
|
return {
|
|
36
|
-
create: () =>
|
|
37
|
-
get: () =>
|
|
38
|
-
list: () =>
|
|
39
|
-
removeForAction: () =>
|
|
36
|
+
create: () => t("create"),
|
|
37
|
+
get: () => t("get"),
|
|
38
|
+
list: () => t("list"),
|
|
39
|
+
removeForAction: () => t("removeForAction")
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/keys.ts
|
|
44
|
-
var
|
|
44
|
+
var f = {
|
|
45
45
|
pk: (e) => `TENANT#${e}`,
|
|
46
46
|
sk: () => "TENANT",
|
|
47
47
|
gsi1pk: () => "TENANTS",
|
|
48
48
|
gsi1sk: (e) => `TENANT#${e}`
|
|
49
|
-
},
|
|
49
|
+
}, p = {
|
|
50
50
|
pk: (e) => `TENANT#${e}`,
|
|
51
51
|
sk: (e) => `USER#${e}`,
|
|
52
52
|
gsi1pk: (e, t) => `TENANT#${e}#EMAIL#${t.toLowerCase()}`,
|
|
53
53
|
gsi1sk: () => "USER",
|
|
54
54
|
gsi2pk: (e, t) => `TENANT#${e}#CONNECTION#${t}`,
|
|
55
55
|
gsi2sk: (e) => `USER#${e}`
|
|
56
|
-
},
|
|
56
|
+
}, m = {
|
|
57
57
|
pk: (e) => `TENANT#${e}`,
|
|
58
58
|
sk: (e) => `SESSION#${e}`,
|
|
59
59
|
gsi1pk: (e, t) => `TENANT#${e}#USER#${t}`,
|
|
60
60
|
gsi1sk: (e) => `SESSION#${e}`
|
|
61
|
-
},
|
|
61
|
+
}, h = {
|
|
62
62
|
pk: (e) => `TENANT#${e}`,
|
|
63
63
|
sk: (e) => `LOGIN_SESSION#${e}`
|
|
64
|
-
},
|
|
64
|
+
}, g = {
|
|
65
65
|
pk: (e) => `TENANT#${e}`,
|
|
66
66
|
sk: (e) => `CLIENT#${e}`
|
|
67
|
-
},
|
|
67
|
+
}, _ = {
|
|
68
68
|
pk: (e) => `TENANT#${e}`,
|
|
69
69
|
sk: (e) => `CLIENT_GRANT#${e}`,
|
|
70
70
|
gsi1pk: (e, t) => `TENANT#${e}#CLIENT#${t}`,
|
|
71
71
|
gsi1sk: (e) => `CLIENT_GRANT#${e}`
|
|
72
|
-
},
|
|
72
|
+
}, v = {
|
|
73
73
|
pk: (e) => `TENANT#${e}`,
|
|
74
74
|
sk: (e) => `CONNECTION#${e}`,
|
|
75
75
|
gsi1pk: (e, t) => `TENANT#${e}#CONNECTION_NAME#${t}`,
|
|
76
76
|
gsi1sk: () => "CONNECTION"
|
|
77
|
-
},
|
|
77
|
+
}, y = {
|
|
78
78
|
pk: (e) => `TENANT#${e}`,
|
|
79
79
|
sk: (e, t) => `CODE#${e}#${t}`,
|
|
80
80
|
skPrefixByCodeId: (e) => `CODE#${e}#`
|
|
81
|
-
},
|
|
81
|
+
}, b = {
|
|
82
82
|
pk: (e, t) => `TENANT#${e}#USER#${t}`,
|
|
83
83
|
sk: (e) => `PASSWORD#${e}`,
|
|
84
84
|
skPrefix: () => "PASSWORD#"
|
|
85
85
|
}, Re = {
|
|
86
86
|
pk: (e) => `TENANT#${e}`,
|
|
87
87
|
sk: () => "BRANDING"
|
|
88
|
-
},
|
|
88
|
+
}, x = {
|
|
89
89
|
pk: (e) => `TENANT#${e}`,
|
|
90
90
|
sk: () => "UNIVERSAL_LOGIN_TEMPLATE"
|
|
91
|
-
},
|
|
91
|
+
}, S = {
|
|
92
92
|
pk: (e) => `TENANT#${e}`,
|
|
93
93
|
sk: (e) => `THEME#${e}`
|
|
94
|
-
},
|
|
94
|
+
}, C = {
|
|
95
95
|
pk: (e) => `TENANT#${e}`,
|
|
96
96
|
sk: (e) => `HOOK#${e}`
|
|
97
97
|
}, ze = {
|
|
98
98
|
pk: () => "KEYS",
|
|
99
99
|
sk: (e) => `KEY#${e}`
|
|
100
|
-
},
|
|
100
|
+
}, w = {
|
|
101
101
|
pk: (e) => `TENANT#${e}`,
|
|
102
102
|
sk: (e) => `CUSTOM_DOMAIN#${e}`,
|
|
103
103
|
gsi1pk: (e) => `DOMAIN#${e}`,
|
|
104
104
|
gsi1sk: () => "CUSTOM_DOMAIN"
|
|
105
|
-
},
|
|
105
|
+
}, T = {
|
|
106
106
|
pk: (e) => `TENANT#${e}`,
|
|
107
107
|
sk: (e) => `PROXY_ROUTE#${e}`,
|
|
108
108
|
gsi1pk: (e, t) => `TENANT#${e}#CUSTOM_DOMAIN#${t}`,
|
|
109
109
|
gsi1sk: (e) => `PROXY_ROUTE#${e}`
|
|
110
|
-
},
|
|
110
|
+
}, E = {
|
|
111
111
|
pk: (e) => `TENANT#${e}`,
|
|
112
112
|
sk: (e) => `LOG#${e}`,
|
|
113
113
|
gsi1pk: (e, t) => `TENANT#${e}#LOG#${t}`,
|
|
114
114
|
gsi1sk: (e) => `LOG#${e}`
|
|
115
|
-
},
|
|
115
|
+
}, D = {
|
|
116
116
|
pk: (e) => `TENANT#${e}`,
|
|
117
117
|
sk: () => "EMAIL_PROVIDER"
|
|
118
|
-
},
|
|
118
|
+
}, O = {
|
|
119
119
|
pk: (e) => `TENANT#${e}`,
|
|
120
120
|
sk: (e) => `EMAIL_TEMPLATE#${e}`,
|
|
121
121
|
skPrefix: () => "EMAIL_TEMPLATE#"
|
|
122
|
-
},
|
|
122
|
+
}, Be = {
|
|
123
123
|
pk: (e) => `TENANT#${e}`,
|
|
124
124
|
sk: () => "PROMPT_SETTINGS"
|
|
125
125
|
}, k = {
|
|
@@ -176,7 +176,7 @@ var d = {
|
|
|
176
176
|
sk: (e) => `INVITE#${e}`,
|
|
177
177
|
gsi1pk: (e, t) => `TENANT#${e}#ORG#${t}`,
|
|
178
178
|
gsi1sk: (e) => `INVITE#${e}`
|
|
179
|
-
},
|
|
179
|
+
}, Ve = {
|
|
180
180
|
pk: () => "LEGACY_CLIENTS",
|
|
181
181
|
sk: (e) => `LEGACY_CLIENT#${e}`
|
|
182
182
|
}, V = {
|
|
@@ -206,10 +206,10 @@ var d = {
|
|
|
206
206
|
};
|
|
207
207
|
//#endregion
|
|
208
208
|
//#region src/cursor.ts
|
|
209
|
-
function
|
|
209
|
+
function He(e) {
|
|
210
210
|
return re(JSON.stringify(e));
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function Ue(e, t) {
|
|
213
213
|
let n;
|
|
214
214
|
try {
|
|
215
215
|
n = JSON.parse(ee(e));
|
|
@@ -226,7 +226,7 @@ function He(e, t) {
|
|
|
226
226
|
}
|
|
227
227
|
//#endregion
|
|
228
228
|
//#region src/utils.ts
|
|
229
|
-
async function
|
|
229
|
+
async function We(e, t) {
|
|
230
230
|
let n = t.map((t) => {
|
|
231
231
|
if (t.type === "put" && t.item) return { Put: {
|
|
232
232
|
TableName: e.tableName,
|
|
@@ -292,7 +292,7 @@ async function J(e, t, n) {
|
|
|
292
292
|
lastKey: ee.LastEvaluatedKey
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function Ge(e) {
|
|
296
296
|
return e?.from !== void 0 || e?.take !== void 0;
|
|
297
297
|
}
|
|
298
298
|
async function Y(e, t, n = {}, r) {
|
|
@@ -301,8 +301,8 @@ async function Y(e, t, n = {}, r) {
|
|
|
301
301
|
let e = u ? `${u}SK` : "SK";
|
|
302
302
|
ne += ` AND begins_with(${e}, :skPrefix)`, re[":skPrefix"] = l;
|
|
303
303
|
}
|
|
304
|
-
if (
|
|
305
|
-
let n = s ?
|
|
304
|
+
if (Ge(n)) {
|
|
305
|
+
let n = s ? Ue(s, {
|
|
306
306
|
pk: t,
|
|
307
307
|
indexName: u,
|
|
308
308
|
skPrefix: l
|
|
@@ -314,7 +314,7 @@ async function Y(e, t, n = {}, r) {
|
|
|
314
314
|
Limit: te,
|
|
315
315
|
ExclusiveStartKey: n,
|
|
316
316
|
ScanIndexForward: ee
|
|
317
|
-
})), i = r.Items || [], a = r.LastEvaluatedKey ?
|
|
317
|
+
})), i = r.Items || [], a = r.LastEvaluatedKey ? He(r.LastEvaluatedKey) : void 0;
|
|
318
318
|
return {
|
|
319
319
|
items: i,
|
|
320
320
|
start: 0,
|
|
@@ -388,7 +388,7 @@ function Q(e) {
|
|
|
388
388
|
}
|
|
389
389
|
//#endregion
|
|
390
390
|
//#region src/adapters/flows.ts
|
|
391
|
-
function
|
|
391
|
+
function Ke(e) {
|
|
392
392
|
let { tenant_id: t, ...n } = Z(e), r = [];
|
|
393
393
|
if (e.actions) try {
|
|
394
394
|
r = JSON.parse(e.actions);
|
|
@@ -401,82 +401,82 @@ function Ge(e) {
|
|
|
401
401
|
});
|
|
402
402
|
return ie.parse(i);
|
|
403
403
|
}
|
|
404
|
-
function
|
|
404
|
+
function qe(e) {
|
|
405
405
|
return {
|
|
406
|
-
async create(
|
|
407
|
-
let
|
|
408
|
-
PK: j.pk(
|
|
409
|
-
SK: j.sk(
|
|
406
|
+
async create(t, n) {
|
|
407
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = `af_${d()}`, a = {
|
|
408
|
+
PK: j.pk(t),
|
|
409
|
+
SK: j.sk(i),
|
|
410
410
|
entityType: "FLOW",
|
|
411
|
-
tenant_id:
|
|
412
|
-
id:
|
|
413
|
-
name:
|
|
414
|
-
actions:
|
|
415
|
-
created_at:
|
|
416
|
-
updated_at:
|
|
411
|
+
tenant_id: t,
|
|
412
|
+
id: i,
|
|
413
|
+
name: n.name,
|
|
414
|
+
actions: n.actions ? JSON.stringify(n.actions) : void 0,
|
|
415
|
+
created_at: r,
|
|
416
|
+
updated_at: r
|
|
417
417
|
};
|
|
418
|
-
return await K(
|
|
418
|
+
return await K(e, a), Ke(a);
|
|
419
419
|
},
|
|
420
|
-
async get(
|
|
421
|
-
let r = await G(
|
|
422
|
-
return r ?
|
|
420
|
+
async get(t, n) {
|
|
421
|
+
let r = await G(e, j.pk(t), j.sk(n));
|
|
422
|
+
return r ? Ke(r) : null;
|
|
423
423
|
},
|
|
424
|
-
async list(
|
|
425
|
-
let r = await Y(
|
|
424
|
+
async list(t, n = {}) {
|
|
425
|
+
let r = await Y(e, j.pk(t), n, { skPrefix: "FLOW#" });
|
|
426
426
|
return {
|
|
427
|
-
flows: r.items.map(
|
|
427
|
+
flows: r.items.map(Ke),
|
|
428
428
|
start: r.start,
|
|
429
429
|
limit: r.limit,
|
|
430
430
|
length: r.length,
|
|
431
431
|
next: r.next
|
|
432
432
|
};
|
|
433
433
|
},
|
|
434
|
-
async update(
|
|
434
|
+
async update(t, n, r) {
|
|
435
435
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
436
|
-
return r.name !== void 0 && (i.name = r.name), r.actions !== void 0 && (i.actions = JSON.stringify(r.actions)), await X(
|
|
436
|
+
return r.name !== void 0 && (i.name = r.name), r.actions !== void 0 && (i.actions = JSON.stringify(r.actions)), await X(e, j.pk(t), j.sk(n), i) ? this.get(t, n) : null;
|
|
437
437
|
},
|
|
438
|
-
async remove(
|
|
439
|
-
return q(
|
|
438
|
+
async remove(t, n) {
|
|
439
|
+
return q(e, j.pk(t), j.sk(n));
|
|
440
440
|
}
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
443
|
//#endregion
|
|
444
444
|
//#region src/adapters/tenants.ts
|
|
445
|
-
function
|
|
445
|
+
function Je(e) {
|
|
446
446
|
let t = Z(e);
|
|
447
447
|
return Se.parse(Q(t));
|
|
448
448
|
}
|
|
449
|
-
function
|
|
449
|
+
function Ye(e) {
|
|
450
450
|
return {
|
|
451
|
-
async create(
|
|
452
|
-
let
|
|
453
|
-
PK:
|
|
454
|
-
SK:
|
|
455
|
-
GSI1PK:
|
|
456
|
-
GSI1SK:
|
|
451
|
+
async create(t) {
|
|
452
|
+
let n = (/* @__PURE__ */ new Date()).toISOString(), r = t.id || d(), i = {
|
|
453
|
+
PK: f.pk(r),
|
|
454
|
+
SK: f.sk(),
|
|
455
|
+
GSI1PK: f.gsi1pk(),
|
|
456
|
+
GSI1SK: f.gsi1sk(r),
|
|
457
457
|
entityType: "TENANT",
|
|
458
|
-
id:
|
|
459
|
-
audience:
|
|
460
|
-
friendly_name:
|
|
461
|
-
sender_name:
|
|
462
|
-
sender_email:
|
|
463
|
-
session_lifetime:
|
|
464
|
-
idle_session_lifetime:
|
|
465
|
-
created_at:
|
|
466
|
-
updated_at:
|
|
458
|
+
id: r,
|
|
459
|
+
audience: t.audience,
|
|
460
|
+
friendly_name: t.friendly_name,
|
|
461
|
+
sender_name: t.sender_name,
|
|
462
|
+
sender_email: t.sender_email,
|
|
463
|
+
session_lifetime: t.session_lifetime,
|
|
464
|
+
idle_session_lifetime: t.idle_session_lifetime,
|
|
465
|
+
created_at: n,
|
|
466
|
+
updated_at: n
|
|
467
467
|
};
|
|
468
|
-
return await K(
|
|
468
|
+
return await K(e, i), Je(i);
|
|
469
469
|
},
|
|
470
|
-
async get(
|
|
471
|
-
let n = await G(
|
|
472
|
-
return n ?
|
|
470
|
+
async get(t) {
|
|
471
|
+
let n = await G(e, f.pk(t), f.sk());
|
|
472
|
+
return n ? Je(n) : null;
|
|
473
473
|
},
|
|
474
|
-
async list(
|
|
475
|
-
let { include_totals: n = !1 } =
|
|
474
|
+
async list(t = {}) {
|
|
475
|
+
let { include_totals: n = !1 } = t, r = await Y(e, f.gsi1pk(), t, {
|
|
476
476
|
indexName: "GSI1",
|
|
477
477
|
skPrefix: "TENANT#"
|
|
478
|
-
}), i = r.items.map(
|
|
479
|
-
return
|
|
478
|
+
}), i = r.items.map(Je);
|
|
479
|
+
return Ge(t) ? {
|
|
480
480
|
tenants: i,
|
|
481
481
|
totals: {
|
|
482
482
|
start: r.start,
|
|
@@ -493,21 +493,21 @@ function Je(t) {
|
|
|
493
493
|
}
|
|
494
494
|
} : { tenants: i };
|
|
495
495
|
},
|
|
496
|
-
async update(
|
|
496
|
+
async update(t, n) {
|
|
497
497
|
let r = {
|
|
498
498
|
...n,
|
|
499
499
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
500
500
|
};
|
|
501
|
-
await X(
|
|
501
|
+
await X(e, f.pk(t), f.sk(), r);
|
|
502
502
|
},
|
|
503
|
-
async remove(
|
|
504
|
-
return q(
|
|
503
|
+
async remove(t) {
|
|
504
|
+
return q(e, f.pk(t), f.sk());
|
|
505
505
|
}
|
|
506
506
|
};
|
|
507
507
|
}
|
|
508
508
|
//#endregion
|
|
509
509
|
//#region src/adapters/users.ts
|
|
510
|
-
function
|
|
510
|
+
function Xe(e, t = []) {
|
|
511
511
|
let { tenant_id: n, ...r } = Z(e), i = Q({
|
|
512
512
|
...r,
|
|
513
513
|
app_metadata: JSON.parse(e.app_metadata || "{}"),
|
|
@@ -536,109 +536,109 @@ function Ye(e, t = []) {
|
|
|
536
536
|
});
|
|
537
537
|
return Ee.parse(i);
|
|
538
538
|
}
|
|
539
|
-
function
|
|
540
|
-
let
|
|
541
|
-
let
|
|
542
|
-
PK:
|
|
543
|
-
SK:
|
|
539
|
+
function Ze(e) {
|
|
540
|
+
let t = async (t, n) => {
|
|
541
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = n.user_id || `${n.provider}|${d()}`, a = {
|
|
542
|
+
PK: p.pk(t),
|
|
543
|
+
SK: p.sk(i),
|
|
544
544
|
entityType: "USER",
|
|
545
|
-
tenant_id:
|
|
546
|
-
user_id:
|
|
547
|
-
email:
|
|
548
|
-
username:
|
|
549
|
-
phone_number:
|
|
550
|
-
given_name:
|
|
551
|
-
family_name:
|
|
552
|
-
nickname:
|
|
553
|
-
name:
|
|
554
|
-
picture:
|
|
555
|
-
locale:
|
|
556
|
-
linked_to:
|
|
557
|
-
profileData:
|
|
558
|
-
email_verified:
|
|
559
|
-
last_ip:
|
|
560
|
-
last_login:
|
|
561
|
-
provider:
|
|
562
|
-
connection:
|
|
563
|
-
is_social:
|
|
545
|
+
tenant_id: t,
|
|
546
|
+
user_id: i,
|
|
547
|
+
email: n.email,
|
|
548
|
+
username: n.username,
|
|
549
|
+
phone_number: n.phone_number,
|
|
550
|
+
given_name: n.given_name,
|
|
551
|
+
family_name: n.family_name,
|
|
552
|
+
nickname: n.nickname,
|
|
553
|
+
name: n.name,
|
|
554
|
+
picture: n.picture,
|
|
555
|
+
locale: n.locale,
|
|
556
|
+
linked_to: n.linked_to,
|
|
557
|
+
profileData: n.profileData,
|
|
558
|
+
email_verified: n.email_verified ?? !1,
|
|
559
|
+
last_ip: n.last_ip,
|
|
560
|
+
last_login: n.last_login,
|
|
561
|
+
provider: n.provider || "auth",
|
|
562
|
+
connection: n.connection,
|
|
563
|
+
is_social: n.is_social ?? !1,
|
|
564
564
|
login_count: 0,
|
|
565
|
-
app_metadata: JSON.stringify(
|
|
566
|
-
user_metadata: JSON.stringify(
|
|
567
|
-
middle_name:
|
|
568
|
-
preferred_username:
|
|
569
|
-
profile:
|
|
570
|
-
website:
|
|
571
|
-
gender:
|
|
572
|
-
birthdate:
|
|
573
|
-
zoneinfo:
|
|
574
|
-
created_at:
|
|
575
|
-
updated_at:
|
|
565
|
+
app_metadata: JSON.stringify(n.app_metadata || {}),
|
|
566
|
+
user_metadata: JSON.stringify(n.user_metadata || {}),
|
|
567
|
+
middle_name: n.middle_name,
|
|
568
|
+
preferred_username: n.preferred_username,
|
|
569
|
+
profile: n.profile,
|
|
570
|
+
website: n.website,
|
|
571
|
+
gender: n.gender,
|
|
572
|
+
birthdate: n.birthdate,
|
|
573
|
+
zoneinfo: n.zoneinfo,
|
|
574
|
+
created_at: r,
|
|
575
|
+
updated_at: r
|
|
576
576
|
};
|
|
577
|
-
|
|
577
|
+
n.email && (a.GSI1PK = p.gsi1pk(t, n.email), a.GSI1SK = p.gsi1sk()), a.GSI2PK = p.gsi2pk(t, n.connection), a.GSI2SK = p.gsi2sk(i);
|
|
578
578
|
try {
|
|
579
|
-
if (
|
|
580
|
-
let
|
|
581
|
-
PK:
|
|
582
|
-
SK:
|
|
579
|
+
if (n.password) {
|
|
580
|
+
let o = d(), s = {
|
|
581
|
+
PK: b.pk(t, i),
|
|
582
|
+
SK: b.sk(o),
|
|
583
583
|
entityType: "PASSWORD",
|
|
584
|
-
id:
|
|
585
|
-
tenant_id:
|
|
586
|
-
user_id:
|
|
587
|
-
password:
|
|
588
|
-
algorithm:
|
|
584
|
+
id: o,
|
|
585
|
+
tenant_id: t,
|
|
586
|
+
user_id: i,
|
|
587
|
+
password: n.password.hash,
|
|
588
|
+
algorithm: n.password.algorithm,
|
|
589
589
|
is_current: !0,
|
|
590
|
-
created_at:
|
|
591
|
-
updated_at:
|
|
590
|
+
created_at: r,
|
|
591
|
+
updated_at: r
|
|
592
592
|
};
|
|
593
|
-
await
|
|
593
|
+
await We(e, [{
|
|
594
594
|
type: "put",
|
|
595
|
-
item:
|
|
595
|
+
item: a,
|
|
596
596
|
conditionExpression: "attribute_not_exists(PK)"
|
|
597
597
|
}, {
|
|
598
598
|
type: "put",
|
|
599
|
-
item:
|
|
599
|
+
item: s
|
|
600
600
|
}]);
|
|
601
|
-
} else await K(
|
|
601
|
+
} else await K(e, a, { conditionExpression: "attribute_not_exists(PK)" });
|
|
602
602
|
} catch (e) {
|
|
603
603
|
throw e.name === "ConditionalCheckFailedException" || e.name === "TransactionCanceledException" && (e.CancellationReasons || []).some((e) => e?.Code === "ConditionalCheckFailed") ? new Pe(409, { message: "User already exists" }) : e;
|
|
604
604
|
}
|
|
605
|
-
return
|
|
605
|
+
return Xe(a);
|
|
606
606
|
};
|
|
607
607
|
return {
|
|
608
|
-
create:
|
|
609
|
-
rawCreate:
|
|
610
|
-
async get(
|
|
611
|
-
let [r, i] = await Promise.all([G(
|
|
612
|
-
return r ?
|
|
613
|
-
},
|
|
614
|
-
async list(
|
|
615
|
-
let r = await Y(
|
|
608
|
+
create: t,
|
|
609
|
+
rawCreate: t,
|
|
610
|
+
async get(t, n) {
|
|
611
|
+
let [r, i] = await Promise.all([G(e, p.pk(t), p.sk(n)), J(e, p.pk(t), { skPrefix: "USER#" }).then((e) => e.items.filter((e) => e.linked_to === n))]);
|
|
612
|
+
return r ? Xe(r, i) : null;
|
|
613
|
+
},
|
|
614
|
+
async list(t, n = {}) {
|
|
615
|
+
let r = await Y(e, p.pk(t), n, { skPrefix: "USER#" }), i = r.items.filter((e) => !e.linked_to), a = r.items.filter((e) => e.linked_to);
|
|
616
616
|
return {
|
|
617
|
-
users: i.map((e) =>
|
|
617
|
+
users: i.map((e) => Xe(e, a.filter((t) => t.linked_to === e.user_id))),
|
|
618
618
|
start: r.start,
|
|
619
619
|
limit: r.limit,
|
|
620
620
|
length: r.length
|
|
621
621
|
};
|
|
622
622
|
},
|
|
623
|
-
async update(
|
|
623
|
+
async update(t, n, r) {
|
|
624
624
|
let i = {
|
|
625
625
|
...r,
|
|
626
626
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
627
627
|
};
|
|
628
|
-
return 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)), delete i.user_id, delete i.identities, X(
|
|
628
|
+
return 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)), delete i.user_id, delete i.identities, X(e, p.pk(t), p.sk(n), i);
|
|
629
629
|
},
|
|
630
|
-
async remove(
|
|
631
|
-
return q(
|
|
630
|
+
async remove(t, n) {
|
|
631
|
+
return q(e, p.pk(t), p.sk(n));
|
|
632
632
|
},
|
|
633
|
-
async unlink(
|
|
633
|
+
async unlink(t, n, r, i) {
|
|
634
634
|
let a = `${r}|${i}`;
|
|
635
|
-
return q(
|
|
635
|
+
return q(e, p.pk(t), p.sk(a));
|
|
636
636
|
}
|
|
637
637
|
};
|
|
638
638
|
}
|
|
639
639
|
//#endregion
|
|
640
640
|
//#region src/adapters/sessions.ts
|
|
641
|
-
function
|
|
641
|
+
function Qe(e) {
|
|
642
642
|
let { tenant_id: t, ...n } = Z(e), r = Q({
|
|
643
643
|
...n,
|
|
644
644
|
device: JSON.parse(e.device || "{}"),
|
|
@@ -646,14 +646,14 @@ function Ze(e) {
|
|
|
646
646
|
});
|
|
647
647
|
return be.parse(r);
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function $e(e) {
|
|
650
650
|
return {
|
|
651
651
|
async create(t, n) {
|
|
652
652
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
653
|
-
PK:
|
|
654
|
-
SK:
|
|
655
|
-
GSI1PK:
|
|
656
|
-
GSI1SK:
|
|
653
|
+
PK: m.pk(t),
|
|
654
|
+
SK: m.sk(n.id),
|
|
655
|
+
GSI1PK: m.gsi1pk(t, n.user_id),
|
|
656
|
+
GSI1SK: m.gsi1sk(n.id),
|
|
657
657
|
entityType: "SESSION",
|
|
658
658
|
tenant_id: t,
|
|
659
659
|
id: n.id,
|
|
@@ -670,16 +670,16 @@ function Qe(e) {
|
|
|
670
670
|
created_at: r,
|
|
671
671
|
updated_at: r
|
|
672
672
|
};
|
|
673
|
-
return n.expires_at && (i.ttl = Math.floor(new Date(n.expires_at).getTime() / 1e3)), await K(e, i),
|
|
673
|
+
return n.expires_at && (i.ttl = Math.floor(new Date(n.expires_at).getTime() / 1e3)), await K(e, i), Qe(i);
|
|
674
674
|
},
|
|
675
675
|
async get(t, n) {
|
|
676
|
-
let r = await G(e,
|
|
677
|
-
return r ?
|
|
676
|
+
let r = await G(e, m.pk(t), m.sk(n));
|
|
677
|
+
return r ? Qe(r) : null;
|
|
678
678
|
},
|
|
679
679
|
async list(t, n = {}) {
|
|
680
|
-
let r = await Y(e,
|
|
680
|
+
let r = await Y(e, m.pk(t), n, { skPrefix: "SESSION#" });
|
|
681
681
|
return {
|
|
682
|
-
sessions: r.items.map(
|
|
682
|
+
sessions: r.items.map(Qe),
|
|
683
683
|
start: r.start,
|
|
684
684
|
limit: r.limit,
|
|
685
685
|
length: r.length
|
|
@@ -690,70 +690,70 @@ function Qe(e) {
|
|
|
690
690
|
...r,
|
|
691
691
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
692
692
|
};
|
|
693
|
-
return r.device !== void 0 && (i.device = JSON.stringify(r.device)), r.clients !== void 0 && (i.clients = JSON.stringify(r.clients)), r.expires_at && (i.ttl = Math.floor(new Date(r.expires_at).getTime() / 1e3)), delete i.id, X(e,
|
|
693
|
+
return r.device !== void 0 && (i.device = JSON.stringify(r.device)), r.clients !== void 0 && (i.clients = JSON.stringify(r.clients)), r.expires_at && (i.ttl = Math.floor(new Date(r.expires_at).getTime() / 1e3)), delete i.id, X(e, m.pk(t), m.sk(n), i);
|
|
694
694
|
},
|
|
695
695
|
async remove(t, n) {
|
|
696
|
-
return q(e,
|
|
696
|
+
return q(e, m.pk(t), m.sk(n));
|
|
697
697
|
}
|
|
698
698
|
};
|
|
699
699
|
}
|
|
700
700
|
//#endregion
|
|
701
701
|
//#region src/adapters/passwords.ts
|
|
702
|
-
function
|
|
702
|
+
function et(e) {
|
|
703
703
|
let { tenant_id: t, ...n } = Z(e);
|
|
704
704
|
return me.parse(Q(n));
|
|
705
705
|
}
|
|
706
|
-
function
|
|
706
|
+
function tt(e) {
|
|
707
707
|
return {
|
|
708
|
-
async create(
|
|
709
|
-
let
|
|
710
|
-
for (let
|
|
708
|
+
async create(t, n) {
|
|
709
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = d(), a = await this.list(t, n.user_id);
|
|
710
|
+
for (let i of a) i.is_current && await X(e, b.pk(t, n.user_id), b.sk(i.id), {
|
|
711
711
|
is_current: !1,
|
|
712
|
-
updated_at:
|
|
712
|
+
updated_at: r
|
|
713
713
|
});
|
|
714
|
-
let
|
|
715
|
-
PK:
|
|
716
|
-
SK:
|
|
714
|
+
let o = {
|
|
715
|
+
PK: b.pk(t, n.user_id),
|
|
716
|
+
SK: b.sk(i),
|
|
717
717
|
entityType: "PASSWORD",
|
|
718
|
-
id:
|
|
719
|
-
tenant_id:
|
|
720
|
-
user_id:
|
|
721
|
-
password:
|
|
722
|
-
algorithm:
|
|
718
|
+
id: i,
|
|
719
|
+
tenant_id: t,
|
|
720
|
+
user_id: n.user_id,
|
|
721
|
+
password: n.password,
|
|
722
|
+
algorithm: n.algorithm || "bcrypt",
|
|
723
723
|
is_current: !0,
|
|
724
|
-
created_at:
|
|
725
|
-
updated_at:
|
|
724
|
+
created_at: r,
|
|
725
|
+
updated_at: r
|
|
726
726
|
};
|
|
727
|
-
return await K(
|
|
727
|
+
return await K(e, o), et(o);
|
|
728
728
|
},
|
|
729
729
|
async update(e, t) {
|
|
730
730
|
return await this.create(e, t), !0;
|
|
731
731
|
},
|
|
732
|
-
async get(
|
|
733
|
-
let { items: r } = await J(
|
|
734
|
-
return i ?
|
|
732
|
+
async get(t, n) {
|
|
733
|
+
let { items: r } = await J(e, b.pk(t, n), { skPrefix: b.skPrefix() }), i = r.find((e) => e.is_current);
|
|
734
|
+
return i ? et(i) : null;
|
|
735
735
|
},
|
|
736
|
-
async list(
|
|
737
|
-
let { items: i } = await J(
|
|
738
|
-
skPrefix:
|
|
736
|
+
async list(t, n, r) {
|
|
737
|
+
let { items: i } = await J(e, b.pk(t, n), {
|
|
738
|
+
skPrefix: b.skPrefix(),
|
|
739
739
|
limit: r
|
|
740
740
|
});
|
|
741
|
-
return i.map(
|
|
741
|
+
return i.map(et);
|
|
742
742
|
}
|
|
743
743
|
};
|
|
744
744
|
}
|
|
745
745
|
//#endregion
|
|
746
746
|
//#region src/adapters/codes.ts
|
|
747
|
-
function
|
|
747
|
+
function nt(e) {
|
|
748
748
|
let { tenant_id: t, ...n } = Z(e);
|
|
749
749
|
return s.parse(Q(n));
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function rt(e) {
|
|
752
752
|
return {
|
|
753
753
|
async create(t, n) {
|
|
754
754
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
755
|
-
PK:
|
|
756
|
-
SK:
|
|
755
|
+
PK: y.pk(t),
|
|
756
|
+
SK: y.sk(n.code_id, n.code_type),
|
|
757
757
|
entityType: "CODE",
|
|
758
758
|
code_id: n.code_id,
|
|
759
759
|
tenant_id: t,
|
|
@@ -772,31 +772,31 @@ function nt(e) {
|
|
|
772
772
|
created_at: r,
|
|
773
773
|
updated_at: r
|
|
774
774
|
};
|
|
775
|
-
return i.ttl = Math.floor(new Date(n.expires_at).getTime() / 1e3), await K(e, i),
|
|
775
|
+
return i.ttl = Math.floor(new Date(n.expires_at).getTime() / 1e3), await K(e, i), nt(i);
|
|
776
776
|
},
|
|
777
777
|
async get(t, n, r) {
|
|
778
|
-
let i = await G(e,
|
|
779
|
-
return i ?
|
|
778
|
+
let i = await G(e, y.pk(t), y.sk(n, r));
|
|
779
|
+
return i ? nt(i) : null;
|
|
780
780
|
},
|
|
781
781
|
async list(t, n = {}) {
|
|
782
|
-
let r = await Y(e,
|
|
782
|
+
let r = await Y(e, y.pk(t), n, { skPrefix: "CODE#" });
|
|
783
783
|
return {
|
|
784
|
-
codes: r.items.map(
|
|
784
|
+
codes: r.items.map(nt),
|
|
785
785
|
start: r.start,
|
|
786
786
|
limit: r.limit,
|
|
787
787
|
length: r.length
|
|
788
788
|
};
|
|
789
789
|
},
|
|
790
790
|
async used(t, n) {
|
|
791
|
-
let { items: r } = await J(e,
|
|
792
|
-
skPrefix:
|
|
791
|
+
let { items: r } = await J(e, y.pk(t), {
|
|
792
|
+
skPrefix: y.skPrefixByCodeId(n),
|
|
793
793
|
limit: 1
|
|
794
794
|
}), i = r[0];
|
|
795
|
-
return i ? X(e,
|
|
795
|
+
return i ? X(e, y.pk(t), y.sk(n, i.code_type), { used_at: (/* @__PURE__ */ new Date()).toISOString() }) : !1;
|
|
796
796
|
},
|
|
797
797
|
async consume(t, n) {
|
|
798
|
-
let { items: r } = await J(e,
|
|
799
|
-
skPrefix:
|
|
798
|
+
let { items: r } = await J(e, y.pk(t), {
|
|
799
|
+
skPrefix: y.skPrefixByCodeId(n),
|
|
800
800
|
limit: 1
|
|
801
801
|
}), i = r[0];
|
|
802
802
|
if (!i) return !1;
|
|
@@ -804,8 +804,8 @@ function nt(e) {
|
|
|
804
804
|
return await e.client.send(new Ne({
|
|
805
805
|
TableName: e.tableName,
|
|
806
806
|
Key: {
|
|
807
|
-
PK:
|
|
808
|
-
SK:
|
|
807
|
+
PK: y.pk(t),
|
|
808
|
+
SK: y.sk(n, i.code_type)
|
|
809
809
|
},
|
|
810
810
|
UpdateExpression: "SET #used_at = :now",
|
|
811
811
|
ConditionExpression: "attribute_not_exists(#used_at) OR #used_at = :null",
|
|
@@ -821,11 +821,11 @@ function nt(e) {
|
|
|
821
821
|
}
|
|
822
822
|
},
|
|
823
823
|
async remove(t, n) {
|
|
824
|
-
let { items: r } = await J(e,
|
|
825
|
-
skPrefix:
|
|
824
|
+
let { items: r } = await J(e, y.pk(t), {
|
|
825
|
+
skPrefix: y.skPrefixByCodeId(n),
|
|
826
826
|
limit: 1
|
|
827
827
|
}), i = r[0];
|
|
828
|
-
return i ? q(e,
|
|
828
|
+
return i ? q(e, y.pk(t), y.sk(n, i.code_type)) : !1;
|
|
829
829
|
},
|
|
830
830
|
async cleanup() {
|
|
831
831
|
return 0;
|
|
@@ -834,7 +834,7 @@ function nt(e) {
|
|
|
834
834
|
}
|
|
835
835
|
//#endregion
|
|
836
836
|
//#region src/adapters/clients.ts
|
|
837
|
-
function
|
|
837
|
+
function it(e) {
|
|
838
838
|
let { tenant_id: t, ...n } = Z(e), r = Q({
|
|
839
839
|
...n,
|
|
840
840
|
callbacks: e.callbacks ? JSON.parse(e.callbacks) : void 0,
|
|
@@ -862,86 +862,86 @@ function rt(e) {
|
|
|
862
862
|
});
|
|
863
863
|
return o.parse(r);
|
|
864
864
|
}
|
|
865
|
-
function
|
|
865
|
+
function at(e) {
|
|
866
866
|
return {
|
|
867
|
-
...
|
|
867
|
+
...it(e),
|
|
868
868
|
tenant_id: e.tenant_id
|
|
869
869
|
};
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function ot(e) {
|
|
872
872
|
return {
|
|
873
|
-
async create(
|
|
874
|
-
let
|
|
875
|
-
PK:
|
|
876
|
-
SK:
|
|
873
|
+
async create(t, n) {
|
|
874
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = n.client_id ?? d(), a = {
|
|
875
|
+
PK: g.pk(t),
|
|
876
|
+
SK: g.sk(i),
|
|
877
877
|
entityType: "CLIENT",
|
|
878
|
-
tenant_id:
|
|
879
|
-
client_id:
|
|
880
|
-
name:
|
|
881
|
-
client_secret:
|
|
882
|
-
description:
|
|
883
|
-
logo_uri:
|
|
884
|
-
app_type:
|
|
885
|
-
token_endpoint_auth_method:
|
|
886
|
-
initiate_login_uri:
|
|
887
|
-
cross_origin_loc:
|
|
888
|
-
custom_login_page:
|
|
889
|
-
custom_login_page_preview:
|
|
890
|
-
form_template:
|
|
891
|
-
organization_usage:
|
|
892
|
-
organization_require_behavior:
|
|
893
|
-
compliance_level:
|
|
894
|
-
par_request_expiry:
|
|
895
|
-
global:
|
|
896
|
-
is_first_party:
|
|
897
|
-
oidc_conformant:
|
|
898
|
-
auth0_conformant:
|
|
899
|
-
sso:
|
|
900
|
-
sso_disabled:
|
|
901
|
-
cross_origin_authentication:
|
|
902
|
-
custom_login_page_on:
|
|
903
|
-
require_pushed_authorization_requests:
|
|
904
|
-
require_proof_of_possession:
|
|
905
|
-
callbacks:
|
|
906
|
-
allowed_origins:
|
|
907
|
-
web_origins:
|
|
908
|
-
client_aliases:
|
|
909
|
-
allowed_clients:
|
|
910
|
-
connections:
|
|
911
|
-
allowed_logout_urls:
|
|
912
|
-
session_transfer:
|
|
913
|
-
oidc_logout:
|
|
914
|
-
grant_types:
|
|
915
|
-
jwt_configuration:
|
|
916
|
-
signing_keys:
|
|
917
|
-
encryption_key:
|
|
918
|
-
addons:
|
|
919
|
-
client_metadata:
|
|
920
|
-
mobile:
|
|
921
|
-
native_social_login:
|
|
922
|
-
refresh_token:
|
|
923
|
-
default_organization:
|
|
924
|
-
client_authentication_methods:
|
|
925
|
-
signed_request_object:
|
|
926
|
-
token_quota:
|
|
927
|
-
created_at:
|
|
928
|
-
updated_at:
|
|
878
|
+
tenant_id: t,
|
|
879
|
+
client_id: i,
|
|
880
|
+
name: n.name,
|
|
881
|
+
client_secret: n.client_secret,
|
|
882
|
+
description: n.description,
|
|
883
|
+
logo_uri: n.logo_uri,
|
|
884
|
+
app_type: n.app_type,
|
|
885
|
+
token_endpoint_auth_method: n.token_endpoint_auth_method,
|
|
886
|
+
initiate_login_uri: n.initiate_login_uri,
|
|
887
|
+
cross_origin_loc: n.cross_origin_loc,
|
|
888
|
+
custom_login_page: n.custom_login_page,
|
|
889
|
+
custom_login_page_preview: n.custom_login_page_preview,
|
|
890
|
+
form_template: n.form_template,
|
|
891
|
+
organization_usage: n.organization_usage,
|
|
892
|
+
organization_require_behavior: n.organization_require_behavior,
|
|
893
|
+
compliance_level: n.compliance_level,
|
|
894
|
+
par_request_expiry: n.par_request_expiry,
|
|
895
|
+
global: n.global ?? !1,
|
|
896
|
+
is_first_party: n.is_first_party ?? !1,
|
|
897
|
+
oidc_conformant: n.oidc_conformant ?? !0,
|
|
898
|
+
auth0_conformant: n.auth0_conformant ?? !0,
|
|
899
|
+
sso: n.sso,
|
|
900
|
+
sso_disabled: n.sso_disabled,
|
|
901
|
+
cross_origin_authentication: n.cross_origin_authentication,
|
|
902
|
+
custom_login_page_on: n.custom_login_page_on,
|
|
903
|
+
require_pushed_authorization_requests: n.require_pushed_authorization_requests,
|
|
904
|
+
require_proof_of_possession: n.require_proof_of_possession,
|
|
905
|
+
callbacks: n.callbacks ? JSON.stringify(n.callbacks) : void 0,
|
|
906
|
+
allowed_origins: n.allowed_origins ? JSON.stringify(n.allowed_origins) : void 0,
|
|
907
|
+
web_origins: n.web_origins ? JSON.stringify(n.web_origins) : void 0,
|
|
908
|
+
client_aliases: n.client_aliases ? JSON.stringify(n.client_aliases) : void 0,
|
|
909
|
+
allowed_clients: n.allowed_clients ? JSON.stringify(n.allowed_clients) : void 0,
|
|
910
|
+
connections: n.connections ? JSON.stringify(n.connections) : void 0,
|
|
911
|
+
allowed_logout_urls: n.allowed_logout_urls ? JSON.stringify(n.allowed_logout_urls) : void 0,
|
|
912
|
+
session_transfer: n.session_transfer ? JSON.stringify(n.session_transfer) : void 0,
|
|
913
|
+
oidc_logout: n.oidc_logout ? JSON.stringify(n.oidc_logout) : void 0,
|
|
914
|
+
grant_types: n.grant_types ? JSON.stringify(n.grant_types) : void 0,
|
|
915
|
+
jwt_configuration: n.jwt_configuration ? JSON.stringify(n.jwt_configuration) : void 0,
|
|
916
|
+
signing_keys: n.signing_keys ? JSON.stringify(n.signing_keys) : void 0,
|
|
917
|
+
encryption_key: n.encryption_key ? JSON.stringify(n.encryption_key) : void 0,
|
|
918
|
+
addons: n.addons ? JSON.stringify(n.addons) : void 0,
|
|
919
|
+
client_metadata: n.client_metadata ? JSON.stringify(n.client_metadata) : void 0,
|
|
920
|
+
mobile: n.mobile ? JSON.stringify(n.mobile) : void 0,
|
|
921
|
+
native_social_login: n.native_social_login ? JSON.stringify(n.native_social_login) : void 0,
|
|
922
|
+
refresh_token: n.refresh_token ? JSON.stringify(n.refresh_token) : void 0,
|
|
923
|
+
default_organization: n.default_organization ? JSON.stringify(n.default_organization) : void 0,
|
|
924
|
+
client_authentication_methods: n.client_authentication_methods ? JSON.stringify(n.client_authentication_methods) : void 0,
|
|
925
|
+
signed_request_object: n.signed_request_object ? JSON.stringify(n.signed_request_object) : void 0,
|
|
926
|
+
token_quota: n.token_quota ? JSON.stringify(n.token_quota) : void 0,
|
|
927
|
+
created_at: r,
|
|
928
|
+
updated_at: r
|
|
929
929
|
};
|
|
930
|
-
return await K(
|
|
930
|
+
return await K(e, a), it(a);
|
|
931
931
|
},
|
|
932
|
-
async get(
|
|
933
|
-
let r = await G(
|
|
934
|
-
return r ?
|
|
932
|
+
async get(t, n) {
|
|
933
|
+
let r = await G(e, g.pk(t), g.sk(n));
|
|
934
|
+
return r ? it(r) : null;
|
|
935
935
|
},
|
|
936
|
-
async getByClientId(
|
|
937
|
-
let n = await G(
|
|
936
|
+
async getByClientId(t) {
|
|
937
|
+
let n = await G(e, Ve.pk(), Ve.sk(t));
|
|
938
938
|
if (!n?.tenant_id) return null;
|
|
939
|
-
let r = await G(
|
|
940
|
-
return r ?
|
|
939
|
+
let r = await G(e, g.pk(n.tenant_id), g.sk(t));
|
|
940
|
+
return r ? at(r) : null;
|
|
941
941
|
},
|
|
942
|
-
async list(
|
|
943
|
-
let r = await Y(
|
|
944
|
-
return
|
|
942
|
+
async list(t, n = {}) {
|
|
943
|
+
let r = await Y(e, g.pk(t), n, { skPrefix: "CLIENT#" }), i = r.items.map(it);
|
|
944
|
+
return Ge(n) ? {
|
|
945
945
|
clients: i,
|
|
946
946
|
totals: {
|
|
947
947
|
start: r.start,
|
|
@@ -958,7 +958,7 @@ function at(t) {
|
|
|
958
958
|
}
|
|
959
959
|
} : { clients: i };
|
|
960
960
|
},
|
|
961
|
-
async update(
|
|
961
|
+
async update(t, n, r) {
|
|
962
962
|
let i = {
|
|
963
963
|
...r,
|
|
964
964
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -987,16 +987,16 @@ function at(t) {
|
|
|
987
987
|
"signed_request_object",
|
|
988
988
|
"token_quota"
|
|
989
989
|
]) r[e] !== void 0 && (i[e] = JSON.stringify(r[e]));
|
|
990
|
-
return delete i.client_id, X(
|
|
990
|
+
return delete i.client_id, X(e, g.pk(t), g.sk(n), i);
|
|
991
991
|
},
|
|
992
|
-
async remove(
|
|
993
|
-
return q(
|
|
992
|
+
async remove(t, n) {
|
|
993
|
+
return q(e, g.pk(t), g.sk(n));
|
|
994
994
|
}
|
|
995
995
|
};
|
|
996
996
|
}
|
|
997
997
|
//#endregion
|
|
998
998
|
//#region src/adapters/clientGrants.ts
|
|
999
|
-
function
|
|
999
|
+
function st(e) {
|
|
1000
1000
|
let { tenant_id: t, ...n } = Z(e), r = Q({
|
|
1001
1001
|
...n,
|
|
1002
1002
|
scope: e.scope ? JSON.parse(e.scope) : void 0,
|
|
@@ -1004,74 +1004,74 @@ function ot(e) {
|
|
|
1004
1004
|
});
|
|
1005
1005
|
return i.parse(r);
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1007
|
+
function ct(e) {
|
|
1008
1008
|
return {
|
|
1009
|
-
async create(
|
|
1010
|
-
let
|
|
1011
|
-
PK:
|
|
1012
|
-
SK:
|
|
1013
|
-
GSI1PK:
|
|
1014
|
-
GSI1SK:
|
|
1009
|
+
async create(t, n) {
|
|
1010
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = d(), a = {
|
|
1011
|
+
PK: _.pk(t),
|
|
1012
|
+
SK: _.sk(i),
|
|
1013
|
+
GSI1PK: _.gsi1pk(t, n.client_id),
|
|
1014
|
+
GSI1SK: _.gsi1sk(n.audience),
|
|
1015
1015
|
entityType: "CLIENT_GRANT",
|
|
1016
|
-
tenant_id:
|
|
1017
|
-
id:
|
|
1018
|
-
client_id:
|
|
1019
|
-
audience:
|
|
1020
|
-
scope:
|
|
1021
|
-
organization_usage:
|
|
1022
|
-
allow_any_organization:
|
|
1023
|
-
is_system:
|
|
1024
|
-
subject_type:
|
|
1025
|
-
authorization_details_types:
|
|
1026
|
-
created_at:
|
|
1027
|
-
updated_at:
|
|
1016
|
+
tenant_id: t,
|
|
1017
|
+
id: i,
|
|
1018
|
+
client_id: n.client_id,
|
|
1019
|
+
audience: n.audience,
|
|
1020
|
+
scope: n.scope ? JSON.stringify(n.scope) : void 0,
|
|
1021
|
+
organization_usage: n.organization_usage,
|
|
1022
|
+
allow_any_organization: n.allow_any_organization,
|
|
1023
|
+
is_system: n.is_system,
|
|
1024
|
+
subject_type: n.subject_type,
|
|
1025
|
+
authorization_details_types: n.authorization_details_types ? JSON.stringify(n.authorization_details_types) : void 0,
|
|
1026
|
+
created_at: r,
|
|
1027
|
+
updated_at: r
|
|
1028
1028
|
};
|
|
1029
|
-
return await K(
|
|
1029
|
+
return await K(e, a), st(a);
|
|
1030
1030
|
},
|
|
1031
|
-
async get(
|
|
1032
|
-
let r = await G(
|
|
1033
|
-
return r ?
|
|
1031
|
+
async get(t, n) {
|
|
1032
|
+
let r = await G(e, _.pk(t), _.sk(n));
|
|
1033
|
+
return r ? st(r) : null;
|
|
1034
1034
|
},
|
|
1035
|
-
async list(
|
|
1036
|
-
let r = await Y(
|
|
1035
|
+
async list(t, n = {}) {
|
|
1036
|
+
let r = await Y(e, _.pk(t), n, { skPrefix: "CLIENT_GRANT#" });
|
|
1037
1037
|
return {
|
|
1038
|
-
client_grants: r.items.map(
|
|
1038
|
+
client_grants: r.items.map(st),
|
|
1039
1039
|
start: r.start,
|
|
1040
1040
|
limit: r.limit,
|
|
1041
1041
|
length: r.length,
|
|
1042
1042
|
next: r.next
|
|
1043
1043
|
};
|
|
1044
1044
|
},
|
|
1045
|
-
async update(
|
|
1045
|
+
async update(t, n, r) {
|
|
1046
1046
|
let i = {
|
|
1047
1047
|
...r,
|
|
1048
1048
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1049
1049
|
};
|
|
1050
|
-
return r.scope !== void 0 && (i.scope = JSON.stringify(r.scope)), r.authorization_details_types !== void 0 && (i.authorization_details_types = JSON.stringify(r.authorization_details_types)), delete i.id, X(
|
|
1050
|
+
return r.scope !== void 0 && (i.scope = JSON.stringify(r.scope)), r.authorization_details_types !== void 0 && (i.authorization_details_types = JSON.stringify(r.authorization_details_types)), delete i.id, X(e, _.pk(t), _.sk(n), i);
|
|
1051
1051
|
},
|
|
1052
|
-
async remove(
|
|
1053
|
-
return q(
|
|
1052
|
+
async remove(t, n) {
|
|
1053
|
+
return q(e, _.pk(t), _.sk(n));
|
|
1054
1054
|
}
|
|
1055
1055
|
};
|
|
1056
1056
|
}
|
|
1057
1057
|
//#endregion
|
|
1058
1058
|
//#region src/adapters/clientConnections.ts
|
|
1059
|
-
function
|
|
1059
|
+
function lt(e) {
|
|
1060
1060
|
let { tenant_id: t, ...n } = Z(e), r = Q({
|
|
1061
1061
|
...n,
|
|
1062
1062
|
options: e.options ? JSON.parse(e.options) : void 0
|
|
1063
1063
|
});
|
|
1064
1064
|
return c.parse(r);
|
|
1065
1065
|
}
|
|
1066
|
-
function
|
|
1066
|
+
function ut(e) {
|
|
1067
1067
|
return {
|
|
1068
1068
|
async listByClient(t, n) {
|
|
1069
1069
|
let { items: r } = await J(e, V.pk(t, n), { skPrefix: V.skPrefix() });
|
|
1070
1070
|
r.sort((e, t) => e.order - t.order);
|
|
1071
1071
|
let i = [];
|
|
1072
1072
|
for (let n of r) {
|
|
1073
|
-
let r = await G(e,
|
|
1074
|
-
r && i.push(
|
|
1073
|
+
let r = await G(e, v.pk(t), v.sk(n.connection_id));
|
|
1074
|
+
r && i.push(lt(r));
|
|
1075
1075
|
}
|
|
1076
1076
|
return i;
|
|
1077
1077
|
},
|
|
@@ -1139,14 +1139,14 @@ function lt(e) {
|
|
|
1139
1139
|
}
|
|
1140
1140
|
//#endregion
|
|
1141
1141
|
//#region src/adapters/clientRegistrationTokens.ts
|
|
1142
|
-
function
|
|
1142
|
+
function dt(e) {
|
|
1143
1143
|
let { tenant_id: t, constraints: n, ...r } = Z(e), i = Q({
|
|
1144
1144
|
...r,
|
|
1145
1145
|
constraints: n ? JSON.parse(n) : void 0
|
|
1146
1146
|
});
|
|
1147
1147
|
return a.parse(i);
|
|
1148
1148
|
}
|
|
1149
|
-
function
|
|
1149
|
+
function ft(e) {
|
|
1150
1150
|
return {
|
|
1151
1151
|
async create(t, n) {
|
|
1152
1152
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
@@ -1167,11 +1167,11 @@ function dt(e) {
|
|
|
1167
1167
|
created_at: r,
|
|
1168
1168
|
updated_at: r
|
|
1169
1169
|
};
|
|
1170
|
-
return n.client_id && (i.GSI2PK = U.gsi2pk(t, n.client_id), i.GSI2SK = U.gsi2sk(n.id)), n.expires_at && (i.ttl = Math.floor(new Date(n.expires_at).getTime() / 1e3)), await K(e, i),
|
|
1170
|
+
return n.client_id && (i.GSI2PK = U.gsi2pk(t, n.client_id), i.GSI2SK = U.gsi2sk(n.id)), n.expires_at && (i.ttl = Math.floor(new Date(n.expires_at).getTime() / 1e3)), await K(e, i), dt(i);
|
|
1171
1171
|
},
|
|
1172
1172
|
async get(t, n) {
|
|
1173
1173
|
let r = await G(e, U.pk(t), U.sk(n));
|
|
1174
|
-
return r ?
|
|
1174
|
+
return r ? dt(r) : null;
|
|
1175
1175
|
},
|
|
1176
1176
|
async getByHash(t, n) {
|
|
1177
1177
|
let r = await J(e, U.gsi1pk(t, n), {
|
|
@@ -1179,14 +1179,14 @@ function dt(e) {
|
|
|
1179
1179
|
skValue: U.gsi1sk(),
|
|
1180
1180
|
limit: 1
|
|
1181
1181
|
});
|
|
1182
|
-
return r.items[0] ?
|
|
1182
|
+
return r.items[0] ? dt(r.items[0]) : null;
|
|
1183
1183
|
},
|
|
1184
1184
|
async listByClient(t, n) {
|
|
1185
1185
|
return (await J(e, U.gsi2pk(t, n), {
|
|
1186
1186
|
indexName: "GSI2",
|
|
1187
1187
|
skPrefix: U.skPrefix(),
|
|
1188
1188
|
scanIndexForward: !1
|
|
1189
|
-
})).items.map(
|
|
1189
|
+
})).items.map(dt);
|
|
1190
1190
|
},
|
|
1191
1191
|
async markUsed(t, n, r) {
|
|
1192
1192
|
try {
|
|
@@ -1272,7 +1272,7 @@ function dt(e) {
|
|
|
1272
1272
|
}
|
|
1273
1273
|
//#endregion
|
|
1274
1274
|
//#region src/adapters/connections.ts
|
|
1275
|
-
function
|
|
1275
|
+
function pt(e) {
|
|
1276
1276
|
let { tenant_id: t, is_system: n, ...r } = Z(e), i = Q({
|
|
1277
1277
|
...r,
|
|
1278
1278
|
options: e.options ? JSON.parse(e.options) : void 0,
|
|
@@ -1280,106 +1280,106 @@ function ft(e) {
|
|
|
1280
1280
|
});
|
|
1281
1281
|
return c.parse(i);
|
|
1282
1282
|
}
|
|
1283
|
-
function
|
|
1283
|
+
function mt(e) {
|
|
1284
1284
|
return {
|
|
1285
|
-
async create(
|
|
1286
|
-
let
|
|
1287
|
-
PK:
|
|
1288
|
-
SK:
|
|
1289
|
-
GSI1PK:
|
|
1290
|
-
GSI1SK:
|
|
1285
|
+
async create(t, n) {
|
|
1286
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = n.id || d(), a = {
|
|
1287
|
+
PK: v.pk(t),
|
|
1288
|
+
SK: v.sk(i),
|
|
1289
|
+
GSI1PK: v.gsi1pk(t, n.name),
|
|
1290
|
+
GSI1SK: v.gsi1sk(),
|
|
1291
1291
|
entityType: "CONNECTION",
|
|
1292
|
-
tenant_id:
|
|
1293
|
-
id:
|
|
1294
|
-
name:
|
|
1295
|
-
strategy:
|
|
1296
|
-
options:
|
|
1297
|
-
is_system:
|
|
1298
|
-
created_at:
|
|
1299
|
-
updated_at:
|
|
1292
|
+
tenant_id: t,
|
|
1293
|
+
id: i,
|
|
1294
|
+
name: n.name,
|
|
1295
|
+
strategy: n.strategy,
|
|
1296
|
+
options: n.options ? JSON.stringify(n.options) : void 0,
|
|
1297
|
+
is_system: n.is_system ?? !1,
|
|
1298
|
+
created_at: r,
|
|
1299
|
+
updated_at: r
|
|
1300
1300
|
};
|
|
1301
|
-
return await K(
|
|
1301
|
+
return await K(e, a), pt(a);
|
|
1302
1302
|
},
|
|
1303
|
-
async get(
|
|
1304
|
-
let r = await G(
|
|
1305
|
-
return r ?
|
|
1303
|
+
async get(t, n) {
|
|
1304
|
+
let r = await G(e, v.pk(t), v.sk(n));
|
|
1305
|
+
return r ? pt(r) : null;
|
|
1306
1306
|
},
|
|
1307
|
-
async list(
|
|
1308
|
-
let r = await Y(
|
|
1307
|
+
async list(t, n = {}) {
|
|
1308
|
+
let r = await Y(e, v.pk(t), n, { skPrefix: "CONNECTION#" });
|
|
1309
1309
|
return {
|
|
1310
|
-
connections: r.items.map(
|
|
1310
|
+
connections: r.items.map(pt),
|
|
1311
1311
|
start: r.start,
|
|
1312
1312
|
limit: r.limit,
|
|
1313
1313
|
length: r.length
|
|
1314
1314
|
};
|
|
1315
1315
|
},
|
|
1316
|
-
async update(
|
|
1316
|
+
async update(t, n, r) {
|
|
1317
1317
|
let i = {
|
|
1318
1318
|
...r,
|
|
1319
1319
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1320
1320
|
};
|
|
1321
|
-
return r.options !== void 0 && (i.options = JSON.stringify(r.options)), r.name !== void 0 && (i.GSI1PK =
|
|
1321
|
+
return r.options !== void 0 && (i.options = JSON.stringify(r.options)), r.name !== void 0 && (i.GSI1PK = v.gsi1pk(t, r.name), i.GSI1SK = v.gsi1sk()), delete i.id, X(e, v.pk(t), v.sk(n), i);
|
|
1322
1322
|
},
|
|
1323
|
-
async remove(
|
|
1324
|
-
return q(
|
|
1323
|
+
async remove(t, n) {
|
|
1324
|
+
return q(e, v.pk(t), v.sk(n));
|
|
1325
1325
|
}
|
|
1326
1326
|
};
|
|
1327
1327
|
}
|
|
1328
1328
|
//#endregion
|
|
1329
1329
|
//#region src/adapters/loginSessions.ts
|
|
1330
|
-
function
|
|
1330
|
+
function ht(e) {
|
|
1331
1331
|
let { tenant_id: t, authParams: n, ...r } = Z(e), i = Q({
|
|
1332
1332
|
...r,
|
|
1333
1333
|
authParams: JSON.parse(n)
|
|
1334
1334
|
});
|
|
1335
1335
|
return ue.parse(i);
|
|
1336
1336
|
}
|
|
1337
|
-
function
|
|
1337
|
+
function gt(e) {
|
|
1338
1338
|
return {
|
|
1339
|
-
async create(
|
|
1340
|
-
let
|
|
1341
|
-
PK:
|
|
1342
|
-
SK:
|
|
1339
|
+
async create(n, r) {
|
|
1340
|
+
let i = (/* @__PURE__ */ new Date()).toISOString(), a = d(), o = {
|
|
1341
|
+
PK: h.pk(n),
|
|
1342
|
+
SK: h.sk(a),
|
|
1343
1343
|
entityType: "LOGIN_SESSION",
|
|
1344
|
-
tenant_id:
|
|
1345
|
-
id:
|
|
1346
|
-
csrf_token:
|
|
1347
|
-
authParams: JSON.stringify(
|
|
1348
|
-
expires_at:
|
|
1349
|
-
state:
|
|
1350
|
-
state_data:
|
|
1351
|
-
failure_reason:
|
|
1352
|
-
user_id:
|
|
1353
|
-
auth0Client:
|
|
1354
|
-
deleted_at:
|
|
1355
|
-
ip:
|
|
1356
|
-
useragent:
|
|
1357
|
-
session_id:
|
|
1358
|
-
authorization_url:
|
|
1359
|
-
created_at:
|
|
1360
|
-
updated_at:
|
|
1344
|
+
tenant_id: n,
|
|
1345
|
+
id: a,
|
|
1346
|
+
csrf_token: r.csrf_token,
|
|
1347
|
+
authParams: JSON.stringify(r.authParams),
|
|
1348
|
+
expires_at: r.expires_at,
|
|
1349
|
+
state: r.state ?? t.PENDING,
|
|
1350
|
+
state_data: r.state_data,
|
|
1351
|
+
failure_reason: r.failure_reason,
|
|
1352
|
+
user_id: r.user_id,
|
|
1353
|
+
auth0Client: r.auth0Client,
|
|
1354
|
+
deleted_at: r.deleted_at,
|
|
1355
|
+
ip: r.ip,
|
|
1356
|
+
useragent: r.useragent,
|
|
1357
|
+
session_id: r.session_id,
|
|
1358
|
+
authorization_url: r.authorization_url?.slice(0, 1024),
|
|
1359
|
+
created_at: i,
|
|
1360
|
+
updated_at: i
|
|
1361
1361
|
};
|
|
1362
|
-
return
|
|
1362
|
+
return o.ttl = Math.floor(new Date(r.expires_at).getTime() / 1e3), await K(e, o), ht(o);
|
|
1363
1363
|
},
|
|
1364
|
-
async get(
|
|
1365
|
-
let r = await G(
|
|
1366
|
-
return r ?
|
|
1364
|
+
async get(t, n) {
|
|
1365
|
+
let r = await G(e, h.pk(t), h.sk(n));
|
|
1366
|
+
return r ? ht(r) : null;
|
|
1367
1367
|
},
|
|
1368
|
-
async update(
|
|
1368
|
+
async update(t, n, r) {
|
|
1369
1369
|
let i = {
|
|
1370
1370
|
...r,
|
|
1371
1371
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1372
1372
|
};
|
|
1373
|
-
return r.authParams !== void 0 && (i.authParams = JSON.stringify(r.authParams)), delete i.id, X(
|
|
1373
|
+
return r.authParams !== void 0 && (i.authParams = JSON.stringify(r.authParams)), delete i.id, X(e, h.pk(t), h.sk(n), i);
|
|
1374
1374
|
},
|
|
1375
|
-
async remove(
|
|
1376
|
-
return q(
|
|
1375
|
+
async remove(t, n) {
|
|
1376
|
+
return q(e, h.pk(t), h.sk(n));
|
|
1377
1377
|
}
|
|
1378
1378
|
};
|
|
1379
1379
|
}
|
|
1380
1380
|
//#endregion
|
|
1381
1381
|
//#region src/adapters/branding.ts
|
|
1382
|
-
function
|
|
1382
|
+
function _t(e) {
|
|
1383
1383
|
let { tenant_id: t, ...n } = Z(e), i = Q({
|
|
1384
1384
|
...n,
|
|
1385
1385
|
colors: e.colors ? JSON.parse(e.colors) : void 0,
|
|
@@ -1387,7 +1387,7 @@ function gt(e) {
|
|
|
1387
1387
|
});
|
|
1388
1388
|
return r.parse(i);
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function vt(e) {
|
|
1391
1391
|
return {
|
|
1392
1392
|
async set(t, n) {
|
|
1393
1393
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = await G(e, Re.pk(t), Re.sk());
|
|
@@ -1407,23 +1407,23 @@ function _t(e) {
|
|
|
1407
1407
|
},
|
|
1408
1408
|
async get(t) {
|
|
1409
1409
|
let n = await G(e, Re.pk(t), Re.sk());
|
|
1410
|
-
return n ?
|
|
1410
|
+
return n ? _t(n) : null;
|
|
1411
1411
|
}
|
|
1412
1412
|
};
|
|
1413
1413
|
}
|
|
1414
1414
|
//#endregion
|
|
1415
1415
|
//#region src/adapters/universalLoginTemplates.ts
|
|
1416
|
-
function
|
|
1416
|
+
function yt(e) {
|
|
1417
1417
|
return {
|
|
1418
1418
|
async get(t) {
|
|
1419
|
-
let n = await G(e,
|
|
1419
|
+
let n = await G(e, x.pk(t), x.sk());
|
|
1420
1420
|
return n ? { body: n.body } : null;
|
|
1421
1421
|
},
|
|
1422
1422
|
async set(t, n) {
|
|
1423
|
-
let r = (/* @__PURE__ */ new Date()).toISOString(), i = await G(e,
|
|
1423
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = await G(e, x.pk(t), x.sk());
|
|
1424
1424
|
await K(e, {
|
|
1425
|
-
PK:
|
|
1426
|
-
SK:
|
|
1425
|
+
PK: x.pk(t),
|
|
1426
|
+
SK: x.sk(),
|
|
1427
1427
|
entityType: "UNIVERSAL_LOGIN_TEMPLATE",
|
|
1428
1428
|
tenant_id: t,
|
|
1429
1429
|
body: n.body,
|
|
@@ -1432,7 +1432,7 @@ function vt(e) {
|
|
|
1432
1432
|
});
|
|
1433
1433
|
},
|
|
1434
1434
|
async delete(t) {
|
|
1435
|
-
await q(e,
|
|
1435
|
+
await q(e, x.pk(t), x.sk());
|
|
1436
1436
|
}
|
|
1437
1437
|
};
|
|
1438
1438
|
}
|
|
@@ -1442,7 +1442,7 @@ var $ = {
|
|
|
1442
1442
|
pk: (e) => `TENANT#${e}`,
|
|
1443
1443
|
sk: (e) => `HOOK_CODE#${e}`
|
|
1444
1444
|
};
|
|
1445
|
-
function
|
|
1445
|
+
function bt(e) {
|
|
1446
1446
|
let { tenant_id: t, secrets: n, ...r } = Z(e);
|
|
1447
1447
|
return {
|
|
1448
1448
|
...r,
|
|
@@ -1450,98 +1450,98 @@ function yt(e) {
|
|
|
1450
1450
|
secrets: n ? JSON.parse(n) : void 0
|
|
1451
1451
|
};
|
|
1452
1452
|
}
|
|
1453
|
-
function
|
|
1453
|
+
function xt(e) {
|
|
1454
1454
|
return {
|
|
1455
|
-
async create(
|
|
1456
|
-
let
|
|
1457
|
-
PK: $.pk(
|
|
1458
|
-
SK: $.sk(
|
|
1455
|
+
async create(t, n) {
|
|
1456
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = `hc_${d()}`, a = {
|
|
1457
|
+
PK: $.pk(t),
|
|
1458
|
+
SK: $.sk(i),
|
|
1459
1459
|
entityType: "HOOK_CODE",
|
|
1460
|
-
id:
|
|
1461
|
-
tenant_id:
|
|
1462
|
-
code:
|
|
1463
|
-
secrets:
|
|
1464
|
-
created_at:
|
|
1465
|
-
updated_at:
|
|
1460
|
+
id: i,
|
|
1461
|
+
tenant_id: t,
|
|
1462
|
+
code: n.code,
|
|
1463
|
+
secrets: n.secrets ? JSON.stringify(n.secrets) : null,
|
|
1464
|
+
created_at: r,
|
|
1465
|
+
updated_at: r
|
|
1466
1466
|
};
|
|
1467
|
-
return await K(
|
|
1467
|
+
return await K(e, a), bt(a);
|
|
1468
1468
|
},
|
|
1469
|
-
async get(
|
|
1470
|
-
let r = await G(
|
|
1471
|
-
return r ?
|
|
1469
|
+
async get(t, n) {
|
|
1470
|
+
let r = await G(e, $.pk(t), $.sk(n));
|
|
1471
|
+
return r ? bt(r) : null;
|
|
1472
1472
|
},
|
|
1473
|
-
async update(
|
|
1474
|
-
let i = await G(
|
|
1473
|
+
async update(t, n, r) {
|
|
1474
|
+
let i = await G(e, $.pk(t), $.sk(n));
|
|
1475
1475
|
if (!i) return !1;
|
|
1476
1476
|
let a = {
|
|
1477
1477
|
...i,
|
|
1478
1478
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1479
1479
|
};
|
|
1480
|
-
return r.code !== void 0 && (a.code = r.code), r.secrets !== void 0 && (a.secrets = JSON.stringify(r.secrets)), await K(
|
|
1480
|
+
return r.code !== void 0 && (a.code = r.code), r.secrets !== void 0 && (a.secrets = JSON.stringify(r.secrets)), await K(e, a), !0;
|
|
1481
1481
|
},
|
|
1482
|
-
async remove(
|
|
1483
|
-
return await G(
|
|
1482
|
+
async remove(t, n) {
|
|
1483
|
+
return await G(e, $.pk(t), $.sk(n)) ? (await q(e, $.pk(t), $.sk(n)), !0) : !1;
|
|
1484
1484
|
}
|
|
1485
1485
|
};
|
|
1486
1486
|
}
|
|
1487
1487
|
//#endregion
|
|
1488
1488
|
//#region src/adapters/hooks.ts
|
|
1489
|
-
function
|
|
1489
|
+
function St(e) {
|
|
1490
1490
|
let { tenant_id: t, ...n } = Z(e);
|
|
1491
1491
|
return se.parse(Q(n));
|
|
1492
1492
|
}
|
|
1493
|
-
function
|
|
1493
|
+
function Ct(e) {
|
|
1494
1494
|
return {
|
|
1495
|
-
async create(
|
|
1496
|
-
let
|
|
1497
|
-
PK:
|
|
1498
|
-
SK:
|
|
1495
|
+
async create(t, n) {
|
|
1496
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = n.hook_id || d(), a = "url" in n ? n.url : void 0, o = "form_id" in n ? n.form_id : void 0, s = "template_id" in n ? n.template_id : void 0, c = {
|
|
1497
|
+
PK: C.pk(t),
|
|
1498
|
+
SK: C.sk(i),
|
|
1499
1499
|
entityType: "HOOK",
|
|
1500
|
-
tenant_id:
|
|
1501
|
-
hook_id:
|
|
1502
|
-
trigger_id:
|
|
1503
|
-
url:
|
|
1504
|
-
form_id:
|
|
1505
|
-
template_id:
|
|
1506
|
-
enabled:
|
|
1507
|
-
synchronous:
|
|
1508
|
-
priority:
|
|
1509
|
-
created_at:
|
|
1510
|
-
updated_at:
|
|
1500
|
+
tenant_id: t,
|
|
1501
|
+
hook_id: i,
|
|
1502
|
+
trigger_id: n.trigger_id,
|
|
1503
|
+
url: a,
|
|
1504
|
+
form_id: o,
|
|
1505
|
+
template_id: s,
|
|
1506
|
+
enabled: n.enabled ?? !1,
|
|
1507
|
+
synchronous: n.synchronous ?? !1,
|
|
1508
|
+
priority: n.priority,
|
|
1509
|
+
created_at: r,
|
|
1510
|
+
updated_at: r
|
|
1511
1511
|
};
|
|
1512
|
-
return await K(
|
|
1512
|
+
return await K(e, c), St(c);
|
|
1513
1513
|
},
|
|
1514
|
-
async get(
|
|
1515
|
-
let r = await G(
|
|
1516
|
-
return r ?
|
|
1514
|
+
async get(t, n) {
|
|
1515
|
+
let r = await G(e, C.pk(t), C.sk(n));
|
|
1516
|
+
return r ? St(r) : null;
|
|
1517
1517
|
},
|
|
1518
|
-
async list(
|
|
1519
|
-
let r = await Y(
|
|
1518
|
+
async list(t, n = {}) {
|
|
1519
|
+
let r = await Y(e, C.pk(t), n, { skPrefix: "HOOK#" });
|
|
1520
1520
|
return {
|
|
1521
|
-
hooks: r.items.map(
|
|
1521
|
+
hooks: r.items.map(St),
|
|
1522
1522
|
start: r.start,
|
|
1523
1523
|
limit: r.limit,
|
|
1524
1524
|
length: r.length
|
|
1525
1525
|
};
|
|
1526
1526
|
},
|
|
1527
|
-
async update(
|
|
1527
|
+
async update(t, n, r) {
|
|
1528
1528
|
let i = {
|
|
1529
1529
|
...r,
|
|
1530
1530
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1531
1531
|
};
|
|
1532
|
-
return delete i.hook_id, X(
|
|
1532
|
+
return delete i.hook_id, X(e, C.pk(t), C.sk(n), i);
|
|
1533
1533
|
},
|
|
1534
|
-
async remove(
|
|
1535
|
-
return q(
|
|
1534
|
+
async remove(t, n) {
|
|
1535
|
+
return q(e, C.pk(t), C.sk(n));
|
|
1536
1536
|
}
|
|
1537
1537
|
};
|
|
1538
1538
|
}
|
|
1539
1539
|
//#endregion
|
|
1540
1540
|
//#region src/adapters/keys.ts
|
|
1541
|
-
function
|
|
1541
|
+
function wt(e) {
|
|
1542
1542
|
return xe.parse(Q(Z(e)));
|
|
1543
1543
|
}
|
|
1544
|
-
function
|
|
1544
|
+
function Tt(e) {
|
|
1545
1545
|
return {
|
|
1546
1546
|
async create(t) {
|
|
1547
1547
|
let n = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -1570,7 +1570,7 @@ function wt(e) {
|
|
|
1570
1570
|
async list(t = {}) {
|
|
1571
1571
|
let n = await Y(e, ze.pk(), t, { skPrefix: "KEY#" });
|
|
1572
1572
|
return {
|
|
1573
|
-
signingKeys: n.items.map(
|
|
1573
|
+
signingKeys: n.items.map(wt),
|
|
1574
1574
|
start: n.start,
|
|
1575
1575
|
limit: n.limit,
|
|
1576
1576
|
length: n.length
|
|
@@ -1587,7 +1587,7 @@ function wt(e) {
|
|
|
1587
1587
|
}
|
|
1588
1588
|
//#endregion
|
|
1589
1589
|
//#region src/adapters/customDomains.ts
|
|
1590
|
-
function
|
|
1590
|
+
function Et(e) {
|
|
1591
1591
|
let { tenant_id: t, verification: n, domain_metadata: r, ...i } = Z(e), a = Q({
|
|
1592
1592
|
...i,
|
|
1593
1593
|
verification: n ? JSON.parse(n) : void 0,
|
|
@@ -1595,7 +1595,7 @@ function Tt(e) {
|
|
|
1595
1595
|
});
|
|
1596
1596
|
return l.parse(a);
|
|
1597
1597
|
}
|
|
1598
|
-
function
|
|
1598
|
+
function Dt(e) {
|
|
1599
1599
|
let { verification: t, domain_metadata: n, ...r } = Z(e), i = Q({
|
|
1600
1600
|
...r,
|
|
1601
1601
|
tenant_id: e.tenant_id,
|
|
@@ -1604,60 +1604,60 @@ function Et(e) {
|
|
|
1604
1604
|
});
|
|
1605
1605
|
return u.parse(i);
|
|
1606
1606
|
}
|
|
1607
|
-
function
|
|
1607
|
+
function Ot(e) {
|
|
1608
1608
|
return {
|
|
1609
|
-
async create(
|
|
1610
|
-
let
|
|
1611
|
-
PK:
|
|
1612
|
-
SK:
|
|
1613
|
-
GSI1PK:
|
|
1614
|
-
GSI1SK:
|
|
1609
|
+
async create(t, n) {
|
|
1610
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = n.custom_domain_id || d(), a = {
|
|
1611
|
+
PK: w.pk(t),
|
|
1612
|
+
SK: w.sk(i),
|
|
1613
|
+
GSI1PK: w.gsi1pk(n.domain),
|
|
1614
|
+
GSI1SK: w.gsi1sk(),
|
|
1615
1615
|
entityType: "CUSTOM_DOMAIN",
|
|
1616
|
-
tenant_id:
|
|
1617
|
-
custom_domain_id:
|
|
1618
|
-
domain:
|
|
1616
|
+
tenant_id: t,
|
|
1617
|
+
custom_domain_id: i,
|
|
1618
|
+
domain: n.domain,
|
|
1619
1619
|
primary: !1,
|
|
1620
1620
|
status: "pending_verification",
|
|
1621
|
-
type:
|
|
1622
|
-
verification_method:
|
|
1623
|
-
custom_client_ip_header:
|
|
1624
|
-
tls_policy:
|
|
1625
|
-
domain_metadata:
|
|
1626
|
-
created_at:
|
|
1627
|
-
updated_at:
|
|
1621
|
+
type: n.type,
|
|
1622
|
+
verification_method: n.verification_method,
|
|
1623
|
+
custom_client_ip_header: n.custom_client_ip_header,
|
|
1624
|
+
tls_policy: n.tls_policy,
|
|
1625
|
+
domain_metadata: n.domain_metadata ? JSON.stringify(n.domain_metadata) : void 0,
|
|
1626
|
+
created_at: r,
|
|
1627
|
+
updated_at: r
|
|
1628
1628
|
};
|
|
1629
|
-
return await K(
|
|
1629
|
+
return await K(e, a), Et(a);
|
|
1630
1630
|
},
|
|
1631
|
-
async get(
|
|
1632
|
-
let r = await G(
|
|
1633
|
-
return r ?
|
|
1631
|
+
async get(t, n) {
|
|
1632
|
+
let r = await G(e, w.pk(t), w.sk(n));
|
|
1633
|
+
return r ? Et(r) : null;
|
|
1634
1634
|
},
|
|
1635
|
-
async getByDomain(
|
|
1636
|
-
let { items: n } = await J(
|
|
1635
|
+
async getByDomain(t) {
|
|
1636
|
+
let { items: n } = await J(e, w.gsi1pk(t), {
|
|
1637
1637
|
indexName: "GSI1",
|
|
1638
|
-
skValue:
|
|
1638
|
+
skValue: w.gsi1sk()
|
|
1639
1639
|
});
|
|
1640
|
-
return n.length ?
|
|
1640
|
+
return n.length ? Dt(n[0]) : null;
|
|
1641
1641
|
},
|
|
1642
|
-
async list(
|
|
1643
|
-
let { items: n } = await J(
|
|
1644
|
-
return n.map(
|
|
1642
|
+
async list(t) {
|
|
1643
|
+
let { items: n } = await J(e, w.pk(t), { skPrefix: "CUSTOM_DOMAIN#" });
|
|
1644
|
+
return n.map(Et);
|
|
1645
1645
|
},
|
|
1646
|
-
async update(
|
|
1646
|
+
async update(t, n, r) {
|
|
1647
1647
|
let i = {
|
|
1648
1648
|
...r,
|
|
1649
1649
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1650
1650
|
};
|
|
1651
|
-
return r.verification !== void 0 && (i.verification = JSON.stringify(r.verification)), r.domain_metadata !== void 0 && (i.domain_metadata = JSON.stringify(r.domain_metadata)), delete i.custom_domain_id, X(
|
|
1651
|
+
return r.verification !== void 0 && (i.verification = JSON.stringify(r.verification)), r.domain_metadata !== void 0 && (i.domain_metadata = JSON.stringify(r.domain_metadata)), delete i.custom_domain_id, X(e, w.pk(t), w.sk(n), i);
|
|
1652
1652
|
},
|
|
1653
|
-
async remove(
|
|
1654
|
-
return q(
|
|
1653
|
+
async remove(t, n) {
|
|
1654
|
+
return q(e, w.pk(t), w.sk(n));
|
|
1655
1655
|
}
|
|
1656
1656
|
};
|
|
1657
1657
|
}
|
|
1658
1658
|
//#endregion
|
|
1659
1659
|
//#region src/adapters/logs.ts
|
|
1660
|
-
function
|
|
1660
|
+
function kt(e) {
|
|
1661
1661
|
let { tenant_id: t, country_code: n, city_name: r, latitude: i, longitude: a, time_zone: o, continent_code: s, ...c } = Z(e), l = Q({
|
|
1662
1662
|
...c,
|
|
1663
1663
|
auth0_client: e.auth0_client ? JSON.parse(e.auth0_client) : void 0,
|
|
@@ -1673,69 +1673,69 @@ function Ot(e) {
|
|
|
1673
1673
|
});
|
|
1674
1674
|
return le.parse(l);
|
|
1675
1675
|
}
|
|
1676
|
-
function
|
|
1676
|
+
function At(e) {
|
|
1677
1677
|
return {
|
|
1678
|
-
async create(
|
|
1679
|
-
let
|
|
1680
|
-
PK:
|
|
1681
|
-
SK:
|
|
1682
|
-
GSI1PK:
|
|
1683
|
-
GSI1SK:
|
|
1678
|
+
async create(t, n) {
|
|
1679
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = n.log_id || d(), a = n.date || r, o = a.substring(0, 10), s = {
|
|
1680
|
+
PK: E.pk(t),
|
|
1681
|
+
SK: E.sk(i),
|
|
1682
|
+
GSI1PK: E.gsi1pk(t, o),
|
|
1683
|
+
GSI1SK: E.gsi1sk(i),
|
|
1684
1684
|
entityType: "LOG",
|
|
1685
|
-
tenant_id:
|
|
1686
|
-
log_id:
|
|
1687
|
-
type:
|
|
1688
|
-
description:
|
|
1689
|
-
ip:
|
|
1690
|
-
user_agent:
|
|
1691
|
-
date:
|
|
1692
|
-
user_id:
|
|
1693
|
-
user_name:
|
|
1694
|
-
connection:
|
|
1695
|
-
connection_id:
|
|
1696
|
-
client_id:
|
|
1697
|
-
client_name:
|
|
1698
|
-
audience:
|
|
1699
|
-
scope:
|
|
1700
|
-
strategy:
|
|
1701
|
-
strategy_type:
|
|
1702
|
-
hostname:
|
|
1703
|
-
isMobile:
|
|
1704
|
-
auth0_client:
|
|
1705
|
-
details:
|
|
1706
|
-
country_code:
|
|
1707
|
-
city_name:
|
|
1708
|
-
latitude:
|
|
1709
|
-
longitude:
|
|
1710
|
-
time_zone:
|
|
1711
|
-
continent_code:
|
|
1712
|
-
created_at:
|
|
1713
|
-
updated_at:
|
|
1714
|
-
},
|
|
1715
|
-
return
|
|
1685
|
+
tenant_id: t,
|
|
1686
|
+
log_id: i,
|
|
1687
|
+
type: n.type,
|
|
1688
|
+
description: n.description,
|
|
1689
|
+
ip: n.ip,
|
|
1690
|
+
user_agent: n.user_agent,
|
|
1691
|
+
date: a,
|
|
1692
|
+
user_id: n.user_id,
|
|
1693
|
+
user_name: n.user_name,
|
|
1694
|
+
connection: n.connection,
|
|
1695
|
+
connection_id: n.connection_id,
|
|
1696
|
+
client_id: n.client_id,
|
|
1697
|
+
client_name: n.client_name,
|
|
1698
|
+
audience: n.audience,
|
|
1699
|
+
scope: n.scope,
|
|
1700
|
+
strategy: n.strategy,
|
|
1701
|
+
strategy_type: n.strategy_type,
|
|
1702
|
+
hostname: n.hostname,
|
|
1703
|
+
isMobile: n.isMobile,
|
|
1704
|
+
auth0_client: n.auth0_client ? JSON.stringify(n.auth0_client) : void 0,
|
|
1705
|
+
details: n.details ? JSON.stringify(n.details) : void 0,
|
|
1706
|
+
country_code: n.location_info?.country_code,
|
|
1707
|
+
city_name: n.location_info?.city_name,
|
|
1708
|
+
latitude: n.location_info?.latitude,
|
|
1709
|
+
longitude: n.location_info?.longitude,
|
|
1710
|
+
time_zone: n.location_info?.time_zone,
|
|
1711
|
+
continent_code: n.location_info?.continent_code,
|
|
1712
|
+
created_at: r,
|
|
1713
|
+
updated_at: r
|
|
1714
|
+
}, c = new Date(a);
|
|
1715
|
+
return c.setDate(c.getDate() + 30), s.ttl = Math.floor(c.getTime() / 1e3), await K(e, s), kt(s);
|
|
1716
1716
|
},
|
|
1717
|
-
async list(
|
|
1718
|
-
let r = await Y(
|
|
1717
|
+
async list(t, n = {}) {
|
|
1718
|
+
let r = await Y(e, E.pk(t), n, {
|
|
1719
1719
|
skPrefix: "LOG#",
|
|
1720
1720
|
scanIndexForward: !1
|
|
1721
1721
|
});
|
|
1722
1722
|
return {
|
|
1723
|
-
logs: r.items.map(
|
|
1723
|
+
logs: r.items.map(kt),
|
|
1724
1724
|
start: r.start,
|
|
1725
1725
|
limit: r.limit,
|
|
1726
1726
|
length: r.length,
|
|
1727
1727
|
next: r.next
|
|
1728
1728
|
};
|
|
1729
1729
|
},
|
|
1730
|
-
async get(
|
|
1731
|
-
let r = await G(
|
|
1732
|
-
return r ?
|
|
1730
|
+
async get(t, n) {
|
|
1731
|
+
let r = await G(e, E.pk(t), E.sk(n));
|
|
1732
|
+
return r ? kt(r) : null;
|
|
1733
1733
|
}
|
|
1734
1734
|
};
|
|
1735
1735
|
}
|
|
1736
1736
|
//#endregion
|
|
1737
1737
|
//#region src/adapters/themes.ts
|
|
1738
|
-
function
|
|
1738
|
+
function jt(e) {
|
|
1739
1739
|
let { tenant_id: t, ...n } = Z(e), r = Q({
|
|
1740
1740
|
...n,
|
|
1741
1741
|
borders: e.borders ? JSON.parse(e.borders) : void 0,
|
|
@@ -1746,49 +1746,49 @@ function At(e) {
|
|
|
1746
1746
|
});
|
|
1747
1747
|
return Ce.parse(r);
|
|
1748
1748
|
}
|
|
1749
|
-
function
|
|
1749
|
+
function Mt(e) {
|
|
1750
1750
|
return {
|
|
1751
|
-
async create(n, r, i
|
|
1752
|
-
let
|
|
1753
|
-
PK:
|
|
1754
|
-
SK:
|
|
1751
|
+
async create(t, n, r, i) {
|
|
1752
|
+
let a = i?.importMetadata, o = (/* @__PURE__ */ new Date()).toISOString(), s = a?.id || r || d(), c = {
|
|
1753
|
+
PK: S.pk(t),
|
|
1754
|
+
SK: S.sk(s),
|
|
1755
1755
|
entityType: "THEME",
|
|
1756
|
-
tenant_id:
|
|
1757
|
-
themeId:
|
|
1758
|
-
displayName:
|
|
1759
|
-
borders:
|
|
1760
|
-
colors:
|
|
1761
|
-
fonts:
|
|
1762
|
-
page_background:
|
|
1763
|
-
widget:
|
|
1764
|
-
created_at:
|
|
1765
|
-
updated_at:
|
|
1756
|
+
tenant_id: t,
|
|
1757
|
+
themeId: s,
|
|
1758
|
+
displayName: n.displayName,
|
|
1759
|
+
borders: n.borders ? JSON.stringify(n.borders) : void 0,
|
|
1760
|
+
colors: n.colors ? JSON.stringify(n.colors) : void 0,
|
|
1761
|
+
fonts: n.fonts ? JSON.stringify(n.fonts) : void 0,
|
|
1762
|
+
page_background: n.page_background ? JSON.stringify(n.page_background) : void 0,
|
|
1763
|
+
widget: n.widget ? JSON.stringify(n.widget) : void 0,
|
|
1764
|
+
created_at: a?.created_at ?? o,
|
|
1765
|
+
updated_at: a?.updated_at ?? o
|
|
1766
1766
|
};
|
|
1767
|
-
return await K(
|
|
1767
|
+
return await K(e, c), jt(c);
|
|
1768
1768
|
},
|
|
1769
|
-
async get(
|
|
1770
|
-
let r = await G(
|
|
1771
|
-
return r ?
|
|
1769
|
+
async get(t, n) {
|
|
1770
|
+
let r = await G(e, S.pk(t), S.sk(n));
|
|
1771
|
+
return r ? jt(r) : null;
|
|
1772
1772
|
},
|
|
1773
|
-
async update(
|
|
1773
|
+
async update(t, n, r) {
|
|
1774
1774
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
1775
|
-
return r.displayName !== void 0 && (i.displayName = r.displayName), r.borders !== void 0 && (i.borders = JSON.stringify(r.borders)), r.colors !== void 0 && (i.colors = JSON.stringify(r.colors)), r.fonts !== void 0 && (i.fonts = JSON.stringify(r.fonts)), r.page_background !== void 0 && (i.page_background = JSON.stringify(r.page_background)), r.widget !== void 0 && (i.widget = JSON.stringify(r.widget)), X(
|
|
1775
|
+
return r.displayName !== void 0 && (i.displayName = r.displayName), r.borders !== void 0 && (i.borders = JSON.stringify(r.borders)), r.colors !== void 0 && (i.colors = JSON.stringify(r.colors)), r.fonts !== void 0 && (i.fonts = JSON.stringify(r.fonts)), r.page_background !== void 0 && (i.page_background = JSON.stringify(r.page_background)), r.widget !== void 0 && (i.widget = JSON.stringify(r.widget)), X(e, S.pk(t), S.sk(n), i);
|
|
1776
1776
|
},
|
|
1777
|
-
async remove(
|
|
1778
|
-
return q(
|
|
1777
|
+
async remove(t, n) {
|
|
1778
|
+
return q(e, S.pk(t), S.sk(n));
|
|
1779
1779
|
}
|
|
1780
1780
|
};
|
|
1781
1781
|
}
|
|
1782
1782
|
//#endregion
|
|
1783
1783
|
//#region src/adapters/promptSettings.ts
|
|
1784
|
-
var
|
|
1784
|
+
var Nt = {
|
|
1785
1785
|
universal_login_experience: "new",
|
|
1786
1786
|
identifier_first: !1,
|
|
1787
1787
|
password_first: !1,
|
|
1788
1788
|
webauthn_platform_first_factor: !1,
|
|
1789
1789
|
show_last_used_connection: !1
|
|
1790
1790
|
};
|
|
1791
|
-
function
|
|
1791
|
+
function Pt(e) {
|
|
1792
1792
|
let { tenant_id: t, ...n } = Z(e), r = Q({
|
|
1793
1793
|
universal_login_experience: n.universal_login_experience || "new",
|
|
1794
1794
|
identifier_first: n.identifier_first ?? !1,
|
|
@@ -1798,13 +1798,13 @@ function Nt(e) {
|
|
|
1798
1798
|
});
|
|
1799
1799
|
return he.parse(r);
|
|
1800
1800
|
}
|
|
1801
|
-
function
|
|
1801
|
+
function Ft(e) {
|
|
1802
1802
|
return {
|
|
1803
1803
|
async set(t, n) {
|
|
1804
|
-
let r = (/* @__PURE__ */ new Date()).toISOString(), i = await this.get(t), a = await G(e,
|
|
1804
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = await this.get(t), a = await G(e, Be.pk(t), Be.sk());
|
|
1805
1805
|
await K(e, {
|
|
1806
|
-
PK:
|
|
1807
|
-
SK:
|
|
1806
|
+
PK: Be.pk(t),
|
|
1807
|
+
SK: Be.sk(),
|
|
1808
1808
|
entityType: "PROMPT_SETTING",
|
|
1809
1809
|
tenant_id: t,
|
|
1810
1810
|
universal_login_experience: n.universal_login_experience ?? i.universal_login_experience,
|
|
@@ -1817,14 +1817,14 @@ function Pt(e) {
|
|
|
1817
1817
|
});
|
|
1818
1818
|
},
|
|
1819
1819
|
async get(t) {
|
|
1820
|
-
let n = await G(e,
|
|
1821
|
-
return n ?
|
|
1820
|
+
let n = await G(e, Be.pk(t), Be.sk());
|
|
1821
|
+
return n ? Pt(n) : Nt;
|
|
1822
1822
|
}
|
|
1823
1823
|
};
|
|
1824
1824
|
}
|
|
1825
1825
|
//#endregion
|
|
1826
1826
|
//#region src/adapters/emailProviders.ts
|
|
1827
|
-
function
|
|
1827
|
+
function It(e) {
|
|
1828
1828
|
let { tenant_id: t, ...n } = Z(e), r = Q({
|
|
1829
1829
|
...n,
|
|
1830
1830
|
credentials: e.credentials ? JSON.parse(e.credentials) : void 0,
|
|
@@ -1832,13 +1832,13 @@ function Ft(e) {
|
|
|
1832
1832
|
});
|
|
1833
1833
|
return te.parse(r);
|
|
1834
1834
|
}
|
|
1835
|
-
function
|
|
1835
|
+
function Lt(e) {
|
|
1836
1836
|
return {
|
|
1837
1837
|
async create(t, n) {
|
|
1838
1838
|
let r = (/* @__PURE__ */ new Date()).toISOString();
|
|
1839
1839
|
await K(e, {
|
|
1840
|
-
PK:
|
|
1841
|
-
SK:
|
|
1840
|
+
PK: D.pk(t),
|
|
1841
|
+
SK: D.sk(),
|
|
1842
1842
|
entityType: "EMAIL_PROVIDER",
|
|
1843
1843
|
tenant_id: t,
|
|
1844
1844
|
name: n.name,
|
|
@@ -1851,24 +1851,24 @@ function It(e) {
|
|
|
1851
1851
|
});
|
|
1852
1852
|
},
|
|
1853
1853
|
async get(t) {
|
|
1854
|
-
let n = await G(e,
|
|
1855
|
-
return n ?
|
|
1854
|
+
let n = await G(e, D.pk(t), D.sk());
|
|
1855
|
+
return n ? It(n) : null;
|
|
1856
1856
|
},
|
|
1857
1857
|
async update(t, n) {
|
|
1858
1858
|
let r = {
|
|
1859
1859
|
...n,
|
|
1860
1860
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1861
1861
|
};
|
|
1862
|
-
n.credentials !== void 0 && (r.credentials = JSON.stringify(n.credentials)), n.settings !== void 0 && (r.settings = JSON.stringify(n.settings)), await X(e,
|
|
1862
|
+
n.credentials !== void 0 && (r.credentials = JSON.stringify(n.credentials)), n.settings !== void 0 && (r.settings = JSON.stringify(n.settings)), await X(e, D.pk(t), D.sk(), r);
|
|
1863
1863
|
},
|
|
1864
1864
|
async remove(t) {
|
|
1865
|
-
await q(e,
|
|
1865
|
+
await q(e, D.pk(t), D.sk());
|
|
1866
1866
|
}
|
|
1867
1867
|
};
|
|
1868
1868
|
}
|
|
1869
1869
|
//#endregion
|
|
1870
1870
|
//#region src/adapters/emailTemplates.ts
|
|
1871
|
-
function
|
|
1871
|
+
function Rt(e) {
|
|
1872
1872
|
let t = Z(e), n = Q({
|
|
1873
1873
|
template: t.template,
|
|
1874
1874
|
body: t.body,
|
|
@@ -1882,13 +1882,13 @@ function Lt(e) {
|
|
|
1882
1882
|
});
|
|
1883
1883
|
return ne.parse(n);
|
|
1884
1884
|
}
|
|
1885
|
-
function
|
|
1885
|
+
function zt(e) {
|
|
1886
1886
|
return {
|
|
1887
1887
|
async create(t, n) {
|
|
1888
1888
|
let r = (/* @__PURE__ */ new Date()).toISOString();
|
|
1889
1889
|
return await K(e, {
|
|
1890
|
-
PK:
|
|
1891
|
-
SK:
|
|
1890
|
+
PK: O.pk(t),
|
|
1891
|
+
SK: O.sk(n.template),
|
|
1892
1892
|
entityType: "EMAIL_TEMPLATE",
|
|
1893
1893
|
tenant_id: t,
|
|
1894
1894
|
template: n.template,
|
|
@@ -1905,25 +1905,25 @@ function Rt(e) {
|
|
|
1905
1905
|
}), n;
|
|
1906
1906
|
},
|
|
1907
1907
|
async get(t, n) {
|
|
1908
|
-
let r = await G(e,
|
|
1909
|
-
return r ?
|
|
1908
|
+
let r = await G(e, O.pk(t), O.sk(n));
|
|
1909
|
+
return r ? Rt(r) : null;
|
|
1910
1910
|
},
|
|
1911
1911
|
async list(t) {
|
|
1912
|
-
let { items: n } = await J(e,
|
|
1913
|
-
return n.map(
|
|
1912
|
+
let { items: n } = await J(e, O.pk(t), { skPrefix: O.skPrefix() });
|
|
1913
|
+
return n.map(Rt);
|
|
1914
1914
|
},
|
|
1915
1915
|
async update(t, n, r) {
|
|
1916
1916
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
1917
|
-
return r.body !== void 0 && (i.body = r.body), r.from !== void 0 && (i.from = r.from), r.subject !== void 0 && (i.subject = r.subject), r.syntax !== void 0 && (i.syntax = r.syntax), r.resultUrl !== void 0 && (i.result_url = r.resultUrl), r.urlLifetimeInSeconds !== void 0 && (i.url_lifetime_in_seconds = r.urlLifetimeInSeconds), r.includeEmailInRedirect !== void 0 && (i.include_email_in_redirect = r.includeEmailInRedirect), r.enabled !== void 0 && (i.enabled = r.enabled), await G(e,
|
|
1917
|
+
return r.body !== void 0 && (i.body = r.body), r.from !== void 0 && (i.from = r.from), r.subject !== void 0 && (i.subject = r.subject), r.syntax !== void 0 && (i.syntax = r.syntax), r.resultUrl !== void 0 && (i.result_url = r.resultUrl), r.urlLifetimeInSeconds !== void 0 && (i.url_lifetime_in_seconds = r.urlLifetimeInSeconds), r.includeEmailInRedirect !== void 0 && (i.include_email_in_redirect = r.includeEmailInRedirect), r.enabled !== void 0 && (i.enabled = r.enabled), await G(e, O.pk(t), O.sk(n)) ? (await X(e, O.pk(t), O.sk(n), i), !0) : !1;
|
|
1918
1918
|
},
|
|
1919
1919
|
async remove(t, n) {
|
|
1920
|
-
return await G(e,
|
|
1920
|
+
return await G(e, O.pk(t), O.sk(n)) ? (await q(e, O.pk(t), O.sk(n)), !0) : !1;
|
|
1921
1921
|
}
|
|
1922
1922
|
};
|
|
1923
1923
|
}
|
|
1924
1924
|
//#endregion
|
|
1925
1925
|
//#region src/adapters/refreshTokens.ts
|
|
1926
|
-
function
|
|
1926
|
+
function Bt(e) {
|
|
1927
1927
|
let { tenant_id: t, device: n, resource_servers: r, ...i } = Z(e), a = Q({
|
|
1928
1928
|
...i,
|
|
1929
1929
|
device: JSON.parse(n),
|
|
@@ -1931,7 +1931,7 @@ function zt(e) {
|
|
|
1931
1931
|
});
|
|
1932
1932
|
return ge.parse(a);
|
|
1933
1933
|
}
|
|
1934
|
-
async function
|
|
1934
|
+
async function Vt(e, t, n, r) {
|
|
1935
1935
|
let i = 0, a = 0;
|
|
1936
1936
|
for (;;) {
|
|
1937
1937
|
let o = await Y(e, k.pk(t), {
|
|
@@ -1965,7 +1965,7 @@ async function Bt(e, t, n, r) {
|
|
|
1965
1965
|
}
|
|
1966
1966
|
return i;
|
|
1967
1967
|
}
|
|
1968
|
-
function
|
|
1968
|
+
function Ht(e) {
|
|
1969
1969
|
return {
|
|
1970
1970
|
async create(t, n) {
|
|
1971
1971
|
let r = (/* @__PURE__ */ new Date()).toISOString(), i = {
|
|
@@ -1997,11 +1997,11 @@ function Vt(e) {
|
|
|
1997
1997
|
created_at: r,
|
|
1998
1998
|
updated_at: r
|
|
1999
1999
|
};
|
|
2000
|
-
return n.token_lookup && (i.GSI2PK = k.gsi2pk(t, n.token_lookup), i.GSI2SK = k.gsi2sk()), n.expires_at && (i.ttl = Math.floor(new Date(n.expires_at).getTime() / 1e3)), await K(e, i),
|
|
2000
|
+
return n.token_lookup && (i.GSI2PK = k.gsi2pk(t, n.token_lookup), i.GSI2SK = k.gsi2sk()), n.expires_at && (i.ttl = Math.floor(new Date(n.expires_at).getTime() / 1e3)), await K(e, i), Bt(i);
|
|
2001
2001
|
},
|
|
2002
2002
|
async get(t, n) {
|
|
2003
2003
|
let r = await G(e, k.pk(t), k.sk(n));
|
|
2004
|
-
return r ?
|
|
2004
|
+
return r ? Bt(r) : null;
|
|
2005
2005
|
},
|
|
2006
2006
|
async getByLookup(t, n) {
|
|
2007
2007
|
let r = await J(e, k.gsi2pk(t, n), {
|
|
@@ -2009,12 +2009,12 @@ function Vt(e) {
|
|
|
2009
2009
|
skValue: k.gsi2sk(),
|
|
2010
2010
|
limit: 1
|
|
2011
2011
|
});
|
|
2012
|
-
return r.items[0] ?
|
|
2012
|
+
return r.items[0] ? Bt(r.items[0]) : null;
|
|
2013
2013
|
},
|
|
2014
2014
|
async list(t, n = {}) {
|
|
2015
2015
|
let r = await Y(e, k.pk(t), n, { skPrefix: "REFRESH_TOKEN#" });
|
|
2016
2016
|
return {
|
|
2017
|
-
refresh_tokens: r.items.map(
|
|
2017
|
+
refresh_tokens: r.items.map(Bt),
|
|
2018
2018
|
start: r.start,
|
|
2019
2019
|
limit: r.limit,
|
|
2020
2020
|
length: r.length
|
|
@@ -2028,7 +2028,7 @@ function Vt(e) {
|
|
|
2028
2028
|
r.device !== void 0 && (a.device = JSON.stringify(r.device)), r.resource_servers !== void 0 && (a.resource_servers = JSON.stringify(r.resource_servers)), delete a.id;
|
|
2029
2029
|
let o = await X(e, k.pk(t), k.sk(n), a);
|
|
2030
2030
|
if (o && i?.loginSessionBump) try {
|
|
2031
|
-
await X(e,
|
|
2031
|
+
await X(e, h.pk(t), h.sk(i.loginSessionBump.login_id), {
|
|
2032
2032
|
expires_at: i.loginSessionBump.expires_at,
|
|
2033
2033
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2034
2034
|
});
|
|
@@ -2039,22 +2039,22 @@ function Vt(e) {
|
|
|
2039
2039
|
return q(e, k.pk(t), k.sk(n));
|
|
2040
2040
|
},
|
|
2041
2041
|
async revokeByUser(t, n, r) {
|
|
2042
|
-
return
|
|
2042
|
+
return Vt(e, t, r, (e) => e.user_id === n);
|
|
2043
2043
|
},
|
|
2044
2044
|
async revokeByLoginSession(t, n, r) {
|
|
2045
|
-
return
|
|
2045
|
+
return Vt(e, t, r, (e) => e.login_id === n);
|
|
2046
2046
|
},
|
|
2047
2047
|
async revokeBySession(t, n, r) {
|
|
2048
|
-
return
|
|
2048
|
+
return Vt(e, t, r, (e) => !!e.session_id && e.session_id === n);
|
|
2049
2049
|
},
|
|
2050
2050
|
async revokeFamily(t, n, r) {
|
|
2051
|
-
return
|
|
2051
|
+
return Vt(e, t, r, (e) => e.family_id === n);
|
|
2052
2052
|
}
|
|
2053
2053
|
};
|
|
2054
2054
|
}
|
|
2055
2055
|
//#endregion
|
|
2056
2056
|
//#region src/adapters/forms.ts
|
|
2057
|
-
function
|
|
2057
|
+
function Ut(e) {
|
|
2058
2058
|
let { tenant_id: t, ...n } = Z(e), r = Q({
|
|
2059
2059
|
...n,
|
|
2060
2060
|
nodes: e.nodes ? JSON.parse(e.nodes) : void 0,
|
|
@@ -2067,53 +2067,53 @@ function Ht(e) {
|
|
|
2067
2067
|
});
|
|
2068
2068
|
return ae.parse(r);
|
|
2069
2069
|
}
|
|
2070
|
-
function
|
|
2070
|
+
function Wt(e) {
|
|
2071
2071
|
return {
|
|
2072
|
-
async create(
|
|
2073
|
-
let
|
|
2074
|
-
PK: A.pk(
|
|
2075
|
-
SK: A.sk(
|
|
2072
|
+
async create(t, n) {
|
|
2073
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = d(), a = {
|
|
2074
|
+
PK: A.pk(t),
|
|
2075
|
+
SK: A.sk(i),
|
|
2076
2076
|
entityType: "FORM",
|
|
2077
|
-
tenant_id:
|
|
2078
|
-
id:
|
|
2079
|
-
name:
|
|
2080
|
-
nodes:
|
|
2081
|
-
start:
|
|
2082
|
-
ending:
|
|
2083
|
-
messages:
|
|
2084
|
-
languages:
|
|
2085
|
-
translations:
|
|
2086
|
-
style:
|
|
2087
|
-
created_at:
|
|
2088
|
-
updated_at:
|
|
2077
|
+
tenant_id: t,
|
|
2078
|
+
id: i,
|
|
2079
|
+
name: n.name,
|
|
2080
|
+
nodes: n.nodes ? JSON.stringify(n.nodes) : void 0,
|
|
2081
|
+
start: n.start ? JSON.stringify(n.start) : void 0,
|
|
2082
|
+
ending: n.ending ? JSON.stringify(n.ending) : void 0,
|
|
2083
|
+
messages: n.messages ? JSON.stringify(n.messages) : void 0,
|
|
2084
|
+
languages: n.languages ? JSON.stringify(n.languages) : void 0,
|
|
2085
|
+
translations: n.translations ? JSON.stringify(n.translations) : void 0,
|
|
2086
|
+
style: n.style ? JSON.stringify(n.style) : void 0,
|
|
2087
|
+
created_at: r,
|
|
2088
|
+
updated_at: r
|
|
2089
2089
|
};
|
|
2090
|
-
return await K(
|
|
2090
|
+
return await K(e, a), Ut(a);
|
|
2091
2091
|
},
|
|
2092
|
-
async get(
|
|
2093
|
-
let r = await G(
|
|
2094
|
-
return r ?
|
|
2092
|
+
async get(t, n) {
|
|
2093
|
+
let r = await G(e, A.pk(t), A.sk(n));
|
|
2094
|
+
return r ? Ut(r) : null;
|
|
2095
2095
|
},
|
|
2096
|
-
async list(
|
|
2097
|
-
let r = await Y(
|
|
2096
|
+
async list(t, n = {}) {
|
|
2097
|
+
let r = await Y(e, A.pk(t), n, { skPrefix: "FORM#" });
|
|
2098
2098
|
return {
|
|
2099
|
-
forms: r.items.map(
|
|
2099
|
+
forms: r.items.map(Ut),
|
|
2100
2100
|
start: r.start,
|
|
2101
2101
|
limit: r.limit,
|
|
2102
2102
|
length: r.length
|
|
2103
2103
|
};
|
|
2104
2104
|
},
|
|
2105
|
-
async update(
|
|
2105
|
+
async update(t, n, r) {
|
|
2106
2106
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
2107
|
-
return r.name !== void 0 && (i.name = r.name), r.nodes !== void 0 && (i.nodes = JSON.stringify(r.nodes)), r.start !== void 0 && (i.start = JSON.stringify(r.start)), r.ending !== void 0 && (i.ending = JSON.stringify(r.ending)), r.messages !== void 0 && (i.messages = JSON.stringify(r.messages)), r.languages !== void 0 && (i.languages = JSON.stringify(r.languages)), r.translations !== void 0 && (i.translations = JSON.stringify(r.translations)), r.style !== void 0 && (i.style = JSON.stringify(r.style)), X(
|
|
2107
|
+
return r.name !== void 0 && (i.name = r.name), r.nodes !== void 0 && (i.nodes = JSON.stringify(r.nodes)), r.start !== void 0 && (i.start = JSON.stringify(r.start)), r.ending !== void 0 && (i.ending = JSON.stringify(r.ending)), r.messages !== void 0 && (i.messages = JSON.stringify(r.messages)), r.languages !== void 0 && (i.languages = JSON.stringify(r.languages)), r.translations !== void 0 && (i.translations = JSON.stringify(r.translations)), r.style !== void 0 && (i.style = JSON.stringify(r.style)), X(e, A.pk(t), A.sk(n), i);
|
|
2108
2108
|
},
|
|
2109
|
-
async remove(
|
|
2110
|
-
return q(
|
|
2109
|
+
async remove(t, n) {
|
|
2110
|
+
return q(e, A.pk(t), A.sk(n));
|
|
2111
2111
|
}
|
|
2112
2112
|
};
|
|
2113
2113
|
}
|
|
2114
2114
|
//#endregion
|
|
2115
2115
|
//#region src/adapters/resourceServers.ts
|
|
2116
|
-
function
|
|
2116
|
+
function Gt(e) {
|
|
2117
2117
|
let { tenant_id: t, verification_key: n, is_system: r, metadata: i, ...a } = Z(e), o = Q({
|
|
2118
2118
|
...a,
|
|
2119
2119
|
verificationKey: n,
|
|
@@ -2124,66 +2124,66 @@ function Wt(e) {
|
|
|
2124
2124
|
});
|
|
2125
2125
|
return _e.parse(o);
|
|
2126
2126
|
}
|
|
2127
|
-
function
|
|
2127
|
+
function Kt(e) {
|
|
2128
2128
|
return {
|
|
2129
|
-
async create(
|
|
2130
|
-
let
|
|
2131
|
-
PK: M.pk(
|
|
2132
|
-
SK: M.sk(
|
|
2133
|
-
GSI1PK: M.gsi1pk(
|
|
2129
|
+
async create(t, n) {
|
|
2130
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = n.id || d(), a = {
|
|
2131
|
+
PK: M.pk(t),
|
|
2132
|
+
SK: M.sk(i),
|
|
2133
|
+
GSI1PK: M.gsi1pk(t, n.identifier),
|
|
2134
2134
|
GSI1SK: M.gsi1sk(),
|
|
2135
2135
|
entityType: "RESOURCE_SERVER",
|
|
2136
|
-
tenant_id:
|
|
2137
|
-
id:
|
|
2138
|
-
identifier:
|
|
2139
|
-
name:
|
|
2140
|
-
signing_alg:
|
|
2141
|
-
signing_secret:
|
|
2142
|
-
allow_offline_access:
|
|
2143
|
-
skip_consent_for_verifiable_first_party_clients:
|
|
2144
|
-
token_lifetime:
|
|
2145
|
-
token_lifetime_for_web:
|
|
2146
|
-
enforce_policies:
|
|
2147
|
-
token_dialect:
|
|
2148
|
-
scopes:
|
|
2149
|
-
options:
|
|
2150
|
-
verification_key:
|
|
2151
|
-
is_system:
|
|
2152
|
-
metadata:
|
|
2153
|
-
created_at:
|
|
2154
|
-
updated_at:
|
|
2136
|
+
tenant_id: t,
|
|
2137
|
+
id: i,
|
|
2138
|
+
identifier: n.identifier,
|
|
2139
|
+
name: n.name,
|
|
2140
|
+
signing_alg: n.signing_alg,
|
|
2141
|
+
signing_secret: n.signing_secret,
|
|
2142
|
+
allow_offline_access: n.allow_offline_access,
|
|
2143
|
+
skip_consent_for_verifiable_first_party_clients: n.skip_consent_for_verifiable_first_party_clients,
|
|
2144
|
+
token_lifetime: n.token_lifetime,
|
|
2145
|
+
token_lifetime_for_web: n.token_lifetime_for_web,
|
|
2146
|
+
enforce_policies: n.options?.enforce_policies,
|
|
2147
|
+
token_dialect: n.options?.token_dialect,
|
|
2148
|
+
scopes: n.scopes ? JSON.stringify(n.scopes) : void 0,
|
|
2149
|
+
options: n.options ? JSON.stringify(n.options) : void 0,
|
|
2150
|
+
verification_key: n.verificationKey,
|
|
2151
|
+
is_system: n.is_system ?? !1,
|
|
2152
|
+
metadata: n.metadata,
|
|
2153
|
+
created_at: r,
|
|
2154
|
+
updated_at: r
|
|
2155
2155
|
};
|
|
2156
|
-
return await K(
|
|
2156
|
+
return await K(e, a), Gt(a);
|
|
2157
2157
|
},
|
|
2158
|
-
async get(
|
|
2159
|
-
let r = await G(
|
|
2160
|
-
return r ?
|
|
2158
|
+
async get(t, n) {
|
|
2159
|
+
let r = await G(e, M.pk(t), M.sk(n));
|
|
2160
|
+
return r ? Gt(r) : null;
|
|
2161
2161
|
},
|
|
2162
|
-
async list(
|
|
2163
|
-
let r = await Y(
|
|
2162
|
+
async list(t, n = {}) {
|
|
2163
|
+
let r = await Y(e, M.pk(t), n, { skPrefix: "RESOURCE_SERVER#" });
|
|
2164
2164
|
return {
|
|
2165
|
-
resource_servers: r.items.map(
|
|
2165
|
+
resource_servers: r.items.map(Gt),
|
|
2166
2166
|
start: r.start,
|
|
2167
2167
|
limit: r.limit,
|
|
2168
2168
|
length: r.length,
|
|
2169
2169
|
next: r.next
|
|
2170
2170
|
};
|
|
2171
2171
|
},
|
|
2172
|
-
async update(
|
|
2172
|
+
async update(t, n, r) {
|
|
2173
2173
|
let i = {
|
|
2174
2174
|
...r,
|
|
2175
2175
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2176
2176
|
};
|
|
2177
|
-
return r.scopes !== void 0 && (i.scopes = JSON.stringify(r.scopes)), r.options !== void 0 && (i.options = JSON.stringify(r.options)), r.verificationKey !== void 0 && (i.verification_key = r.verificationKey, delete i.verificationKey), delete i.id, X(
|
|
2177
|
+
return r.scopes !== void 0 && (i.scopes = JSON.stringify(r.scopes)), r.options !== void 0 && (i.options = JSON.stringify(r.options)), r.verificationKey !== void 0 && (i.verification_key = r.verificationKey, delete i.verificationKey), delete i.id, X(e, M.pk(t), M.sk(n), i);
|
|
2178
2178
|
},
|
|
2179
|
-
async remove(
|
|
2180
|
-
return q(
|
|
2179
|
+
async remove(t, n) {
|
|
2180
|
+
return q(e, M.pk(t), M.sk(n));
|
|
2181
2181
|
}
|
|
2182
2182
|
};
|
|
2183
2183
|
}
|
|
2184
2184
|
//#endregion
|
|
2185
2185
|
//#region src/adapters/roles.ts
|
|
2186
|
-
function
|
|
2186
|
+
function qt(e) {
|
|
2187
2187
|
let { tenant_id: t, is_system: n, metadata: r, ...i } = Z(e);
|
|
2188
2188
|
return ye.parse(Q({
|
|
2189
2189
|
...i,
|
|
@@ -2191,56 +2191,56 @@ function Kt(e) {
|
|
|
2191
2191
|
metadata: r
|
|
2192
2192
|
}));
|
|
2193
2193
|
}
|
|
2194
|
-
function
|
|
2194
|
+
function Jt(e) {
|
|
2195
2195
|
return {
|
|
2196
|
-
async create(
|
|
2197
|
-
let
|
|
2198
|
-
PK: N.pk(
|
|
2199
|
-
SK: N.sk(
|
|
2196
|
+
async create(t, n) {
|
|
2197
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = d(), a = {
|
|
2198
|
+
PK: N.pk(t),
|
|
2199
|
+
SK: N.sk(i),
|
|
2200
2200
|
entityType: "ROLE",
|
|
2201
|
-
tenant_id:
|
|
2202
|
-
id:
|
|
2203
|
-
name:
|
|
2204
|
-
description:
|
|
2205
|
-
is_system:
|
|
2206
|
-
metadata:
|
|
2207
|
-
created_at:
|
|
2208
|
-
updated_at:
|
|
2201
|
+
tenant_id: t,
|
|
2202
|
+
id: i,
|
|
2203
|
+
name: n.name,
|
|
2204
|
+
description: n.description,
|
|
2205
|
+
is_system: n.is_system ?? !1,
|
|
2206
|
+
metadata: n.metadata,
|
|
2207
|
+
created_at: r,
|
|
2208
|
+
updated_at: r
|
|
2209
2209
|
};
|
|
2210
|
-
return await K(
|
|
2210
|
+
return await K(e, a), qt(a);
|
|
2211
2211
|
},
|
|
2212
|
-
async get(
|
|
2213
|
-
let r = await G(
|
|
2214
|
-
return r ?
|
|
2212
|
+
async get(t, n) {
|
|
2213
|
+
let r = await G(e, N.pk(t), N.sk(n));
|
|
2214
|
+
return r ? qt(r) : null;
|
|
2215
2215
|
},
|
|
2216
|
-
async list(
|
|
2217
|
-
let r = await Y(
|
|
2216
|
+
async list(t, n = {}) {
|
|
2217
|
+
let r = await Y(e, N.pk(t), n, { skPrefix: "ROLE#" });
|
|
2218
2218
|
return {
|
|
2219
|
-
roles: r.items.map(
|
|
2219
|
+
roles: r.items.map(qt),
|
|
2220
2220
|
start: r.start,
|
|
2221
2221
|
limit: r.limit,
|
|
2222
2222
|
length: r.length
|
|
2223
2223
|
};
|
|
2224
2224
|
},
|
|
2225
|
-
async update(
|
|
2225
|
+
async update(t, n, r) {
|
|
2226
2226
|
let i = {
|
|
2227
2227
|
...r,
|
|
2228
2228
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2229
2229
|
};
|
|
2230
|
-
return delete i.id, X(
|
|
2230
|
+
return delete i.id, X(e, N.pk(t), N.sk(n), i);
|
|
2231
2231
|
},
|
|
2232
|
-
async remove(
|
|
2233
|
-
return q(
|
|
2232
|
+
async remove(t, n) {
|
|
2233
|
+
return q(e, N.pk(t), N.sk(n));
|
|
2234
2234
|
}
|
|
2235
2235
|
};
|
|
2236
2236
|
}
|
|
2237
2237
|
//#endregion
|
|
2238
2238
|
//#region src/adapters/rolePermissions.ts
|
|
2239
|
-
function
|
|
2239
|
+
function Yt(e) {
|
|
2240
2240
|
let { tenant_id: t, ...n } = Z(e);
|
|
2241
2241
|
return ve.parse(Q(n));
|
|
2242
2242
|
}
|
|
2243
|
-
function
|
|
2243
|
+
function Xt(e) {
|
|
2244
2244
|
return {
|
|
2245
2245
|
async assign(t, n, r) {
|
|
2246
2246
|
let i = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -2262,13 +2262,13 @@ function Yt(e) {
|
|
|
2262
2262
|
return !0;
|
|
2263
2263
|
},
|
|
2264
2264
|
async list(t, n, r = {}) {
|
|
2265
|
-
return (await Y(e, P.pk(t, n), r, { skPrefix: P.skPrefix() })).items.map(
|
|
2265
|
+
return (await Y(e, P.pk(t, n), r, { skPrefix: P.skPrefix() })).items.map(Yt);
|
|
2266
2266
|
}
|
|
2267
2267
|
};
|
|
2268
2268
|
}
|
|
2269
2269
|
//#endregion
|
|
2270
2270
|
//#region src/adapters/userPermissions.ts
|
|
2271
|
-
function
|
|
2271
|
+
function Zt(e) {
|
|
2272
2272
|
let { tenant_id: t, sources: n, ...r } = Z(e), i = Q({
|
|
2273
2273
|
...r,
|
|
2274
2274
|
resource_server_name: e.resource_server_name || e.resource_server_identifier,
|
|
@@ -2276,7 +2276,7 @@ function Xt(e) {
|
|
|
2276
2276
|
});
|
|
2277
2277
|
return Te.parse(i);
|
|
2278
2278
|
}
|
|
2279
|
-
function
|
|
2279
|
+
function Qt(e) {
|
|
2280
2280
|
return {
|
|
2281
2281
|
async create(t, n, r, i) {
|
|
2282
2282
|
let a = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -2297,17 +2297,17 @@ function Zt(e) {
|
|
|
2297
2297
|
return q(e, F.pk(t, n, i), F.sk(r.resource_server_identifier, r.permission_name));
|
|
2298
2298
|
},
|
|
2299
2299
|
async list(t, n, r = {}, i) {
|
|
2300
|
-
return (await Y(e, F.pk(t, n, i), r, { skPrefix: F.skPrefix() })).items.map(
|
|
2300
|
+
return (await Y(e, F.pk(t, n, i), r, { skPrefix: F.skPrefix() })).items.map(Zt);
|
|
2301
2301
|
}
|
|
2302
2302
|
};
|
|
2303
2303
|
}
|
|
2304
2304
|
//#endregion
|
|
2305
2305
|
//#region src/adapters/userRoles.ts
|
|
2306
|
-
function
|
|
2306
|
+
function $t(e) {
|
|
2307
2307
|
let { tenant_id: t, ...n } = Z(e);
|
|
2308
2308
|
return ye.parse(Q(n));
|
|
2309
2309
|
}
|
|
2310
|
-
function
|
|
2310
|
+
function en(e) {
|
|
2311
2311
|
return {
|
|
2312
2312
|
async create(t, n, r, i) {
|
|
2313
2313
|
let a = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -2333,7 +2333,7 @@ function $t(e) {
|
|
|
2333
2333
|
let { items: a } = await J(e, I.pk(t, n, i), { skPrefix: I.skPrefix() }), o = [];
|
|
2334
2334
|
for (let n of a) {
|
|
2335
2335
|
let r = await G(e, N.pk(t), N.sk(n.role_id));
|
|
2336
|
-
r && o.push(
|
|
2336
|
+
r && o.push($t(r));
|
|
2337
2337
|
}
|
|
2338
2338
|
return o;
|
|
2339
2339
|
}
|
|
@@ -2341,7 +2341,7 @@ function $t(e) {
|
|
|
2341
2341
|
}
|
|
2342
2342
|
//#endregion
|
|
2343
2343
|
//#region src/adapters/organizations.ts
|
|
2344
|
-
function
|
|
2344
|
+
function tn(e) {
|
|
2345
2345
|
let { tenant_id: t, ...n } = Z(e), r = Q({
|
|
2346
2346
|
...n,
|
|
2347
2347
|
branding: e.branding ? JSON.parse(e.branding) : void 0,
|
|
@@ -2351,70 +2351,70 @@ function en(e) {
|
|
|
2351
2351
|
});
|
|
2352
2352
|
return fe.parse(r);
|
|
2353
2353
|
}
|
|
2354
|
-
function
|
|
2354
|
+
function nn(e) {
|
|
2355
2355
|
return {
|
|
2356
|
-
async create(
|
|
2357
|
-
let
|
|
2358
|
-
PK: L.pk(
|
|
2359
|
-
SK: L.sk(
|
|
2360
|
-
GSI1PK: L.gsi1pk(
|
|
2356
|
+
async create(t, n) {
|
|
2357
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = n.id || d(), a = {
|
|
2358
|
+
PK: L.pk(t),
|
|
2359
|
+
SK: L.sk(i),
|
|
2360
|
+
GSI1PK: L.gsi1pk(t, n.name),
|
|
2361
2361
|
GSI1SK: L.gsi1sk(),
|
|
2362
2362
|
entityType: "ORGANIZATION",
|
|
2363
|
-
tenant_id:
|
|
2364
|
-
id:
|
|
2365
|
-
name:
|
|
2366
|
-
display_name:
|
|
2367
|
-
branding:
|
|
2368
|
-
metadata:
|
|
2369
|
-
enabled_connections:
|
|
2370
|
-
token_quota:
|
|
2371
|
-
created_at:
|
|
2372
|
-
updated_at:
|
|
2363
|
+
tenant_id: t,
|
|
2364
|
+
id: i,
|
|
2365
|
+
name: n.name,
|
|
2366
|
+
display_name: n.display_name,
|
|
2367
|
+
branding: n.branding ? JSON.stringify(n.branding) : void 0,
|
|
2368
|
+
metadata: n.metadata ? JSON.stringify(n.metadata) : void 0,
|
|
2369
|
+
enabled_connections: n.enabled_connections ? JSON.stringify(n.enabled_connections) : void 0,
|
|
2370
|
+
token_quota: n.token_quota ? JSON.stringify(n.token_quota) : void 0,
|
|
2371
|
+
created_at: r,
|
|
2372
|
+
updated_at: r
|
|
2373
2373
|
};
|
|
2374
|
-
return await K(
|
|
2374
|
+
return await K(e, a), tn(a);
|
|
2375
2375
|
},
|
|
2376
|
-
async get(
|
|
2377
|
-
let r = await G(
|
|
2378
|
-
return r ||= (await Y(
|
|
2376
|
+
async get(t, n) {
|
|
2377
|
+
let r = await G(e, L.pk(t), L.sk(n));
|
|
2378
|
+
return r ||= (await Y(e, L.gsi1pk(t, n), {
|
|
2379
2379
|
page: 0,
|
|
2380
2380
|
per_page: 1
|
|
2381
2381
|
}, {
|
|
2382
2382
|
indexName: "GSI1",
|
|
2383
2383
|
skPrefix: "ORGANIZATION"
|
|
2384
|
-
})).items[0] || null, r ?
|
|
2384
|
+
})).items[0] || null, r ? tn(r) : null;
|
|
2385
2385
|
},
|
|
2386
|
-
async list(
|
|
2387
|
-
let r = await Y(
|
|
2386
|
+
async list(t, n = {}) {
|
|
2387
|
+
let r = await Y(e, L.pk(t), n, { skPrefix: "ORGANIZATION#" });
|
|
2388
2388
|
return {
|
|
2389
|
-
organizations: r.items.map(
|
|
2389
|
+
organizations: r.items.map(tn),
|
|
2390
2390
|
start: r.start,
|
|
2391
2391
|
limit: r.limit,
|
|
2392
2392
|
length: r.length,
|
|
2393
2393
|
next: r.next
|
|
2394
2394
|
};
|
|
2395
2395
|
},
|
|
2396
|
-
async update(
|
|
2396
|
+
async update(t, n, r) {
|
|
2397
2397
|
let i = {
|
|
2398
2398
|
...r,
|
|
2399
2399
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2400
2400
|
};
|
|
2401
|
-
return r.branding !== void 0 && (i.branding = JSON.stringify(r.branding)), r.metadata !== void 0 && (i.metadata = JSON.stringify(r.metadata)), r.enabled_connections !== void 0 && (i.enabled_connections = JSON.stringify(r.enabled_connections)), r.token_quota !== void 0 && (i.token_quota = JSON.stringify(r.token_quota)), delete i.id, X(
|
|
2401
|
+
return r.branding !== void 0 && (i.branding = JSON.stringify(r.branding)), r.metadata !== void 0 && (i.metadata = JSON.stringify(r.metadata)), r.enabled_connections !== void 0 && (i.enabled_connections = JSON.stringify(r.enabled_connections)), r.token_quota !== void 0 && (i.token_quota = JSON.stringify(r.token_quota)), delete i.id, X(e, L.pk(t), L.sk(n), i);
|
|
2402
2402
|
},
|
|
2403
|
-
async remove(
|
|
2404
|
-
return q(
|
|
2403
|
+
async remove(t, n) {
|
|
2404
|
+
return q(e, L.pk(t), L.sk(n));
|
|
2405
2405
|
}
|
|
2406
2406
|
};
|
|
2407
2407
|
}
|
|
2408
2408
|
//#endregion
|
|
2409
2409
|
//#region src/adapters/organizationConnections.ts
|
|
2410
|
-
async function
|
|
2411
|
-
let r = await G(e,
|
|
2410
|
+
async function rn(e, t, n) {
|
|
2411
|
+
let r = await G(e, v.pk(t), v.sk(n));
|
|
2412
2412
|
if (r) return {
|
|
2413
2413
|
name: r.name,
|
|
2414
2414
|
strategy: r.strategy
|
|
2415
2415
|
};
|
|
2416
2416
|
}
|
|
2417
|
-
function
|
|
2417
|
+
function an(e, t) {
|
|
2418
2418
|
return {
|
|
2419
2419
|
connection_id: e.connection_id,
|
|
2420
2420
|
assign_membership_on_login: e.assign_membership_on_login,
|
|
@@ -2428,7 +2428,7 @@ function rn(e, t) {
|
|
|
2428
2428
|
updated_at: e.updated_at
|
|
2429
2429
|
};
|
|
2430
2430
|
}
|
|
2431
|
-
function
|
|
2431
|
+
function on(e) {
|
|
2432
2432
|
return {
|
|
2433
2433
|
async create(t, n, r) {
|
|
2434
2434
|
let i = (/* @__PURE__ */ new Date()).toISOString(), a = {
|
|
@@ -2444,26 +2444,26 @@ function an(e) {
|
|
|
2444
2444
|
created_at: i,
|
|
2445
2445
|
updated_at: i
|
|
2446
2446
|
};
|
|
2447
|
-
return await K(e, a),
|
|
2447
|
+
return await K(e, a), an(a, await rn(e, t, r.connection_id));
|
|
2448
2448
|
},
|
|
2449
2449
|
async list(t, n) {
|
|
2450
2450
|
let { items: r } = await J(e, z.pk(t, n), { skPrefix: z.skPrefix() }), i = [];
|
|
2451
2451
|
for (let n of r) {
|
|
2452
|
-
let r = await
|
|
2453
|
-
i.push(
|
|
2452
|
+
let r = await rn(e, t, n.connection_id);
|
|
2453
|
+
i.push(an(n, r));
|
|
2454
2454
|
}
|
|
2455
2455
|
return i;
|
|
2456
2456
|
},
|
|
2457
2457
|
async get(t, n, r) {
|
|
2458
2458
|
let i = await G(e, z.pk(t, n), z.sk(r));
|
|
2459
|
-
return i ?
|
|
2459
|
+
return i ? an(i, await rn(e, t, r)) : null;
|
|
2460
2460
|
},
|
|
2461
2461
|
async update(t, n, r, i) {
|
|
2462
2462
|
if (!await G(e, z.pk(t, n), z.sk(r))) return null;
|
|
2463
2463
|
let a = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
2464
2464
|
i.assign_membership_on_login !== void 0 && (a.assign_membership_on_login = i.assign_membership_on_login), i.show_as_button !== void 0 && (a.show_as_button = i.show_as_button), i.is_signup_enabled !== void 0 && (a.is_signup_enabled = i.is_signup_enabled), await X(e, z.pk(t, n), z.sk(r), a);
|
|
2465
2465
|
let o = await G(e, z.pk(t, n), z.sk(r));
|
|
2466
|
-
return o ?
|
|
2466
|
+
return o ? an(o, await rn(e, t, r)) : null;
|
|
2467
2467
|
},
|
|
2468
2468
|
async remove(t, n, r) {
|
|
2469
2469
|
return await G(e, z.pk(t, n), z.sk(r)) ? q(e, z.pk(t, n), z.sk(r)) : !1;
|
|
@@ -2472,11 +2472,11 @@ function an(e) {
|
|
|
2472
2472
|
}
|
|
2473
2473
|
//#endregion
|
|
2474
2474
|
//#region src/adapters/userOrganizations.ts
|
|
2475
|
-
function
|
|
2475
|
+
function sn(e) {
|
|
2476
2476
|
let { tenant_id: t, ...n } = Z(e);
|
|
2477
2477
|
return we.parse(Q(n));
|
|
2478
2478
|
}
|
|
2479
|
-
function
|
|
2479
|
+
function cn(e) {
|
|
2480
2480
|
let { tenant_id: t, ...n } = Z(e), r = Q({
|
|
2481
2481
|
...n,
|
|
2482
2482
|
branding: e.branding ? JSON.parse(e.branding) : void 0,
|
|
@@ -2486,50 +2486,50 @@ function sn(e) {
|
|
|
2486
2486
|
});
|
|
2487
2487
|
return fe.parse(r);
|
|
2488
2488
|
}
|
|
2489
|
-
function
|
|
2489
|
+
function ln(e) {
|
|
2490
2490
|
return {
|
|
2491
|
-
async create(
|
|
2492
|
-
let
|
|
2493
|
-
PK: R.pk(
|
|
2494
|
-
SK: R.sk(
|
|
2495
|
-
GSI1PK: R.gsi1pk(
|
|
2496
|
-
GSI1SK: R.gsi1sk(
|
|
2497
|
-
GSI2PK: R.gsi2pk(
|
|
2498
|
-
GSI2SK: R.gsi2sk(
|
|
2491
|
+
async create(t, n) {
|
|
2492
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = d(), a = {
|
|
2493
|
+
PK: R.pk(t),
|
|
2494
|
+
SK: R.sk(i),
|
|
2495
|
+
GSI1PK: R.gsi1pk(t, n.user_id),
|
|
2496
|
+
GSI1SK: R.gsi1sk(n.organization_id),
|
|
2497
|
+
GSI2PK: R.gsi2pk(t, n.organization_id),
|
|
2498
|
+
GSI2SK: R.gsi2sk(n.user_id),
|
|
2499
2499
|
entityType: "USER_ORGANIZATION",
|
|
2500
|
-
tenant_id:
|
|
2501
|
-
id:
|
|
2502
|
-
user_id:
|
|
2503
|
-
organization_id:
|
|
2504
|
-
created_at:
|
|
2505
|
-
updated_at:
|
|
2500
|
+
tenant_id: t,
|
|
2501
|
+
id: i,
|
|
2502
|
+
user_id: n.user_id,
|
|
2503
|
+
organization_id: n.organization_id,
|
|
2504
|
+
created_at: r,
|
|
2505
|
+
updated_at: r
|
|
2506
2506
|
};
|
|
2507
|
-
return await K(
|
|
2507
|
+
return await K(e, a), sn(a);
|
|
2508
2508
|
},
|
|
2509
|
-
async get(
|
|
2510
|
-
let r = await G(
|
|
2511
|
-
return r ?
|
|
2509
|
+
async get(t, n) {
|
|
2510
|
+
let r = await G(e, R.pk(t), R.sk(n));
|
|
2511
|
+
return r ? sn(r) : null;
|
|
2512
2512
|
},
|
|
2513
|
-
async remove(
|
|
2514
|
-
return q(
|
|
2513
|
+
async remove(t, n) {
|
|
2514
|
+
return q(e, R.pk(t), R.sk(n));
|
|
2515
2515
|
},
|
|
2516
|
-
async list(
|
|
2517
|
-
let r = await Y(
|
|
2516
|
+
async list(t, n = {}) {
|
|
2517
|
+
let r = await Y(e, R.pk(t), n, { skPrefix: "USER_ORG#" });
|
|
2518
2518
|
return {
|
|
2519
|
-
userOrganizations: r.items.map(
|
|
2519
|
+
userOrganizations: r.items.map(sn),
|
|
2520
2520
|
start: r.start,
|
|
2521
2521
|
limit: r.limit,
|
|
2522
2522
|
length: r.length
|
|
2523
2523
|
};
|
|
2524
2524
|
},
|
|
2525
|
-
async listUserOrganizations(
|
|
2526
|
-
let i = await Y(
|
|
2525
|
+
async listUserOrganizations(t, n, r = {}) {
|
|
2526
|
+
let i = await Y(e, R.gsi1pk(t, n), r, {
|
|
2527
2527
|
indexName: "GSI1",
|
|
2528
2528
|
skPrefix: "USER_ORG#"
|
|
2529
2529
|
}), a = [];
|
|
2530
2530
|
for (let n of i.items) {
|
|
2531
|
-
let r = await G(
|
|
2532
|
-
r && a.push(
|
|
2531
|
+
let r = await G(e, L.pk(t), L.sk(n.organization_id));
|
|
2532
|
+
r && a.push(cn(r));
|
|
2533
2533
|
}
|
|
2534
2534
|
return {
|
|
2535
2535
|
organizations: a,
|
|
@@ -2538,18 +2538,18 @@ function cn(t) {
|
|
|
2538
2538
|
length: i.length
|
|
2539
2539
|
};
|
|
2540
2540
|
},
|
|
2541
|
-
async update(
|
|
2541
|
+
async update(t, n, r) {
|
|
2542
2542
|
let i = {
|
|
2543
2543
|
...r,
|
|
2544
2544
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2545
2545
|
};
|
|
2546
|
-
return X(
|
|
2546
|
+
return X(e, R.pk(t), R.sk(n), i);
|
|
2547
2547
|
}
|
|
2548
2548
|
};
|
|
2549
2549
|
}
|
|
2550
2550
|
//#endregion
|
|
2551
2551
|
//#region src/adapters/invites.ts
|
|
2552
|
-
function
|
|
2552
|
+
function un(e) {
|
|
2553
2553
|
let { tenant_id: t, ...n } = Z(e), r = Q({
|
|
2554
2554
|
...n,
|
|
2555
2555
|
inviter: e.inviter ? JSON.parse(e.inviter) : {},
|
|
@@ -2560,62 +2560,62 @@ function ln(e) {
|
|
|
2560
2560
|
});
|
|
2561
2561
|
return ce.parse(r);
|
|
2562
2562
|
}
|
|
2563
|
-
function
|
|
2563
|
+
function dn(e) {
|
|
2564
2564
|
return {
|
|
2565
|
-
async create(
|
|
2566
|
-
let
|
|
2567
|
-
PK: B.pk(
|
|
2568
|
-
SK: B.sk(
|
|
2569
|
-
GSI1PK: B.gsi1pk(
|
|
2570
|
-
GSI1SK: B.gsi1sk(
|
|
2565
|
+
async create(t, n) {
|
|
2566
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = d(), a = n.ttl_sec || 604800, o = new Date(Date.now() + a * 1e3).toISOString(), s = {
|
|
2567
|
+
PK: B.pk(t),
|
|
2568
|
+
SK: B.sk(i),
|
|
2569
|
+
GSI1PK: B.gsi1pk(t, n.organization_id),
|
|
2570
|
+
GSI1SK: B.gsi1sk(i),
|
|
2571
2571
|
entityType: "INVITE",
|
|
2572
|
-
tenant_id:
|
|
2573
|
-
id:
|
|
2574
|
-
organization_id:
|
|
2575
|
-
inviter: JSON.stringify(
|
|
2576
|
-
invitee: JSON.stringify(
|
|
2577
|
-
client_id:
|
|
2578
|
-
connection_id:
|
|
2579
|
-
invitation_url:
|
|
2580
|
-
expires_at:
|
|
2581
|
-
app_metadata:
|
|
2582
|
-
user_metadata:
|
|
2583
|
-
roles:
|
|
2584
|
-
ttl_sec:
|
|
2585
|
-
send_invitation_email:
|
|
2586
|
-
created_at:
|
|
2587
|
-
updated_at:
|
|
2572
|
+
tenant_id: t,
|
|
2573
|
+
id: i,
|
|
2574
|
+
organization_id: n.organization_id,
|
|
2575
|
+
inviter: JSON.stringify(n.inviter || {}),
|
|
2576
|
+
invitee: JSON.stringify(n.invitee || {}),
|
|
2577
|
+
client_id: n.client_id,
|
|
2578
|
+
connection_id: n.connection_id,
|
|
2579
|
+
invitation_url: n.invitation_url,
|
|
2580
|
+
expires_at: o,
|
|
2581
|
+
app_metadata: n.app_metadata ? JSON.stringify(n.app_metadata) : void 0,
|
|
2582
|
+
user_metadata: n.user_metadata ? JSON.stringify(n.user_metadata) : void 0,
|
|
2583
|
+
roles: n.roles ? JSON.stringify(n.roles) : void 0,
|
|
2584
|
+
ttl_sec: a,
|
|
2585
|
+
send_invitation_email: n.send_invitation_email ?? !0,
|
|
2586
|
+
created_at: r,
|
|
2587
|
+
updated_at: r
|
|
2588
2588
|
};
|
|
2589
|
-
return
|
|
2589
|
+
return s.ttl = Math.floor(new Date(o).getTime() / 1e3), await K(e, s), un(s);
|
|
2590
2590
|
},
|
|
2591
|
-
async get(
|
|
2592
|
-
let r = await G(
|
|
2593
|
-
return r ?
|
|
2591
|
+
async get(t, n) {
|
|
2592
|
+
let r = await G(e, B.pk(t), B.sk(n));
|
|
2593
|
+
return r ? un(r) : null;
|
|
2594
2594
|
},
|
|
2595
|
-
async list(
|
|
2596
|
-
let r = await Y(
|
|
2595
|
+
async list(t, n = {}) {
|
|
2596
|
+
let r = await Y(e, B.pk(t), n, { skPrefix: "INVITE#" });
|
|
2597
2597
|
return {
|
|
2598
|
-
invites: r.items.map(
|
|
2598
|
+
invites: r.items.map(un),
|
|
2599
2599
|
start: r.start,
|
|
2600
2600
|
limit: r.limit,
|
|
2601
2601
|
length: r.length
|
|
2602
2602
|
};
|
|
2603
2603
|
},
|
|
2604
|
-
async update(
|
|
2604
|
+
async update(t, n, r) {
|
|
2605
2605
|
let i = {
|
|
2606
2606
|
...r,
|
|
2607
2607
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
2608
2608
|
};
|
|
2609
|
-
return r.inviter !== void 0 && (i.inviter = JSON.stringify(r.inviter)), r.invitee !== void 0 && (i.invitee = JSON.stringify(r.invitee)), 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.roles !== void 0 && (i.roles = JSON.stringify(r.roles)), delete i.id, X(
|
|
2609
|
+
return r.inviter !== void 0 && (i.inviter = JSON.stringify(r.inviter)), r.invitee !== void 0 && (i.invitee = JSON.stringify(r.invitee)), 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.roles !== void 0 && (i.roles = JSON.stringify(r.roles)), delete i.id, X(e, B.pk(t), B.sk(n), i);
|
|
2610
2610
|
},
|
|
2611
|
-
async remove(
|
|
2612
|
-
return q(
|
|
2611
|
+
async remove(t, n) {
|
|
2612
|
+
return q(e, B.pk(t), B.sk(n));
|
|
2613
2613
|
}
|
|
2614
2614
|
};
|
|
2615
2615
|
}
|
|
2616
2616
|
//#endregion
|
|
2617
2617
|
//#region src/adapters/customText.ts
|
|
2618
|
-
function
|
|
2618
|
+
function fn(e) {
|
|
2619
2619
|
return {
|
|
2620
2620
|
async get(t, n, r) {
|
|
2621
2621
|
let i = await G(e, W.pk(t), W.sk(n, r));
|
|
@@ -2653,53 +2653,53 @@ function dn(e) {
|
|
|
2653
2653
|
}
|
|
2654
2654
|
//#endregion
|
|
2655
2655
|
//#region src/adapters/authenticationMethods.ts
|
|
2656
|
-
function
|
|
2656
|
+
function pn(e) {
|
|
2657
2657
|
let { tenant_id: t, ...r } = Z(e);
|
|
2658
2658
|
return n.parse(Q(r));
|
|
2659
2659
|
}
|
|
2660
|
-
function
|
|
2660
|
+
function mn(e) {
|
|
2661
2661
|
return {
|
|
2662
|
-
async create(
|
|
2663
|
-
let
|
|
2664
|
-
PK: H.pk(
|
|
2665
|
-
SK: H.sk(
|
|
2666
|
-
GSI1PK: H.gsi1pk(
|
|
2667
|
-
GSI1SK: H.gsi1sk(
|
|
2662
|
+
async create(t, n) {
|
|
2663
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = d(), a = {
|
|
2664
|
+
PK: H.pk(t),
|
|
2665
|
+
SK: H.sk(i),
|
|
2666
|
+
GSI1PK: H.gsi1pk(t, n.user_id),
|
|
2667
|
+
GSI1SK: H.gsi1sk(i),
|
|
2668
2668
|
entityType: "AUTHENTICATION_METHOD",
|
|
2669
|
-
id:
|
|
2670
|
-
tenant_id:
|
|
2671
|
-
user_id:
|
|
2672
|
-
type:
|
|
2673
|
-
phone_number:
|
|
2674
|
-
totp_secret:
|
|
2675
|
-
credential_id:
|
|
2676
|
-
public_key:
|
|
2677
|
-
sign_count:
|
|
2678
|
-
credential_backed_up:
|
|
2679
|
-
transports:
|
|
2680
|
-
friendly_name:
|
|
2681
|
-
confirmed:
|
|
2682
|
-
created_at:
|
|
2683
|
-
updated_at:
|
|
2684
|
-
},
|
|
2685
|
-
return await K(
|
|
2669
|
+
id: i,
|
|
2670
|
+
tenant_id: t,
|
|
2671
|
+
user_id: n.user_id,
|
|
2672
|
+
type: n.type,
|
|
2673
|
+
phone_number: n.phone_number,
|
|
2674
|
+
totp_secret: n.totp_secret,
|
|
2675
|
+
credential_id: n.credential_id,
|
|
2676
|
+
public_key: n.public_key,
|
|
2677
|
+
sign_count: n.sign_count,
|
|
2678
|
+
credential_backed_up: n.credential_backed_up,
|
|
2679
|
+
transports: n.transports,
|
|
2680
|
+
friendly_name: n.friendly_name,
|
|
2681
|
+
confirmed: n.confirmed ?? !1,
|
|
2682
|
+
created_at: r,
|
|
2683
|
+
updated_at: r
|
|
2684
|
+
}, o = pn(a);
|
|
2685
|
+
return await K(e, a), o;
|
|
2686
2686
|
},
|
|
2687
|
-
async get(
|
|
2688
|
-
let r = await G(
|
|
2689
|
-
return r ?
|
|
2687
|
+
async get(t, n) {
|
|
2688
|
+
let r = await G(e, H.pk(t), H.sk(n));
|
|
2689
|
+
return r ? pn(r) : null;
|
|
2690
2690
|
},
|
|
2691
|
-
async getByCredentialId(
|
|
2692
|
-
let r = (await J(
|
|
2693
|
-
return r ?
|
|
2691
|
+
async getByCredentialId(t, n) {
|
|
2692
|
+
let r = (await J(e, H.pk(t), { skPrefix: "AUTHENTICATION_METHOD#" })).items.find((e) => e.credential_id === n);
|
|
2693
|
+
return r ? pn(r) : null;
|
|
2694
2694
|
},
|
|
2695
|
-
async list(
|
|
2696
|
-
return (await J(
|
|
2695
|
+
async list(t, n) {
|
|
2696
|
+
return (await J(e, H.gsi1pk(t, n), {
|
|
2697
2697
|
skPrefix: H.gsi1skPrefix(),
|
|
2698
2698
|
indexName: "GSI1"
|
|
2699
|
-
})).items.map(
|
|
2699
|
+
})).items.map(pn);
|
|
2700
2700
|
},
|
|
2701
|
-
async update(
|
|
2702
|
-
let a = await this.get(
|
|
2701
|
+
async update(t, r, i) {
|
|
2702
|
+
let a = await this.get(t, r);
|
|
2703
2703
|
if (!a) throw Error(`Authentication method ${r} not found`);
|
|
2704
2704
|
let o = {
|
|
2705
2705
|
...a,
|
|
@@ -2708,16 +2708,16 @@ function pn(t) {
|
|
|
2708
2708
|
};
|
|
2709
2709
|
n.parse(o);
|
|
2710
2710
|
let s = { updated_at: o.updated_at };
|
|
2711
|
-
return i.phone_number !== void 0 && (s.phone_number = i.phone_number), i.totp_secret !== void 0 && (s.totp_secret = i.totp_secret), i.credential_id !== void 0 && (s.credential_id = i.credential_id), i.public_key !== void 0 && (s.public_key = i.public_key), i.sign_count !== void 0 && (s.sign_count = i.sign_count), i.credential_backed_up !== void 0 && (s.credential_backed_up = i.credential_backed_up), i.transports !== void 0 && (s.transports = i.transports), i.friendly_name !== void 0 && (s.friendly_name = i.friendly_name), i.confirmed !== void 0 && (s.confirmed = i.confirmed), await X(
|
|
2711
|
+
return i.phone_number !== void 0 && (s.phone_number = i.phone_number), i.totp_secret !== void 0 && (s.totp_secret = i.totp_secret), i.credential_id !== void 0 && (s.credential_id = i.credential_id), i.public_key !== void 0 && (s.public_key = i.public_key), i.sign_count !== void 0 && (s.sign_count = i.sign_count), i.credential_backed_up !== void 0 && (s.credential_backed_up = i.credential_backed_up), i.transports !== void 0 && (s.transports = i.transports), i.friendly_name !== void 0 && (s.friendly_name = i.friendly_name), i.confirmed !== void 0 && (s.confirmed = i.confirmed), await X(e, H.pk(t), H.sk(r), s), n.parse(o);
|
|
2712
2712
|
},
|
|
2713
|
-
async remove(
|
|
2714
|
-
return q(
|
|
2713
|
+
async remove(t, n) {
|
|
2714
|
+
return q(e, H.pk(t), H.sk(n));
|
|
2715
2715
|
}
|
|
2716
2716
|
};
|
|
2717
2717
|
}
|
|
2718
2718
|
//#endregion
|
|
2719
2719
|
//#region src/adapters/proxyRoutes.ts
|
|
2720
|
-
function
|
|
2720
|
+
function hn(e) {
|
|
2721
2721
|
if (!e) return { path: "/*" };
|
|
2722
2722
|
try {
|
|
2723
2723
|
let t = JSON.parse(e), n = de.safeParse(t);
|
|
@@ -2725,7 +2725,7 @@ function mn(e) {
|
|
|
2725
2725
|
} catch {}
|
|
2726
2726
|
return { path: "/*" };
|
|
2727
2727
|
}
|
|
2728
|
-
function
|
|
2728
|
+
function gn(e) {
|
|
2729
2729
|
if (!e) return [];
|
|
2730
2730
|
try {
|
|
2731
2731
|
let t = JSON.parse(e);
|
|
@@ -2740,70 +2740,70 @@ function hn(e) {
|
|
|
2740
2740
|
return [];
|
|
2741
2741
|
}
|
|
2742
2742
|
}
|
|
2743
|
-
function
|
|
2743
|
+
function _n(e) {
|
|
2744
2744
|
let { match: t, handlers: n, ...r } = Z(e);
|
|
2745
2745
|
return Q({
|
|
2746
2746
|
...r,
|
|
2747
|
-
match:
|
|
2748
|
-
handlers:
|
|
2747
|
+
match: hn(t),
|
|
2748
|
+
handlers: gn(n)
|
|
2749
2749
|
});
|
|
2750
2750
|
}
|
|
2751
|
-
function
|
|
2751
|
+
function vn(e) {
|
|
2752
2752
|
return [...e].sort((e, t) => e.priority === t.priority ? e.created_at.localeCompare(t.created_at) : e.priority - t.priority);
|
|
2753
2753
|
}
|
|
2754
|
-
function
|
|
2754
|
+
function yn(e) {
|
|
2755
2755
|
return {
|
|
2756
|
-
async create(
|
|
2757
|
-
let
|
|
2758
|
-
PK:
|
|
2759
|
-
SK:
|
|
2760
|
-
GSI1PK:
|
|
2761
|
-
GSI1SK:
|
|
2756
|
+
async create(t, n) {
|
|
2757
|
+
let r = (/* @__PURE__ */ new Date()).toISOString(), i = d(), a = {
|
|
2758
|
+
PK: T.pk(t),
|
|
2759
|
+
SK: T.sk(i),
|
|
2760
|
+
GSI1PK: T.gsi1pk(t, n.custom_domain_id),
|
|
2761
|
+
GSI1SK: T.gsi1sk(i),
|
|
2762
2762
|
entityType: "PROXY_ROUTE",
|
|
2763
|
-
tenant_id:
|
|
2764
|
-
id:
|
|
2765
|
-
custom_domain_id:
|
|
2766
|
-
priority:
|
|
2767
|
-
match: JSON.stringify(
|
|
2768
|
-
handlers: JSON.stringify(
|
|
2769
|
-
created_at:
|
|
2770
|
-
updated_at:
|
|
2763
|
+
tenant_id: t,
|
|
2764
|
+
id: i,
|
|
2765
|
+
custom_domain_id: n.custom_domain_id,
|
|
2766
|
+
priority: n.priority,
|
|
2767
|
+
match: JSON.stringify(n.match),
|
|
2768
|
+
handlers: JSON.stringify(n.handlers),
|
|
2769
|
+
created_at: r,
|
|
2770
|
+
updated_at: r
|
|
2771
2771
|
};
|
|
2772
|
-
return await K(
|
|
2772
|
+
return await K(e, a), _n(a);
|
|
2773
2773
|
},
|
|
2774
|
-
async get(
|
|
2775
|
-
let r = await G(
|
|
2776
|
-
return r ?
|
|
2774
|
+
async get(t, n) {
|
|
2775
|
+
let r = await G(e, T.pk(t), T.sk(n));
|
|
2776
|
+
return r ? _n(r) : null;
|
|
2777
2777
|
},
|
|
2778
|
-
async list(
|
|
2778
|
+
async list(t, n = {}) {
|
|
2779
2779
|
let r = n.page ?? 0, i = n.per_page ?? 50, a;
|
|
2780
2780
|
if (n.custom_domain_id) {
|
|
2781
|
-
let { items: r } = await J(
|
|
2781
|
+
let { items: r } = await J(e, T.gsi1pk(t, n.custom_domain_id), { indexName: "GSI1" });
|
|
2782
2782
|
a = r;
|
|
2783
2783
|
} else {
|
|
2784
|
-
let { items: n } = await J(
|
|
2784
|
+
let { items: n } = await J(e, T.pk(t), { skPrefix: "PROXY_ROUTE#" });
|
|
2785
2785
|
a = n;
|
|
2786
2786
|
}
|
|
2787
|
-
let o =
|
|
2787
|
+
let o = vn(a).slice(r * i, r * i + i);
|
|
2788
2788
|
return {
|
|
2789
|
-
proxy_routes: o.map(
|
|
2789
|
+
proxy_routes: o.map(_n),
|
|
2790
2790
|
start: r * i,
|
|
2791
2791
|
limit: i,
|
|
2792
2792
|
length: o.length
|
|
2793
2793
|
};
|
|
2794
2794
|
},
|
|
2795
|
-
async update(
|
|
2795
|
+
async update(t, n, r) {
|
|
2796
2796
|
let i = { updated_at: (/* @__PURE__ */ new Date()).toISOString() };
|
|
2797
|
-
return r.priority !== void 0 && (i.priority = r.priority), r.match !== void 0 && (i.match = JSON.stringify(r.match)), r.handlers !== void 0 && (i.handlers = JSON.stringify(r.handlers)), await G(
|
|
2797
|
+
return r.priority !== void 0 && (i.priority = r.priority), r.match !== void 0 && (i.match = JSON.stringify(r.match)), r.handlers !== void 0 && (i.handlers = JSON.stringify(r.handlers)), await G(e, T.pk(t), T.sk(n)) ? X(e, T.pk(t), T.sk(n), i) : !1;
|
|
2798
2798
|
},
|
|
2799
|
-
async remove(
|
|
2800
|
-
return await G(
|
|
2799
|
+
async remove(t, n) {
|
|
2800
|
+
return await G(e, T.pk(t), T.sk(n)) ? q(e, T.pk(t), T.sk(n)) : !1;
|
|
2801
2801
|
}
|
|
2802
2802
|
};
|
|
2803
2803
|
}
|
|
2804
2804
|
//#endregion
|
|
2805
2805
|
//#region src/adapters/proxyData.ts
|
|
2806
|
-
function
|
|
2806
|
+
function bn(e) {
|
|
2807
2807
|
if (!e) return null;
|
|
2808
2808
|
let t;
|
|
2809
2809
|
try {
|
|
@@ -2814,7 +2814,7 @@ function yn(e) {
|
|
|
2814
2814
|
let n = de.safeParse(t);
|
|
2815
2815
|
return n.success ? n.data : null;
|
|
2816
2816
|
}
|
|
2817
|
-
function
|
|
2817
|
+
function xn(e) {
|
|
2818
2818
|
if (!e) return null;
|
|
2819
2819
|
let t;
|
|
2820
2820
|
try {
|
|
@@ -2831,8 +2831,8 @@ function bn(e) {
|
|
|
2831
2831
|
}
|
|
2832
2832
|
return n;
|
|
2833
2833
|
}
|
|
2834
|
-
function
|
|
2835
|
-
let t =
|
|
2834
|
+
function Sn(e) {
|
|
2835
|
+
let t = bn(e.match), n = xn(e.handlers);
|
|
2836
2836
|
return t === null || n === null ? null : {
|
|
2837
2837
|
id: e.id,
|
|
2838
2838
|
tenant_id: e.tenant_id,
|
|
@@ -2844,13 +2844,13 @@ function xn(e) {
|
|
|
2844
2844
|
updated_at: e.updated_at
|
|
2845
2845
|
};
|
|
2846
2846
|
}
|
|
2847
|
-
async function
|
|
2848
|
-
let n = t.indexOf(":"), r = n === -1 ? t : t.slice(0, n), i = (r.endsWith(".") ? r.slice(0, -1) : r).toLowerCase(), { items: a } = await J(e,
|
|
2847
|
+
async function Cn(e, t) {
|
|
2848
|
+
let n = t.indexOf(":"), r = n === -1 ? t : t.slice(0, n), i = (r.endsWith(".") ? r.slice(0, -1) : r).toLowerCase(), { items: a } = await J(e, w.gsi1pk(i), {
|
|
2849
2849
|
indexName: "GSI1",
|
|
2850
|
-
skValue:
|
|
2850
|
+
skValue: w.gsi1sk()
|
|
2851
2851
|
}), o = a[0];
|
|
2852
2852
|
if (!o) return null;
|
|
2853
|
-
let { items: s } = await J(e,
|
|
2853
|
+
let { items: s } = await J(e, T.gsi1pk(o.tenant_id, o.custom_domain_id), { indexName: "GSI1" }), c = s.map(Sn).filter((e) => e !== null).sort((e, t) => e.priority === t.priority ? e.created_at.localeCompare(t.created_at) : e.priority - t.priority);
|
|
2854
2854
|
return {
|
|
2855
2855
|
tenant_id: o.tenant_id,
|
|
2856
2856
|
custom_domain_id: o.custom_domain_id,
|
|
@@ -2858,15 +2858,15 @@ async function Sn(e, t) {
|
|
|
2858
2858
|
routes: c
|
|
2859
2859
|
};
|
|
2860
2860
|
}
|
|
2861
|
-
function
|
|
2861
|
+
function wn(e) {
|
|
2862
2862
|
return {
|
|
2863
|
-
proxyRoutes:
|
|
2864
|
-
resolveHost: (t) =>
|
|
2863
|
+
proxyRoutes: yn(e),
|
|
2864
|
+
resolveHost: (t) => Cn(e, t)
|
|
2865
2865
|
};
|
|
2866
2866
|
}
|
|
2867
2867
|
//#endregion
|
|
2868
2868
|
//#region src/index.ts
|
|
2869
|
-
function
|
|
2869
|
+
function Tn(e, t) {
|
|
2870
2870
|
let n = {
|
|
2871
2871
|
client: e,
|
|
2872
2872
|
tableName: t.tableName
|
|
@@ -2874,43 +2874,43 @@ function wn(e, t) {
|
|
|
2874
2874
|
actions: Fe(),
|
|
2875
2875
|
actionExecutions: Ie(),
|
|
2876
2876
|
actionVersions: Le(),
|
|
2877
|
-
branding:
|
|
2878
|
-
clients:
|
|
2879
|
-
clientConnections:
|
|
2880
|
-
clientGrants:
|
|
2881
|
-
clientRegistrationTokens:
|
|
2882
|
-
codes:
|
|
2883
|
-
connections:
|
|
2884
|
-
customDomains:
|
|
2885
|
-
emailProviders:
|
|
2886
|
-
emailTemplates:
|
|
2887
|
-
flows:
|
|
2888
|
-
forms:
|
|
2889
|
-
hookCode:
|
|
2890
|
-
hooks:
|
|
2891
|
-
invites:
|
|
2892
|
-
keys:
|
|
2893
|
-
loginSessions:
|
|
2894
|
-
logs:
|
|
2895
|
-
authenticationMethods:
|
|
2896
|
-
organizations:
|
|
2897
|
-
organizationConnections:
|
|
2898
|
-
passwords:
|
|
2899
|
-
promptSettings:
|
|
2900
|
-
proxyRoutes:
|
|
2901
|
-
refreshTokens:
|
|
2902
|
-
resourceServers:
|
|
2903
|
-
rolePermissions:
|
|
2904
|
-
roles:
|
|
2905
|
-
sessions:
|
|
2906
|
-
tenants:
|
|
2907
|
-
themes:
|
|
2908
|
-
universalLoginTemplates:
|
|
2909
|
-
customText:
|
|
2910
|
-
userOrganizations:
|
|
2911
|
-
userPermissions:
|
|
2912
|
-
userRoles:
|
|
2913
|
-
users:
|
|
2877
|
+
branding: vt(n),
|
|
2878
|
+
clients: ot(n),
|
|
2879
|
+
clientConnections: ut(n),
|
|
2880
|
+
clientGrants: ct(n),
|
|
2881
|
+
clientRegistrationTokens: ft(n),
|
|
2882
|
+
codes: rt(n),
|
|
2883
|
+
connections: mt(n),
|
|
2884
|
+
customDomains: Ot(n),
|
|
2885
|
+
emailProviders: Lt(n),
|
|
2886
|
+
emailTemplates: zt(n),
|
|
2887
|
+
flows: qe(n),
|
|
2888
|
+
forms: Wt(n),
|
|
2889
|
+
hookCode: xt(n),
|
|
2890
|
+
hooks: Ct(n),
|
|
2891
|
+
invites: dn(n),
|
|
2892
|
+
keys: Tt(n),
|
|
2893
|
+
loginSessions: gt(n),
|
|
2894
|
+
logs: At(n),
|
|
2895
|
+
authenticationMethods: mn(n),
|
|
2896
|
+
organizations: nn(n),
|
|
2897
|
+
organizationConnections: on(n),
|
|
2898
|
+
passwords: tt(n),
|
|
2899
|
+
promptSettings: Ft(n),
|
|
2900
|
+
proxyRoutes: yn(n),
|
|
2901
|
+
refreshTokens: Ht(n),
|
|
2902
|
+
resourceServers: Kt(n),
|
|
2903
|
+
rolePermissions: Xt(n),
|
|
2904
|
+
roles: Jt(n),
|
|
2905
|
+
sessions: $e(n),
|
|
2906
|
+
tenants: Ye(n),
|
|
2907
|
+
themes: Mt(n),
|
|
2908
|
+
universalLoginTemplates: yt(n),
|
|
2909
|
+
customText: fn(n),
|
|
2910
|
+
userOrganizations: ln(n),
|
|
2911
|
+
userPermissions: Qt(n),
|
|
2912
|
+
userRoles: en(n),
|
|
2913
|
+
users: Ze(n),
|
|
2914
2914
|
async transaction(e) {
|
|
2915
2915
|
if (r.outbox) throw Error("DynamoDB adapter does not support atomic transactions. Cannot guarantee atomicity between entity writes and outbox events. Use a SQL-backed adapter for outbox-enabled tenants.");
|
|
2916
2916
|
return e(r);
|
|
@@ -2919,4 +2919,4 @@ function wn(e, t) {
|
|
|
2919
2919
|
return r;
|
|
2920
2920
|
}
|
|
2921
2921
|
//#endregion
|
|
2922
|
-
export { H as authenticationMethodKeys, Re as brandingKeys, V as clientConnectionKeys,
|
|
2922
|
+
export { H as authenticationMethodKeys, Re as brandingKeys, V as clientConnectionKeys, _ as clientGrantKeys, g as clientKeys, U as clientRegistrationTokenKeys, y as codeKeys, v as connectionKeys, Ie as createActionExecutionsAdapter, Le as createActionVersionsAdapter, Fe as createActionsAdapter, mn as createAuthenticationMethodsAdapter, vt as createBrandingAdapter, ut as createClientConnectionsAdapter, ct as createClientGrantsAdapter, ot as createClientsAdapter, rt as createCodesAdapter, mt as createConnectionsAdapter, Ot as createCustomDomainsAdapter, Lt as createEmailProvidersAdapter, qe as createFlowsAdapter, Wt as createFormsAdapter, Ct as createHooksAdapter, dn as createInvitesAdapter, Tt as createKeysAdapter, gt as createLoginSessionsAdapter, At as createLogsAdapter, on as createOrganizationConnectionsAdapter, nn as createOrganizationsAdapter, tt as createPasswordsAdapter, Ft as createPromptSettingsAdapter, wn as createProxyDataAdapter, yn as createProxyRoutesAdapter, Ht as createRefreshTokensAdapter, Kt as createResourceServersAdapter, Xt as createRolePermissionsAdapter, Jt as createRolesAdapter, $e as createSessionsAdapter, Ye as createTenantsAdapter, Mt as createThemesAdapter, ln as createUserOrganizationsAdapter, Qt as createUserPermissionsAdapter, en as createUserRolesAdapter, Ze as createUsersAdapter, w as customDomainKeys, W as customTextKeys, Tn as default, q as deleteItem, D as emailProviderKeys, O as emailTemplateKeys, j as flowKeys, A as formKeys, G as getItem, C as hookKeys, B as inviteKeys, Ge as isKeysetRequest, ze as keyKeys, Ve as legacyClientKeys, E as logKeys, h as loginSessionKeys, z as organizationConnectionKeys, L as organizationKeys, b as passwordKeys, Be as promptSettingsKeys, T as proxyRouteKeys, K as putItem, J as queryItems, Y as queryWithPagination, k as refreshTokenKeys, Q as removeNullProperties, M as resourceServerKeys, N as roleKeys, P as rolePermissionKeys, m as sessionKeys, Z as stripDynamoDBFields, f as tenantKeys, S as themeKeys, We as transactWriteItems, x as universalLoginTemplateKeys, X as updateItem, p as userKeys, R as userOrganizationKeys, F as userPermissionKeys, I as userRoleKeys };
|