@attraccess/application-models 0.0.0-stage → 1.11.0-beta.4
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/README.md +6 -2
- package/package.json +21 -3
- package/src/index.d.ts +78 -0
- package/src/index.js +82 -0
- package/src/index.js.map +1 -0
- package/src/lib/api-token.d.ts +29 -0
- package/src/lib/api-token.js +3 -0
- package/src/lib/api-token.js.map +1 -0
- package/src/lib/attractap-card.d.ts +48 -0
- package/src/lib/attractap-card.js +3 -0
- package/src/lib/attractap-card.js.map +1 -0
- package/src/lib/attractap-crash-report.d.ts +35 -0
- package/src/lib/attractap-crash-report.js +3 -0
- package/src/lib/attractap-crash-report.js.map +1 -0
- package/src/lib/attractap-installation.d.ts +9 -0
- package/src/lib/attractap-installation.js +3 -0
- package/src/lib/attractap-installation.js.map +1 -0
- package/src/lib/attractap-reader.d.ts +113 -0
- package/src/lib/attractap-reader.js +3 -0
- package/src/lib/attractap-reader.js.map +1 -0
- package/src/lib/attractap-secure-boot.d.ts +17 -0
- package/src/lib/attractap-secure-boot.js +3 -0
- package/src/lib/attractap-secure-boot.js.map +1 -0
- package/src/lib/audit-entry.d.ts +47 -0
- package/src/lib/audit-entry.js +6 -0
- package/src/lib/audit-entry.js.map +1 -0
- package/src/lib/authentication-credential.d.ts +31 -0
- package/src/lib/authentication-credential.js +3 -0
- package/src/lib/authentication-credential.js.map +1 -0
- package/src/lib/authentication-type.d.ts +5 -0
- package/src/lib/authentication-type.js +10 -0
- package/src/lib/authentication-type.js.map +1 -0
- package/src/lib/billing-ledger.d.ts +114 -0
- package/src/lib/billing-ledger.js +3 -0
- package/src/lib/billing-ledger.js.map +1 -0
- package/src/lib/billing-transaction.d.ts +5 -0
- package/src/lib/billing-transaction.js +10 -0
- package/src/lib/billing-transaction.js.map +1 -0
- package/src/lib/companion-device.d.ts +23 -0
- package/src/lib/companion-device.js +3 -0
- package/src/lib/companion-device.js.map +1 -0
- package/src/lib/csv-export-template-record.d.ts +21 -0
- package/src/lib/csv-export-template-record.js +3 -0
- package/src/lib/csv-export-template-record.js.map +1 -0
- package/src/lib/csv-export-template.d.ts +9 -0
- package/src/lib/csv-export-template.js +15 -0
- package/src/lib/csv-export-template.js.map +1 -0
- package/src/lib/dashboard-pins.d.ts +9 -0
- package/src/lib/dashboard-pins.js +3 -0
- package/src/lib/dashboard-pins.js.map +1 -0
- package/src/lib/documentation-type.d.ts +7 -0
- package/src/lib/documentation-type.js +12 -0
- package/src/lib/documentation-type.js.map +1 -0
- package/src/lib/email-template-record.d.ts +17 -0
- package/src/lib/email-template-record.js +3 -0
- package/src/lib/email-template-record.js.map +1 -0
- package/src/lib/email-template.d.ts +18 -0
- package/src/lib/email-template.js +23 -0
- package/src/lib/email-template.js.map +1 -0
- package/src/lib/flow-records.d.ts +77 -0
- package/src/lib/flow-records.js +3 -0
- package/src/lib/flow-records.js.map +1 -0
- package/src/lib/form.d.ts +11 -0
- package/src/lib/form.js +17 -0
- package/src/lib/form.js.map +1 -0
- package/src/lib/mcp-oauth.d.ts +39 -0
- package/src/lib/mcp-oauth.js +3 -0
- package/src/lib/mcp-oauth.js.map +1 -0
- package/src/lib/message.d.ts +4 -0
- package/src/lib/message.js +9 -0
- package/src/lib/message.js.map +1 -0
- package/src/lib/messaging-models.d.ts +52 -0
- package/src/lib/messaging-models.js +3 -0
- package/src/lib/messaging-models.js.map +1 -0
- package/src/lib/metering-records.d.ts +148 -0
- package/src/lib/metering-records.js +3 -0
- package/src/lib/metering-records.js.map +1 -0
- package/src/lib/mqtt-server.d.ts +39 -0
- package/src/lib/mqtt-server.js +3 -0
- package/src/lib/mqtt-server.js.map +1 -0
- package/src/lib/node-type.d.ts +43 -0
- package/src/lib/node-type.js +48 -0
- package/src/lib/node-type.js.map +1 -0
- package/src/lib/notification-preference-record.d.ts +7 -0
- package/src/lib/notification-preference-record.js +3 -0
- package/src/lib/notification-preference-record.js.map +1 -0
- package/src/lib/notification-recipient.d.ts +7 -0
- package/src/lib/notification-recipient.js +3 -0
- package/src/lib/notification-recipient.js.map +1 -0
- package/src/lib/operating-interval.d.ts +33 -0
- package/src/lib/operating-interval.js +3 -0
- package/src/lib/operating-interval.js.map +1 -0
- package/src/lib/passkey.d.ts +28 -0
- package/src/lib/passkey.js +3 -0
- package/src/lib/passkey.js.map +1 -0
- package/src/lib/password-policy-override.d.ts +3 -0
- package/src/lib/password-policy-override.js +8 -0
- package/src/lib/password-policy-override.js.map +1 -0
- package/src/lib/password-policy-records.d.ts +24 -0
- package/src/lib/password-policy-records.js +19 -0
- package/src/lib/password-policy-records.js.map +1 -0
- package/src/lib/password-policy.d.ts +1 -0
- package/src/lib/password-policy.js +5 -0
- package/src/lib/password-policy.js.map +1 -0
- package/src/lib/plugin-ble-endpoint.d.ts +24 -0
- package/src/lib/plugin-ble-endpoint.js +3 -0
- package/src/lib/plugin-ble-endpoint.js.map +1 -0
- package/src/lib/plugin-host-models.d.ts +23 -0
- package/src/lib/plugin-host-models.js +3 -0
- package/src/lib/plugin-host-models.js.map +1 -0
- package/src/lib/project-invitation.d.ts +6 -0
- package/src/lib/project-invitation.js +11 -0
- package/src/lib/project-invitation.js.map +1 -0
- package/src/lib/project-member.d.ts +3 -0
- package/src/lib/project-member.js +8 -0
- package/src/lib/project-member.js.map +1 -0
- package/src/lib/project-record.d.ts +87 -0
- package/src/lib/project-record.js +3 -0
- package/src/lib/project-record.js.map +1 -0
- package/src/lib/push-subscription.d.ts +19 -0
- package/src/lib/push-subscription.js +3 -0
- package/src/lib/push-subscription.js.map +1 -0
- package/src/lib/rbac-record.d.ts +61 -0
- package/src/lib/rbac-record.js +3 -0
- package/src/lib/rbac-record.js.map +1 -0
- package/src/lib/reader-ui-alert.d.ts +15 -0
- package/src/lib/reader-ui-alert.js +3 -0
- package/src/lib/reader-ui-alert.js.map +1 -0
- package/src/lib/resource-actor-user.d.ts +21 -0
- package/src/lib/resource-actor-user.js +3 -0
- package/src/lib/resource-actor-user.js.map +1 -0
- package/src/lib/resource-flow-node/companion-schemas.d.ts +15 -0
- package/src/lib/resource-flow-node/companion-schemas.js +27 -0
- package/src/lib/resource-flow-node/companion-schemas.js.map +1 -0
- package/src/lib/resource-flow-node/external-effect-policy.d.ts +19 -0
- package/src/lib/resource-flow-node/external-effect-policy.js +24 -0
- package/src/lib/resource-flow-node/external-effect-policy.js.map +1 -0
- package/src/lib/resource-flow-node/health-schemas.d.ts +18 -0
- package/src/lib/resource-flow-node/health-schemas.js +34 -0
- package/src/lib/resource-flow-node/health-schemas.js.map +1 -0
- package/src/lib/resource-flow-node/http-schema.d.ts +25 -0
- package/src/lib/resource-flow-node/http-schema.js +20 -0
- package/src/lib/resource-flow-node/http-schema.js.map +1 -0
- package/src/lib/resource-flow-node/metering-schemas.d.ts +28 -0
- package/src/lib/resource-flow-node/metering-schemas.js +48 -0
- package/src/lib/resource-flow-node/metering-schemas.js.map +1 -0
- package/src/lib/resource-flow-node/mqtt-schemas.d.ts +33 -0
- package/src/lib/resource-flow-node/mqtt-schemas.js +43 -0
- package/src/lib/resource-flow-node/mqtt-schemas.js.map +1 -0
- package/src/lib/resource-flow-node/processing-schemas.d.ts +35 -0
- package/src/lib/resource-flow-node/processing-schemas.js +32 -0
- package/src/lib/resource-flow-node/processing-schemas.js.map +1 -0
- package/src/lib/resource-flow-node/resource-schemas.d.ts +27 -0
- package/src/lib/resource-flow-node/resource-schemas.js +44 -0
- package/src/lib/resource-flow-node/resource-schemas.js.map +1 -0
- package/src/lib/resource-flow-node/schema-registry.d.ts +180 -0
- package/src/lib/resource-flow-node/schema-registry.js +80 -0
- package/src/lib/resource-flow-node/schema-registry.js.map +1 -0
- package/src/lib/resource-flow-node/variable-schemas.d.ts +38 -0
- package/src/lib/resource-flow-node/variable-schemas.js +31 -0
- package/src/lib/resource-flow-node/variable-schemas.js.map +1 -0
- package/src/lib/resource-form-records.d.ts +23 -0
- package/src/lib/resource-form-records.js +3 -0
- package/src/lib/resource-form-records.js.map +1 -0
- package/src/lib/resource-health-records.d.ts +12 -0
- package/src/lib/resource-health-records.js +3 -0
- package/src/lib/resource-health-records.js.map +1 -0
- package/src/lib/resource-introducer-records.d.ts +13 -0
- package/src/lib/resource-introducer-records.js +3 -0
- package/src/lib/resource-introducer-records.js.map +1 -0
- package/src/lib/resource-introduction-records.d.ts +43 -0
- package/src/lib/resource-introduction-records.js +3 -0
- package/src/lib/resource-introduction-records.js.map +1 -0
- package/src/lib/resource-maintenance-records.d.ts +54 -0
- package/src/lib/resource-maintenance-records.js +3 -0
- package/src/lib/resource-maintenance-records.js.map +1 -0
- package/src/lib/resource-maintenance-request.d.ts +5 -0
- package/src/lib/resource-maintenance-request.js +10 -0
- package/src/lib/resource-maintenance-request.js.map +1 -0
- package/src/lib/resource-maintenance-schedule.d.ts +11 -0
- package/src/lib/resource-maintenance-schedule.js +17 -0
- package/src/lib/resource-maintenance-schedule.js.map +1 -0
- package/src/lib/resource-metering.d.ts +12 -0
- package/src/lib/resource-metering.js +17 -0
- package/src/lib/resource-metering.js.map +1 -0
- package/src/lib/resource-records.d.ts +33 -0
- package/src/lib/resource-records.js +3 -0
- package/src/lib/resource-records.js.map +1 -0
- package/src/lib/resource-supervision.d.ts +20 -0
- package/src/lib/resource-supervision.js +26 -0
- package/src/lib/resource-supervision.js.map +1 -0
- package/src/lib/resource-type.d.ts +4 -0
- package/src/lib/resource-type.js +9 -0
- package/src/lib/resource-type.js.map +1 -0
- package/src/lib/resourceFlowVariable.d.ts +4 -0
- package/src/lib/resourceFlowVariable.js +9 -0
- package/src/lib/resourceFlowVariable.js.map +1 -0
- package/src/lib/resourceHealthState.d.ts +9 -0
- package/src/lib/resourceHealthState.js +15 -0
- package/src/lib/resourceHealthState.js.map +1 -0
- package/src/lib/resourceIntroducer.d.ts +4 -0
- package/src/lib/resourceIntroducer.js +9 -0
- package/src/lib/resourceIntroducer.js.map +1 -0
- package/src/lib/resourceIntroductionHistoryItem.d.ts +4 -0
- package/src/lib/resourceIntroductionHistoryItem.js +9 -0
- package/src/lib/resourceIntroductionHistoryItem.js.map +1 -0
- package/src/lib/resourceUsage-type.d.ts +6 -0
- package/src/lib/resourceUsage-type.js +11 -0
- package/src/lib/resourceUsage-type.js.map +1 -0
- package/src/lib/session.d.ts +88 -0
- package/src/lib/session.js +3 -0
- package/src/lib/session.js.map +1 -0
- package/src/lib/sso-provider-record.d.ts +61 -0
- package/src/lib/sso-provider-record.js +3 -0
- package/src/lib/sso-provider-record.js.map +1 -0
- package/src/lib/sso-session-context.d.ts +32 -0
- package/src/lib/sso-session-context.js +3 -0
- package/src/lib/sso-session-context.js.map +1 -0
- package/src/lib/ssoProvider-oidc.d.ts +2 -0
- package/src/lib/ssoProvider-oidc.js +6 -0
- package/src/lib/ssoProvider-oidc.js.map +1 -0
- package/src/lib/ssoProvider.d.ts +4 -0
- package/src/lib/ssoProvider.js +9 -0
- package/src/lib/ssoProvider.js.map +1 -0
- package/src/lib/usage-duration-unit.d.ts +5 -0
- package/src/lib/usage-duration-unit.js +10 -0
- package/src/lib/usage-duration-unit.js.map +1 -0
- package/src/lib/usage-session.d.ts +139 -0
- package/src/lib/usage-session.js +3 -0
- package/src/lib/usage-session.js.map +1 -0
- package/src/lib/user-account.d.ts +50 -0
- package/src/lib/user-account.js +3 -0
- package/src/lib/user-account.js.map +1 -0
- package/src/lib/user-record.d.ts +38 -0
- package/src/lib/user-record.js +3 -0
- package/src/lib/user-record.js.map +1 -0
- package/src/lib/user-role.d.ts +4 -0
- package/src/lib/user-role.js +9 -0
- package/src/lib/user-role.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssoProvider.js","sourceRoot":"","sources":["../../../../../libs/application-models/src/lib/ssoProvider.ts"],"names":[],"mappings":";;;AAAA,IAAY,eAGX;AAHD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;AACf,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UsageDurationUnit = void 0;
|
|
4
|
+
var UsageDurationUnit;
|
|
5
|
+
(function (UsageDurationUnit) {
|
|
6
|
+
UsageDurationUnit["MINUTES"] = "MINUTES";
|
|
7
|
+
UsageDurationUnit["HOURS"] = "HOURS";
|
|
8
|
+
UsageDurationUnit["DAYS"] = "DAYS";
|
|
9
|
+
})(UsageDurationUnit || (exports.UsageDurationUnit = UsageDurationUnit = {}));
|
|
10
|
+
//# sourceMappingURL=usage-duration-unit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-duration-unit.js","sourceRoot":"","sources":["../../../../../libs/application-models/src/lib/usage-duration-unit.ts"],"names":[],"mappings":";;;AAAA,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,oCAAe,CAAA;IACf,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { BillingTransactionRecord } from './billing-ledger';
|
|
2
|
+
import { ResourceFormAction } from './form';
|
|
3
|
+
import type { ProjectRecord } from './project-record';
|
|
4
|
+
import type { FormFieldRecord, FormRecord } from './resource-form-records';
|
|
5
|
+
import type { ResourceRecord } from './resource-records';
|
|
6
|
+
import { ResourceType } from './resource-type';
|
|
7
|
+
import { AutoIntroductionTarget, SupervisionMode } from './resource-supervision';
|
|
8
|
+
import { ResourceUsageAction } from './resourceUsage-type';
|
|
9
|
+
import type { UserContact, UserProfile } from './user-record';
|
|
10
|
+
/** What the session lifecycle needs of a user. */
|
|
11
|
+
export interface UsageSessionUser {
|
|
12
|
+
id: number;
|
|
13
|
+
username?: string;
|
|
14
|
+
email?: string | null;
|
|
15
|
+
locale?: string | null;
|
|
16
|
+
billingFactor?: number;
|
|
17
|
+
creditBalance?: number;
|
|
18
|
+
createdAt?: Date;
|
|
19
|
+
updatedAt?: Date;
|
|
20
|
+
}
|
|
21
|
+
/** What the session lifecycle needs of a resource. */
|
|
22
|
+
export interface UsageSessionResource {
|
|
23
|
+
id: number;
|
|
24
|
+
name?: string;
|
|
25
|
+
type: ResourceType;
|
|
26
|
+
maxParallelSessions?: number | null;
|
|
27
|
+
allowTakeOver?: boolean;
|
|
28
|
+
supervisionMode?: SupervisionMode;
|
|
29
|
+
separateUnlockAndUnlatch?: boolean | null;
|
|
30
|
+
supervisedUsagesUntilIntroduction?: number | null;
|
|
31
|
+
autoIntroductionTarget?: AutoIntroductionTarget | null;
|
|
32
|
+
autoIntroductionGroupId?: number | null;
|
|
33
|
+
metadata?: Record<string, unknown> | null;
|
|
34
|
+
}
|
|
35
|
+
/** The rate snapshot of one meter, taken when a session starts. */
|
|
36
|
+
export interface UsageMeterRate {
|
|
37
|
+
meterId: number;
|
|
38
|
+
name: string;
|
|
39
|
+
creditsPerUnit: number;
|
|
40
|
+
allocation?: 'shared' | 'per-session';
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The user of a session: the public profile plus the mail address that flows and notifications need. It never leaves
|
|
44
|
+
* the server as it is; responses map it to the public profile.
|
|
45
|
+
*/
|
|
46
|
+
export type UsageSessionUserRecord = UserContact;
|
|
47
|
+
/** The form a stored submission answers, without its fields. */
|
|
48
|
+
export type UsageSessionForm = Omit<FormRecord, 'fields'>;
|
|
49
|
+
/** A stored form submission of a session, with the relations a read asked for. */
|
|
50
|
+
export interface UsageSessionFormSubmission {
|
|
51
|
+
id: number;
|
|
52
|
+
formId: number;
|
|
53
|
+
data: Record<string, UsageFormAnswer>;
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
updatedAt: Date;
|
|
56
|
+
userId: number;
|
|
57
|
+
resourceUsageId: number;
|
|
58
|
+
action: ResourceFormAction;
|
|
59
|
+
form?: UsageSessionForm;
|
|
60
|
+
user?: UserProfile | null;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A usage session (or a stored door action) with the relations a read asked for. A relation that was not read is
|
|
64
|
+
* absent; a loaded relation whose row does not exist (a deleted user, no project) is null.
|
|
65
|
+
*/
|
|
66
|
+
export interface UsageSession {
|
|
67
|
+
id: number;
|
|
68
|
+
usageAction: ResourceUsageAction;
|
|
69
|
+
resourceId: number;
|
|
70
|
+
userId: number | null;
|
|
71
|
+
startTime: Date;
|
|
72
|
+
startNotes: string | null;
|
|
73
|
+
endTime: Date | null;
|
|
74
|
+
endNotes: string | null;
|
|
75
|
+
/** Minutes between start and end, -1 while the session runs. Computed by the database. */
|
|
76
|
+
usageInMinutes: number;
|
|
77
|
+
projectId: number | null;
|
|
78
|
+
/** A pending reservation is never visible: it is neither finalized nor counted in any duration. */
|
|
79
|
+
isFinalized: boolean;
|
|
80
|
+
lifecyclePending: boolean;
|
|
81
|
+
supervisorUserId: number | null;
|
|
82
|
+
sessionDurationCreditsPerMinute: number | null;
|
|
83
|
+
operatingDurationCreditsPerMinute: number | null;
|
|
84
|
+
creditsPerUsage: number | null;
|
|
85
|
+
billingFactor: number | null;
|
|
86
|
+
meterRates: UsageMeterRate[] | null;
|
|
87
|
+
attributedOperatingDurationInMinutes: number | null;
|
|
88
|
+
resource?: ResourceRecord;
|
|
89
|
+
user?: UsageSessionUserRecord | null;
|
|
90
|
+
project?: ProjectRecord | null;
|
|
91
|
+
supervisorUser?: UserProfile | null;
|
|
92
|
+
formSubmissions?: UsageSessionFormSubmission[];
|
|
93
|
+
billingTransaction?: BillingTransactionRecord | null;
|
|
94
|
+
}
|
|
95
|
+
/** A session read together with its resource and its user (null once the user was deleted). */
|
|
96
|
+
export type UsageSessionWithParties = UsageSession & {
|
|
97
|
+
resource: ResourceRecord;
|
|
98
|
+
user: UsageSessionUserRecord | null;
|
|
99
|
+
};
|
|
100
|
+
export type UsageLifecycleKind = 'start' | 'end' | 'takeover';
|
|
101
|
+
export interface UsageFormAnswer {
|
|
102
|
+
value: string;
|
|
103
|
+
fieldDefinition: FormFieldRecord;
|
|
104
|
+
}
|
|
105
|
+
/** An answered form that is stored with the session change it belongs to. */
|
|
106
|
+
export interface UsageFormSubmissionDraft {
|
|
107
|
+
formId: number;
|
|
108
|
+
resourceUsageId: number;
|
|
109
|
+
userId: number | null;
|
|
110
|
+
action: ResourceFormAction;
|
|
111
|
+
data: Record<string, UsageFormAnswer>;
|
|
112
|
+
form?: FormRecord;
|
|
113
|
+
}
|
|
114
|
+
/** A billing item a flow staged for the session change; stored on the bill when the change commits. */
|
|
115
|
+
export interface UsageBillingItemDraft {
|
|
116
|
+
usageId: number;
|
|
117
|
+
name: string;
|
|
118
|
+
description: string | null;
|
|
119
|
+
externalReference: string | null;
|
|
120
|
+
unitPrice: number;
|
|
121
|
+
quantity: number;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* A reservation of the machine for one start, stop or takeover, never a completed usage or bill. Interrupted
|
|
125
|
+
* attempts are aborted, not replayed.
|
|
126
|
+
*/
|
|
127
|
+
export interface UsageLifecycleAttempt {
|
|
128
|
+
id: string;
|
|
129
|
+
resourceId: number;
|
|
130
|
+
kind: UsageLifecycleKind;
|
|
131
|
+
/** The tentative session a start or takeover prepared. */
|
|
132
|
+
candidateUsageId: number | null;
|
|
133
|
+
/** The published session a stop or takeover is about to end. */
|
|
134
|
+
previousUsageId: number | null;
|
|
135
|
+
transitionTime: Date;
|
|
136
|
+
formSubmissions: UsageFormSubmissionDraft[];
|
|
137
|
+
billingItems: UsageBillingItemDraft[];
|
|
138
|
+
createdAt?: Date;
|
|
139
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usage-session.js","sourceRoot":"","sources":["../../../../../libs/application-models/src/lib/usage-session.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { CredentialRecord } from './authentication-credential';
|
|
2
|
+
import type { SSOProviderType } from './ssoProvider';
|
|
3
|
+
import type { UserRecord } from './user-record';
|
|
4
|
+
import type { UserRoleRecord } from './rbac-record';
|
|
5
|
+
/** A credential of a user as listed on the account: the type and the single sign-on binding, never a secret. */
|
|
6
|
+
export interface AccountCredentialRecord extends CredentialRecord {
|
|
7
|
+
providerType: SSOProviderType | null;
|
|
8
|
+
providerId: number | null;
|
|
9
|
+
ssoSubject: string | null;
|
|
10
|
+
}
|
|
11
|
+
/** A user together with the relations a read asked for. */
|
|
12
|
+
export interface UserAccount extends UserRecord {
|
|
13
|
+
authenticationDetails?: AccountCredentialRecord[];
|
|
14
|
+
userRoles?: UserRoleRecord[];
|
|
15
|
+
}
|
|
16
|
+
/** The columns the application may change on an existing user. `undefined` leaves a column unchanged. */
|
|
17
|
+
export type UserPatch = Partial<Pick<UserRecord, 'username' | 'email' | 'locale' | 'dateTimeLocale' | 'externalIdentifier' | 'billingFactor' | 'lastUsernameChangeAt' | 'emailVerificationToken' | 'emailVerificationTokenExpiresAt' | 'isEmailVerified' | 'passwordResetToken' | 'passwordResetTokenExpiresAt' | 'lockedUntil' | 'failedLoginAttempts' | 'firstFailedLoginAt'>>;
|
|
18
|
+
/** A user to create. The identity arrives normalized (trimmed, lower case). */
|
|
19
|
+
export interface NewUser {
|
|
20
|
+
username: string;
|
|
21
|
+
email: string;
|
|
22
|
+
externalIdentifier: string | null;
|
|
23
|
+
isEmailVerified: boolean;
|
|
24
|
+
locale: string;
|
|
25
|
+
}
|
|
26
|
+
/** Which users a listing returns. Role and single sign-on filters combine with AND. */
|
|
27
|
+
export interface UserListQuery {
|
|
28
|
+
page: number;
|
|
29
|
+
limit: number;
|
|
30
|
+
search?: string;
|
|
31
|
+
ids?: number[];
|
|
32
|
+
roleId?: number;
|
|
33
|
+
roleIds?: number[];
|
|
34
|
+
excludeRoleIds?: number[];
|
|
35
|
+
roleMatch?: 'any' | 'all';
|
|
36
|
+
emailVerified?: boolean;
|
|
37
|
+
ssoProviderIds?: number[];
|
|
38
|
+
excludeSsoProviderIds?: number[];
|
|
39
|
+
ssoProviderNone?: boolean;
|
|
40
|
+
hasSsoProvider?: boolean;
|
|
41
|
+
ssoProviderMatch?: 'any' | 'all';
|
|
42
|
+
includeRoles?: boolean;
|
|
43
|
+
}
|
|
44
|
+
/** What anonymizing a user did. `active-usage` means the user still has a running usage session. */
|
|
45
|
+
export type AnonymizeUserOutcome = {
|
|
46
|
+
outcome: 'anonymized';
|
|
47
|
+
locale: string;
|
|
48
|
+
} | {
|
|
49
|
+
outcome: 'already-deleted' | 'not-found' | 'active-usage';
|
|
50
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-account.js","sourceRoot":"","sources":["../../../../../libs/application-models/src/lib/user-account.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** The fields of a user that are safe to show to other users and administrators. */
|
|
2
|
+
export interface UserProfile {
|
|
3
|
+
id: number;
|
|
4
|
+
username: string;
|
|
5
|
+
locale: string;
|
|
6
|
+
dateTimeLocale: string | null;
|
|
7
|
+
isEmailVerified: boolean;
|
|
8
|
+
isDisabled: boolean;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
updatedAt: Date;
|
|
11
|
+
deletedAt?: Date | null;
|
|
12
|
+
externalIdentifier: string | null;
|
|
13
|
+
creditBalance: number;
|
|
14
|
+
billingFactor: number;
|
|
15
|
+
}
|
|
16
|
+
/** A public profile plus the email address, for flows that send mail. Never mapped into a response. */
|
|
17
|
+
export interface UserContact extends UserProfile {
|
|
18
|
+
email: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A user as the application stores it, including the fields that must never leave the server (email, tokens,
|
|
22
|
+
* lockout state). Responses are built from `UserProfile` through an explicit mapper, never from this record.
|
|
23
|
+
*/
|
|
24
|
+
export interface UserRecord extends UserProfile {
|
|
25
|
+
email: string;
|
|
26
|
+
emailVerificationToken: string | null;
|
|
27
|
+
emailVerificationTokenExpiresAt: Date | null;
|
|
28
|
+
passwordResetToken: string | null;
|
|
29
|
+
passwordResetTokenExpiresAt: Date | null;
|
|
30
|
+
lastUsernameChangeAt: Date | null;
|
|
31
|
+
lockedUntil: Date | null;
|
|
32
|
+
failedLoginAttempts: number;
|
|
33
|
+
firstFailedLoginAt: Date | null;
|
|
34
|
+
deleteAccountToken: string | null;
|
|
35
|
+
deleteAccountTokenExpiresAt: Date | null;
|
|
36
|
+
deleteAccountRequestedAt: Date | null;
|
|
37
|
+
nfcKeySeedToken: string | null;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-record.js","sourceRoot":"","sources":["../../../../../libs/application-models/src/lib/user-record.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UserRoleSource = void 0;
|
|
4
|
+
var UserRoleSource;
|
|
5
|
+
(function (UserRoleSource) {
|
|
6
|
+
UserRoleSource["MANUAL"] = "manual";
|
|
7
|
+
UserRoleSource["SSO"] = "sso";
|
|
8
|
+
})(UserRoleSource || (exports.UserRoleSource = UserRoleSource = {}));
|
|
9
|
+
//# sourceMappingURL=user-role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user-role.js","sourceRoot":"","sources":["../../../../../libs/application-models/src/lib/user-role.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mCAAiB,CAAA;IACjB,6BAAW,CAAA;AACb,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB"}
|