@getstrata/bootstrap 0.2.22 → 0.2.23
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/bootstrap/applicationRegistry.d.ts +1 -1
- package/dist/bootstrap/buildModuleRoutes.d.ts +10 -0
- package/dist/bootstrap/config.d.ts +1 -1
- package/dist/bootstrap/contracts.d.ts +4 -4
- package/dist/bootstrap/public-api.d.ts +2 -0
- package/dist/entries/applicationRegistry.js +12 -115
- package/dist/entries/buildModuleRoutes.js +626 -0
- package/dist/entries/config.js +9 -9
- package/dist/entries/context.js +114 -178
- package/dist/entries/contracts.js +10 -85
- package/dist/entries/createWebRoutes.js +9 -9
- package/dist/entries/dependencies.js +114 -178
- package/dist/entries/http/securedRouteModelBinding.js +4 -34
- package/dist/entries/httpKernel.js +9 -9
- package/dist/entries/membershipService.js +0 -34
- package/dist/entries/providers/view.js +9 -9
- package/dist/entries/providers.js +104 -115
- package/dist/entries/queue/defaultJobs.js +0 -34
- package/dist/entries/web/routing.js +20 -41
- package/dist/index.js +1670 -1659
- package/package.json +9 -4
- package/dist/cli/commands/scheduleRun.d.ts +0 -3
- package/dist/config/app.d.ts +0 -10
- package/dist/config/auth.d.ts +0 -7
- package/dist/config/contentSecurityPolicy.d.ts +0 -5
- package/dist/config/cors.d.ts +0 -9
- package/dist/config/database.d.ts +0 -10
- package/dist/config/features.d.ts +0 -18
- package/dist/config/frontend.d.ts +0 -6
- package/dist/config/queue.d.ts +0 -8
- package/dist/config/rateLimit.d.ts +0 -10
- package/dist/config/uploads.d.ts +0 -5
- package/dist/core/admin/formatValue.d.ts +0 -3
- package/dist/core/admin/index.d.ts +0 -3
- package/dist/core/admin/registry.d.ts +0 -11
- package/dist/core/admin/types.d.ts +0 -24
- package/dist/core/audit/exportAuditLogs.d.ts +0 -8
- package/dist/core/audit/siemFormatter.d.ts +0 -30
- package/dist/core/auth/abilityChecker.d.ts +0 -6
- package/dist/core/auth/accessControl.d.ts +0 -8
- package/dist/core/auth/authContext.d.ts +0 -11
- package/dist/core/auth/guard.d.ts +0 -36
- package/dist/core/auth/membershipContext.d.ts +0 -15
- package/dist/core/auth/membershipContextMiddleware.d.ts +0 -3
- package/dist/core/auth/membershipMiddleware.d.ts +0 -2
- package/dist/core/auth/membershipScope.d.ts +0 -16
- package/dist/core/auth/membershipService.d.ts +0 -23
- package/dist/core/auth/oauth/oidcProvider.d.ts +0 -18
- package/dist/core/auth/oauth/providers.d.ts +0 -22
- package/dist/core/auth/oauth/samlProvider.d.ts +0 -9
- package/dist/core/auth/oauth/types.d.ts +0 -11
- package/dist/core/auth/password.d.ts +0 -3
- package/dist/core/auth/policy.d.ts +0 -15
- package/dist/core/auth/resolveMembershipService.d.ts +0 -3
- package/dist/core/auth/scimAuthMiddleware.d.ts +0 -3
- package/dist/core/auth/sessionCookie.d.ts +0 -6
- package/dist/core/auth/sessionGuard.d.ts +0 -9
- package/dist/core/auth/tokenHash.d.ts +0 -3
- package/dist/core/cache/createCacheStore.d.ts +0 -11
- package/dist/core/cache/redisCacheStore.d.ts +0 -23
- package/dist/core/cache/repository.d.ts +0 -17
- package/dist/core/cache/simpleCache.d.ts +0 -23
- package/dist/core/cache/simpleCacheStore.d.ts +0 -16
- package/dist/core/cache/store.d.ts +0 -12
- package/dist/core/cache/taggedCache.d.ts +0 -9
- package/dist/core/cache/tags.d.ts +0 -11
- package/dist/core/config/envSchema.d.ts +0 -12
- package/dist/core/contracts/container.d.ts +0 -30
- package/dist/core/contracts/di.d.ts +0 -31
- package/dist/core/contracts/serviceContainer.d.ts +0 -1
- package/dist/core/contracts/serviceTokens.d.ts +0 -8
- package/dist/core/crypto/fieldEncryption.d.ts +0 -13
- package/dist/core/crypto/mfaSecret.d.ts +0 -3
- package/dist/core/crypto/nonCryptographicHash.d.ts +0 -2
- package/dist/core/database/baseRepository.d.ts +0 -67
- package/dist/core/database/bindConnection.d.ts +0 -3
- package/dist/core/database/boundConnection.d.ts +0 -5
- package/dist/core/database/connection.d.ts +0 -7
- package/dist/core/database/connectionContext.d.ts +0 -8
- package/dist/core/database/defaultConnection.d.ts +0 -6
- package/dist/core/database/errors.d.ts +0 -12
- package/dist/core/database/index.d.ts +0 -18
- package/dist/core/database/migrations/advisoryLock.d.ts +0 -6
- package/dist/core/database/migrations/runner.d.ts +0 -25
- package/dist/core/database/migrations/types.d.ts +0 -15
- package/dist/core/database/model.d.ts +0 -57
- package/dist/core/database/query.d.ts +0 -63
- package/dist/core/database/queryProxy.d.ts +0 -3
- package/dist/core/database/relationships.d.ts +0 -100
- package/dist/core/database/repositoryConnection.d.ts +0 -4
- package/dist/core/database/repositoryQuery.d.ts +0 -38
- package/dist/core/database/schema/blueprint.d.ts +0 -47
- package/dist/core/database/schema/columnDefinition.d.ts +0 -36
- package/dist/core/database/schema/driver.d.ts +0 -8
- package/dist/core/database/schema/errors.d.ts +0 -4
- package/dist/core/database/schema/grammars/compileStatements.d.ts +0 -8
- package/dist/core/database/schema/grammars/createGrammar.d.ts +0 -4
- package/dist/core/database/schema/grammars/grammar.d.ts +0 -10
- package/dist/core/database/schema/grammars/index.d.ts +0 -7
- package/dist/core/database/schema/grammars/mysqlGrammar.d.ts +0 -2
- package/dist/core/database/schema/grammars/postgresGrammar.d.ts +0 -2
- package/dist/core/database/schema/grammars/sqliteGrammar.d.ts +0 -2
- package/dist/core/database/schema/index.d.ts +0 -12
- package/dist/core/database/schema/schema.d.ts +0 -21
- package/dist/core/database/seeders/runner.d.ts +0 -6
- package/dist/core/database/seeders/types.d.ts +0 -8
- package/dist/core/database/table.d.ts +0 -13
- package/dist/core/database/transaction.d.ts +0 -3
- package/dist/core/database/types.d.ts +0 -66
- package/dist/core/database/whereBuilder.d.ts +0 -17
- package/dist/core/errors/http.d.ts +0 -33
- package/dist/core/events/eventBus.d.ts +0 -10
- package/dist/core/events/index.d.ts +0 -4
- package/dist/core/facades/index.d.ts +0 -10
- package/dist/core/http/authMiddleware.d.ts +0 -5
- package/dist/core/http/authorizeMiddleware.d.ts +0 -5
- package/dist/core/http/bodySizeLimitMiddleware.d.ts +0 -4
- package/dist/core/http/conditionalResponse.d.ts +0 -2
- package/dist/core/http/contentNegotiation.d.ts +0 -2
- package/dist/core/http/cookies.d.ts +0 -4
- package/dist/core/http/corsMiddleware.d.ts +0 -3
- package/dist/core/http/csrfMiddleware.d.ts +0 -3
- package/dist/core/http/csrfProtection.d.ts +0 -12
- package/dist/core/http/csrfToken.d.ts +0 -14
- package/dist/core/http/etag.d.ts +0 -18
- package/dist/core/http/flashMiddleware.d.ts +0 -3
- package/dist/core/http/flashSession.d.ts +0 -12
- package/dist/core/http/formRequest.d.ts +0 -10
- package/dist/core/http/index.d.ts +0 -27
- package/dist/core/http/loginThrottleMiddleware.d.ts +0 -11
- package/dist/core/http/memoryThrottleMiddleware.d.ts +0 -9
- package/dist/core/http/metricsMiddleware.d.ts +0 -4
- package/dist/core/http/middleware.d.ts +0 -8
- package/dist/core/http/pagination.d.ts +0 -11
- package/dist/core/http/parseFormBody.d.ts +0 -6
- package/dist/core/http/parseMultipartUpload.d.ts +0 -10
- package/dist/core/http/requestMetaContext.d.ts +0 -15
- package/dist/core/http/requireAbilityMiddleware.d.ts +0 -4
- package/dist/core/http/requireAuthMiddleware.d.ts +0 -4
- package/dist/core/http/requireGlobalAdminMiddleware.d.ts +0 -3
- package/dist/core/http/requireWebAuthMiddleware.d.ts +0 -4
- package/dist/core/http/resources.d.ts +0 -7
- package/dist/core/http/route.d.ts +0 -6
- package/dist/core/http/routeMiddleware.d.ts +0 -3
- package/dist/core/http/routeModelBinding.d.ts +0 -3
- package/dist/core/http/scimThrottleMiddleware.d.ts +0 -9
- package/dist/core/http/securedRouteModelBinding.d.ts +0 -11
- package/dist/core/http/securityHeadersMiddleware.d.ts +0 -3
- package/dist/core/http/throttleMiddleware.d.ts +0 -11
- package/dist/core/http/validation.d.ts +0 -23
- package/dist/core/http/webErrorResponse.d.ts +0 -5
- package/dist/core/http/webFormRequest.d.ts +0 -7
- package/dist/core/jobs/dispatchWebhookJob.d.ts +0 -13
- package/dist/core/jobs/invalidateCacheTagsJob.d.ts +0 -12
- package/dist/core/lifecycle/gracefulShutdown.d.ts +0 -6
- package/dist/core/logging/logger.d.ts +0 -17
- package/dist/core/logging/requestLoggingMiddleware.d.ts +0 -3
- package/dist/core/mail/mailer.d.ts +0 -38
- package/dist/core/mail/markdownMail.d.ts +0 -15
- package/dist/core/mail/markdownMailable.d.ts +0 -12
- package/dist/core/metrics/prometheus.d.ts +0 -26
- package/dist/core/notifications/dispatcher.d.ts +0 -13
- package/dist/core/notifications/index.d.ts +0 -3
- package/dist/core/notifications/notification.d.ts +0 -7
- package/dist/core/notifications/types.d.ts +0 -25
- package/dist/core/openapi/registeredRoute.d.ts +0 -6
- package/dist/core/pagination/index.d.ts +0 -27
- package/dist/core/queue/createAppQueue.d.ts +0 -5
- package/dist/core/queue/failedJobRepository.d.ts +0 -6
- package/dist/core/queue/failedJobService.d.ts +0 -16
- package/dist/core/queue/failedJobTable.d.ts +0 -3
- package/dist/core/queue/index.d.ts +0 -19
- package/dist/core/queue/jobRegistry.d.ts +0 -13
- package/dist/core/queue/jobRunner.d.ts +0 -9
- package/dist/core/queue/publicQueue.d.ts +0 -16
- package/dist/core/queue/queueMetrics.d.ts +0 -15
- package/dist/core/queue/redisQueue.d.ts +0 -29
- package/dist/core/queue/resilientQueue.d.ts +0 -9
- package/dist/core/queue/types.d.ts +0 -8
- package/dist/core/runtime/applicationRegistry.d.ts +0 -17
- package/dist/core/runtime/asyncContextStore.d.ts +0 -3
- package/dist/core/scheduler/schedule.d.ts +0 -15
- package/dist/core/security/publicReads.d.ts +0 -3
- package/dist/core/security/safeFetch.d.ts +0 -10
- package/dist/core/security/safeUrl.d.ts +0 -20
- package/dist/core/security/scimTenantTokens.d.ts +0 -3
- package/dist/core/security/securityEvents.d.ts +0 -6
- package/dist/core/security/timingSafeCompare.d.ts +0 -2
- package/dist/core/security/tokenExpiry.d.ts +0 -2
- package/dist/core/security/totp.d.ts +0 -3
- package/dist/core/storage/storage.d.ts +0 -44
- package/dist/core/tenant/databaseTenantContext.d.ts +0 -2
- package/dist/core/tenant/resolveTenant.d.ts +0 -3
- package/dist/core/tenant/tenantContext.d.ts +0 -13
- package/dist/core/tenant/tenantDatabaseScope.d.ts +0 -8
- package/dist/core/tenant/tenantMiddleware.d.ts +0 -6
- package/dist/core/tracing/otel.d.ts +0 -26
- package/dist/core/tracing/traceContext.d.ts +0 -9
- package/dist/core/tracing/tracingMiddleware.d.ts +0 -3
- package/dist/core/validation/rules.d.ts +0 -17
- package/dist/core/view/etaViewEngine.d.ts +0 -15
- package/dist/core/view/htmlResponse.d.ts +0 -6
- package/dist/core/view/index.d.ts +0 -5
- package/dist/core/view/viewEngine.d.ts +0 -6
- package/dist/core/view/webLayoutData.d.ts +0 -17
- package/dist/db/connection/createConnection.d.ts +0 -6
- package/dist/db/connection/index.d.ts +0 -11
- package/dist/domain/abilities.d.ts +0 -5
- package/dist/domain/auth.d.ts +0 -4
- package/dist/domain/scim.d.ts +0 -9
- package/dist/domain/workhub.d.ts +0 -35
- package/dist/framework/public-api.d.ts +0 -116
- package/dist/modules/organization/memberRepository.d.ts +0 -14
- package/dist/modules/organization/memberTypes.d.ts +0 -9
- package/dist/modules/organization/repository.d.ts +0 -14
- package/dist/modules/organization/table.d.ts +0 -3
- package/dist/modules/organization/types.d.ts +0 -10
- package/dist/modules/scim/controller.d.ts +0 -16
- package/dist/modules/scim/scimResponse.d.ts +0 -10
- package/dist/modules/scim/service.d.ts +0 -214
- package/dist/modules/user/apiTokenRepository.d.ts +0 -8
- package/dist/modules/user/apiTokenTable.d.ts +0 -3
- package/dist/modules/user/authService.d.ts +0 -23
- package/dist/modules/user/notificationRepository.d.ts +0 -6
- package/dist/modules/user/notificationService.d.ts +0 -25
- package/dist/modules/user/notificationTable.d.ts +0 -3
- package/dist/modules/user/notificationTypes.d.ts +0 -12
- package/dist/modules/user/oauthIdentityRepository.d.ts +0 -9
- package/dist/modules/user/provider.d.ts +0 -11
- package/dist/modules/user/repository.d.ts +0 -13
- package/dist/modules/user/table.d.ts +0 -3
- package/dist/modules/user/tokenService.d.ts +0 -29
- package/dist/modules/user/types.d.ts +0 -46
- package/dist/types/services.d.ts +0 -16
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import type { AppDependencies } from "@getstrata/core/contracts/di";
|
|
2
|
-
import OrganizationMemberRepository from "../organization/memberRepository";
|
|
3
|
-
import OrganizationRepository from "../organization/repository";
|
|
4
|
-
import type UserRepository from "../user/repository";
|
|
5
|
-
interface ScimUserPayload {
|
|
6
|
-
userName?: string;
|
|
7
|
-
name?: {
|
|
8
|
-
formatted?: string;
|
|
9
|
-
};
|
|
10
|
-
active?: boolean;
|
|
11
|
-
emails?: Array<{
|
|
12
|
-
value: string;
|
|
13
|
-
primary?: boolean;
|
|
14
|
-
}>;
|
|
15
|
-
}
|
|
16
|
-
interface ScimPatchOperation {
|
|
17
|
-
op: string;
|
|
18
|
-
path?: string;
|
|
19
|
-
value?: unknown;
|
|
20
|
-
}
|
|
21
|
-
declare class ScimService {
|
|
22
|
-
private readonly users;
|
|
23
|
-
private readonly organizations;
|
|
24
|
-
private readonly members;
|
|
25
|
-
constructor(users: UserRepository, organizations: OrganizationRepository, members: OrganizationMemberRepository);
|
|
26
|
-
serviceProviderConfig(): {
|
|
27
|
-
schemas: "urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"[];
|
|
28
|
-
patch: {
|
|
29
|
-
supported: boolean;
|
|
30
|
-
};
|
|
31
|
-
bulk: {
|
|
32
|
-
supported: boolean;
|
|
33
|
-
};
|
|
34
|
-
filter: {
|
|
35
|
-
supported: boolean;
|
|
36
|
-
};
|
|
37
|
-
changePassword: {
|
|
38
|
-
supported: boolean;
|
|
39
|
-
};
|
|
40
|
-
sort: {
|
|
41
|
-
supported: boolean;
|
|
42
|
-
};
|
|
43
|
-
etag: {
|
|
44
|
-
supported: boolean;
|
|
45
|
-
};
|
|
46
|
-
authenticationSchemes: {
|
|
47
|
-
type: string;
|
|
48
|
-
name: string;
|
|
49
|
-
description: string;
|
|
50
|
-
}[];
|
|
51
|
-
};
|
|
52
|
-
listUsers(startIndex?: number, count?: number): Promise<{
|
|
53
|
-
schemas: "urn:ietf:params:scim:api:messages:2.0:ListResponse"[];
|
|
54
|
-
totalResults: number;
|
|
55
|
-
startIndex: number;
|
|
56
|
-
itemsPerPage: number;
|
|
57
|
-
Resources: {
|
|
58
|
-
schemas: "urn:ietf:params:scim:schemas:core:2.0:User"[];
|
|
59
|
-
id: string;
|
|
60
|
-
userName: string;
|
|
61
|
-
name: {
|
|
62
|
-
formatted: string;
|
|
63
|
-
};
|
|
64
|
-
displayName: string;
|
|
65
|
-
active: boolean;
|
|
66
|
-
emails: {
|
|
67
|
-
value: string;
|
|
68
|
-
primary: boolean;
|
|
69
|
-
type: string;
|
|
70
|
-
}[];
|
|
71
|
-
roles: {
|
|
72
|
-
value: string;
|
|
73
|
-
primary: boolean;
|
|
74
|
-
}[];
|
|
75
|
-
meta: {
|
|
76
|
-
resourceType: string;
|
|
77
|
-
created: string | undefined;
|
|
78
|
-
lastModified: string | undefined;
|
|
79
|
-
};
|
|
80
|
-
}[];
|
|
81
|
-
}>;
|
|
82
|
-
getUser(id: number): Promise<{
|
|
83
|
-
schemas: "urn:ietf:params:scim:schemas:core:2.0:User"[];
|
|
84
|
-
id: string;
|
|
85
|
-
userName: string;
|
|
86
|
-
name: {
|
|
87
|
-
formatted: string;
|
|
88
|
-
};
|
|
89
|
-
displayName: string;
|
|
90
|
-
active: boolean;
|
|
91
|
-
emails: {
|
|
92
|
-
value: string;
|
|
93
|
-
primary: boolean;
|
|
94
|
-
type: string;
|
|
95
|
-
}[];
|
|
96
|
-
roles: {
|
|
97
|
-
value: string;
|
|
98
|
-
primary: boolean;
|
|
99
|
-
}[];
|
|
100
|
-
meta: {
|
|
101
|
-
resourceType: string;
|
|
102
|
-
created: string | undefined;
|
|
103
|
-
lastModified: string | undefined;
|
|
104
|
-
};
|
|
105
|
-
}>;
|
|
106
|
-
findUserRecord(id: number): Promise<import("../user/types").UserRecord>;
|
|
107
|
-
createUser(payload: ScimUserPayload): Promise<{
|
|
108
|
-
schemas: "urn:ietf:params:scim:schemas:core:2.0:User"[];
|
|
109
|
-
id: string;
|
|
110
|
-
userName: string;
|
|
111
|
-
name: {
|
|
112
|
-
formatted: string;
|
|
113
|
-
};
|
|
114
|
-
displayName: string;
|
|
115
|
-
active: boolean;
|
|
116
|
-
emails: {
|
|
117
|
-
value: string;
|
|
118
|
-
primary: boolean;
|
|
119
|
-
type: string;
|
|
120
|
-
}[];
|
|
121
|
-
roles: {
|
|
122
|
-
value: string;
|
|
123
|
-
primary: boolean;
|
|
124
|
-
}[];
|
|
125
|
-
meta: {
|
|
126
|
-
resourceType: string;
|
|
127
|
-
created: string | undefined;
|
|
128
|
-
lastModified: string | undefined;
|
|
129
|
-
};
|
|
130
|
-
}>;
|
|
131
|
-
patchUser(id: number, operations: ScimPatchOperation[]): Promise<{
|
|
132
|
-
schemas: "urn:ietf:params:scim:schemas:core:2.0:User"[];
|
|
133
|
-
id: string;
|
|
134
|
-
userName: string;
|
|
135
|
-
name: {
|
|
136
|
-
formatted: string;
|
|
137
|
-
};
|
|
138
|
-
displayName: string;
|
|
139
|
-
active: boolean;
|
|
140
|
-
emails: {
|
|
141
|
-
value: string;
|
|
142
|
-
primary: boolean;
|
|
143
|
-
type: string;
|
|
144
|
-
}[];
|
|
145
|
-
roles: {
|
|
146
|
-
value: string;
|
|
147
|
-
primary: boolean;
|
|
148
|
-
}[];
|
|
149
|
-
meta: {
|
|
150
|
-
resourceType: string;
|
|
151
|
-
created: string | undefined;
|
|
152
|
-
lastModified: string | undefined;
|
|
153
|
-
};
|
|
154
|
-
}>;
|
|
155
|
-
deleteUser(id: number): Promise<{
|
|
156
|
-
id: number;
|
|
157
|
-
updated_at: Date;
|
|
158
|
-
}>;
|
|
159
|
-
listGroups(startIndex?: number, count?: number): Promise<{
|
|
160
|
-
schemas: "urn:ietf:params:scim:api:messages:2.0:ListResponse"[];
|
|
161
|
-
totalResults: number;
|
|
162
|
-
startIndex: number;
|
|
163
|
-
itemsPerPage: number;
|
|
164
|
-
Resources: {
|
|
165
|
-
schemas: "urn:ietf:params:scim:schemas:core:2.0:Group"[];
|
|
166
|
-
id: string;
|
|
167
|
-
displayName: string;
|
|
168
|
-
externalId: string;
|
|
169
|
-
members: {
|
|
170
|
-
value: string;
|
|
171
|
-
display: string;
|
|
172
|
-
}[];
|
|
173
|
-
meta: {
|
|
174
|
-
resourceType: string;
|
|
175
|
-
lastModified: string;
|
|
176
|
-
};
|
|
177
|
-
}[];
|
|
178
|
-
}>;
|
|
179
|
-
getGroup(id: number): Promise<{
|
|
180
|
-
schemas: "urn:ietf:params:scim:schemas:core:2.0:Group"[];
|
|
181
|
-
id: string;
|
|
182
|
-
displayName: string;
|
|
183
|
-
externalId: string;
|
|
184
|
-
members: {
|
|
185
|
-
value: string;
|
|
186
|
-
display: string;
|
|
187
|
-
}[];
|
|
188
|
-
meta: {
|
|
189
|
-
resourceType: string;
|
|
190
|
-
lastModified: string;
|
|
191
|
-
};
|
|
192
|
-
}>;
|
|
193
|
-
findOrganizationRecord(id: number): Promise<import("../organization/types").OrganizationRecord>;
|
|
194
|
-
patchGroup(id: number, operations: ScimPatchOperation[]): Promise<{
|
|
195
|
-
schemas: "urn:ietf:params:scim:schemas:core:2.0:Group"[];
|
|
196
|
-
id: string;
|
|
197
|
-
displayName: string;
|
|
198
|
-
externalId: string;
|
|
199
|
-
members: {
|
|
200
|
-
value: string;
|
|
201
|
-
display: string;
|
|
202
|
-
}[];
|
|
203
|
-
meta: {
|
|
204
|
-
resourceType: string;
|
|
205
|
-
lastModified: string;
|
|
206
|
-
};
|
|
207
|
-
}>;
|
|
208
|
-
private toScimGroup;
|
|
209
|
-
private toScimUser;
|
|
210
|
-
}
|
|
211
|
-
declare function createScimService(dependencies: AppDependencies): ScimService;
|
|
212
|
-
export default ScimService;
|
|
213
|
-
export type { ScimPatchOperation, ScimUserPayload };
|
|
214
|
-
export { createScimService };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { BaseRepository } from "@getstrata/core/database";
|
|
2
|
-
import type { ApiTokenRecord } from "./types";
|
|
3
|
-
declare class ApiTokenRepository extends BaseRepository<ApiTokenRecord, "id"> {
|
|
4
|
-
constructor();
|
|
5
|
-
findByTokenHash(tokenHash: string): Promise<ApiTokenRecord | null>;
|
|
6
|
-
touchLastUsedAt(id: number): Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export default ApiTokenRepository;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { OAuthProvider } from "@getstrata/core/auth/oauth/types";
|
|
2
|
-
import type OAuthIdentityRepository from "./oauthIdentityRepository";
|
|
3
|
-
import type UserRepository from "./repository";
|
|
4
|
-
import type TokenService from "./tokenService";
|
|
5
|
-
import type { CreatedApiToken } from "./types";
|
|
6
|
-
interface LoginOptions {
|
|
7
|
-
mfaCode?: string;
|
|
8
|
-
}
|
|
9
|
-
declare class AuthService {
|
|
10
|
-
private readonly users;
|
|
11
|
-
private readonly tokens;
|
|
12
|
-
private readonly oauthIdentities;
|
|
13
|
-
private readonly oauthProviders;
|
|
14
|
-
constructor(users: UserRepository, tokens: TokenService, oauthIdentities: OAuthIdentityRepository);
|
|
15
|
-
registerOAuthProvider(provider: OAuthProvider): void;
|
|
16
|
-
getOAuthProvider(name: string): OAuthProvider | undefined;
|
|
17
|
-
loginWithPassword(email: string, password: string, options?: LoginOptions): Promise<CreatedApiToken>;
|
|
18
|
-
loginWithOAuth(providerName: string, code: string): Promise<CreatedApiToken>;
|
|
19
|
-
buildOAuthAuthorizationUrl(providerName: string, state: string): string;
|
|
20
|
-
private findOrCreateOAuthUser;
|
|
21
|
-
}
|
|
22
|
-
export default AuthService;
|
|
23
|
-
export type { LoginOptions };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { BaseRepository } from "@getstrata/core/database";
|
|
2
|
-
import type { NotificationRecord } from "./notificationTypes";
|
|
3
|
-
declare class NotificationRepository extends BaseRepository<NotificationRecord, "id"> {
|
|
4
|
-
constructor();
|
|
5
|
-
}
|
|
6
|
-
export default NotificationRepository;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { PaginatedResult } from "@getstrata/core/pagination";
|
|
2
|
-
import type NotificationRepository from "./notificationRepository";
|
|
3
|
-
import type { NotificationRecord } from "./notificationTypes";
|
|
4
|
-
interface CreateNotificationInput {
|
|
5
|
-
userId: number;
|
|
6
|
-
tenantId: number;
|
|
7
|
-
type: string;
|
|
8
|
-
title: string;
|
|
9
|
-
body: string;
|
|
10
|
-
data?: Record<string, unknown>;
|
|
11
|
-
}
|
|
12
|
-
declare class NotificationService {
|
|
13
|
-
private readonly repository;
|
|
14
|
-
constructor(repository: NotificationRepository);
|
|
15
|
-
listForUser(userId: number, options: {
|
|
16
|
-
page: number;
|
|
17
|
-
perPage: number;
|
|
18
|
-
unreadOnly?: boolean;
|
|
19
|
-
}): Promise<PaginatedResult<NotificationRecord>>;
|
|
20
|
-
markRead(userId: number, notificationId: number): Promise<NotificationRecord>;
|
|
21
|
-
markAllRead(userId: number): Promise<number>;
|
|
22
|
-
create(input: CreateNotificationInput): Promise<NotificationRecord>;
|
|
23
|
-
}
|
|
24
|
-
export default NotificationService;
|
|
25
|
-
export type { CreateNotificationInput };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { BaseRepository } from "@getstrata/core/database";
|
|
2
|
-
import type { OAuthIdentityRecord } from "./types";
|
|
3
|
-
declare const oauthIdentityTable: import("@getstrata/core/database").TableDefinition<OAuthIdentityRecord, "id">;
|
|
4
|
-
declare class OAuthIdentityRepository extends BaseRepository<OAuthIdentityRecord, "id"> {
|
|
5
|
-
constructor();
|
|
6
|
-
findByProviderUser(provider: string, providerUserId: string): Promise<OAuthIdentityRecord | null>;
|
|
7
|
-
}
|
|
8
|
-
export default OAuthIdentityRepository;
|
|
9
|
-
export { oauthIdentityTable };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ServiceProvider } from "@getstrata/core/contracts/di";
|
|
2
|
-
declare const userRepositoryToken = "user.repository";
|
|
3
|
-
declare const apiTokenRepositoryToken = "user.apiTokenRepository";
|
|
4
|
-
declare const tokenServiceToken = "core.tokenService";
|
|
5
|
-
declare const authServiceToken = "user.authService";
|
|
6
|
-
declare const oauthIdentityRepositoryToken = "user.oauthIdentityRepository";
|
|
7
|
-
declare const notificationRepositoryToken = "user.notificationRepository";
|
|
8
|
-
declare const notificationServiceToken = "user.notificationService";
|
|
9
|
-
declare const userProvider: ServiceProvider;
|
|
10
|
-
export default userProvider;
|
|
11
|
-
export { apiTokenRepositoryToken, authServiceToken, notificationRepositoryToken, notificationServiceToken, oauthIdentityRepositoryToken, tokenServiceToken, userRepositoryToken, };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { BaseRepository } from "@getstrata/core/database";
|
|
2
|
-
import type { UserRecord } from "./types";
|
|
3
|
-
declare class UserRepository extends BaseRepository<UserRecord, "id"> {
|
|
4
|
-
constructor();
|
|
5
|
-
private decode;
|
|
6
|
-
findById(id: number): Promise<UserRecord | null>;
|
|
7
|
-
findAll(options?: Parameters<BaseRepository<UserRecord, "id">["findAll"]>[0]): Promise<UserRecord[]>;
|
|
8
|
-
create(values: Partial<UserRecord>): Promise<UserRecord>;
|
|
9
|
-
updateByIdOrThrow(id: number, values: Partial<UserRecord>, errorFactory?: (missingId: number) => Error): Promise<UserRecord>;
|
|
10
|
-
findByEmail(email: string): Promise<UserRecord | null>;
|
|
11
|
-
countForTenant(tenantId?: number): Promise<number>;
|
|
12
|
-
}
|
|
13
|
-
export default UserRepository;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { AuthUser } from "@getstrata/core/auth/authContext";
|
|
2
|
-
import type ApiTokenRepository from "./apiTokenRepository";
|
|
3
|
-
import type UserRepository from "./repository";
|
|
4
|
-
import type { ApiTokenRecord, ApiTokenResource, CreatedApiToken, UserRecord } from "./types";
|
|
5
|
-
interface CreateTokenInput {
|
|
6
|
-
name: string;
|
|
7
|
-
abilities?: string[];
|
|
8
|
-
expiresAt?: Date | null;
|
|
9
|
-
expiresInDays?: number;
|
|
10
|
-
}
|
|
11
|
-
declare function toApiTokenResource(record: ApiTokenRecord): ApiTokenResource;
|
|
12
|
-
declare function generatePlainTextToken(): string;
|
|
13
|
-
declare function resolveExpiresAt(input: CreateTokenInput): Date | null;
|
|
14
|
-
declare function normalizeAbilities(value: unknown): string[];
|
|
15
|
-
declare class TokenService {
|
|
16
|
-
private readonly users;
|
|
17
|
-
private readonly tokens;
|
|
18
|
-
constructor(users: UserRepository, tokens: ApiTokenRepository);
|
|
19
|
-
resolveUserFromToken(token: string): Promise<AuthUser | null>;
|
|
20
|
-
createToken(userId: number, input: CreateTokenInput): Promise<CreatedApiToken>;
|
|
21
|
-
listTokensForUser(userId: number): Promise<ApiTokenResource[]>;
|
|
22
|
-
revokeToken(userId: number, tokenId: number): Promise<void>;
|
|
23
|
-
tokenCan(user: AuthUser | null, ability: string): boolean;
|
|
24
|
-
requireAbility(user: AuthUser | null, ability: string): void;
|
|
25
|
-
findByIdOrThrow(id: number): Promise<UserRecord>;
|
|
26
|
-
deleteUserAccount(userId: number): Promise<void>;
|
|
27
|
-
}
|
|
28
|
-
export default TokenService;
|
|
29
|
-
export { generatePlainTextToken, normalizeAbilities, resolveExpiresAt, toApiTokenResource };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { UserRole } from "../../domain/auth";
|
|
2
|
-
interface UserRecord {
|
|
3
|
-
id: number;
|
|
4
|
-
name: string;
|
|
5
|
-
email: string;
|
|
6
|
-
email_lookup?: string | null;
|
|
7
|
-
role: UserRole;
|
|
8
|
-
tenant_id: number;
|
|
9
|
-
password_hash?: string | null;
|
|
10
|
-
email_verified_at?: Date | null;
|
|
11
|
-
mfa_secret?: string | null;
|
|
12
|
-
mfa_enabled?: boolean;
|
|
13
|
-
created_at: Date;
|
|
14
|
-
updated_at: Date;
|
|
15
|
-
}
|
|
16
|
-
interface OAuthIdentityRecord {
|
|
17
|
-
id: number;
|
|
18
|
-
user_id: number;
|
|
19
|
-
provider: string;
|
|
20
|
-
provider_user_id: string;
|
|
21
|
-
email: string | null;
|
|
22
|
-
created_at: Date;
|
|
23
|
-
}
|
|
24
|
-
interface ApiTokenRecord {
|
|
25
|
-
id: number;
|
|
26
|
-
user_id: number;
|
|
27
|
-
name: string;
|
|
28
|
-
token_hash: string;
|
|
29
|
-
abilities: string[];
|
|
30
|
-
last_used_at: Date | null;
|
|
31
|
-
expires_at: Date | null;
|
|
32
|
-
created_at: Date;
|
|
33
|
-
}
|
|
34
|
-
interface ApiTokenResource {
|
|
35
|
-
id: number;
|
|
36
|
-
name: string;
|
|
37
|
-
abilities: string[];
|
|
38
|
-
last_used_at: string | null;
|
|
39
|
-
expires_at: string | null;
|
|
40
|
-
created_at: string;
|
|
41
|
-
}
|
|
42
|
-
interface CreatedApiToken {
|
|
43
|
-
token: ApiTokenResource;
|
|
44
|
-
plainTextToken: string;
|
|
45
|
-
}
|
|
46
|
-
export type { ApiTokenRecord, ApiTokenResource, CreatedApiToken, OAuthIdentityRecord, UserRecord };
|
package/dist/types/services.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface CacheLike {
|
|
2
|
-
get<T>(key: string): Promise<T | undefined>;
|
|
3
|
-
remember<T>(key: string, callback: () => Promise<T>, ttlMs?: number): Promise<T>;
|
|
4
|
-
forget(key: string): Promise<boolean>;
|
|
5
|
-
flush(): Promise<void>;
|
|
6
|
-
tags(...names: string[]): {
|
|
7
|
-
remember<T>(key: string, callback: () => Promise<T>, ttlMs?: number): Promise<T>;
|
|
8
|
-
flush(): Promise<number>;
|
|
9
|
-
};
|
|
10
|
-
getOrSet<T>(key: string, loader: () => Promise<T>, ttlMs?: number): Promise<T>;
|
|
11
|
-
invalidate(key: string): Promise<boolean>;
|
|
12
|
-
invalidateByPrefix(prefix: string): Promise<number>;
|
|
13
|
-
clear(): Promise<void>;
|
|
14
|
-
size(): Promise<number>;
|
|
15
|
-
}
|
|
16
|
-
export type { CacheLike };
|