@treeseed/sdk 0.8.19 → 0.10.5
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/api/app.d.ts +8 -0
- package/dist/api/app.js +404 -0
- package/dist/api/auth/d1-database.d.ts +3 -0
- package/dist/api/auth/d1-database.js +20 -0
- package/dist/api/auth/d1-provider.d.ts +79 -0
- package/dist/api/auth/d1-provider.js +92 -0
- package/dist/api/auth/d1-store.d.ts +114 -0
- package/dist/api/auth/d1-store.js +902 -0
- package/dist/api/auth/memory-provider.d.ts +77 -0
- package/dist/api/auth/memory-provider.js +256 -0
- package/dist/api/auth/rbac.d.ts +22 -0
- package/dist/api/auth/rbac.js +162 -0
- package/dist/api/auth/tokens.d.ts +18 -0
- package/dist/api/auth/tokens.js +56 -0
- package/dist/api/config.d.ts +2 -0
- package/dist/api/config.js +118 -0
- package/dist/api/http.d.ts +28 -0
- package/dist/api/http.js +51 -0
- package/dist/api/index.d.ts +10 -0
- package/dist/api/index.js +27 -0
- package/dist/api/operations-routes.d.ts +11 -0
- package/dist/api/operations-routes.js +39 -0
- package/dist/api/operations.d.ts +3 -0
- package/dist/api/operations.js +26 -0
- package/dist/api/providers.d.ts +2 -0
- package/dist/api/providers.js +68 -0
- package/dist/api/railway.d.ts +52 -0
- package/dist/api/railway.js +71 -0
- package/dist/api/sdk-dispatch.d.ts +6 -0
- package/dist/api/sdk-dispatch.js +14 -0
- package/dist/api/sdk-routes.d.ts +11 -0
- package/dist/api/sdk-routes.js +29 -0
- package/dist/api/templates.d.ts +3 -0
- package/dist/api/templates.js +31 -0
- package/dist/api/types.d.ts +232 -0
- package/dist/api/types.js +0 -0
- package/dist/capacity-provider.d.ts +383 -0
- package/dist/capacity-provider.js +535 -0
- package/dist/capacity.d.ts +2 -35
- package/dist/control-plane-client.d.ts +8 -3
- package/dist/control-plane-client.js +12 -1
- package/dist/d1-store.js +27 -3
- package/dist/db/node-sqlite.js +11 -2
- package/dist/dispatch.js +0 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +40 -0
- package/dist/market-client.d.ts +1 -5
- package/dist/market-client.js +2 -8
- package/dist/model-registry.js +55 -24
- package/dist/operations/providers/default.js +0 -9
- package/dist/operations/services/config-runtime.d.ts +2 -2
- package/dist/operations/services/config-runtime.js +55 -3
- package/dist/operations/services/d1-migration.js +32 -0
- package/dist/operations/services/deploy.js +3 -0
- package/dist/operations/services/github-automation.d.ts +10 -15
- package/dist/operations/services/github-automation.js +3 -35
- package/dist/operations/services/hosting-audit.d.ts +1 -1
- package/dist/operations/services/hosting-audit.js +3 -27
- package/dist/operations/services/hub-launch.d.ts +0 -1
- package/dist/operations/services/hub-launch.js +1 -2
- package/dist/operations/services/hub-provider-launch.d.ts +0 -15
- package/dist/operations/services/hub-provider-launch.js +5 -41
- package/dist/operations/services/package-reference-policy.d.ts +1 -0
- package/dist/operations/services/package-reference-policy.js +10 -2
- package/dist/operations/services/project-platform.d.ts +69 -1
- package/dist/operations/services/project-platform.js +33 -13
- package/dist/operations/services/release-candidate.js +19 -3
- package/dist/operations/services/repository-save-orchestrator.js +10 -1
- package/dist/operations-registry.js +1 -3
- package/dist/platform/contracts.d.ts +2 -2
- package/dist/project-workflow.d.ts +0 -3
- package/dist/scripts/publish-package.js +5 -1
- package/dist/scripts/tenant-workflow-action.js +3 -3
- package/dist/scripts/workflow-commands.test.js +3 -6
- package/dist/sdk-types.d.ts +34 -2
- package/dist/sdk-types.js +2 -1
- package/dist/stores/operational-store.d.ts +13 -0
- package/dist/stores/operational-store.js +50 -0
- package/dist/treeseed/template-catalog/templates/starter-basic/template/package.json +1 -4
- package/dist/treeseed/template-catalog/templates/starter-basic/template/src/api/server.js +1 -1
- package/dist/treeseed/template-catalog/templates/starter-basic/template/treeseed.site.yaml +1 -17
- package/dist/workflow/operations.js +26 -8
- package/package.json +14 -1
- package/templates/github/hosted-project.workflow.yml +0 -1
- package/templates/github/deploy-processing.workflow.yml +0 -123
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import type { D1DatabaseLike } from '../../types/cloudflare.ts';
|
|
2
|
+
import type { ApiConfig, ApiCredential, ApiPrincipal, DeviceCodeApproveRequest, DeviceCodePollRequest, DeviceCodePollResponse, DeviceCodeStartRequest, DeviceCodeStartResponse, TokenRefreshRequest, TokenRefreshResponse, TrustedUserAssertionClaims, UserIdentityProfileInput } from '../types.ts';
|
|
3
|
+
type PrincipalRecord = {
|
|
4
|
+
principal: ApiPrincipal;
|
|
5
|
+
userId: string;
|
|
6
|
+
};
|
|
7
|
+
export interface PersonalAccessTokenResult {
|
|
8
|
+
id: string;
|
|
9
|
+
token: string;
|
|
10
|
+
prefix: string;
|
|
11
|
+
name: string;
|
|
12
|
+
expiresAt: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface ServiceCredentialResult {
|
|
15
|
+
id: string;
|
|
16
|
+
serviceId: string;
|
|
17
|
+
secret: string;
|
|
18
|
+
}
|
|
19
|
+
export declare class D1AuthStore {
|
|
20
|
+
private readonly config;
|
|
21
|
+
private readonly db;
|
|
22
|
+
private initializationPromise;
|
|
23
|
+
constructor(config: ApiConfig, db: D1DatabaseLike);
|
|
24
|
+
private run;
|
|
25
|
+
private first;
|
|
26
|
+
private all;
|
|
27
|
+
private ensureInitialized;
|
|
28
|
+
private ensureAuthSchema;
|
|
29
|
+
private seedCatalog;
|
|
30
|
+
private seedConfiguredServices;
|
|
31
|
+
private loadUser;
|
|
32
|
+
private loadIdentityByProvider;
|
|
33
|
+
private loadUserByVerifiedEmail;
|
|
34
|
+
private rolesForUser;
|
|
35
|
+
private permissionsForUser;
|
|
36
|
+
private permissionsForRoles;
|
|
37
|
+
private scopesForPrincipal;
|
|
38
|
+
private principalForUser;
|
|
39
|
+
private assignRole;
|
|
40
|
+
private replaceRoles;
|
|
41
|
+
private bootstrapRolesForUser;
|
|
42
|
+
private writeAuditEvent;
|
|
43
|
+
private userMetadata;
|
|
44
|
+
syncUser(identity: UserIdentityProfileInput): Promise<{
|
|
45
|
+
identityId: string | null;
|
|
46
|
+
principal: ApiPrincipal;
|
|
47
|
+
userId: string;
|
|
48
|
+
}>;
|
|
49
|
+
createUser(input: {
|
|
50
|
+
email?: string | null;
|
|
51
|
+
username?: string | null;
|
|
52
|
+
displayName?: string | null;
|
|
53
|
+
metadata?: Record<string, unknown>;
|
|
54
|
+
}): Promise<PrincipalRecord>;
|
|
55
|
+
setUserRoles(userId: string, roles: string[]): Promise<PrincipalRecord>;
|
|
56
|
+
startDeviceFlow(request: DeviceCodeStartRequest): Promise<DeviceCodeStartResponse>;
|
|
57
|
+
approveDeviceFlow(request: DeviceCodeApproveRequest): Promise<{
|
|
58
|
+
ok: true;
|
|
59
|
+
}>;
|
|
60
|
+
pollDeviceFlow(request: DeviceCodePollRequest): Promise<DeviceCodePollResponse>;
|
|
61
|
+
refreshAccessToken(request: TokenRefreshRequest): Promise<TokenRefreshResponse>;
|
|
62
|
+
createPersonalAccessToken(userId: string, input: {
|
|
63
|
+
name: string;
|
|
64
|
+
scopes?: string[];
|
|
65
|
+
expiresAt?: string | null;
|
|
66
|
+
}): Promise<{
|
|
67
|
+
id: `${string}-${string}-${string}-${string}-${string}`;
|
|
68
|
+
token: string;
|
|
69
|
+
prefix: string;
|
|
70
|
+
name: string;
|
|
71
|
+
expiresAt: string | null;
|
|
72
|
+
}>;
|
|
73
|
+
listPersonalAccessTokens(userId: string): Promise<{
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
token_prefix: string;
|
|
77
|
+
expires_at: string | null;
|
|
78
|
+
last_used_at: string | null;
|
|
79
|
+
revoked_at: string | null;
|
|
80
|
+
created_at: string;
|
|
81
|
+
}[]>;
|
|
82
|
+
revokePersonalAccessToken(userId: string, tokenId: string): Promise<void>;
|
|
83
|
+
upsertServiceCredential(input: {
|
|
84
|
+
serviceId: string;
|
|
85
|
+
name: string;
|
|
86
|
+
secret: string;
|
|
87
|
+
roles?: string[];
|
|
88
|
+
permissions?: string[];
|
|
89
|
+
}): Promise<string>;
|
|
90
|
+
createServiceCredential(input: {
|
|
91
|
+
serviceId: string;
|
|
92
|
+
name: string;
|
|
93
|
+
roles?: string[];
|
|
94
|
+
permissions?: string[];
|
|
95
|
+
}): Promise<ServiceCredentialResult>;
|
|
96
|
+
rotateServiceCredential(serviceId: string): Promise<ServiceCredentialResult>;
|
|
97
|
+
authenticateBearerToken(token: string): Promise<{
|
|
98
|
+
principal: ApiPrincipal;
|
|
99
|
+
credential: ApiCredential;
|
|
100
|
+
} | null>;
|
|
101
|
+
authenticateService(serviceId: string, secret: string): Promise<{
|
|
102
|
+
principal: ApiPrincipal;
|
|
103
|
+
credential: ApiCredential;
|
|
104
|
+
} | null>;
|
|
105
|
+
exchangeTrustedUserAssertion(claims: TrustedUserAssertionClaims): Promise<{
|
|
106
|
+
ok: true;
|
|
107
|
+
accessToken: string;
|
|
108
|
+
tokenType: "Bearer";
|
|
109
|
+
expiresAt: string;
|
|
110
|
+
expiresInSeconds: number;
|
|
111
|
+
principal: ApiPrincipal;
|
|
112
|
+
}>;
|
|
113
|
+
}
|
|
114
|
+
export {};
|