@astrale-os/kernel-core 0.9.0-beta.39 → 0.9.0-beta.40
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/auth/index.d.ts +2 -2
- package/dist/auth/index.js +1 -1
- package/dist/auth/jwk/index.d.ts +1 -1
- package/dist/auth/jwk/index.js +1 -1
- package/dist/auth/jwk/thumbprint.d.ts +2 -0
- package/dist/auth/jwk/thumbprint.js +12 -6
- package/dist/auth/register/fingerprint/fingerprint.d.ts +25 -0
- package/dist/auth/register/fingerprint/fingerprint.js +31 -0
- package/dist/auth/register/fingerprint/index.d.ts +2 -0
- package/dist/auth/register/index.d.ts +5 -0
- package/dist/auth/register/request/admission.d.ts +3 -0
- package/dist/auth/register/request/admission.js +103 -0
- package/dist/auth/register/request/index.d.ts +3 -0
- package/dist/auth/register/request/limits.d.ts +6 -0
- package/dist/auth/register/request/limits.js +6 -0
- package/dist/auth/register/request/request.d.ts +19 -0
- package/dist/auth/{provision → register}/request/self-issuer.d.ts +1 -1
- package/dist/auth/{provision → register}/request/self-issuer.js +1 -1
- package/dist/auth/register/result/index.d.ts +1 -0
- package/dist/auth/register/result/result.d.ts +10 -0
- package/dist/schema/kernel/projection/project.js +4 -4
- package/dist/schema/kernel/schema.d.ts +40 -534
- package/dist/schema/kernel/schema.js +1 -1
- package/dist/schema/kernel/syscalls/contracts/index.d.ts +1 -1
- package/dist/schema/kernel/syscalls/contracts/index.js +1 -1
- package/dist/schema/kernel/syscalls/contracts/register.d.ts +20 -0
- package/dist/schema/kernel/syscalls/contracts/register.js +24 -0
- package/dist/schema/kernel/syscalls/declarations/index.d.ts +10 -257
- package/dist/schema/kernel/syscalls/declarations/index.js +2 -2
- package/dist/schema/kernel/syscalls/declarations/register.d.ts +23 -0
- package/dist/schema/kernel/syscalls/declarations/register.js +8 -0
- package/dist/schema/kernel/syscalls/descriptors/functions.d.ts +1 -1
- package/dist/schema/kernel/syscalls/descriptors/functions.js +1 -1
- package/dist/schema/kernel/syscalls/descriptors/index.d.ts +1 -1
- package/dist/schema/kernel/syscalls/descriptors/index.js +1 -1
- package/dist/schema/kernel/syscalls/index.d.ts +1 -1
- package/dist/schema/kernel/syscalls/index.js +1 -1
- package/dist/schema/kernel/syscalls/references/functions.d.ts +2 -2
- package/dist/schema/kernel/syscalls/references/functions.js +1 -1
- package/dist/schema/kernel/syscalls/references/index.d.ts +1 -1
- package/dist/schema/kernel/syscalls/references/index.js +1 -1
- package/package.json +1 -1
- package/dist/auth/provision/fingerprint/fingerprint.d.ts +0 -9
- package/dist/auth/provision/fingerprint/fingerprint.js +0 -30
- package/dist/auth/provision/fingerprint/index.d.ts +0 -2
- package/dist/auth/provision/index.d.ts +0 -5
- package/dist/auth/provision/request/admission.d.ts +0 -3
- package/dist/auth/provision/request/admission.js +0 -197
- package/dist/auth/provision/request/index.d.ts +0 -3
- package/dist/auth/provision/request/request.d.ts +0 -35
- package/dist/auth/provision/result/index.d.ts +0 -1
- package/dist/auth/provision/result/result.d.ts +0 -19
- package/dist/schema/kernel/syscalls/contracts/provision.d.ts +0 -301
- package/dist/schema/kernel/syscalls/contracts/provision.js +0 -28
- package/dist/schema/kernel/syscalls/declarations/provision.d.ts +0 -270
- package/dist/schema/kernel/syscalls/declarations/provision.js +0 -8
- /package/dist/auth/{provision → register}/fingerprint/index.js +0 -0
- /package/dist/auth/{provision → register}/index.js +0 -0
- /package/dist/auth/{provision → register}/request/index.js +0 -0
- /package/dist/auth/{provision → register}/request/request.js +0 -0
- /package/dist/auth/{provision → register}/result/index.js +0 -0
- /package/dist/auth/{provision → register}/result/result.js +0 -0
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
-
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
3
|
-
import { isLocalBinding } from '../../../graph/graph/index.js';
|
|
4
|
-
import { MutationAST } from '../../../graph/mutate/index.js';
|
|
5
|
-
import { NodeId } from '../../../graph/node/index.js';
|
|
6
|
-
import { admitConstraint, MAX_REQUIRED_CLAIMS } from '../../claims/admission/index.js';
|
|
7
|
-
import { AuthValueError } from '../../error.js';
|
|
8
|
-
import { accept as acceptIssuer } from '../../issuer/index.js';
|
|
9
|
-
import { acceptPublic } from '../../jwk/index.js';
|
|
10
|
-
const PROOF_BYTES_LIMIT = 64 * 1024;
|
|
11
|
-
const textEncoder = new TextEncoder();
|
|
12
|
-
/** Admit unknown input into the exact immutable Provision request language. */
|
|
13
|
-
export function accept(input) {
|
|
14
|
-
if (!isRecord(input))
|
|
15
|
-
invalid('', 'Expected a Provision request object');
|
|
16
|
-
exact(input, input.mutation === undefined
|
|
17
|
-
? ['idempotencyKey', 'identities']
|
|
18
|
-
: ['idempotencyKey', 'identities', 'mutation'], '');
|
|
19
|
-
if (typeof input.idempotencyKey !== 'string' || input.idempotencyKey.length === 0) {
|
|
20
|
-
invalid('/idempotencyKey', 'Expected a non-empty idempotency key');
|
|
21
|
-
}
|
|
22
|
-
const mutation = input.mutation === undefined ? undefined : MutationAST.decode(input.mutation);
|
|
23
|
-
if (!Array.isArray(input.identities) || input.identities.length === 0) {
|
|
24
|
-
invalid('/identities', 'Expected a non-empty Identity provision array');
|
|
25
|
-
}
|
|
26
|
-
const identities = input.identities
|
|
27
|
-
.map((candidate, index) => identityInput(candidate, `/identities/${index}`))
|
|
28
|
-
.sort(compareIdentity);
|
|
29
|
-
const targets = new Set();
|
|
30
|
-
const authentications = new Set();
|
|
31
|
-
for (const [index, identity] of identities.entries()) {
|
|
32
|
-
const target = targetKey(identity);
|
|
33
|
-
if (targets.has(target))
|
|
34
|
-
invalid(`/identities/${index}/identity`, 'Duplicate Identity target');
|
|
35
|
-
targets.add(target);
|
|
36
|
-
const authentication = assertedAuthenticationKey(identity.authentication);
|
|
37
|
-
if (authentication === undefined)
|
|
38
|
-
continue;
|
|
39
|
-
if (authentications.has(authentication)) {
|
|
40
|
-
invalid(`/identities/${index}/authentication`, 'Duplicate Authentication');
|
|
41
|
-
}
|
|
42
|
-
authentications.add(authentication);
|
|
43
|
-
}
|
|
44
|
-
return Object.freeze({
|
|
45
|
-
idempotencyKey: input.idempotencyKey,
|
|
46
|
-
...(mutation === undefined ? {} : { mutation }),
|
|
47
|
-
identities: Object.freeze(identities),
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function identityInput(input, path) {
|
|
51
|
-
if (!isRecord(input))
|
|
52
|
-
invalid(path, 'Expected an Identity provision object');
|
|
53
|
-
if (!isRecord(input.identity))
|
|
54
|
-
invalid(`${path}/identity`, 'Expected an Identity target');
|
|
55
|
-
if (Object.hasOwn(input.identity, 'created')) {
|
|
56
|
-
exact(input.identity, ['created'], `${path}/identity`);
|
|
57
|
-
const created = input.identity.created;
|
|
58
|
-
if (typeof created !== 'string' || !isLocalBinding(created)) {
|
|
59
|
-
invalid(`${path}/identity/created`, 'Expected a LocalBinding');
|
|
60
|
-
}
|
|
61
|
-
exact(input, [
|
|
62
|
-
'identity',
|
|
63
|
-
...(input.authentication === undefined ? [] : ['authentication']),
|
|
64
|
-
...(input.requiredClaims === undefined ? [] : ['requiredClaims']),
|
|
65
|
-
], path);
|
|
66
|
-
const authentication = input.authentication === undefined
|
|
67
|
-
? undefined
|
|
68
|
-
: authenticationInput(input.authentication, `${path}/authentication`);
|
|
69
|
-
const requiredClaims = constraints(input.requiredClaims, `${path}/requiredClaims`);
|
|
70
|
-
return Object.freeze({
|
|
71
|
-
identity: Object.freeze({ created }),
|
|
72
|
-
...(authentication === undefined ? {} : { authentication }),
|
|
73
|
-
...(requiredClaims.length === 0 ? {} : { requiredClaims }),
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
exact(input.identity, ['class', 'id'], `${path}/identity`);
|
|
77
|
-
exact(input, ['authentication', 'identity'], path);
|
|
78
|
-
if (typeof input.identity.id !== 'string') {
|
|
79
|
-
invalid(`${path}/identity/id`, 'Expected an IdentityId');
|
|
80
|
-
}
|
|
81
|
-
if (typeof input.identity.class !== 'string' || !ClassKey.is(input.identity.class)) {
|
|
82
|
-
invalid(`${path}/identity/class`, 'Expected a ClassKey');
|
|
83
|
-
}
|
|
84
|
-
let id;
|
|
85
|
-
try {
|
|
86
|
-
id = NodeId(input.identity.id);
|
|
87
|
-
}
|
|
88
|
-
catch (cause) {
|
|
89
|
-
invalid(`${path}/identity/id`, 'Expected an IdentityId', cause);
|
|
90
|
-
}
|
|
91
|
-
return Object.freeze({
|
|
92
|
-
identity: Object.freeze({
|
|
93
|
-
id,
|
|
94
|
-
class: ClassKey(input.identity.class),
|
|
95
|
-
}),
|
|
96
|
-
authentication: authenticationInput(input.authentication, `${path}/authentication`),
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
function authenticationInput(input, path) {
|
|
100
|
-
if (!isRecord(input))
|
|
101
|
-
invalid(path, 'Expected an Authentication provision object');
|
|
102
|
-
if (Object.hasOwn(input, 'credentials')) {
|
|
103
|
-
exact(input, ['credentials'], path);
|
|
104
|
-
if (!isRecord(input.credentials))
|
|
105
|
-
invalid(`${path}/credentials`, 'Expected credentials');
|
|
106
|
-
exact(input.credentials, ['proof', 'publicKey'], `${path}/credentials`);
|
|
107
|
-
return Object.freeze({
|
|
108
|
-
credentials: Object.freeze({
|
|
109
|
-
publicKey: publicJwk(input.credentials.publicKey, `${path}/credentials/publicKey`),
|
|
110
|
-
proof: credentialProof(input.credentials.proof, `${path}/credentials/proof`),
|
|
111
|
-
}),
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
exact(input, ['iss', 'sub'], path);
|
|
115
|
-
if (typeof input.iss !== 'string')
|
|
116
|
-
invalid(`${path}/iss`, 'Expected an issuer');
|
|
117
|
-
let iss;
|
|
118
|
-
try {
|
|
119
|
-
iss = acceptIssuer(input.iss);
|
|
120
|
-
}
|
|
121
|
-
catch (cause) {
|
|
122
|
-
invalid(`${path}/iss`, 'Expected a canonical issuer', cause);
|
|
123
|
-
}
|
|
124
|
-
if (typeof input.sub !== 'string' || input.sub.length === 0) {
|
|
125
|
-
invalid(`${path}/sub`, 'Expected a non-empty subject');
|
|
126
|
-
}
|
|
127
|
-
return Object.freeze({ iss, sub: input.sub });
|
|
128
|
-
}
|
|
129
|
-
function targetKey(input) {
|
|
130
|
-
return 'created' in input.identity
|
|
131
|
-
? `created\u0000${input.identity.created}`
|
|
132
|
-
: `existing\u0000${input.identity.class}\u0000${input.identity.id}`;
|
|
133
|
-
}
|
|
134
|
-
function assertedAuthenticationKey(input) {
|
|
135
|
-
return input === undefined || 'credentials' in input
|
|
136
|
-
? undefined
|
|
137
|
-
: `${input.iss}\u0000${input.sub}`;
|
|
138
|
-
}
|
|
139
|
-
function compareIdentity(left, right) {
|
|
140
|
-
return compare(targetKey(left), targetKey(right));
|
|
141
|
-
}
|
|
142
|
-
function credentialProof(input, path) {
|
|
143
|
-
if (typeof input === 'string') {
|
|
144
|
-
const bytes = textEncoder.encode(input).byteLength;
|
|
145
|
-
if (bytes === 0 || bytes > PROOF_BYTES_LIMIT) {
|
|
146
|
-
invalid(path, `Credential proof must contain 1-${PROOF_BYTES_LIMIT} bytes`);
|
|
147
|
-
}
|
|
148
|
-
return input;
|
|
149
|
-
}
|
|
150
|
-
if (!(input instanceof Uint8Array) ||
|
|
151
|
-
input.byteLength === 0 ||
|
|
152
|
-
input.byteLength > PROOF_BYTES_LIMIT) {
|
|
153
|
-
invalid(path, `Credential proof must contain 1-${PROOF_BYTES_LIMIT} bytes`);
|
|
154
|
-
}
|
|
155
|
-
return input.slice();
|
|
156
|
-
}
|
|
157
|
-
function publicJwk(input, path) {
|
|
158
|
-
try {
|
|
159
|
-
return acceptPublic(input);
|
|
160
|
-
}
|
|
161
|
-
catch (cause) {
|
|
162
|
-
invalid(path, 'Expected a thumbprintable public JWK', cause);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
function constraints(input, path) {
|
|
166
|
-
if (input === undefined)
|
|
167
|
-
return Object.freeze([]);
|
|
168
|
-
if (!Array.isArray(input) || input.length > MAX_REQUIRED_CLAIMS) {
|
|
169
|
-
invalid(path, `Expected at most ${MAX_REQUIRED_CLAIMS} required-claim constraints`);
|
|
170
|
-
}
|
|
171
|
-
return Object.freeze(input.map((item, index) => {
|
|
172
|
-
let admitted;
|
|
173
|
-
try {
|
|
174
|
-
admitted = portable.accept(item);
|
|
175
|
-
}
|
|
176
|
-
catch (cause) {
|
|
177
|
-
invalid(`${path}/${index}`, 'Expected a portable claim constraint', cause);
|
|
178
|
-
}
|
|
179
|
-
return admitConstraint(admitted, `${path}/${index}`, invalid);
|
|
180
|
-
}));
|
|
181
|
-
}
|
|
182
|
-
function isRecord(input) {
|
|
183
|
-
return input !== null && typeof input === 'object' && !Array.isArray(input);
|
|
184
|
-
}
|
|
185
|
-
function exact(input, expected, path) {
|
|
186
|
-
const actual = Object.keys(input).sort(compare);
|
|
187
|
-
const wanted = [...expected].sort(compare);
|
|
188
|
-
if (actual.length !== wanted.length || actual.some((key, index) => key !== wanted[index])) {
|
|
189
|
-
invalid(path, `Expected exactly ${expected.join(', ')}`);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
function compare(left, right) {
|
|
193
|
-
return left < right ? -1 : left > right ? 1 : 0;
|
|
194
|
-
}
|
|
195
|
-
function invalid(path, message, cause) {
|
|
196
|
-
throw new AuthValueError('AUTH_PROVISION_REQUEST_INVALID', message, path, cause === undefined ? undefined : { cause });
|
|
197
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { ClassKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
-
import type { LocalBinding, MutationAST } from '../../../graph/mutate/index.js';
|
|
3
|
-
import type { ClaimConstraint } from '../../claims/index.js';
|
|
4
|
-
import type { CredentialInput } from '../../credential/input/index.js';
|
|
5
|
-
import type { Authentication, IdentityId } from '../../identity/index.js';
|
|
6
|
-
import type { JsonWebKey } from '../../jwk/index.js';
|
|
7
|
-
export type RequiredClaims = readonly ClaimConstraint[];
|
|
8
|
-
export type AuthenticationProvision = Authentication | {
|
|
9
|
-
readonly credentials: {
|
|
10
|
-
readonly publicKey: JsonWebKey;
|
|
11
|
-
readonly proof: CredentialInput;
|
|
12
|
-
};
|
|
13
|
-
readonly iss?: never;
|
|
14
|
-
readonly sub?: never;
|
|
15
|
-
};
|
|
16
|
-
export type IdentityProvision = {
|
|
17
|
-
readonly identity: {
|
|
18
|
-
readonly created: LocalBinding;
|
|
19
|
-
};
|
|
20
|
-
readonly authentication?: AuthenticationProvision;
|
|
21
|
-
readonly requiredClaims?: RequiredClaims;
|
|
22
|
-
} | {
|
|
23
|
-
readonly identity: {
|
|
24
|
-
readonly id: IdentityId;
|
|
25
|
-
readonly class: ClassKey;
|
|
26
|
-
};
|
|
27
|
-
readonly authentication: AuthenticationProvision;
|
|
28
|
-
readonly requiredClaims?: never;
|
|
29
|
-
};
|
|
30
|
-
/** One protected Identity transition with an optional caller-authored graph Mutation. */
|
|
31
|
-
export interface ProvisionRequest {
|
|
32
|
-
readonly idempotencyKey: string;
|
|
33
|
-
readonly mutation?: MutationAST;
|
|
34
|
-
readonly identities: readonly [IdentityProvision, ...IdentityProvision[]];
|
|
35
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { ProvisionedIdentity, ProvisionResult } from './result.js';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { LocalBinding } from '../../../graph/mutate/index.js';
|
|
2
|
-
import type { NodeId } from '../../../graph/node/index.js';
|
|
3
|
-
import type { IdentityId, Subject } from '../../identity/index.js';
|
|
4
|
-
import type { IssuerId } from '../../issuer/index.js';
|
|
5
|
-
interface ProvisionedIdentityBase {
|
|
6
|
-
readonly id: IdentityId;
|
|
7
|
-
}
|
|
8
|
-
export type ProvisionedIdentity = ProvisionedIdentityBase & ({
|
|
9
|
-
readonly iss?: never;
|
|
10
|
-
readonly sub?: never;
|
|
11
|
-
} | {
|
|
12
|
-
readonly iss: IssuerId;
|
|
13
|
-
readonly sub: Subject;
|
|
14
|
-
});
|
|
15
|
-
export interface ProvisionResult {
|
|
16
|
-
readonly createdNodes: Readonly<Record<LocalBinding, NodeId>>;
|
|
17
|
-
readonly identities: readonly [ProvisionedIdentity, ...ProvisionedIdentity[]];
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
export declare const provisionInput: import("zod").ZodObject<{
|
|
2
|
-
idempotencyKey: import("zod").ZodString;
|
|
3
|
-
mutation: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
4
|
-
format: import("zod").ZodLiteral<"astrale.graph.mutation">;
|
|
5
|
-
version: import("zod").ZodLiteral<"v3">;
|
|
6
|
-
preconditions: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
7
|
-
kind: import("zod").ZodLiteral<"node">;
|
|
8
|
-
node: import("zod").ZodString;
|
|
9
|
-
class: import("zod").ZodString;
|
|
10
|
-
props: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
11
|
-
equals: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
12
|
-
absent: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
13
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
14
|
-
absent: import("zod").ZodArray<import("zod").ZodString>;
|
|
15
|
-
}, import("zod/v4/core").$strict>]>>;
|
|
16
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
17
|
-
kind: import("zod").ZodLiteral<"edge">;
|
|
18
|
-
edge: import("zod").ZodObject<{
|
|
19
|
-
source: import("zod").ZodString;
|
|
20
|
-
target: import("zod").ZodString;
|
|
21
|
-
class: import("zod").ZodString;
|
|
22
|
-
}, import("zod/v4/core").$strict>;
|
|
23
|
-
slug: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodType<import("../../../../graph/edge/index.js").EdgeSlug, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../../../graph/edge/index.js").EdgeSlug, unknown>>>>;
|
|
24
|
-
props: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
25
|
-
equals: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
26
|
-
absent: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodString>>;
|
|
27
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
28
|
-
absent: import("zod").ZodArray<import("zod").ZodString>;
|
|
29
|
-
}, import("zod/v4/core").$strict>]>>;
|
|
30
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
31
|
-
kind: import("zod").ZodLiteral<"query">;
|
|
32
|
-
query: import("zod").ZodObject<{
|
|
33
|
-
format: import("zod").ZodLiteral<"astrale.graph.query">;
|
|
34
|
-
version: import("zod").ZodLiteral<"v6">;
|
|
35
|
-
source: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
36
|
-
kind: import("zod").ZodLiteral<"node">;
|
|
37
|
-
terms: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
38
|
-
kind: import("zod").ZodLiteral<"path">;
|
|
39
|
-
path: import("zod").ZodString;
|
|
40
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
41
|
-
kind: import("zod").ZodLiteral<"class">;
|
|
42
|
-
class: import("zod").ZodObject<{
|
|
43
|
-
origin: import("zod").ZodString;
|
|
44
|
-
kind: import("zod").ZodLiteral<"class">;
|
|
45
|
-
name: import("zod").ZodString;
|
|
46
|
-
}, import("zod/v4/core").$strict>;
|
|
47
|
-
}, import("zod/v4/core").$strict>], "kind">>;
|
|
48
|
-
binding: import("zod").ZodString;
|
|
49
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
50
|
-
kind: import("zod").ZodLiteral<"edge">;
|
|
51
|
-
terms: import("zod").ZodArray<import("zod").ZodObject<{
|
|
52
|
-
kind: import("zod").ZodLiteral<"class">;
|
|
53
|
-
class: import("zod").ZodObject<{
|
|
54
|
-
origin: import("zod").ZodString;
|
|
55
|
-
kind: import("zod").ZodLiteral<"class">;
|
|
56
|
-
name: import("zod").ZodString;
|
|
57
|
-
}, import("zod/v4/core").$strict>;
|
|
58
|
-
}, import("zod/v4/core").$strict>>;
|
|
59
|
-
bindings: import("zod").ZodObject<{
|
|
60
|
-
source: import("zod").ZodString;
|
|
61
|
-
edge: import("zod").ZodString;
|
|
62
|
-
target: import("zod").ZodString;
|
|
63
|
-
}, import("zod/v4/core").$strict>;
|
|
64
|
-
}, import("zod/v4/core").$strict>], "kind">;
|
|
65
|
-
steps: import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
66
|
-
op: import("zod").ZodLiteral<"filter">;
|
|
67
|
-
binding: import("zod").ZodString;
|
|
68
|
-
predicate: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
69
|
-
kind: import("zod").ZodLiteral<"class.satisfies">;
|
|
70
|
-
class: import("zod").ZodObject<{
|
|
71
|
-
origin: import("zod").ZodString;
|
|
72
|
-
kind: import("zod").ZodLiteral<"class">;
|
|
73
|
-
name: import("zod").ZodString;
|
|
74
|
-
}, import("zod/v4/core").$strict>;
|
|
75
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
76
|
-
kind: import("zod").ZodLiteral<"class.equal">;
|
|
77
|
-
class: import("zod").ZodObject<{
|
|
78
|
-
origin: import("zod").ZodString;
|
|
79
|
-
kind: import("zod").ZodLiteral<"class">;
|
|
80
|
-
name: import("zod").ZodString;
|
|
81
|
-
}, import("zod/v4/core").$strict>;
|
|
82
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
83
|
-
kind: import("zod").ZodLiteral<"property.equal">;
|
|
84
|
-
property: import("zod").ZodString;
|
|
85
|
-
value: import("zod").ZodUnknown;
|
|
86
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
87
|
-
kind: import("zod").ZodLiteral<"property.present">;
|
|
88
|
-
property: import("zod").ZodString;
|
|
89
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
90
|
-
kind: import("zod").ZodLiteral<"identity.equal">;
|
|
91
|
-
identity: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
92
|
-
source: import("zod").ZodString;
|
|
93
|
-
target: import("zod").ZodString;
|
|
94
|
-
class: import("zod").ZodString;
|
|
95
|
-
}, import("zod/v4/core").$strict>]>;
|
|
96
|
-
}, import("zod/v4/core").$strict>], "kind">;
|
|
97
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
98
|
-
op: import("zod").ZodLiteral<"expand">;
|
|
99
|
-
from: import("zod").ZodString;
|
|
100
|
-
via: import("zod").ZodArray<import("zod").ZodObject<{
|
|
101
|
-
origin: import("zod").ZodString;
|
|
102
|
-
kind: import("zod").ZodLiteral<"class">;
|
|
103
|
-
name: import("zod").ZodString;
|
|
104
|
-
}, import("zod/v4/core").$strict>>;
|
|
105
|
-
direction: import("zod").ZodEnum<{
|
|
106
|
-
incident: "incident";
|
|
107
|
-
incoming: "incoming";
|
|
108
|
-
outgoing: "outgoing";
|
|
109
|
-
}>;
|
|
110
|
-
bindings: import("zod").ZodObject<{
|
|
111
|
-
edge: import("zod").ZodString;
|
|
112
|
-
node: import("zod").ZodString;
|
|
113
|
-
}, import("zod/v4/core").$strict>;
|
|
114
|
-
}, import("zod/v4/core").$strict>], "op">>;
|
|
115
|
-
select: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
116
|
-
kind: import("zod").ZodLiteral<"graph">;
|
|
117
|
-
binding: import("zod").ZodString;
|
|
118
|
-
order: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
119
|
-
property: import("zod").ZodString;
|
|
120
|
-
direction: import("zod").ZodEnum<{
|
|
121
|
-
asc: "asc";
|
|
122
|
-
desc: "desc";
|
|
123
|
-
}>;
|
|
124
|
-
unranked: import("zod").ZodEnum<{
|
|
125
|
-
first: "first";
|
|
126
|
-
last: "last";
|
|
127
|
-
}>;
|
|
128
|
-
}, import("zod/v4/core").$strict>>;
|
|
129
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
130
|
-
kind: import("zod").ZodLiteral<"nodes">;
|
|
131
|
-
binding: import("zod").ZodString;
|
|
132
|
-
projection: import("zod").ZodObject<{
|
|
133
|
-
kind: import("zod").ZodEnum<{
|
|
134
|
-
reference: "reference";
|
|
135
|
-
value: "value";
|
|
136
|
-
}>;
|
|
137
|
-
}, import("zod/v4/core").$strict>;
|
|
138
|
-
order: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
139
|
-
property: import("zod").ZodString;
|
|
140
|
-
direction: import("zod").ZodEnum<{
|
|
141
|
-
asc: "asc";
|
|
142
|
-
desc: "desc";
|
|
143
|
-
}>;
|
|
144
|
-
unranked: import("zod").ZodEnum<{
|
|
145
|
-
first: "first";
|
|
146
|
-
last: "last";
|
|
147
|
-
}>;
|
|
148
|
-
}, import("zod/v4/core").$strict>>;
|
|
149
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
150
|
-
kind: import("zod").ZodLiteral<"edges">;
|
|
151
|
-
binding: import("zod").ZodString;
|
|
152
|
-
projection: import("zod").ZodObject<{
|
|
153
|
-
edge: import("zod").ZodEnum<{
|
|
154
|
-
reference: "reference";
|
|
155
|
-
value: "value";
|
|
156
|
-
}>;
|
|
157
|
-
source: import("zod").ZodEnum<{
|
|
158
|
-
reference: "reference";
|
|
159
|
-
value: "value";
|
|
160
|
-
}>;
|
|
161
|
-
target: import("zod").ZodEnum<{
|
|
162
|
-
reference: "reference";
|
|
163
|
-
value: "value";
|
|
164
|
-
}>;
|
|
165
|
-
}, import("zod/v4/core").$strict>;
|
|
166
|
-
order: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
167
|
-
property: import("zod").ZodString;
|
|
168
|
-
direction: import("zod").ZodEnum<{
|
|
169
|
-
asc: "asc";
|
|
170
|
-
desc: "desc";
|
|
171
|
-
}>;
|
|
172
|
-
unranked: import("zod").ZodEnum<{
|
|
173
|
-
first: "first";
|
|
174
|
-
last: "last";
|
|
175
|
-
}>;
|
|
176
|
-
}, import("zod/v4/core").$strict>>;
|
|
177
|
-
}, import("zod/v4/core").$strict>], "kind">;
|
|
178
|
-
}, import("zod/v4/core").$strict>;
|
|
179
|
-
equals: import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
180
|
-
kind: import("zod").ZodLiteral<"node">;
|
|
181
|
-
ids: import("zod").ZodArray<import("zod").ZodString>;
|
|
182
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
183
|
-
kind: import("zod").ZodLiteral<"edge">;
|
|
184
|
-
keys: import("zod").ZodArray<import("zod").ZodObject<{
|
|
185
|
-
source: import("zod").ZodString;
|
|
186
|
-
target: import("zod").ZodString;
|
|
187
|
-
class: import("zod").ZodString;
|
|
188
|
-
}, import("zod/v4/core").$strict>>;
|
|
189
|
-
}, import("zod/v4/core").$strict>], "kind">;
|
|
190
|
-
}, import("zod/v4/core").$strict>]>>;
|
|
191
|
-
operations: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
192
|
-
op: import("zod").ZodLiteral<"node.create">;
|
|
193
|
-
as: import("zod").ZodString;
|
|
194
|
-
class: import("zod").ZodString;
|
|
195
|
-
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
196
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
197
|
-
op: import("zod").ZodLiteral<"node.update">;
|
|
198
|
-
node: import("zod").ZodString;
|
|
199
|
-
class: import("zod").ZodString;
|
|
200
|
-
props: import("zod").ZodObject<{
|
|
201
|
-
set: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
202
|
-
unset: import("zod").ZodArray<import("zod").ZodString>;
|
|
203
|
-
}, import("zod/v4/core").$strict>;
|
|
204
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
205
|
-
op: import("zod").ZodLiteral<"node.delete">;
|
|
206
|
-
node: import("zod").ZodString;
|
|
207
|
-
class: import("zod").ZodString;
|
|
208
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
209
|
-
op: import("zod").ZodLiteral<"edge.create">;
|
|
210
|
-
class: import("zod").ZodString;
|
|
211
|
-
source: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
212
|
-
created: import("zod").ZodString;
|
|
213
|
-
}, import("zod/v4/core").$strict>]>;
|
|
214
|
-
target: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodObject<{
|
|
215
|
-
created: import("zod").ZodString;
|
|
216
|
-
}, import("zod/v4/core").$strict>]>;
|
|
217
|
-
slug: import("zod").ZodOptional<import("zod").ZodType<import("../../../../graph/edge/index.js").EdgeSlug, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../../../graph/edge/index.js").EdgeSlug, unknown>>>;
|
|
218
|
-
props: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
219
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
220
|
-
op: import("zod").ZodLiteral<"edge.update">;
|
|
221
|
-
edge: import("zod").ZodObject<{
|
|
222
|
-
source: import("zod").ZodString;
|
|
223
|
-
target: import("zod").ZodString;
|
|
224
|
-
class: import("zod").ZodString;
|
|
225
|
-
}, import("zod/v4/core").$strict>;
|
|
226
|
-
slug: import("zod").ZodNullable<import("zod").ZodType<import("../../../../graph/edge/index.js").EdgeSlug, unknown, import("zod/v4/core").$ZodTypeInternals<import("../../../../graph/edge/index.js").EdgeSlug, unknown>>>;
|
|
227
|
-
props: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
228
|
-
set: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
229
|
-
unset: import("zod").ZodArray<import("zod").ZodString>;
|
|
230
|
-
}, import("zod/v4/core").$strict>>;
|
|
231
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
232
|
-
op: import("zod").ZodLiteral<"edge.update">;
|
|
233
|
-
edge: import("zod").ZodObject<{
|
|
234
|
-
source: import("zod").ZodString;
|
|
235
|
-
target: import("zod").ZodString;
|
|
236
|
-
class: import("zod").ZodString;
|
|
237
|
-
}, import("zod/v4/core").$strict>;
|
|
238
|
-
props: import("zod").ZodObject<{
|
|
239
|
-
set: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
240
|
-
unset: import("zod").ZodArray<import("zod").ZodString>;
|
|
241
|
-
}, import("zod/v4/core").$strict>;
|
|
242
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
243
|
-
op: import("zod").ZodLiteral<"edge.delete">;
|
|
244
|
-
edge: import("zod").ZodObject<{
|
|
245
|
-
source: import("zod").ZodString;
|
|
246
|
-
target: import("zod").ZodString;
|
|
247
|
-
class: import("zod").ZodString;
|
|
248
|
-
}, import("zod/v4/core").$strict>;
|
|
249
|
-
}, import("zod/v4/core").$strict>]>>;
|
|
250
|
-
}, import("zod/v4/core").$strict>>;
|
|
251
|
-
identities: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
252
|
-
identity: import("zod").ZodObject<{
|
|
253
|
-
created: import("zod").ZodString;
|
|
254
|
-
}, import("zod/v4/core").$strict>;
|
|
255
|
-
authentication: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
256
|
-
iss: import("zod").ZodString;
|
|
257
|
-
sub: import("zod").ZodString;
|
|
258
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
259
|
-
credentials: import("zod").ZodObject<{
|
|
260
|
-
publicKey: import("zod").ZodUnknown;
|
|
261
|
-
proof: import("zod").ZodString;
|
|
262
|
-
}, import("zod/v4/core").$strict>;
|
|
263
|
-
}, import("zod/v4/core").$strict>]>>;
|
|
264
|
-
requiredClaims: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodDiscriminatedUnion<[import("zod").ZodObject<{
|
|
265
|
-
claim: import("zod").ZodString;
|
|
266
|
-
op: import("zod").ZodLiteral<"contains">;
|
|
267
|
-
value: import("zod").ZodNonOptional<import("zod").ZodUnknown>;
|
|
268
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
269
|
-
claim: import("zod").ZodString;
|
|
270
|
-
op: import("zod").ZodLiteral<"eq">;
|
|
271
|
-
value: import("zod").ZodNonOptional<import("zod").ZodUnknown>;
|
|
272
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
273
|
-
claim: import("zod").ZodString;
|
|
274
|
-
op: import("zod").ZodLiteral<"exists">;
|
|
275
|
-
}, import("zod/v4/core").$strict>], "op">>>;
|
|
276
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
277
|
-
identity: import("zod").ZodObject<{
|
|
278
|
-
id: import("zod").ZodString;
|
|
279
|
-
class: import("zod").ZodString;
|
|
280
|
-
}, import("zod/v4/core").$strict>;
|
|
281
|
-
authentication: import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
282
|
-
iss: import("zod").ZodString;
|
|
283
|
-
sub: import("zod").ZodString;
|
|
284
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
285
|
-
credentials: import("zod").ZodObject<{
|
|
286
|
-
publicKey: import("zod").ZodUnknown;
|
|
287
|
-
proof: import("zod").ZodString;
|
|
288
|
-
}, import("zod/v4/core").$strict>;
|
|
289
|
-
}, import("zod/v4/core").$strict>]>;
|
|
290
|
-
}, import("zod/v4/core").$strict>]>>;
|
|
291
|
-
}, import("zod/v4/core").$strict>;
|
|
292
|
-
export declare const provisionOutput: import("zod").ZodObject<{
|
|
293
|
-
createdNodes: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodString>;
|
|
294
|
-
identities: import("zod").ZodArray<import("zod").ZodUnion<readonly [import("zod").ZodObject<{
|
|
295
|
-
id: import("zod").ZodString;
|
|
296
|
-
}, import("zod/v4/core").$strict>, import("zod").ZodObject<{
|
|
297
|
-
id: import("zod").ZodString;
|
|
298
|
-
iss: import("zod").ZodString;
|
|
299
|
-
sub: import("zod").ZodString;
|
|
300
|
-
}, import("zod/v4/core").$strict>]>>;
|
|
301
|
-
}, import("zod/v4/core").$strict>;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { array, record, strictObject, string, union, unknown as unknownSchema } from 'zod';
|
|
2
|
-
import { mutationAstSchema } from '#graph/mutate/wire';
|
|
3
|
-
import { requiredClaimsSchema } from '../../../authority/claims.js';
|
|
4
|
-
const text = string().min(1);
|
|
5
|
-
const requiredClaims = requiredClaimsSchema.optional();
|
|
6
|
-
const asserted = strictObject({ iss: text, sub: text });
|
|
7
|
-
const self = strictObject({
|
|
8
|
-
credentials: strictObject({ publicKey: unknownSchema(), proof: text }),
|
|
9
|
-
});
|
|
10
|
-
const authentication = union([asserted, self]);
|
|
11
|
-
const createdIdentity = strictObject({
|
|
12
|
-
identity: strictObject({ created: text }),
|
|
13
|
-
authentication: authentication.optional(),
|
|
14
|
-
requiredClaims,
|
|
15
|
-
});
|
|
16
|
-
const existingIdentity = strictObject({
|
|
17
|
-
identity: strictObject({ id: text, class: text }),
|
|
18
|
-
authentication,
|
|
19
|
-
});
|
|
20
|
-
export const provisionInput = strictObject({
|
|
21
|
-
idempotencyKey: text,
|
|
22
|
-
mutation: mutationAstSchema.optional(),
|
|
23
|
-
identities: array(union([createdIdentity, existingIdentity])).nonempty(),
|
|
24
|
-
});
|
|
25
|
-
export const provisionOutput = strictObject({
|
|
26
|
-
createdNodes: record(string(), text),
|
|
27
|
-
identities: array(union([strictObject({ id: text }), strictObject({ id: text, iss: text, sub: text })])).nonempty(),
|
|
28
|
-
});
|