@sylphx/contract 0.6.0 → 0.7.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/CHANGELOG.md +9 -1
- package/README.md +1 -1
- package/dist/compute.d.ts +33 -0
- package/dist/compute.d.ts.map +1 -0
- package/dist/compute.js +119 -0
- package/dist/endpoints/admin-config.d.ts +3 -0
- package/dist/endpoints/admin-config.d.ts.map +1 -1
- package/dist/endpoints/admin-config.js +9 -1
- package/dist/endpoints/ai-admin.d.ts +134 -5
- package/dist/endpoints/ai-admin.d.ts.map +1 -1
- package/dist/endpoints/analytics-admin.d.ts +141 -6
- package/dist/endpoints/analytics-admin.d.ts.map +1 -1
- package/dist/endpoints/analytics-admin.js +7 -7
- package/dist/endpoints/auth.d.ts +26 -8
- package/dist/endpoints/auth.d.ts.map +1 -1
- package/dist/endpoints/auth.js +5 -5
- package/dist/endpoints/domains.d.ts +7 -1
- package/dist/endpoints/domains.d.ts.map +1 -1
- package/dist/endpoints/email-admin.d.ts +1 -0
- package/dist/endpoints/email-admin.d.ts.map +1 -1
- package/dist/endpoints/flags-admin.d.ts +8 -0
- package/dist/endpoints/flags-admin.d.ts.map +1 -1
- package/dist/endpoints/notifications-admin.d.ts +4 -4
- package/dist/endpoints/project-manifest.d.ts +308 -306
- package/dist/endpoints/project-manifest.d.ts.map +1 -1
- package/dist/hono-app.d.ts +1 -1
- package/dist/index.d.ts +634 -330
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/schemas/admin-config.d.ts +4 -0
- package/dist/schemas/admin-config.d.ts.map +1 -1
- package/dist/schemas/admin-config.js +3 -0
- package/dist/schemas/ai-admin.d.ts +137 -8
- package/dist/schemas/ai-admin.d.ts.map +1 -1
- package/dist/schemas/ai-admin.js +119 -13
- package/dist/schemas/analytics-admin.d.ts +164 -7
- package/dist/schemas/analytics-admin.d.ts.map +1 -1
- package/dist/schemas/analytics-admin.js +104 -3
- package/dist/schemas/auth.d.ts +2 -1
- package/dist/schemas/auth.d.ts.map +1 -1
- package/dist/schemas/auth.js +2 -1
- package/dist/schemas/domain.d.ts +3 -1
- package/dist/schemas/domain.d.ts.map +1 -1
- package/dist/schemas/domain.js +2 -1
- package/dist/schemas/email-admin.d.ts +1 -0
- package/dist/schemas/email-admin.d.ts.map +1 -1
- package/dist/schemas/email-admin.js +1 -0
- package/dist/schemas/flags-admin.d.ts +13 -0
- package/dist/schemas/flags-admin.d.ts.map +1 -1
- package/dist/schemas/flags-admin.js +6 -0
- package/dist/schemas/notifications-admin.d.ts +6 -6
- package/dist/schemas/notifications-admin.js +1 -1
- package/dist/schemas/project-manifest.d.ts +316 -306
- package/dist/schemas/project-manifest.d.ts.map +1 -1
- package/dist/schemas/project-manifest.js +5 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @sylphx/contract
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#746](https://github.com/SylphxAI/platform/pull/746) [`382a78e`](https://github.com/SylphxAI/platform/commit/382a78e2fb52d248890ae4fcb9551b8dde17a641) Thanks [@shtse8](https://github.com/shtse8)! - Align Management SDK email logs, suppressions, and settings with the contract-derived email admin surface.
|
|
8
|
+
|
|
9
|
+
The email management module now returns the contract list shape for logs, exposes log detail and suppression management helpers, and uses the contract settings input/response types. Consumers using the older hand-written email settings or log-list TypeScript shapes should migrate to the exported `EmailSettings`, `UpdateEmailSettingsInput`, `ListEmailLogsResult`, and `ListSuppressionsResult` types.
|
|
10
|
+
|
|
3
11
|
## 0.6.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -40,7 +48,7 @@
|
|
|
40
48
|
|
|
41
49
|
### Changes
|
|
42
50
|
|
|
43
|
-
- **Initial beta release.** Effect Schema SSOT for the entire Sylphx API surface. Per
|
|
51
|
+
- **Initial beta release.** Effect Schema SSOT for the entire Sylphx API surface. Per **ADR-084** (Effect Schema Contract — Sylphx-internal architecture record), every endpoint, request body, response envelope, and error type is defined once in this package and consumed everywhere — `apps/api` Hono routes, the published SDKs (`@sylphx/management`, `@sylphx/sdk`), and the derived `openapi.json` spec. Hand-written parallel types are a bug (ADR-084 Rule 2).
|
|
44
52
|
- **70 endpoint groups, 82 schema files, ~745 endpoint definitions** covering three planes:
|
|
45
53
|
- **Management** (`api.sylphx.com/v1`, Bearer `slx_*` / `sk_*`): `projects`, `deployments`, `environments`, `databases`, `envVars`, `domains`, `organizations`, `secrets`, `users`, `ciSettings`, `github`, `billingSettings`, `serviceTokens`, `serviceTokenRequests`, `runners`, `backups`, `webhooks`, `tasks`, `storage`, `storageAdmin`, `realtime`, `realtimeAdmin`, `saml`, `oidc`, `security`, `monitoring`, `monitoringAdmin`, `analytics`, `analyticsAdmin`, `flags`, `flagsAdmin`, `experiments`, `newsletter`, `referralsAdmin`, `engagementAdmin`, `aiAdmin`, `search`, `sessionReplay`, `email`, `emailAdmin`, `notifications`, `notificationsAdmin`, `consentAdmin`, `privacy`, `plans`, `billingConsole`.
|
|
46
54
|
- **BaaS** (`<tenant-slug>.api.sylphx.com/v1`, ADR-083.1): `auth`, `refresh`, `challenge`, `kv`, `kvAdmin`, `email` (transactional send), `notifications` (push / in-app), `flags.evaluate`, `realtime` (pub/sub), `storage`, `search`.
|
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
> The Effect Schema SSOT for every Sylphx API endpoint.
|
|
7
7
|
|
|
8
|
-
Part of
|
|
8
|
+
Part of **ADR-084 — Effect Schema Contract** (Sylphx-internal architecture record).
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { MachineSize } from './schemas/project-manifest.js';
|
|
2
|
+
export declare const MACHINE_SIZES: readonly ["nano", "micro", "small", "standard", "large", "xlarge"];
|
|
3
|
+
export declare const DEFAULT_MACHINE_SIZE: MachineSize;
|
|
4
|
+
export interface MachineConfig {
|
|
5
|
+
cpu?: string;
|
|
6
|
+
memory?: string;
|
|
7
|
+
gpu?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface MachineResourceRequirements {
|
|
10
|
+
requests?: {
|
|
11
|
+
cpu?: string;
|
|
12
|
+
memory?: string;
|
|
13
|
+
};
|
|
14
|
+
limits?: {
|
|
15
|
+
cpu?: string;
|
|
16
|
+
memory?: string;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface MachineTierResources {
|
|
20
|
+
cpuCores: number;
|
|
21
|
+
ramGb: number;
|
|
22
|
+
}
|
|
23
|
+
export declare const MACHINE_CONFIGS: Record<MachineSize, MachineConfig>;
|
|
24
|
+
export declare const MACHINE_RESOURCE_REQUIREMENTS: Record<MachineSize, MachineResourceRequirements>;
|
|
25
|
+
export declare const MACHINE_MAX_INSTANCES: Record<MachineSize, number>;
|
|
26
|
+
export declare function isMachineSize(value: unknown): value is MachineSize;
|
|
27
|
+
export declare function parseMachineSize(value: unknown): MachineSize | null;
|
|
28
|
+
export declare function toPublicMachineSize(value: unknown): MachineSize | null;
|
|
29
|
+
export declare function resolveMachineConfig(machine: MachineSize): MachineConfig;
|
|
30
|
+
export declare function resolveMachineResources(machine: MachineSize): MachineResourceRequirements;
|
|
31
|
+
export declare function resolveMachineMaxInstances(machine: MachineSize): number;
|
|
32
|
+
export declare function resolveMachineTierResources(machine: MachineSize): MachineTierResources;
|
|
33
|
+
//# sourceMappingURL=compute.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../src/compute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAEhE,eAAO,MAAM,aAAa,oEAOiB,CAAA;AAE3C,eAAO,MAAM,oBAAoB,EAAE,WAAwB,CAAA;AAE3D,MAAM,WAAW,aAAa;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,2BAA2B;IAC3C,QAAQ,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5C,MAAM,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACpC,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACb;AAED,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,aAAa,CAO9D,CAAA;AAED,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,WAAW,EAAE,2BAA2B,CAyB1F,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAO7D,CAAA;AAkBD,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAElE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAEnE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAItE;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,aAAa,CAExE;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,WAAW,GAAG,2BAA2B,CAMzF;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAEvE;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,WAAW,GAAG,oBAAoB,CAMtF"}
|
package/dist/compute.js
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export const MACHINE_SIZES = [
|
|
2
|
+
'nano',
|
|
3
|
+
'micro',
|
|
4
|
+
'small',
|
|
5
|
+
'standard',
|
|
6
|
+
'large',
|
|
7
|
+
'xlarge',
|
|
8
|
+
];
|
|
9
|
+
export const DEFAULT_MACHINE_SIZE = 'standard';
|
|
10
|
+
export const MACHINE_CONFIGS = {
|
|
11
|
+
nano: { cpu: '100m', memory: '256Mi' },
|
|
12
|
+
micro: { cpu: '250m', memory: '512Mi' },
|
|
13
|
+
small: { cpu: '500m', memory: '1Gi' },
|
|
14
|
+
standard: { cpu: '1000m', memory: '2Gi' },
|
|
15
|
+
large: { cpu: '2000m', memory: '4Gi' },
|
|
16
|
+
xlarge: { cpu: '4000m', memory: '8Gi' },
|
|
17
|
+
};
|
|
18
|
+
export const MACHINE_RESOURCE_REQUIREMENTS = {
|
|
19
|
+
nano: {
|
|
20
|
+
requests: MACHINE_CONFIGS.nano,
|
|
21
|
+
limits: { cpu: '500m', memory: '512Mi' },
|
|
22
|
+
},
|
|
23
|
+
micro: {
|
|
24
|
+
requests: MACHINE_CONFIGS.micro,
|
|
25
|
+
limits: { cpu: '1000m', memory: '1Gi' },
|
|
26
|
+
},
|
|
27
|
+
small: {
|
|
28
|
+
requests: MACHINE_CONFIGS.small,
|
|
29
|
+
limits: { cpu: '2000m', memory: '2Gi' },
|
|
30
|
+
},
|
|
31
|
+
standard: {
|
|
32
|
+
requests: MACHINE_CONFIGS.standard,
|
|
33
|
+
limits: { cpu: '4000m', memory: '4Gi' },
|
|
34
|
+
},
|
|
35
|
+
large: {
|
|
36
|
+
requests: MACHINE_CONFIGS.large,
|
|
37
|
+
limits: { cpu: '8000m', memory: '8Gi' },
|
|
38
|
+
},
|
|
39
|
+
xlarge: {
|
|
40
|
+
requests: MACHINE_CONFIGS.xlarge,
|
|
41
|
+
limits: { cpu: '16000m', memory: '16Gi' },
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export const MACHINE_MAX_INSTANCES = {
|
|
45
|
+
nano: 1,
|
|
46
|
+
micro: 3,
|
|
47
|
+
small: 5,
|
|
48
|
+
standard: 10,
|
|
49
|
+
large: 10,
|
|
50
|
+
xlarge: 20,
|
|
51
|
+
};
|
|
52
|
+
const LEGACY_PUBLIC_MACHINE_SIZE_ALIASES = {
|
|
53
|
+
xs: 'nano',
|
|
54
|
+
sm: 'micro',
|
|
55
|
+
md: 'standard',
|
|
56
|
+
lg: 'large',
|
|
57
|
+
xl: 'xlarge',
|
|
58
|
+
'2xl': 'xlarge',
|
|
59
|
+
'4xl': 'xlarge',
|
|
60
|
+
'starter-1x': 'standard',
|
|
61
|
+
'standard-1x': 'large',
|
|
62
|
+
'standard-2x': 'large',
|
|
63
|
+
'performance-m': 'xlarge',
|
|
64
|
+
'performance-l': 'xlarge',
|
|
65
|
+
'performance-xl': 'xlarge',
|
|
66
|
+
};
|
|
67
|
+
export function isMachineSize(value) {
|
|
68
|
+
return typeof value === 'string' && MACHINE_SIZES.includes(value);
|
|
69
|
+
}
|
|
70
|
+
export function parseMachineSize(value) {
|
|
71
|
+
return isMachineSize(value) ? value : null;
|
|
72
|
+
}
|
|
73
|
+
export function toPublicMachineSize(value) {
|
|
74
|
+
if (isMachineSize(value))
|
|
75
|
+
return value;
|
|
76
|
+
if (typeof value !== 'string')
|
|
77
|
+
return null;
|
|
78
|
+
return LEGACY_PUBLIC_MACHINE_SIZE_ALIASES[value] ?? null;
|
|
79
|
+
}
|
|
80
|
+
export function resolveMachineConfig(machine) {
|
|
81
|
+
return { ...MACHINE_CONFIGS[machine] };
|
|
82
|
+
}
|
|
83
|
+
export function resolveMachineResources(machine) {
|
|
84
|
+
const resources = MACHINE_RESOURCE_REQUIREMENTS[machine];
|
|
85
|
+
const resolved = {};
|
|
86
|
+
if (resources.requests)
|
|
87
|
+
resolved.requests = { ...resources.requests };
|
|
88
|
+
if (resources.limits)
|
|
89
|
+
resolved.limits = { ...resources.limits };
|
|
90
|
+
return resolved;
|
|
91
|
+
}
|
|
92
|
+
export function resolveMachineMaxInstances(machine) {
|
|
93
|
+
return MACHINE_MAX_INSTANCES[machine];
|
|
94
|
+
}
|
|
95
|
+
export function resolveMachineTierResources(machine) {
|
|
96
|
+
const resources = MACHINE_RESOURCE_REQUIREMENTS[machine];
|
|
97
|
+
return {
|
|
98
|
+
cpuCores: parseCpuCores(resources.limits?.cpu ?? resources.requests?.cpu),
|
|
99
|
+
ramGb: parseMemoryGb(resources.limits?.memory ?? resources.requests?.memory),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
function parseCpuCores(quantity) {
|
|
103
|
+
if (!quantity)
|
|
104
|
+
return 0;
|
|
105
|
+
if (quantity.endsWith('m'))
|
|
106
|
+
return Number.parseFloat(quantity) / 1000;
|
|
107
|
+
return Number.parseFloat(quantity);
|
|
108
|
+
}
|
|
109
|
+
function parseMemoryGb(quantity) {
|
|
110
|
+
if (!quantity)
|
|
111
|
+
return 0;
|
|
112
|
+
if (quantity.endsWith('Gi'))
|
|
113
|
+
return Number.parseFloat(quantity);
|
|
114
|
+
if (quantity.endsWith('Mi'))
|
|
115
|
+
return Number.parseFloat(quantity) / 1024;
|
|
116
|
+
if (quantity.endsWith('Ki'))
|
|
117
|
+
return Number.parseFloat(quantity) / (1024 * 1024);
|
|
118
|
+
return Number.parseFloat(quantity) / 1024 ** 3;
|
|
119
|
+
}
|
|
@@ -172,6 +172,9 @@ export declare const adminConfigEndpoints: {
|
|
|
172
172
|
filename: typeof import("effect/Schema").String;
|
|
173
173
|
count: typeof import("effect/Schema").Number;
|
|
174
174
|
}>, undefined>;
|
|
175
|
+
readonly getOAuthProviders: import("../endpoint.js").Endpoint<"GET", "/operator/config/oauth-providers", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
176
|
+
enabledProviders: import("effect/Schema").Array$<typeof import("effect/Schema").String>;
|
|
177
|
+
}>, undefined>;
|
|
175
178
|
readonly notificationsOverview: import("../endpoint.js").Endpoint<"GET", "/operator/config/notifications/overview", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, typeof import("effect/Schema").Unknown, undefined>;
|
|
176
179
|
readonly referralsOverview: import("../endpoint.js").Endpoint<"GET", "/operator/config/referrals/overview", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, typeof import("effect/Schema").Unknown, undefined>;
|
|
177
180
|
readonly flagsOverview: import("../endpoint.js").Endpoint<"GET", "/operator/config/flags/overview", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, typeof import("effect/Schema").Unknown, undefined>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin-config.d.ts","sourceRoot":"","sources":["../../src/endpoints/admin-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"admin-config.d.ts","sourceRoot":"","sources":["../../src/endpoints/admin-config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAmBH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2GvB,CAAA"}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Production mount: `/admin/config/*`.
|
|
6
6
|
*/
|
|
7
7
|
import { defineEndpoint } from '../endpoint.js';
|
|
8
|
-
import { AdminConfigProjectParams, AdminExportUsersResult, AdminGetConsentConfigResult, AdminGetPushCredentialsResult, AdminGetReferralConfigResult, AdminOverviewResult, AdminUpdateConsentConfigInput, AdminUpdateConsentConfigResult, AdminUpdatePushCredentialsInput, AdminUpdatePushCredentialsResult, AdminUpdateReferralConfigInput, AdminUpdateReferralConfigResult, } from '../schemas/admin-config.js';
|
|
8
|
+
import { AdminConfigProjectParams, AdminExportUsersResult, AdminGetConsentConfigResult, AdminGetPushCredentialsResult, AdminGetReferralConfigResult, AdminOAuthProvidersResult, AdminOverviewResult, AdminUpdateConsentConfigInput, AdminUpdateConsentConfigResult, AdminUpdatePushCredentialsInput, AdminUpdatePushCredentialsResult, AdminUpdateReferralConfigInput, AdminUpdateReferralConfigResult, } from '../schemas/admin-config.js';
|
|
9
9
|
export const adminConfigEndpoints = {
|
|
10
10
|
getReferralConfig: defineEndpoint({
|
|
11
11
|
method: 'GET',
|
|
@@ -73,6 +73,14 @@ export const adminConfigEndpoints = {
|
|
|
73
73
|
summary: 'Export app users as CSV',
|
|
74
74
|
tags: ['admin-config'],
|
|
75
75
|
}),
|
|
76
|
+
getOAuthProviders: defineEndpoint({
|
|
77
|
+
method: 'GET',
|
|
78
|
+
path: '/operator/config/oauth-providers',
|
|
79
|
+
response: AdminOAuthProvidersResult,
|
|
80
|
+
plane: 'management',
|
|
81
|
+
summary: 'List platform OAuth providers configured by environment',
|
|
82
|
+
tags: ['admin-config'],
|
|
83
|
+
}),
|
|
76
84
|
notificationsOverview: defineEndpoint({
|
|
77
85
|
method: 'GET',
|
|
78
86
|
path: '/operator/config/notifications/overview',
|
|
@@ -9,22 +9,151 @@
|
|
|
9
9
|
export declare const aiAdminEndpoints: {
|
|
10
10
|
readonly getOverview: import("../endpoint.js").Endpoint<"GET", "/ai/overview", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
11
11
|
period: import("effect/Schema").optional<import("effect/Schema").Literal<["day", "week", "month"]>>;
|
|
12
|
-
}>, import("effect/Schema").Schema.AnyNoContext | undefined,
|
|
12
|
+
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
13
|
+
period: import("effect/Schema").Literal<["day", "week", "month"]>;
|
|
14
|
+
totals: import("effect/Schema").Struct<{
|
|
15
|
+
requests: typeof import("effect/Schema").Number;
|
|
16
|
+
tokens: typeof import("effect/Schema").Number;
|
|
17
|
+
cost: import("effect/Schema").Struct<{
|
|
18
|
+
microdollars: typeof import("effect/Schema").Number;
|
|
19
|
+
formatted: typeof import("effect/Schema").String;
|
|
20
|
+
}>;
|
|
21
|
+
avgLatencyMs: typeof import("effect/Schema").Number;
|
|
22
|
+
successRate: typeof import("effect/Schema").Number;
|
|
23
|
+
}>;
|
|
24
|
+
byProject: import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
25
|
+
projectId: typeof import("effect/Schema").String;
|
|
26
|
+
projectName: typeof import("effect/Schema").String;
|
|
27
|
+
requests: typeof import("effect/Schema").Number;
|
|
28
|
+
inputTokens: typeof import("effect/Schema").Number;
|
|
29
|
+
outputTokens: typeof import("effect/Schema").Number;
|
|
30
|
+
cost: import("effect/Schema").Struct<{
|
|
31
|
+
microdollars: typeof import("effect/Schema").Number;
|
|
32
|
+
formatted: typeof import("effect/Schema").String;
|
|
33
|
+
}>;
|
|
34
|
+
successRate: typeof import("effect/Schema").Number;
|
|
35
|
+
}>>;
|
|
36
|
+
byModel: import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
37
|
+
model: typeof import("effect/Schema").String;
|
|
38
|
+
requests: typeof import("effect/Schema").Number;
|
|
39
|
+
tokens: typeof import("effect/Schema").Number;
|
|
40
|
+
cost: import("effect/Schema").Struct<{
|
|
41
|
+
microdollars: typeof import("effect/Schema").Number;
|
|
42
|
+
formatted: typeof import("effect/Schema").String;
|
|
43
|
+
}>;
|
|
44
|
+
}>>;
|
|
45
|
+
byProvider: import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
46
|
+
provider: typeof import("effect/Schema").String;
|
|
47
|
+
requests: typeof import("effect/Schema").Number;
|
|
48
|
+
tokens: typeof import("effect/Schema").Number;
|
|
49
|
+
cost: import("effect/Schema").Struct<{
|
|
50
|
+
microdollars: typeof import("effect/Schema").Number;
|
|
51
|
+
formatted: typeof import("effect/Schema").String;
|
|
52
|
+
}>;
|
|
53
|
+
}>>;
|
|
54
|
+
}>, undefined>;
|
|
13
55
|
readonly getProjectUsage: import("../endpoint.js").Endpoint<"GET", "/ai/projects/:projectId/usage", import("effect/Schema").Struct<{
|
|
14
56
|
projectId: typeof import("effect/Schema").String;
|
|
15
57
|
}>, import("effect/Schema").Struct<{
|
|
16
58
|
period: import("effect/Schema").optional<import("effect/Schema").Literal<["day", "week", "month"]>>;
|
|
17
|
-
}>, import("effect/Schema").Schema.AnyNoContext | undefined,
|
|
59
|
+
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
60
|
+
app: import("effect/Schema").Struct<{
|
|
61
|
+
id: typeof import("effect/Schema").String;
|
|
62
|
+
name: typeof import("effect/Schema").String;
|
|
63
|
+
slug: typeof import("effect/Schema").String;
|
|
64
|
+
}>;
|
|
65
|
+
period: import("effect/Schema").Literal<["day", "week", "month"]>;
|
|
66
|
+
stats: import("effect/Schema").Struct<{
|
|
67
|
+
requests: typeof import("effect/Schema").Number;
|
|
68
|
+
inputTokens: typeof import("effect/Schema").Number;
|
|
69
|
+
outputTokens: typeof import("effect/Schema").Number;
|
|
70
|
+
cost: import("effect/Schema").Struct<{
|
|
71
|
+
microdollars: typeof import("effect/Schema").Number;
|
|
72
|
+
formatted: typeof import("effect/Schema").String;
|
|
73
|
+
}>;
|
|
74
|
+
latency: import("effect/Schema").Struct<{
|
|
75
|
+
avgMs: typeof import("effect/Schema").Number;
|
|
76
|
+
p95Ms: typeof import("effect/Schema").Number;
|
|
77
|
+
}>;
|
|
78
|
+
successRate: typeof import("effect/Schema").Number;
|
|
79
|
+
}>;
|
|
80
|
+
byModel: import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
81
|
+
model: typeof import("effect/Schema").String;
|
|
82
|
+
requests: typeof import("effect/Schema").Number;
|
|
83
|
+
tokens: typeof import("effect/Schema").Number;
|
|
84
|
+
cost: import("effect/Schema").Struct<{
|
|
85
|
+
microdollars: typeof import("effect/Schema").Number;
|
|
86
|
+
formatted: typeof import("effect/Schema").String;
|
|
87
|
+
}>;
|
|
88
|
+
}>>;
|
|
89
|
+
byType: import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
90
|
+
type: typeof import("effect/Schema").String;
|
|
91
|
+
requests: typeof import("effect/Schema").Number;
|
|
92
|
+
tokens: typeof import("effect/Schema").Number;
|
|
93
|
+
}>>;
|
|
94
|
+
recentErrors: import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
95
|
+
id: typeof import("effect/Schema").String;
|
|
96
|
+
model: typeof import("effect/Schema").String;
|
|
97
|
+
type: typeof import("effect/Schema").String;
|
|
98
|
+
error: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
|
|
99
|
+
code: import("effect/Schema").NullOr<typeof import("effect/Schema").String>;
|
|
100
|
+
timestamp: typeof import("effect/Schema").String;
|
|
101
|
+
}>>;
|
|
102
|
+
}>, undefined>;
|
|
18
103
|
readonly getCostTrends: import("../endpoint.js").Endpoint<"GET", "/ai/trends", import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
19
104
|
period: import("effect/Schema").optional<import("effect/Schema").Literal<["day", "week", "month"]>>;
|
|
20
105
|
interval: import("effect/Schema").optional<import("effect/Schema").Literal<["hour", "day"]>>;
|
|
21
106
|
projectId: import("effect/Schema").optional<typeof import("effect/Schema").String>;
|
|
22
|
-
}>, import("effect/Schema").Schema.AnyNoContext | undefined,
|
|
107
|
+
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
108
|
+
period: import("effect/Schema").Literal<["day", "week", "month"]>;
|
|
109
|
+
interval: import("effect/Schema").Literal<["hour", "day"]>;
|
|
110
|
+
data: import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
111
|
+
timestamp: typeof import("effect/Schema").String;
|
|
112
|
+
requests: typeof import("effect/Schema").Number;
|
|
113
|
+
tokens: typeof import("effect/Schema").Number;
|
|
114
|
+
cost: import("effect/Schema").Struct<{
|
|
115
|
+
microdollars: typeof import("effect/Schema").Number;
|
|
116
|
+
formatted: typeof import("effect/Schema").String;
|
|
117
|
+
}>;
|
|
118
|
+
avgLatencyMs: typeof import("effect/Schema").Number;
|
|
119
|
+
}>>;
|
|
120
|
+
}>, undefined>;
|
|
23
121
|
readonly getProjectConfig: import("../endpoint.js").Endpoint<"GET", "/ai/projects/:projectId/config", import("effect/Schema").Struct<{
|
|
24
122
|
projectId: typeof import("effect/Schema").String;
|
|
25
|
-
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined,
|
|
123
|
+
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
124
|
+
app: import("effect/Schema").Struct<{
|
|
125
|
+
id: typeof import("effect/Schema").String;
|
|
126
|
+
name: typeof import("effect/Schema").String;
|
|
127
|
+
slug: typeof import("effect/Schema").String;
|
|
128
|
+
}>;
|
|
129
|
+
config: import("effect/Schema").Struct<{
|
|
130
|
+
defaultMaxTokens: typeof import("effect/Schema").Number;
|
|
131
|
+
defaultTemperature: typeof import("effect/Schema").Number;
|
|
132
|
+
enableCaching: typeof import("effect/Schema").Boolean;
|
|
133
|
+
allowedModels: import("effect/Schema").NullOr<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
|
|
134
|
+
blockedModels: import("effect/Schema").NullOr<import("effect/Schema").Array$<typeof import("effect/Schema").String>>;
|
|
135
|
+
}>;
|
|
136
|
+
rateLimits: import("effect/Schema").Array$<import("effect/Schema").Struct<{
|
|
137
|
+
id: typeof import("effect/Schema").String;
|
|
138
|
+
modelPattern: typeof import("effect/Schema").String;
|
|
139
|
+
requestsPerMinute: import("effect/Schema").NullOr<typeof import("effect/Schema").Number>;
|
|
140
|
+
requestsPerDay: import("effect/Schema").NullOr<typeof import("effect/Schema").Number>;
|
|
141
|
+
tokensPerMinute: import("effect/Schema").NullOr<typeof import("effect/Schema").Number>;
|
|
142
|
+
tokensPerDay: import("effect/Schema").NullOr<typeof import("effect/Schema").Number>;
|
|
143
|
+
costPerDayMicrodollars: import("effect/Schema").NullOr<typeof import("effect/Schema").Number>;
|
|
144
|
+
isActive: typeof import("effect/Schema").Boolean;
|
|
145
|
+
}>>;
|
|
146
|
+
}>, undefined>;
|
|
26
147
|
readonly updateProjectConfig: import("../endpoint.js").Endpoint<"PATCH", "/ai/projects/:projectId/config", import("effect/Schema").Struct<{
|
|
27
148
|
projectId: typeof import("effect/Schema").String;
|
|
28
|
-
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").
|
|
149
|
+
}>, import("effect/Schema").Schema.AnyNoContext | undefined, import("effect/Schema").Struct<{
|
|
150
|
+
defaultMaxTokens: import("effect/Schema").optional<typeof import("effect/Schema").Number>;
|
|
151
|
+
defaultTemperature: import("effect/Schema").optional<typeof import("effect/Schema").Number>;
|
|
152
|
+
enableCaching: import("effect/Schema").optional<typeof import("effect/Schema").Boolean>;
|
|
153
|
+
allowedModels: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").Array$<typeof import("effect/Schema").String>>>;
|
|
154
|
+
blockedModels: import("effect/Schema").optional<import("effect/Schema").NullOr<import("effect/Schema").Array$<typeof import("effect/Schema").String>>>;
|
|
155
|
+
}>, import("effect/Schema").Struct<{
|
|
156
|
+
success: typeof import("effect/Schema").Boolean;
|
|
157
|
+
}>, undefined>;
|
|
29
158
|
};
|
|
30
159
|
//# sourceMappingURL=ai-admin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-admin.d.ts","sourceRoot":"","sources":["../../src/endpoints/ai-admin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgBH,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"ai-admin.d.ts","sourceRoot":"","sources":["../../src/endpoints/ai-admin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAgBH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDnB,CAAA"}
|