@house-rules/party 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +67 -0
- package/LICENSE +21 -0
- package/README.md +142 -2
- package/dist/adapters/memory/party.d.ts +3 -0
- package/dist/adapters/memory/party.js +170 -0
- package/dist/adapters/memory/person.d.ts +3 -0
- package/dist/adapters/memory/person.js +87 -0
- package/dist/adapters/postgres/party.d.ts +4 -0
- package/dist/adapters/postgres/party.js +73 -0
- package/dist/adapters/postgres/person.d.ts +4 -0
- package/dist/adapters/postgres/person.js +63 -0
- package/dist/assignment/assignment.d.ts +13 -0
- package/dist/assignment/assignment.js +9 -0
- package/dist/assignment/holders.d.ts +11 -0
- package/dist/assignment/holders.js +7 -0
- package/dist/contract.d.ts +9 -0
- package/dist/contract.js +9 -0
- package/dist/facade.d.ts +22 -0
- package/dist/facade.js +35 -0
- package/dist/index.d.ts +294 -0
- package/dist/index.js +20 -0
- package/dist/invitation/invitation.d.ts +36 -0
- package/dist/invitation/invitation.js +17 -0
- package/dist/invitation/invitations.d.ts +34 -0
- package/dist/invitation/invitations.js +70 -0
- package/dist/organisation/organisation.d.ts +59 -0
- package/dist/organisation/organisation.js +46 -0
- package/dist/person/bind-party.d.ts +7 -0
- package/dist/person/bind-party.js +42 -0
- package/dist/person/operations.d.ts +306 -0
- package/dist/person/operations.js +92 -0
- package/dist/person/party.d.ts +36 -0
- package/dist/person/party.js +55 -0
- package/dist/person/permissions.d.ts +6 -0
- package/dist/person/permissions.js +5 -0
- package/dist/person/person-store.d.ts +21 -0
- package/dist/person/person-store.js +3 -0
- package/dist/person/person.d.ts +43 -0
- package/dist/person/person.js +25 -0
- package/dist/person/policy.d.ts +1 -0
- package/dist/person/policy.js +6 -0
- package/dist/person/principal-operations.d.ts +110 -0
- package/dist/person/principal-operations.js +77 -0
- package/dist/person/principal.d.ts +126 -0
- package/dist/person/principal.js +49 -0
- package/dist/person/principals.d.ts +102 -0
- package/dist/person/principals.js +73 -0
- package/dist/relationship/relationship.d.ts +30 -0
- package/dist/relationship/relationship.js +12 -0
- package/dist/relationship/removal.d.ts +101 -0
- package/dist/relationship/removal.js +22 -0
- package/dist/role/access.d.ts +171 -0
- package/dist/role/access.js +252 -0
- package/dist/role/operations.d.ts +145 -0
- package/dist/role/operations.js +215 -0
- package/dist/role/people.d.ts +45 -0
- package/dist/role/people.js +57 -0
- package/dist/role/permission-catalogue.d.ts +2 -0
- package/dist/role/permission-catalogue.js +1 -0
- package/dist/role/role.d.ts +31 -0
- package/dist/role/role.js +12 -0
- package/dist/storage.d.ts +38 -0
- package/dist/storage.js +4 -0
- package/migrations/0001_party_person.sql +5 -0
- package/migrations/0002_party_model.sql +27 -0
- package/migrations/0003_party_invitation.sql +11 -0
- package/migrations/0004_publish_staff.sql +4 -0
- package/migrations/0005_principals.sql +18 -0
- package/package.json +57 -3
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type Caller } from "@house-rules/domain";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { PartyDenied, PartyNotFound, PartyUnavailable } from "../organisation/organisation.js";
|
|
4
|
+
import type { PartyStore } from "../storage.js";
|
|
5
|
+
export declare const makeInvitations: (store: PartyStore["Service"], admin: (caller: Caller, organisationId: string | null) => Effect.Effect<void, PartyDenied | PartyUnavailable>, checkRole: (caller: Caller, key: string, org: string) => Effect.Effect<void, PartyDenied | PartyNotFound | PartyUnavailable>) => {
|
|
6
|
+
createInvitation: (caller: Caller, input: {
|
|
7
|
+
readonly organisationId: string;
|
|
8
|
+
readonly roleKey: string | null;
|
|
9
|
+
}) => Effect.Effect<{
|
|
10
|
+
invitation: {
|
|
11
|
+
id: string;
|
|
12
|
+
organisationId: string;
|
|
13
|
+
roleKey: string | null;
|
|
14
|
+
createdBy: string & import("effect/Brand").Brand<"ActorId">;
|
|
15
|
+
expiresAt: number;
|
|
16
|
+
state: "pending" | "revoked" | "used";
|
|
17
|
+
};
|
|
18
|
+
code: string;
|
|
19
|
+
}, import("@house-rules/domain").NoOpenUnit | PartyDenied | PartyNotFound | PartyUnavailable, never>;
|
|
20
|
+
acceptInvitation: (caller: Caller, code: string) => Effect.Effect<{
|
|
21
|
+
organisationId: string;
|
|
22
|
+
roleKey: string | null;
|
|
23
|
+
personId: string & import("effect/Brand").Brand<"ActorId">;
|
|
24
|
+
}, import("@house-rules/domain").NoOpenUnit | PartyDenied | PartyNotFound | PartyUnavailable, never>;
|
|
25
|
+
revokeInvitation: (caller: Caller, id: string) => Effect.Effect<undefined, import("@house-rules/domain").NoOpenUnit | PartyDenied | PartyNotFound | PartyUnavailable, never>;
|
|
26
|
+
listInvitations: (caller: Caller, organisationId: string) => Effect.Effect<{
|
|
27
|
+
id: string;
|
|
28
|
+
organisationId: string;
|
|
29
|
+
roleKey: string | null;
|
|
30
|
+
createdBy: string & import("effect/Brand").Brand<"ActorId">;
|
|
31
|
+
expiresAt: number;
|
|
32
|
+
state: "pending" | "revoked" | "used";
|
|
33
|
+
}[], PartyDenied | PartyUnavailable, never>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { UnitOfWork } from "@house-rules/domain";
|
|
2
|
+
import { Clock, Effect } from "effect";
|
|
3
|
+
import { Hex } from "effect/encoding";
|
|
4
|
+
import { PartyDenied, PartyNotFound, PartyUnavailable } from "../organisation/organisation.js";
|
|
5
|
+
const publicInvitation = ({ codeHash: _hash, ...value }) => value;
|
|
6
|
+
const hashCode = (code) => Effect.tryPromise({
|
|
7
|
+
try: () => globalThis.crypto.subtle.digest("SHA-256", new TextEncoder().encode(code)),
|
|
8
|
+
catch: (cause) => new PartyUnavailable({ cause }),
|
|
9
|
+
}).pipe(Effect.map((bytes) => Hex.encode(new Uint8Array(bytes))));
|
|
10
|
+
const randomCode = Effect.sync(() => Hex.encode(globalThis.crypto.getRandomValues(new Uint8Array(32))));
|
|
11
|
+
export const makeInvitations = (store, admin, checkRole) => ({
|
|
12
|
+
createInvitation: Effect.fn("Party.createInvitation")(function* (caller, input) {
|
|
13
|
+
yield* UnitOfWork.required;
|
|
14
|
+
yield* admin(caller, input.organisationId);
|
|
15
|
+
if (caller.kind !== "person")
|
|
16
|
+
return yield* new PartyDenied();
|
|
17
|
+
if (!(yield* store.organisation(input.organisationId)))
|
|
18
|
+
return yield* new PartyNotFound();
|
|
19
|
+
if (input.roleKey !== null)
|
|
20
|
+
yield* checkRole(caller, input.roleKey, input.organisationId);
|
|
21
|
+
const code = yield* randomCode;
|
|
22
|
+
const value = {
|
|
23
|
+
id: yield* randomCode,
|
|
24
|
+
organisationId: input.organisationId,
|
|
25
|
+
roleKey: input.roleKey,
|
|
26
|
+
createdBy: caller.actor.id,
|
|
27
|
+
codeHash: yield* hashCode(code),
|
|
28
|
+
expiresAt: (yield* Clock.currentTimeMillis) + 7 * 24 * 60 * 60 * 1000,
|
|
29
|
+
state: "pending",
|
|
30
|
+
};
|
|
31
|
+
yield* store.insertInvitation(value);
|
|
32
|
+
return { invitation: publicInvitation(value), code };
|
|
33
|
+
}),
|
|
34
|
+
acceptInvitation: Effect.fn("Party.acceptInvitation")(function* (caller, code) {
|
|
35
|
+
yield* UnitOfWork.required;
|
|
36
|
+
if (caller.kind !== "person")
|
|
37
|
+
return yield* new PartyDenied();
|
|
38
|
+
const value = yield* store.consumeInvitation(yield* hashCode(code), yield* Clock.currentTimeMillis);
|
|
39
|
+
// One conditional UPDATE claims the code. A rolled-back feature restores it.
|
|
40
|
+
if (!value)
|
|
41
|
+
return yield* new PartyNotFound();
|
|
42
|
+
if (value.roleKey !== null)
|
|
43
|
+
yield* checkRole({ kind: "person", actor: { id: value.createdBy }, via: caller.via }, value.roleKey, value.organisationId).pipe(Effect.catchTags({
|
|
44
|
+
PartyDenied: () => new PartyNotFound(),
|
|
45
|
+
PartyNotFound: () => new PartyNotFound(),
|
|
46
|
+
}));
|
|
47
|
+
yield* store.relate({
|
|
48
|
+
from: { kind: "person", id: caller.actor.id },
|
|
49
|
+
to: { kind: "organisation", id: value.organisationId },
|
|
50
|
+
kind: "staff",
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
organisationId: value.organisationId,
|
|
54
|
+
roleKey: value.roleKey,
|
|
55
|
+
personId: caller.actor.id,
|
|
56
|
+
};
|
|
57
|
+
}),
|
|
58
|
+
revokeInvitation: Effect.fn("Party.revokeInvitation")(function* (caller, id) {
|
|
59
|
+
yield* UnitOfWork.required;
|
|
60
|
+
const value = yield* store.invitation(id);
|
|
61
|
+
if (!value)
|
|
62
|
+
return yield* new PartyNotFound();
|
|
63
|
+
yield* admin(caller, value.organisationId);
|
|
64
|
+
yield* store.revokeInvitation(id);
|
|
65
|
+
}),
|
|
66
|
+
listInvitations: Effect.fn("Party.listInvitations")(function* (caller, organisationId) {
|
|
67
|
+
yield* admin(caller, organisationId);
|
|
68
|
+
return (yield* store.invitations(organisationId)).map(publicInvitation);
|
|
69
|
+
}),
|
|
70
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
export declare const OrganisationId: Schema.NonEmptyString;
|
|
3
|
+
export declare const Organisation: Schema.Struct<{
|
|
4
|
+
readonly id: Schema.NonEmptyString;
|
|
5
|
+
readonly name: Schema.NonEmptyString;
|
|
6
|
+
}>;
|
|
7
|
+
export type Organisation = typeof Organisation.Type;
|
|
8
|
+
export declare const OrganisationRelation: Schema.Struct<{
|
|
9
|
+
readonly id: Schema.NonEmptyString;
|
|
10
|
+
readonly name: Schema.NonEmptyString;
|
|
11
|
+
readonly relation: Schema.String;
|
|
12
|
+
}>;
|
|
13
|
+
export type OrganisationRelation = typeof OrganisationRelation.Type;
|
|
14
|
+
export declare const OwnOrganisation: Schema.Struct<{
|
|
15
|
+
readonly id: Schema.NonEmptyString;
|
|
16
|
+
readonly name: Schema.NonEmptyString;
|
|
17
|
+
readonly relation: Schema.NullOr<Schema.String>;
|
|
18
|
+
}>;
|
|
19
|
+
export type OwnOrganisation = typeof OwnOrganisation.Type;
|
|
20
|
+
declare const PartyNotFound_base: Schema.Class<PartyNotFound, Schema.TaggedStruct<"PartyNotFound", {
|
|
21
|
+
readonly kind: Schema.tag<"not_found">;
|
|
22
|
+
}>, import("effect/Cause").YieldableError>;
|
|
23
|
+
export declare class PartyNotFound extends PartyNotFound_base {
|
|
24
|
+
}
|
|
25
|
+
declare const PartyInputInvalid_base: Schema.Class<PartyInputInvalid, Schema.TaggedStruct<"PartyInputInvalid", {
|
|
26
|
+
readonly kind: Schema.tag<"invalid">;
|
|
27
|
+
readonly message: Schema.String;
|
|
28
|
+
}>, import("effect/Cause").YieldableError>;
|
|
29
|
+
export declare class PartyInputInvalid extends PartyInputInvalid_base {
|
|
30
|
+
}
|
|
31
|
+
declare const PartyDenied_base: Schema.Class<PartyDenied, Schema.TaggedStruct<"PartyDenied", {
|
|
32
|
+
readonly kind: Schema.tag<"forbidden">;
|
|
33
|
+
}>, import("effect/Cause").YieldableError>;
|
|
34
|
+
export declare class PartyDenied extends PartyDenied_base {
|
|
35
|
+
get message(): string;
|
|
36
|
+
}
|
|
37
|
+
declare const PartyLastAdmin_base: Schema.Class<PartyLastAdmin, Schema.TaggedStruct<"PartyLastAdmin", {
|
|
38
|
+
readonly kind: Schema.tag<"conflict">;
|
|
39
|
+
readonly message: Schema.tag<"An organisation must keep at least one administrator.">;
|
|
40
|
+
}>, import("effect/Cause").YieldableError>;
|
|
41
|
+
export declare class PartyLastAdmin extends PartyLastAdmin_base {
|
|
42
|
+
}
|
|
43
|
+
declare const PartyConflict_base: Schema.Class<PartyConflict, Schema.TaggedStruct<"PartyConflict", {
|
|
44
|
+
readonly kind: Schema.tag<"conflict">;
|
|
45
|
+
}>, import("effect/Cause").YieldableError>;
|
|
46
|
+
export declare class PartyConflict extends PartyConflict_base {
|
|
47
|
+
}
|
|
48
|
+
declare const PartyUnavailable_base: Schema.Class<PartyUnavailable, Schema.TaggedStruct<"PartyUnavailable", {
|
|
49
|
+
readonly kind: Schema.tag<"unavailable">;
|
|
50
|
+
readonly cause: Schema.Defect;
|
|
51
|
+
}>, import("effect/Cause").YieldableError>;
|
|
52
|
+
export declare class PartyUnavailable extends PartyUnavailable_base {
|
|
53
|
+
get message(): string;
|
|
54
|
+
}
|
|
55
|
+
export declare const validateOrganisation: (input: Organisation) => Effect.Effect<{
|
|
56
|
+
readonly id: string;
|
|
57
|
+
readonly name: string;
|
|
58
|
+
}, PartyInputInvalid, never>;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { errorKind } from "@house-rules/domain/contract";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
export const OrganisationId = Schema.NonEmptyString;
|
|
4
|
+
export const Organisation = Schema.Struct({ id: OrganisationId, name: Schema.NonEmptyString });
|
|
5
|
+
export const OrganisationRelation = Schema.Struct({
|
|
6
|
+
...Organisation.fields,
|
|
7
|
+
relation: Schema.String,
|
|
8
|
+
});
|
|
9
|
+
export const OwnOrganisation = Schema.Struct({
|
|
10
|
+
...Organisation.fields,
|
|
11
|
+
relation: Schema.NullOr(Schema.String),
|
|
12
|
+
});
|
|
13
|
+
export class PartyNotFound extends Schema.TaggedError()("PartyNotFound", {
|
|
14
|
+
kind: errorKind("not_found"),
|
|
15
|
+
}) {
|
|
16
|
+
}
|
|
17
|
+
export class PartyInputInvalid extends Schema.TaggedError()("PartyInputInvalid", {
|
|
18
|
+
kind: errorKind("invalid"),
|
|
19
|
+
message: Schema.String,
|
|
20
|
+
}) {
|
|
21
|
+
}
|
|
22
|
+
export class PartyDenied extends Schema.TaggedError()("PartyDenied", {
|
|
23
|
+
kind: errorKind("forbidden"),
|
|
24
|
+
}) {
|
|
25
|
+
get message() {
|
|
26
|
+
return "You do not have permission for this action in this scope.";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export class PartyLastAdmin extends Schema.TaggedError()("PartyLastAdmin", {
|
|
30
|
+
kind: errorKind("conflict"),
|
|
31
|
+
message: Schema.tag("An organisation must keep at least one administrator."),
|
|
32
|
+
}) {
|
|
33
|
+
}
|
|
34
|
+
export class PartyConflict extends Schema.TaggedError()("PartyConflict", {
|
|
35
|
+
kind: errorKind("conflict"),
|
|
36
|
+
}) {
|
|
37
|
+
}
|
|
38
|
+
export class PartyUnavailable extends Schema.TaggedError()("PartyUnavailable", {
|
|
39
|
+
kind: errorKind("unavailable"),
|
|
40
|
+
cause: Schema.Defect(),
|
|
41
|
+
}) {
|
|
42
|
+
get message() {
|
|
43
|
+
return "Party is unavailable. Try again shortly.";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export const validateOrganisation = (input) => Schema.decodeEffect(Organisation)(input).pipe(Effect.mapError(() => new PartyInputInvalid({ message: "Invalid organisation." })));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Binding } from "@house-rules/application";
|
|
2
|
+
import type { makeAccess } from "../role/access.js";
|
|
3
|
+
import type { makeParty } from "./party.js";
|
|
4
|
+
import type { makePrincipals } from "./principals.js";
|
|
5
|
+
type Service = ReturnType<typeof makeParty> & ReturnType<typeof makeAccess> & ReturnType<typeof makePrincipals>;
|
|
6
|
+
export declare const bindParty: (service: Service) => readonly Binding[];
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { bindOperation } from "@house-rules/application";
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
import { PartyOperations } from "./operations.js";
|
|
4
|
+
import { PersonCallerDenied, PersonNotFound, PersonUpdateRefused } from "./person.js";
|
|
5
|
+
export const bindParty = (service) => [
|
|
6
|
+
bindOperation(PartyOperations.createPrincipal, (input, { caller }) => caller.kind === "system"
|
|
7
|
+
? service.createPrincipal(input)
|
|
8
|
+
: Effect.fail(new PersonCallerDenied())),
|
|
9
|
+
bindOperation(PartyOperations.disable, ({ id }, { caller }) => caller.kind === "system" ? service.disable(id) : Effect.fail(new PersonCallerDenied())),
|
|
10
|
+
bindOperation(PartyOperations.lockActive, (input, { caller }) => service
|
|
11
|
+
.lockActive(input)
|
|
12
|
+
.pipe(Effect.catchTag(["PrincipalKindRefused", "PrincipalDisabledRefused"], (error) => Effect.fail(caller.kind === "person" ? new PersonNotFound() : error)))),
|
|
13
|
+
bindOperation(PartyOperations.principalsByIds, ({ ids }) => service.principalsByIds(ids)),
|
|
14
|
+
bindOperation(PartyOperations.findPrincipal, (input) => service.findPrincipal(input)),
|
|
15
|
+
bindOperation(PartyOperations.holdersOf, (input) => service.holdersOf(input)),
|
|
16
|
+
bindOperation(PartyOperations.canAdminOrganisation, ({ organisationId }, { caller }) => service.canAdminOrganisation(caller, organisationId)),
|
|
17
|
+
bindOperation(PartyOperations.createInvitation, (input, { caller }) => service.createInvitation(caller, input)),
|
|
18
|
+
bindOperation(PartyOperations.acceptInvitation, ({ code }, { caller }) => service.acceptInvitation(caller, code)),
|
|
19
|
+
bindOperation(PartyOperations.revokeInvitation, ({ id }, { caller }) => service.revokeInvitation(caller, id)),
|
|
20
|
+
bindOperation(PartyOperations.listInvitations, ({ organisationId }, { caller }) => service.listInvitations(caller, organisationId)),
|
|
21
|
+
bindOperation(PartyOperations.myOrganisations, (_input, { caller }) => service.myOrganisations(caller)),
|
|
22
|
+
bindOperation(PartyOperations.listMembers, ({ organisationId }, { caller }) => service.listMembers(caller, organisationId)),
|
|
23
|
+
bindOperation(PartyOperations.listPeople, (_input, { caller }) => service.listPeople(caller)),
|
|
24
|
+
bindOperation(PartyOperations.myAccess, (_input, { caller }) => service.myAccess(caller)),
|
|
25
|
+
bindOperation(PartyOperations.createOrganisation, (input, { caller }) => service.createOrganisation(caller, input)),
|
|
26
|
+
bindOperation(PartyOperations.showOrganisation, ({ id }) => service.showOrganisation(id)),
|
|
27
|
+
bindOperation(PartyOperations.relate, (input, { caller }) => service.relate(caller, input)),
|
|
28
|
+
bindOperation(PartyOperations.unrelate, (input, { caller }) => service.unrelate(caller, input)),
|
|
29
|
+
bindOperation(PartyOperations.isRelated, (input) => service.isRelated(input)),
|
|
30
|
+
bindOperation(PartyOperations.defineRole, (input, { caller }) => service.defineRole(caller, input)),
|
|
31
|
+
bindOperation(PartyOperations.deleteRole, ({ key }, { caller }) => service.deleteRole(caller, key)),
|
|
32
|
+
bindOperation(PartyOperations.listRoles, (_input, { caller }) => service.listRoles(caller)),
|
|
33
|
+
bindOperation(PartyOperations.assignRole, (input, { caller }) => service.assignRole(caller, input)),
|
|
34
|
+
bindOperation(PartyOperations.revokeRole, (input, { caller }) => service.revokeRole(caller, input)),
|
|
35
|
+
bindOperation(PartyOperations.rolesOf, ({ personId }, { caller }) => service.rolesOf(caller, personId)),
|
|
36
|
+
bindOperation(PartyOperations.createPerson, (input, { caller }) => caller.kind === "system" ? service.createPerson(input) : Effect.fail(new PersonCallerDenied())),
|
|
37
|
+
bindOperation(PartyOperations.showPerson, ({ id }, { caller }) => caller.kind === "person" ? service.get(caller.actor, id) : Effect.fail(new PersonNotFound())),
|
|
38
|
+
bindOperation(PartyOperations.showMe, (_input, { caller }) => caller.kind === "person" ? service.me(caller.actor) : Effect.fail(new PersonNotFound())),
|
|
39
|
+
bindOperation(PartyOperations.renamePerson, ({ id, displayName }, { caller }) => caller.kind === "person"
|
|
40
|
+
? service.rename(caller.actor, id, displayName)
|
|
41
|
+
: Effect.fail(new PersonUpdateRefused())),
|
|
42
|
+
];
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { PartyDenied, PartyNotFound, PartyUnavailable } from "../organisation/organisation.js";
|
|
3
|
+
import { PersonAlreadyExists, PersonCallerDenied, PersonInputInvalid, PersonNotFound, PersonStoreUnavailable, PersonUpdateRefused } from "./person.js";
|
|
4
|
+
export declare const PartyOperations: {
|
|
5
|
+
readonly canAdminOrganisation: import("@house-rules/domain/contract").Operation<"Party.canAdminOrganisation", Schema.Struct<{
|
|
6
|
+
readonly organisationId: Schema.String;
|
|
7
|
+
}>, Schema.Boolean, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
8
|
+
readonly createInvitation: import("@house-rules/domain/contract").Operation<"Party.createInvitation", Schema.Struct<{
|
|
9
|
+
readonly organisationId: Schema.String;
|
|
10
|
+
readonly roleKey: Schema.NullOr<Schema.String>;
|
|
11
|
+
}>, Schema.Struct<{
|
|
12
|
+
readonly invitation: Schema.Struct<{
|
|
13
|
+
readonly id: Schema.String;
|
|
14
|
+
readonly organisationId: Schema.String;
|
|
15
|
+
readonly roleKey: Schema.NullOr<Schema.String>;
|
|
16
|
+
readonly createdBy: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
17
|
+
readonly expiresAt: Schema.Finite;
|
|
18
|
+
readonly state: Schema.Literals<readonly ["pending", "used", "revoked"]>;
|
|
19
|
+
}>;
|
|
20
|
+
readonly code: Schema.String;
|
|
21
|
+
}>, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, false, false, true, false>;
|
|
22
|
+
readonly acceptInvitation: import("@house-rules/domain/contract").Operation<"Party.acceptInvitation", Schema.Struct<{
|
|
23
|
+
readonly code: Schema.String;
|
|
24
|
+
}>, Schema.Struct<{
|
|
25
|
+
readonly organisationId: Schema.String;
|
|
26
|
+
readonly roleKey: Schema.NullOr<Schema.String>;
|
|
27
|
+
readonly personId: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
28
|
+
}>, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, false, false, true, false>;
|
|
29
|
+
readonly revokeInvitation: import("@house-rules/domain/contract").Operation<"Party.revokeInvitation", Schema.Struct<{
|
|
30
|
+
readonly id: Schema.String;
|
|
31
|
+
}>, Schema.Void, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, false, true, true, true>;
|
|
32
|
+
readonly listInvitations: import("@house-rules/domain/contract").Operation<"Party.listInvitations", Schema.Struct<{
|
|
33
|
+
readonly organisationId: Schema.String;
|
|
34
|
+
}>, Schema.$Array<Schema.Struct<{
|
|
35
|
+
readonly id: Schema.String;
|
|
36
|
+
readonly organisationId: Schema.String;
|
|
37
|
+
readonly roleKey: Schema.NullOr<Schema.String>;
|
|
38
|
+
readonly createdBy: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
39
|
+
readonly expiresAt: Schema.Finite;
|
|
40
|
+
readonly state: Schema.Literals<readonly ["pending", "used", "revoked"]>;
|
|
41
|
+
}>>, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
42
|
+
readonly myOrganisations: import("@house-rules/domain/contract").Operation<"Party.myOrganisations", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
43
|
+
readonly id: Schema.NonEmptyString;
|
|
44
|
+
readonly name: Schema.NonEmptyString;
|
|
45
|
+
readonly relation: Schema.NullOr<Schema.String>;
|
|
46
|
+
readonly roles: Schema.$Array<Schema.Struct<{
|
|
47
|
+
readonly roleKey: Schema.String;
|
|
48
|
+
readonly roleName: Schema.String;
|
|
49
|
+
readonly permissions: Schema.$Array<Schema.String>;
|
|
50
|
+
}>>;
|
|
51
|
+
}>>, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
52
|
+
readonly myAccess: import("@house-rules/domain/contract").Operation<"Party.myAccess", Schema.$Record<Schema.String, Schema.Never>, Schema.Struct<{
|
|
53
|
+
readonly roles: Schema.$Array<Schema.Struct<{
|
|
54
|
+
readonly personId: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
55
|
+
readonly roleKey: Schema.NonEmptyString;
|
|
56
|
+
readonly organisationId: Schema.NullOr<Schema.NonEmptyString>;
|
|
57
|
+
}>>;
|
|
58
|
+
readonly permissions: Schema.$Array<Schema.String>;
|
|
59
|
+
readonly catalogue: Schema.$Array<Schema.String>;
|
|
60
|
+
}>, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
61
|
+
readonly createOrganisation: import("@house-rules/domain/contract").Operation<"Party.createOrganisation", Schema.Struct<{
|
|
62
|
+
readonly id: Schema.NonEmptyString;
|
|
63
|
+
readonly name: Schema.NonEmptyString;
|
|
64
|
+
}>, Schema.Struct<{
|
|
65
|
+
readonly id: Schema.NonEmptyString;
|
|
66
|
+
readonly name: Schema.NonEmptyString;
|
|
67
|
+
}>, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, false, false, true, false>;
|
|
68
|
+
readonly showOrganisation: import("@house-rules/domain/contract").Operation<"Party.showOrganisation", Schema.Struct<{
|
|
69
|
+
readonly id: Schema.String;
|
|
70
|
+
}>, Schema.Struct<{
|
|
71
|
+
readonly id: Schema.NonEmptyString;
|
|
72
|
+
readonly name: Schema.NonEmptyString;
|
|
73
|
+
}>, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
74
|
+
readonly relate: import("@house-rules/domain/contract").Operation<"Party.relate", Schema.Struct<{
|
|
75
|
+
readonly from: Schema.Struct<{
|
|
76
|
+
readonly kind: Schema.Literals<readonly ["person", "organisation"]>;
|
|
77
|
+
readonly id: Schema.NonEmptyString;
|
|
78
|
+
}>;
|
|
79
|
+
readonly to: Schema.Struct<{
|
|
80
|
+
readonly kind: Schema.Literals<readonly ["person", "organisation"]>;
|
|
81
|
+
readonly id: Schema.NonEmptyString;
|
|
82
|
+
}>;
|
|
83
|
+
readonly kind: Schema.NonEmptyString;
|
|
84
|
+
}>, Schema.Void, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, false, false, true, false>;
|
|
85
|
+
readonly unrelate: import("@house-rules/domain/contract").Operation<"Party.unrelate", Schema.Struct<{
|
|
86
|
+
readonly from: Schema.Struct<{
|
|
87
|
+
readonly kind: Schema.Literals<readonly ["person", "organisation"]>;
|
|
88
|
+
readonly id: Schema.NonEmptyString;
|
|
89
|
+
}>;
|
|
90
|
+
readonly to: Schema.Struct<{
|
|
91
|
+
readonly kind: Schema.Literals<readonly ["person", "organisation"]>;
|
|
92
|
+
readonly id: Schema.NonEmptyString;
|
|
93
|
+
}>;
|
|
94
|
+
readonly kind: Schema.NonEmptyString;
|
|
95
|
+
}>, Schema.Void, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, false, true, true, true>;
|
|
96
|
+
readonly isRelated: import("@house-rules/domain/contract").Operation<"Party.isRelated", Schema.Struct<{
|
|
97
|
+
readonly from: Schema.Struct<{
|
|
98
|
+
readonly kind: Schema.Literals<readonly ["person", "organisation"]>;
|
|
99
|
+
readonly id: Schema.NonEmptyString;
|
|
100
|
+
}>;
|
|
101
|
+
readonly to: Schema.Struct<{
|
|
102
|
+
readonly kind: Schema.Literals<readonly ["person", "organisation"]>;
|
|
103
|
+
readonly id: Schema.NonEmptyString;
|
|
104
|
+
}>;
|
|
105
|
+
readonly kind: Schema.NonEmptyString;
|
|
106
|
+
}>, Schema.Boolean, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
107
|
+
readonly defineRole: import("@house-rules/domain/contract").Operation<"Party.defineRole", Schema.Struct<{
|
|
108
|
+
readonly key: Schema.String;
|
|
109
|
+
readonly name: Schema.String;
|
|
110
|
+
readonly permissions: Schema.$Array<Schema.String>;
|
|
111
|
+
readonly organisationId: Schema.NullOr<Schema.String>;
|
|
112
|
+
}>, Schema.Struct<{
|
|
113
|
+
readonly key: Schema.NonEmptyString;
|
|
114
|
+
readonly name: Schema.NonEmptyString;
|
|
115
|
+
readonly permissions: Schema.$Array<Schema.String>;
|
|
116
|
+
readonly organisationId: Schema.NullOr<Schema.NonEmptyString>;
|
|
117
|
+
readonly builtIn: Schema.Boolean;
|
|
118
|
+
}>, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, false, false, true, false>;
|
|
119
|
+
readonly deleteRole: import("@house-rules/domain/contract").Operation<"Party.deleteRole", Schema.Struct<{
|
|
120
|
+
readonly key: Schema.String;
|
|
121
|
+
}>, Schema.Void, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, false, true, true, true>;
|
|
122
|
+
readonly listRoles: import("@house-rules/domain/contract").Operation<"Party.listRoles", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
123
|
+
readonly key: Schema.NonEmptyString;
|
|
124
|
+
readonly name: Schema.NonEmptyString;
|
|
125
|
+
readonly permissions: Schema.$Array<Schema.String>;
|
|
126
|
+
readonly organisationId: Schema.NullOr<Schema.NonEmptyString>;
|
|
127
|
+
readonly builtIn: Schema.Boolean;
|
|
128
|
+
}>>, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
129
|
+
readonly assignRole: import("@house-rules/domain/contract").Operation<"Party.assignRole", Schema.Struct<{
|
|
130
|
+
readonly personId: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
131
|
+
readonly roleKey: Schema.NonEmptyString;
|
|
132
|
+
readonly organisationId: Schema.NullOr<Schema.NonEmptyString>;
|
|
133
|
+
}>, Schema.Void, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, false, false, true, false>;
|
|
134
|
+
readonly revokeRole: import("@house-rules/domain/contract").Operation<"Party.revokeRole", Schema.Struct<{
|
|
135
|
+
readonly personId: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
136
|
+
readonly roleKey: Schema.NonEmptyString;
|
|
137
|
+
readonly organisationId: Schema.NullOr<Schema.NonEmptyString>;
|
|
138
|
+
}>, Schema.Void, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, false, true, true, true>;
|
|
139
|
+
readonly rolesOf: import("@house-rules/domain/contract").Operation<"Party.rolesOf", Schema.Struct<{
|
|
140
|
+
readonly personId: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
141
|
+
}>, Schema.$Array<Schema.Struct<{
|
|
142
|
+
readonly personId: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
143
|
+
readonly roleKey: Schema.NonEmptyString;
|
|
144
|
+
readonly organisationId: Schema.NullOr<Schema.NonEmptyString>;
|
|
145
|
+
}>>, Schema.Union<readonly [typeof import("../organisation/organisation.js").PartyLastAdmin, typeof import("../organisation/organisation.js").PartyConflict, typeof PartyDenied, typeof import("../organisation/organisation.js").PartyInputInvalid, typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
146
|
+
readonly createPrincipal: import("@house-rules/domain/contract").Operation<"Party.createPrincipal", Schema.Struct<{
|
|
147
|
+
readonly id: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
148
|
+
readonly displayName: Schema.String;
|
|
149
|
+
readonly kind: Schema.Literals<readonly ["person", "agent"]>;
|
|
150
|
+
readonly handle: Schema.String;
|
|
151
|
+
readonly createdBy: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
152
|
+
}>, Schema.Struct<{
|
|
153
|
+
readonly principal: Schema.Struct<{
|
|
154
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
155
|
+
readonly displayName: Schema.Trim;
|
|
156
|
+
readonly createdAt: Schema.Int;
|
|
157
|
+
readonly kind: Schema.Literals<readonly ["person", "agent"]>;
|
|
158
|
+
readonly handle: Schema.String;
|
|
159
|
+
readonly createdBy: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
160
|
+
readonly disabledAt: Schema.NullOr<Schema.Int>;
|
|
161
|
+
}>;
|
|
162
|
+
readonly fact: Schema.Struct<{
|
|
163
|
+
readonly kind: Schema.Literal<"principal.created">;
|
|
164
|
+
readonly after: Schema.Struct<{
|
|
165
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
166
|
+
readonly displayName: Schema.Trim;
|
|
167
|
+
readonly createdAt: Schema.Int;
|
|
168
|
+
readonly kind: Schema.Literals<readonly ["person", "agent"]>;
|
|
169
|
+
readonly handle: Schema.String;
|
|
170
|
+
readonly createdBy: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
171
|
+
readonly disabledAt: Schema.NullOr<Schema.Int>;
|
|
172
|
+
}>;
|
|
173
|
+
}>;
|
|
174
|
+
}>, Schema.Union<readonly [typeof PersonAlreadyExists, typeof PersonCallerDenied, typeof PersonInputInvalid, typeof PersonStoreUnavailable]>, NoInfer<readonly []>, false, false, true, false>;
|
|
175
|
+
readonly disable: import("@house-rules/domain/contract").Operation<"Party.disable", Schema.Struct<{
|
|
176
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
177
|
+
}>, Schema.Struct<{
|
|
178
|
+
readonly principal: Schema.Struct<{
|
|
179
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
180
|
+
readonly displayName: Schema.Trim;
|
|
181
|
+
readonly createdAt: Schema.Int;
|
|
182
|
+
readonly kind: Schema.Literals<readonly ["person", "agent"]>;
|
|
183
|
+
readonly handle: Schema.String;
|
|
184
|
+
readonly createdBy: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
185
|
+
readonly disabledAt: Schema.NullOr<Schema.Int>;
|
|
186
|
+
}>;
|
|
187
|
+
readonly fact: Schema.NullOr<Schema.Struct<{
|
|
188
|
+
readonly kind: Schema.Literal<"principal.disabled">;
|
|
189
|
+
readonly before: Schema.Struct<{
|
|
190
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
191
|
+
readonly displayName: Schema.Trim;
|
|
192
|
+
readonly createdAt: Schema.Int;
|
|
193
|
+
readonly kind: Schema.Literals<readonly ["person", "agent"]>;
|
|
194
|
+
readonly handle: Schema.String;
|
|
195
|
+
readonly createdBy: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
196
|
+
readonly disabledAt: Schema.NullOr<Schema.Int>;
|
|
197
|
+
}>;
|
|
198
|
+
readonly after: Schema.Struct<{
|
|
199
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
200
|
+
readonly displayName: Schema.Trim;
|
|
201
|
+
readonly createdAt: Schema.Int;
|
|
202
|
+
readonly kind: Schema.Literals<readonly ["person", "agent"]>;
|
|
203
|
+
readonly handle: Schema.String;
|
|
204
|
+
readonly createdBy: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
205
|
+
readonly disabledAt: Schema.NullOr<Schema.Int>;
|
|
206
|
+
}>;
|
|
207
|
+
}>>;
|
|
208
|
+
}>, Schema.Union<readonly [typeof PersonNotFound, typeof PersonCallerDenied, typeof PersonStoreUnavailable]>, NoInfer<readonly []>, false, true, true, true>;
|
|
209
|
+
readonly lockActive: import("@house-rules/domain/contract").Operation<"Party.lockActive", Schema.Struct<{
|
|
210
|
+
readonly handle: Schema.String;
|
|
211
|
+
readonly kind: Schema.Literals<readonly ["person", "agent"]>;
|
|
212
|
+
}>, Schema.Struct<{
|
|
213
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
214
|
+
readonly displayName: Schema.Trim;
|
|
215
|
+
readonly createdAt: Schema.Int;
|
|
216
|
+
readonly kind: Schema.Literals<readonly ["person", "agent"]>;
|
|
217
|
+
readonly handle: Schema.String;
|
|
218
|
+
readonly createdBy: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
219
|
+
readonly disabledAt: Schema.NullOr<Schema.Int>;
|
|
220
|
+
}>, Schema.Union<readonly [typeof PersonNotFound, typeof import("./principal.ts").PrincipalKindRefused, typeof import("./principal.ts").PrincipalDisabledRefused, typeof PersonStoreUnavailable]>, NoInfer<readonly []>, false, false, true, false>;
|
|
221
|
+
readonly principalsByIds: import("@house-rules/domain/contract").Operation<"Party.principalsByIds", Schema.Struct<{
|
|
222
|
+
readonly ids: Schema.$Array<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
223
|
+
}>, Schema.$Array<Schema.Struct<{
|
|
224
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
225
|
+
readonly displayName: Schema.Trim;
|
|
226
|
+
readonly createdAt: Schema.Int;
|
|
227
|
+
readonly kind: Schema.Literals<readonly ["person", "agent"]>;
|
|
228
|
+
readonly handle: Schema.String;
|
|
229
|
+
readonly createdBy: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
230
|
+
readonly disabledAt: Schema.NullOr<Schema.Int>;
|
|
231
|
+
}>>, typeof PersonStoreUnavailable, NoInfer<readonly []>, true, false, false, false>;
|
|
232
|
+
readonly findPrincipal: import("@house-rules/domain/contract").Operation<"Party.findPrincipal", Schema.Struct<{
|
|
233
|
+
readonly handle: Schema.String;
|
|
234
|
+
}>, Schema.Struct<{
|
|
235
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
236
|
+
readonly displayName: Schema.Trim;
|
|
237
|
+
readonly createdAt: Schema.Int;
|
|
238
|
+
readonly kind: Schema.Literals<readonly ["person", "agent"]>;
|
|
239
|
+
readonly handle: Schema.String;
|
|
240
|
+
readonly createdBy: Schema.NullOr<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
241
|
+
readonly disabledAt: Schema.NullOr<Schema.Int>;
|
|
242
|
+
}>, Schema.Union<readonly [typeof PersonNotFound, typeof PersonStoreUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
243
|
+
readonly holdersOf: import("@house-rules/domain/contract").Operation<"Party.holdersOf", Schema.Struct<{
|
|
244
|
+
readonly role: Schema.NonEmptyString;
|
|
245
|
+
readonly scope: Schema.optionalKey<Schema.NullOr<Schema.NonEmptyString>>;
|
|
246
|
+
}>, Schema.Struct<{
|
|
247
|
+
readonly ids: Schema.$Array<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
248
|
+
readonly truncated: Schema.Boolean;
|
|
249
|
+
}>, typeof PartyUnavailable, NoInfer<readonly []>, true, false, false, false>;
|
|
250
|
+
readonly listMembers: import("@house-rules/domain/contract").Operation<"Party.listMembers", Schema.Struct<{
|
|
251
|
+
readonly organisationId: Schema.String;
|
|
252
|
+
}>, Schema.$Array<Schema.Struct<{
|
|
253
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
254
|
+
readonly displayName: Schema.Trim;
|
|
255
|
+
readonly createdAt: Schema.Int;
|
|
256
|
+
readonly relation: Schema.NullOr<Schema.String>;
|
|
257
|
+
readonly roles: Schema.$Array<Schema.Struct<{
|
|
258
|
+
readonly roleKey: Schema.String;
|
|
259
|
+
readonly roleName: Schema.String;
|
|
260
|
+
}>>;
|
|
261
|
+
}>>, Schema.Union<readonly [typeof PartyNotFound, typeof PartyUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
262
|
+
readonly listPeople: import("@house-rules/domain/contract").Operation<"Party.listPeople", Schema.$Record<Schema.String, Schema.Never>, Schema.$Array<Schema.Struct<{
|
|
263
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
264
|
+
readonly displayName: Schema.Trim;
|
|
265
|
+
readonly createdAt: Schema.Int;
|
|
266
|
+
readonly assignments: Schema.$Array<Schema.Struct<{
|
|
267
|
+
readonly roleKey: Schema.String;
|
|
268
|
+
readonly roleName: Schema.String;
|
|
269
|
+
readonly organisationId: Schema.NullOr<Schema.String>;
|
|
270
|
+
readonly organisationName: Schema.NullOr<Schema.String>;
|
|
271
|
+
}>>;
|
|
272
|
+
readonly organisations: Schema.$Array<Schema.Struct<{
|
|
273
|
+
readonly id: Schema.NonEmptyString;
|
|
274
|
+
readonly name: Schema.NonEmptyString;
|
|
275
|
+
readonly relation: Schema.String;
|
|
276
|
+
}>>;
|
|
277
|
+
}>>, Schema.Union<readonly [typeof PartyDenied, typeof PartyUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
278
|
+
readonly createPerson: import("@house-rules/domain/contract").Operation<"Party.createPerson", Schema.Struct<{
|
|
279
|
+
readonly displayName: Schema.String;
|
|
280
|
+
readonly id: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "ActorId">>;
|
|
281
|
+
}>, Schema.Struct<{
|
|
282
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
283
|
+
readonly displayName: Schema.Trim;
|
|
284
|
+
readonly createdAt: Schema.Int;
|
|
285
|
+
}>, Schema.Union<readonly [typeof PersonAlreadyExists, typeof PersonCallerDenied, typeof PersonInputInvalid, typeof PersonStoreUnavailable]>, NoInfer<readonly []>, false, false, true, false>;
|
|
286
|
+
readonly showPerson: import("@house-rules/domain/contract").Operation<"Party.showPerson", Schema.Struct<{
|
|
287
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
288
|
+
}>, Schema.Struct<{
|
|
289
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
290
|
+
readonly displayName: Schema.Trim;
|
|
291
|
+
readonly createdAt: Schema.Int;
|
|
292
|
+
}>, Schema.Union<readonly [typeof PersonNotFound, typeof PersonStoreUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
293
|
+
readonly showMe: import("@house-rules/domain/contract").Operation<"Party.showMe", Schema.$Record<Schema.String, Schema.Never>, Schema.Struct<{
|
|
294
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
295
|
+
readonly displayName: Schema.Trim;
|
|
296
|
+
readonly createdAt: Schema.Int;
|
|
297
|
+
}>, Schema.Union<readonly [typeof PersonNotFound, typeof PersonStoreUnavailable]>, NoInfer<readonly []>, true, false, false, false>;
|
|
298
|
+
readonly renamePerson: import("@house-rules/domain/contract").Operation<"Party.renamePerson", Schema.Struct<{
|
|
299
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
300
|
+
readonly displayName: Schema.String;
|
|
301
|
+
}>, Schema.Struct<{
|
|
302
|
+
readonly id: Schema.brand<Schema.NonEmptyString, "ActorId">;
|
|
303
|
+
readonly displayName: Schema.Trim;
|
|
304
|
+
readonly createdAt: Schema.Int;
|
|
305
|
+
}>, Schema.Union<readonly [typeof PersonInputInvalid, typeof PersonNotFound, typeof PersonUpdateRefused, typeof PersonStoreUnavailable]>, NoInfer<readonly []>, false, false, true, false>;
|
|
306
|
+
};
|