@getstrata/bootstrap 0.2.6 → 0.2.8
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/contracts.d.ts +2 -0
- package/dist/bootstrap/http/securedRouteModelBinding.d.ts +11 -0
- package/dist/bootstrap/providers/storage.d.ts +3 -0
- package/dist/bootstrap/public-api.d.ts +1 -0
- package/dist/bootstrap/scimRoutes.d.ts +1 -1
- package/dist/core/auth/membershipScope.d.ts +16 -0
- package/dist/core/auth/membershipService.d.ts +24 -0
- package/dist/core/database/baseRepository.d.ts +6 -1
- package/dist/core/database/connectionContext.d.ts +2 -1
- package/dist/core/database/defaultConnection.d.ts +6 -0
- package/dist/core/database/queryProxy.d.ts +3 -0
- package/dist/core/database/repositoryConnection.d.ts +3 -3
- package/dist/core/http/securedRouteModelBinding.d.ts +2 -11
- package/dist/core/jobs/dispatchWebhookJob.d.ts +0 -1
- package/dist/core/queue/queueMetrics.d.ts +15 -0
- package/dist/core/security/safeFetch.d.ts +2 -0
- package/dist/core/security/safeUrl.d.ts +16 -1
- package/dist/core/tenant/tenantDatabaseScope.d.ts +2 -1
- package/dist/db/connection/index.d.ts +1 -1
- package/dist/domain/workhub.d.ts +35 -0
- package/dist/entries/applicationRegistry.js +185 -0
- package/dist/entries/config.js +42 -0
- package/dist/entries/context.js +4213 -0
- package/dist/entries/contracts.js +92 -0
- package/dist/entries/createWebRoutes.js +996 -0
- package/dist/entries/http/securedRouteModelBinding.js +383 -0
- package/dist/entries/httpKernel.js +264 -0
- package/dist/entries/providers/view.js +635 -0
- package/dist/entries/providers.js +4099 -0
- package/dist/framework/public-api.d.ts +30 -6
- package/dist/index.js +455 -110
- package/dist/modules/organization/repository.d.ts +14 -0
- package/dist/modules/organization/table.d.ts +3 -0
- package/dist/modules/organization/types.d.ts +10 -0
- package/dist/modules/scim/controller.d.ts +2 -1
- package/dist/modules/scim/scimResponse.d.ts +1 -1
- package/dist/modules/scim/service.d.ts +4 -7
- package/dist/modules/user/repository.d.ts +1 -0
- package/package.json +10 -4
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseRepository } from "@getstrata/core/database";
|
|
2
|
+
import type { OrganizationRecord } from "./types";
|
|
3
|
+
declare class OrganizationRepository extends BaseRepository<OrganizationRecord, "id"> {
|
|
4
|
+
constructor();
|
|
5
|
+
findBySlug(slug: string): Promise<OrganizationRecord | null>;
|
|
6
|
+
listForTenant(options: {
|
|
7
|
+
limit: number;
|
|
8
|
+
offset: number;
|
|
9
|
+
tenantId?: number;
|
|
10
|
+
}): Promise<OrganizationRecord[]>;
|
|
11
|
+
countForTenant(tenantId?: number): Promise<number>;
|
|
12
|
+
findForTenantOrThrow(id: number, tenantId?: number): Promise<OrganizationRecord>;
|
|
13
|
+
}
|
|
14
|
+
export default OrganizationRepository;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { AppDependencies } from "@getstrata/bootstrap/contracts";
|
|
2
|
+
import type ScimService from "./service";
|
|
2
3
|
declare class ScimController {
|
|
3
4
|
private readonly service;
|
|
4
|
-
constructor(dependencies: AppDependencies);
|
|
5
|
+
constructor(dependencies: AppDependencies, service?: ScimService);
|
|
5
6
|
readonly serviceProviderConfig: () => Promise<Response>;
|
|
6
7
|
readonly listUsers: (request: Request) => Promise<Response>;
|
|
7
8
|
readonly createUser: (request: Request) => Promise<Response>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AppDependencies } from "@getstrata/bootstrap/contracts";
|
|
2
2
|
import OrganizationMemberRepository from "../organization/memberRepository";
|
|
3
|
+
import OrganizationRepository from "../organization/repository";
|
|
3
4
|
import type UserRepository from "../user/repository";
|
|
4
5
|
interface ScimUserPayload {
|
|
5
6
|
userName?: string;
|
|
@@ -19,8 +20,9 @@ interface ScimPatchOperation {
|
|
|
19
20
|
}
|
|
20
21
|
declare class ScimService {
|
|
21
22
|
private readonly users;
|
|
23
|
+
private readonly organizations;
|
|
22
24
|
private readonly members;
|
|
23
|
-
constructor(users: UserRepository, members: OrganizationMemberRepository);
|
|
25
|
+
constructor(users: UserRepository, organizations: OrganizationRepository, members: OrganizationMemberRepository);
|
|
24
26
|
serviceProviderConfig(): {
|
|
25
27
|
schemas: "urn:ietf:params:scim:schemas:core:2.0:ServiceProviderConfig"[];
|
|
26
28
|
patch: {
|
|
@@ -188,12 +190,7 @@ declare class ScimService {
|
|
|
188
190
|
lastModified: string;
|
|
189
191
|
};
|
|
190
192
|
}>;
|
|
191
|
-
findOrganizationRecord(id: number): Promise<
|
|
192
|
-
id: number;
|
|
193
|
-
name: string;
|
|
194
|
-
slug: string;
|
|
195
|
-
updated_at: Date;
|
|
196
|
-
}>;
|
|
193
|
+
findOrganizationRecord(id: number): Promise<import("../organization/types").OrganizationRecord>;
|
|
197
194
|
patchGroup(id: number, operations: ScimPatchOperation[]): Promise<{
|
|
198
195
|
schemas: "urn:ietf:params:scim:schemas:core:2.0:Group"[];
|
|
199
196
|
id: string;
|
|
@@ -8,5 +8,6 @@ declare class UserRepository extends BaseRepository<UserRecord, "id"> {
|
|
|
8
8
|
create(values: Partial<UserRecord>): Promise<UserRecord>;
|
|
9
9
|
updateByIdOrThrow(id: number, values: Partial<UserRecord>, errorFactory?: (missingId: number) => Error): Promise<UserRecord>;
|
|
10
10
|
findByEmail(email: string): Promise<UserRecord | null>;
|
|
11
|
+
countForTenant(tenantId?: number): Promise<number>;
|
|
11
12
|
}
|
|
12
13
|
export default UserRepository;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getstrata/bootstrap",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "Strata application bootstrap — HttpKernel, DI, web session helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,6 +40,11 @@
|
|
|
40
40
|
"import": "./dist/entries/createWebRoutes.js",
|
|
41
41
|
"default": "./dist/entries/createWebRoutes.js"
|
|
42
42
|
},
|
|
43
|
+
"./http/securedRouteModelBinding": {
|
|
44
|
+
"types": "./dist/bootstrap/http/securedRouteModelBinding.d.ts",
|
|
45
|
+
"import": "./dist/entries/http/securedRouteModelBinding.js",
|
|
46
|
+
"default": "./dist/entries/http/securedRouteModelBinding.js"
|
|
47
|
+
},
|
|
43
48
|
"./httpKernel": {
|
|
44
49
|
"types": "./dist/bootstrap/httpKernel.d.ts",
|
|
45
50
|
"import": "./dist/entries/httpKernel.js",
|
|
@@ -63,17 +68,18 @@
|
|
|
63
68
|
"README.md"
|
|
64
69
|
],
|
|
65
70
|
"scripts": {
|
|
66
|
-
"build": "bun run build:bundle && bun run build:types",
|
|
71
|
+
"build": "bun run build:bundle && bun run build:shims && bun run build:subpaths && bun run build:types",
|
|
67
72
|
"build:bundle": "bun build index.ts --outdir dist --target bun --external bun --external eta --external @getstrata/core",
|
|
68
73
|
"build:types": "tsc -p tsconfig.types.json",
|
|
69
74
|
"prepublishOnly": "bun run build",
|
|
70
|
-
"build:subpaths": "bun build
|
|
75
|
+
"build:subpaths": "bun build entries/applicationRegistry.ts entries/config.ts entries/context.ts entries/contracts.ts entries/createWebRoutes.ts entries/http/securedRouteModelBinding.ts entries/httpKernel.ts entries/providers.ts entries/providers/view.ts --outdir dist --root . --target bun --external bun --external eta --external @getstrata/core",
|
|
76
|
+
"build:shims": "true"
|
|
71
77
|
},
|
|
72
78
|
"publishConfig": {
|
|
73
79
|
"access": "public"
|
|
74
80
|
},
|
|
75
81
|
"peerDependencies": {
|
|
76
|
-
"@getstrata/core": "^0.5.
|
|
82
|
+
"@getstrata/core": "^0.5.16",
|
|
77
83
|
"typescript": "^5.9.0"
|
|
78
84
|
}
|
|
79
85
|
}
|