@robelest/convex-auth 0.0.4-preview.32 → 0.0.4-preview.34
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/component/_generated/component.d.ts +1611 -2039
- package/dist/component/account.js +3 -0
- package/dist/component/convex.config.d.ts +2 -2
- package/dist/component/factor/device.js +3 -0
- package/dist/component/factor/passkey.js +3 -0
- package/dist/component/factor/totp.js +3 -0
- package/dist/component/group/invite.js +3 -0
- package/dist/component/group/member.js +3 -0
- package/dist/component/group.js +3 -0
- package/dist/component/model.d.ts +342 -30
- package/dist/component/model.js +22 -4
- package/dist/component/modules.js +24 -21
- package/dist/component/public/factors/devices.js +37 -106
- package/dist/component/public/factors/passkeys.js +29 -149
- package/dist/component/public/factors/totp.js +32 -159
- package/dist/component/public/groups/core.js +19 -82
- package/dist/component/public/groups/invites.js +15 -104
- package/dist/component/public/groups/members.js +26 -149
- package/dist/component/public/identity/accounts.js +12 -94
- package/dist/component/public/identity/codes.js +13 -73
- package/dist/component/public/identity/sessions.js +5 -107
- package/dist/component/public/identity/tokens.js +13 -103
- package/dist/component/public/identity/users.js +188 -185
- package/dist/component/public/identity/verifiers.js +17 -80
- package/dist/component/public/security/keys.js +13 -120
- package/dist/component/public/security/limits.js +0 -43
- package/dist/component/public/sso/audit.js +0 -28
- package/dist/component/public/sso/core.js +31 -104
- package/dist/component/public/sso/domains.js +0 -71
- package/dist/component/public/sso/scim.js +63 -239
- package/dist/component/public/sso/secrets.js +0 -30
- package/dist/component/public/sso/webhooks.js +23 -128
- package/dist/component/rateLimit.js +3 -0
- package/dist/component/schema.d.ts +378 -342
- package/dist/component/schema.js +11 -1
- package/dist/component/session.js +3 -0
- package/dist/component/sso/audit.js +3 -0
- package/dist/component/sso/connection/domain/verification.js +3 -0
- package/dist/component/sso/connection/domain.js +3 -0
- package/dist/component/sso/connection/scim/config.js +3 -0
- package/dist/component/sso/connection/scim/identity.js +3 -0
- package/dist/component/sso/connection/secret.js +3 -0
- package/dist/component/sso/connection.js +3 -0
- package/dist/component/sso/webhook/delivery.js +3 -0
- package/dist/component/sso/webhook/endpoint.js +3 -0
- package/dist/component/token/pkce.js +3 -0
- package/dist/component/token/refresh.js +3 -0
- package/dist/component/token/verification.js +3 -0
- package/dist/component/user/email.js +3 -0
- package/dist/component/user/key.js +3 -0
- package/dist/component/user.js +62 -0
- package/dist/core/index.d.ts +131 -28
- package/dist/core/index.js +2 -0
- package/dist/model.js +391 -0
- package/dist/providers/credentials.d.ts +1 -1
- package/dist/providers/github.js +6 -0
- package/dist/providers/password.js +1 -2
- package/dist/server/auth.d.ts +73 -7
- package/dist/server/auth.js +4 -1
- package/dist/server/context.js +30 -3
- package/dist/server/contract.js +42 -42
- package/dist/server/core.js +224 -86
- package/dist/server/db.js +45 -37
- package/dist/server/facade.d.ts +39 -0
- package/dist/server/facade.js +16 -0
- package/dist/server/index.d.ts +5 -3
- package/dist/server/index.js +3 -1
- package/dist/server/mounts.d.ts +101 -101
- package/dist/server/mutations/credentials/signin.js +3 -7
- package/dist/server/mutations/oauth.js +9 -6
- package/dist/server/runtime.d.ts +147 -46
- package/dist/server/runtime.js +10 -8
- package/dist/server/services/group.js +9 -9
- package/dist/server/sso/domain.d.ts +1 -1
- package/dist/server/sso/domain.js +40 -40
- package/dist/server/sso/http.js +18 -18
- package/dist/server/sso/oidc.js +1 -1
- package/dist/server/sso/policies.js +3 -3
- package/dist/server/sso/policy.js +12 -4
- package/dist/server/sso/provision.js +9 -9
- package/dist/server/sso/validators.js +2 -2
- package/dist/server/sso/webhook.js +8 -8
- package/dist/server/types.d.ts +185 -124
- package/dist/server/types.js +29 -24
- package/dist/server/users.js +49 -2
- package/dist/server/validators.d.ts +745 -0
- package/dist/server/validators.js +60 -0
- package/package.json +1 -1
- package/dist/component/public.js +0 -22
package/dist/server/contract.js
CHANGED
|
@@ -3,72 +3,72 @@ import { cached, invalidateCtxCache } from "./cache/context.js";
|
|
|
3
3
|
//#region src/server/contract.ts
|
|
4
4
|
const query = (ctx, ref, args) => ctx.runQuery(ref, args);
|
|
5
5
|
const mutate = (ctx, ref, args) => ctx.runMutation(ref, args);
|
|
6
|
-
const getGroupConnection = (ctx,
|
|
7
|
-
const getGroupConnectionByDomain = (ctx,
|
|
8
|
-
const listGroupConnections = (ctx,
|
|
9
|
-
const createGroupConnection = (ctx,
|
|
10
|
-
const updateGroupConnection = async (ctx,
|
|
11
|
-
const result = await mutate(ctx,
|
|
6
|
+
const getGroupConnection = (ctx, componentSso, connectionId) => cached(ctx, `group-connection:${connectionId}`, () => query(ctx, componentSso.connection.get, { connectionId }));
|
|
7
|
+
const getGroupConnectionByDomain = (ctx, componentSso, domain) => cached(ctx, `group-connection-domain:${domain}`, () => query(ctx, componentSso.connection.get, { domain }));
|
|
8
|
+
const listGroupConnections = (ctx, componentSso, args) => query(ctx, componentSso.connection.list, args);
|
|
9
|
+
const createGroupConnection = (ctx, componentSso, args) => mutate(ctx, componentSso.connection.create, args);
|
|
10
|
+
const updateGroupConnection = async (ctx, componentSso, args) => {
|
|
11
|
+
const result = await mutate(ctx, componentSso.connection.update, args);
|
|
12
12
|
invalidateCtxCache(ctx, `group-connection:${args.connectionId}`);
|
|
13
13
|
invalidateCtxCache(ctx, "group-connection-domain");
|
|
14
14
|
return result;
|
|
15
15
|
};
|
|
16
|
-
const deleteGroupConnection = async (ctx,
|
|
17
|
-
const result = await mutate(ctx,
|
|
16
|
+
const deleteGroupConnection = async (ctx, componentSso, connectionId) => {
|
|
17
|
+
const result = await mutate(ctx, componentSso.connection.delete, { connectionId });
|
|
18
18
|
invalidateCtxCache(ctx, `group-connection:${connectionId}`);
|
|
19
19
|
invalidateCtxCache(ctx, "group-connection-domain");
|
|
20
20
|
invalidateCtxCache(ctx, `connection-domains:${connectionId}`);
|
|
21
21
|
invalidateCtxCache(ctx, "group-connection-secret");
|
|
22
22
|
return result;
|
|
23
23
|
};
|
|
24
|
-
const getGroup = (ctx,
|
|
25
|
-
const listConnectionDomains = (ctx,
|
|
26
|
-
const addConnectionDomain = async (ctx,
|
|
27
|
-
const result = await mutate(ctx,
|
|
24
|
+
const getGroup = (ctx, componentGroup, groupId) => cached(ctx, `group-record:${groupId}`, () => query(ctx, componentGroup.get, { id: groupId }));
|
|
25
|
+
const listConnectionDomains = (ctx, componentSso, connectionId) => cached(ctx, `connection-domains:${connectionId}`, () => query(ctx, componentSso.connection.domain.list, { connectionId }));
|
|
26
|
+
const addConnectionDomain = async (ctx, componentSso, args) => {
|
|
27
|
+
const result = await mutate(ctx, componentSso.connection.domain.create, args);
|
|
28
28
|
invalidateCtxCache(ctx, `connection-domains:${args.connectionId}`);
|
|
29
29
|
invalidateCtxCache(ctx, "group-connection-domain");
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
|
-
const deleteConnectionDomain = async (ctx,
|
|
33
|
-
const result = await mutate(ctx,
|
|
32
|
+
const deleteConnectionDomain = async (ctx, componentSso, domainId) => {
|
|
33
|
+
const result = await mutate(ctx, componentSso.connection.domain.delete, { domainId });
|
|
34
34
|
invalidateCtxCache(ctx, "connection-domains");
|
|
35
35
|
invalidateCtxCache(ctx, "group-connection-domain");
|
|
36
36
|
return result;
|
|
37
37
|
};
|
|
38
|
-
const getScimConfigByConnection = (ctx,
|
|
39
|
-
const getScimConfigByTokenHash = (ctx,
|
|
40
|
-
const upsertScimConfig = async (ctx,
|
|
41
|
-
const result = await mutate(ctx,
|
|
38
|
+
const getScimConfigByConnection = (ctx, componentSso, connectionId) => cached(ctx, `scim-config-by-connection:${connectionId}`, () => query(ctx, componentSso.connection.scim.config.get, { connectionId }));
|
|
39
|
+
const getScimConfigByTokenHash = (ctx, componentSso, tokenHash) => query(ctx, componentSso.connection.scim.config.get, { tokenHash });
|
|
40
|
+
const upsertScimConfig = async (ctx, componentSso, args) => {
|
|
41
|
+
const result = await mutate(ctx, componentSso.connection.scim.config.upsert, args);
|
|
42
42
|
invalidateCtxCache(ctx, `scim-config-by-connection:${args.connectionId}`);
|
|
43
43
|
return result;
|
|
44
44
|
};
|
|
45
|
-
const getConnectionDomainVerification = (ctx,
|
|
46
|
-
const upsertConnectionDomainVerification = (ctx,
|
|
47
|
-
const deleteConnectionDomainVerification = (ctx,
|
|
48
|
-
const verifyConnectionDomain = (ctx,
|
|
49
|
-
const getGroupConnectionSecret = (ctx,
|
|
50
|
-
const upsertGroupConnectionSecret = async (ctx,
|
|
51
|
-
const result = await mutate(ctx,
|
|
45
|
+
const getConnectionDomainVerification = (ctx, componentSso, domainId) => query(ctx, componentSso.connection.domain.verification.get, { domainId });
|
|
46
|
+
const upsertConnectionDomainVerification = (ctx, componentSso, args) => mutate(ctx, componentSso.connection.domain.verification.upsert, args);
|
|
47
|
+
const deleteConnectionDomainVerification = (ctx, componentSso, domainId) => mutate(ctx, componentSso.connection.domain.verification.delete, { domainId });
|
|
48
|
+
const verifyConnectionDomain = (ctx, componentSso, args) => mutate(ctx, componentSso.connection.domain.verify, args);
|
|
49
|
+
const getGroupConnectionSecret = (ctx, componentSso, args) => cached(ctx, `group-connection-secret:${args.connectionId}:${args.kind}`, () => query(ctx, componentSso.connection.secret.get, args));
|
|
50
|
+
const upsertGroupConnectionSecret = async (ctx, componentSso, args) => {
|
|
51
|
+
const result = await mutate(ctx, componentSso.connection.secret.upsert, args);
|
|
52
52
|
invalidateCtxCache(ctx, `group-connection-secret:${args.connectionId}:${args.kind}`);
|
|
53
53
|
return result;
|
|
54
54
|
};
|
|
55
|
-
const listWebhookEndpoints = (ctx,
|
|
56
|
-
const listWebhookDeliveries = (ctx,
|
|
57
|
-
const listScimIdentitiesByConnection = (ctx,
|
|
58
|
-
const getScimIdentityByConnectionAndUser = (ctx,
|
|
59
|
-
const getScimIdentityByMappedGroup = (ctx,
|
|
60
|
-
const upsertScimIdentity = (ctx,
|
|
61
|
-
const deleteScimIdentity = (ctx,
|
|
62
|
-
const insertAccount = (ctx,
|
|
63
|
-
const insertUser = (ctx,
|
|
64
|
-
const patchUser = (ctx,
|
|
65
|
-
const getScimIdentity = (ctx,
|
|
66
|
-
const listAuditEvents = (ctx,
|
|
67
|
-
const getWebhookEndpoint = (ctx,
|
|
68
|
-
const createWebhookEndpoint = (ctx,
|
|
69
|
-
const updateWebhookEndpoint = (ctx,
|
|
70
|
-
const listReadyWebhookDeliveries = (ctx,
|
|
71
|
-
const patchWebhookDelivery = (ctx,
|
|
55
|
+
const listWebhookEndpoints = (ctx, componentSso, connectionId) => query(ctx, componentSso.webhook.endpoint.list, { connectionId });
|
|
56
|
+
const listWebhookDeliveries = (ctx, componentSso, args) => query(ctx, componentSso.webhook.delivery.list, args);
|
|
57
|
+
const listScimIdentitiesByConnection = (ctx, componentSso, connectionId) => query(ctx, componentSso.connection.scim.identity.list, { connectionId });
|
|
58
|
+
const getScimIdentityByConnectionAndUser = (ctx, componentSso, args) => query(ctx, componentSso.connection.scim.identity.get, args);
|
|
59
|
+
const getScimIdentityByMappedGroup = (ctx, componentSso, mappedGroupId) => query(ctx, componentSso.connection.scim.identity.get, { mappedGroupId });
|
|
60
|
+
const upsertScimIdentity = (ctx, componentSso, args) => mutate(ctx, componentSso.connection.scim.identity.upsert, args);
|
|
61
|
+
const deleteScimIdentity = (ctx, componentSso, identityId) => mutate(ctx, componentSso.connection.scim.identity.delete, { identityId });
|
|
62
|
+
const insertAccount = (ctx, componentAccount, args) => mutate(ctx, componentAccount.create, args);
|
|
63
|
+
const insertUser = (ctx, componentUser, data) => mutate(ctx, componentUser.create, { data });
|
|
64
|
+
const patchUser = (ctx, componentUser, args) => mutate(ctx, componentUser.update, args);
|
|
65
|
+
const getScimIdentity = (ctx, componentSso, args) => query(ctx, componentSso.connection.scim.identity.get, args);
|
|
66
|
+
const listAuditEvents = (ctx, componentSso, args) => query(ctx, componentSso.audit.list, args);
|
|
67
|
+
const getWebhookEndpoint = (ctx, componentSso, endpointId) => query(ctx, componentSso.webhook.endpoint.get, { endpointId });
|
|
68
|
+
const createWebhookEndpoint = (ctx, componentSso, args) => mutate(ctx, componentSso.webhook.endpoint.create, args);
|
|
69
|
+
const updateWebhookEndpoint = (ctx, componentSso, args) => mutate(ctx, componentSso.webhook.endpoint.update, args);
|
|
70
|
+
const listReadyWebhookDeliveries = (ctx, componentSso, args) => query(ctx, componentSso.webhook.delivery.list, args);
|
|
71
|
+
const patchWebhookDelivery = (ctx, componentSso, args) => mutate(ctx, componentSso.webhook.delivery.update, args);
|
|
72
72
|
|
|
73
73
|
//#endregion
|
|
74
74
|
export { addConnectionDomain, createGroupConnection, createWebhookEndpoint, deleteConnectionDomain, deleteConnectionDomainVerification, deleteGroupConnection, deleteScimIdentity, getConnectionDomainVerification, getGroup, getGroupConnection, getGroupConnectionByDomain, getGroupConnectionSecret, getScimConfigByConnection, getScimConfigByTokenHash, getScimIdentity, getScimIdentityByConnectionAndUser, getScimIdentityByMappedGroup, getWebhookEndpoint, insertAccount, insertUser, listAuditEvents, listConnectionDomains, listGroupConnections, listReadyWebhookDeliveries, listScimIdentitiesByConnection, listWebhookDeliveries, listWebhookEndpoints, patchUser, patchWebhookDelivery, updateGroupConnection, updateWebhookEndpoint, upsertConnectionDomainVerification, upsertGroupConnectionSecret, upsertScimConfig, upsertScimIdentity, verifyConnectionDomain };
|