@hasna/instructions 0.4.20 → 0.4.21
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/cli/index.js +275 -93
- package/dist/cli/profile-reads.test.d.ts +2 -0
- package/dist/cli/profile-reads.test.d.ts.map +1 -0
- package/dist/data/config-store.d.ts +10 -1
- package/dist/data/config-store.d.ts.map +1 -1
- package/dist/db/profiles.d.ts +4 -1
- package/dist/db/profiles.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +217 -26
- package/dist/lib/bounded-read.d.ts +7 -0
- package/dist/lib/bounded-read.d.ts.map +1 -0
- package/dist/mcp/index.js +299 -126
- package/dist/server/index.js +246 -36
- package/dist/server/openapi.d.ts +246 -20
- package/dist/server/openapi.d.ts.map +1 -1
- package/dist/server/profile-contract.test.d.ts +2 -0
- package/dist/server/profile-contract.test.d.ts.map +1 -0
- package/dist/server/v1.d.ts.map +1 -1
- package/dist/storage/cloud-store.d.ts +8 -1
- package/dist/storage/cloud-store.d.ts.map +1 -1
- package/dist/types/index.d.ts +24 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -2331,6 +2331,54 @@ async function closeCloud() {
|
|
|
2331
2331
|
|
|
2332
2332
|
// src/storage/cloud-store.ts
|
|
2333
2333
|
import { randomUUID } from "crypto";
|
|
2334
|
+
|
|
2335
|
+
// src/lib/compact-output.ts
|
|
2336
|
+
var DEFAULT_LIST_LIMIT = 20;
|
|
2337
|
+
var MAX_LIST_LIMIT = 100;
|
|
2338
|
+
function parseLimit(value, fallback = DEFAULT_LIST_LIMIT, max = MAX_LIST_LIMIT) {
|
|
2339
|
+
const parsed = typeof value === "number" ? value : Number.parseInt(String(value ?? ""), 10);
|
|
2340
|
+
if (!Number.isFinite(parsed) || parsed <= 0)
|
|
2341
|
+
return fallback;
|
|
2342
|
+
return Math.min(Math.floor(parsed), max);
|
|
2343
|
+
}
|
|
2344
|
+
function parseCursor(value) {
|
|
2345
|
+
const parsed = typeof value === "number" ? value : Number.parseInt(String(value ?? ""), 10);
|
|
2346
|
+
if (!Number.isFinite(parsed) || parsed < 0)
|
|
2347
|
+
return 0;
|
|
2348
|
+
return Math.floor(parsed);
|
|
2349
|
+
}
|
|
2350
|
+
|
|
2351
|
+
// src/lib/bounded-read.ts
|
|
2352
|
+
function normalizeBoundedReadOptions(options = {}) {
|
|
2353
|
+
return {
|
|
2354
|
+
limit: parseLimit(options.limit, DEFAULT_LIST_LIMIT, MAX_LIST_LIMIT),
|
|
2355
|
+
cursor: parseCursor(options.cursor)
|
|
2356
|
+
};
|
|
2357
|
+
}
|
|
2358
|
+
function boundedReadPage(items, total, options = {}) {
|
|
2359
|
+
const { limit, cursor } = normalizeBoundedReadOptions(options);
|
|
2360
|
+
if (items.length > limit) {
|
|
2361
|
+
throw new Error(`bounded read returned ${items.length} rows for limit ${limit}`);
|
|
2362
|
+
}
|
|
2363
|
+
const consumed = cursor + items.length;
|
|
2364
|
+
const complete = consumed >= total;
|
|
2365
|
+
if (!complete && items.length === 0) {
|
|
2366
|
+
throw new Error(`bounded read did not advance at cursor ${cursor} of ${total}`);
|
|
2367
|
+
}
|
|
2368
|
+
return {
|
|
2369
|
+
items,
|
|
2370
|
+
total,
|
|
2371
|
+
limit,
|
|
2372
|
+
cursor,
|
|
2373
|
+
next_cursor: complete ? null : consumed,
|
|
2374
|
+
has_more: !complete,
|
|
2375
|
+
complete,
|
|
2376
|
+
truncated: false,
|
|
2377
|
+
source_bounded: true
|
|
2378
|
+
};
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
// src/storage/cloud-store.ts
|
|
2334
2382
|
function slugify(name) {
|
|
2335
2383
|
return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
2336
2384
|
}
|
|
@@ -2560,8 +2608,21 @@ function rowToProfile(row) {
|
|
|
2560
2608
|
};
|
|
2561
2609
|
}
|
|
2562
2610
|
async function listProfiles(client) {
|
|
2563
|
-
const
|
|
2564
|
-
|
|
2611
|
+
const profiles = [];
|
|
2612
|
+
let cursor = 0;
|
|
2613
|
+
while (true) {
|
|
2614
|
+
const page = await listProfilesPage(client, { limit: 100, cursor });
|
|
2615
|
+
profiles.push(...page.items);
|
|
2616
|
+
if (page.complete)
|
|
2617
|
+
return profiles;
|
|
2618
|
+
cursor = page.next_cursor;
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
async function listProfilesPage(client, options = {}) {
|
|
2622
|
+
const normalized = normalizeBoundedReadOptions(options);
|
|
2623
|
+
const count = await client.get("SELECT COUNT(*) AS total FROM profiles");
|
|
2624
|
+
const rows = await client.many("SELECT * FROM profiles ORDER BY name LIMIT $1 OFFSET $2", [normalized.limit, normalized.cursor]);
|
|
2625
|
+
return boundedReadPage(rows.map(rowToProfile), Number(count?.total ?? 0), normalized);
|
|
2565
2626
|
}
|
|
2566
2627
|
async function getProfile(client, idOrSlug) {
|
|
2567
2628
|
const row = await client.get("SELECT * FROM profiles WHERE id = $1 OR slug = $1", [idOrSlug]);
|
|
@@ -2570,12 +2631,26 @@ async function getProfile(client, idOrSlug) {
|
|
|
2570
2631
|
return rowToProfile(row);
|
|
2571
2632
|
}
|
|
2572
2633
|
async function getProfileConfigs(client, idOrSlug) {
|
|
2634
|
+
const configs = [];
|
|
2635
|
+
let cursor = 0;
|
|
2636
|
+
while (true) {
|
|
2637
|
+
const page = await getProfileConfigsPage(client, idOrSlug, { limit: 100, cursor });
|
|
2638
|
+
configs.push(...page.items);
|
|
2639
|
+
if (page.complete)
|
|
2640
|
+
return configs;
|
|
2641
|
+
cursor = page.next_cursor;
|
|
2642
|
+
}
|
|
2643
|
+
}
|
|
2644
|
+
async function getProfileConfigsPage(client, idOrSlug, options = {}) {
|
|
2573
2645
|
const profile = await getProfile(client, idOrSlug);
|
|
2646
|
+
const normalized = normalizeBoundedReadOptions(options);
|
|
2647
|
+
const count = await client.get("SELECT COUNT(*) AS total FROM profile_configs WHERE profile_id = $1", [profile.id]);
|
|
2574
2648
|
const rows = await client.many(`SELECT c.* FROM configs c
|
|
2575
2649
|
JOIN profile_configs pc ON pc.config_id = c.id
|
|
2576
2650
|
WHERE pc.profile_id = $1
|
|
2577
|
-
ORDER BY pc.sort_order
|
|
2578
|
-
|
|
2651
|
+
ORDER BY pc.sort_order
|
|
2652
|
+
LIMIT $2 OFFSET $3`, [profile.id, normalized.limit, normalized.cursor]);
|
|
2653
|
+
return boundedReadPage(rows.map(rowToConfig), Number(count?.total ?? 0), normalized);
|
|
2579
2654
|
}
|
|
2580
2655
|
async function createProfile(client, input) {
|
|
2581
2656
|
if (!input.name || !input.name.trim())
|
|
@@ -2638,22 +2713,46 @@ async function removeConfigFromProfile(client, profileIdOrSlug, configId) {
|
|
|
2638
2713
|
function profileHasSelectors(selectors) {
|
|
2639
2714
|
return (selectors.os?.length ?? 0) > 0 || (selectors.arch?.length ?? 0) > 0 || (selectors.hostnames?.length ?? 0) > 0;
|
|
2640
2715
|
}
|
|
2641
|
-
async function
|
|
2642
|
-
const
|
|
2716
|
+
async function resolveProfileForMachineRead(client, machine, options = {}) {
|
|
2717
|
+
const { limit } = normalizeBoundedReadOptions(options);
|
|
2643
2718
|
const host = (machine.hostname ?? "").trim().toLowerCase();
|
|
2644
2719
|
const os = (machine.os ?? "").trim().toLowerCase();
|
|
2645
2720
|
const arch = (machine.arch ?? "").trim().toLowerCase();
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2721
|
+
let cursor = 0;
|
|
2722
|
+
let scanned = 0;
|
|
2723
|
+
let total = 0;
|
|
2724
|
+
let selected = null;
|
|
2725
|
+
while (true) {
|
|
2726
|
+
const page = await listProfilesPage(client, { limit, cursor });
|
|
2727
|
+
total = page.total;
|
|
2728
|
+
scanned += page.items.length;
|
|
2729
|
+
for (const p of page.items) {
|
|
2730
|
+
if (!profileHasSelectors(p.selectors))
|
|
2731
|
+
continue;
|
|
2732
|
+
const s = p.selectors;
|
|
2733
|
+
const osOk = !s.os?.length || s.os.some((c) => c.trim().toLowerCase() === os);
|
|
2734
|
+
const archOk = !s.arch?.length || s.arch.some((c) => c.trim().toLowerCase() === arch);
|
|
2735
|
+
const hostOk = !s.hostnames?.length || s.hostnames.some((c) => c.trim().toLowerCase() === host);
|
|
2736
|
+
if (!osOk || !archOk || !hostOk)
|
|
2737
|
+
continue;
|
|
2738
|
+
const score = (p.selectors.hostnames?.length ? 100 : 0) + (p.selectors.os?.length ? 10 : 0) + (p.selectors.arch?.length ? 10 : 0);
|
|
2739
|
+
if (!selected || score > selected.score || score === selected.score && p.name.localeCompare(selected.profile.name) < 0) {
|
|
2740
|
+
selected = { profile: p, score };
|
|
2741
|
+
}
|
|
2742
|
+
}
|
|
2743
|
+
if (page.complete)
|
|
2744
|
+
break;
|
|
2745
|
+
cursor = page.next_cursor;
|
|
2746
|
+
}
|
|
2747
|
+
return {
|
|
2748
|
+
profile: selected?.profile ?? null,
|
|
2749
|
+
scanned,
|
|
2750
|
+
total,
|
|
2751
|
+
batch_limit: limit,
|
|
2752
|
+
source_bounded: true,
|
|
2753
|
+
complete: true,
|
|
2754
|
+
truncated: false
|
|
2755
|
+
};
|
|
2657
2756
|
}
|
|
2658
2757
|
function rowToMachine(row) {
|
|
2659
2758
|
return {
|
|
@@ -2698,6 +2797,19 @@ function json(body, status = 200) {
|
|
|
2698
2797
|
function errorResponse(status, message, extra) {
|
|
2699
2798
|
return json({ error: message, ...extra ?? {} }, status);
|
|
2700
2799
|
}
|
|
2800
|
+
function completeLegacyPage(items) {
|
|
2801
|
+
return {
|
|
2802
|
+
items,
|
|
2803
|
+
total: items.length,
|
|
2804
|
+
limit: Math.max(items.length, 1),
|
|
2805
|
+
cursor: 0,
|
|
2806
|
+
next_cursor: null,
|
|
2807
|
+
has_more: false,
|
|
2808
|
+
complete: true,
|
|
2809
|
+
truncated: false,
|
|
2810
|
+
source_bounded: false
|
|
2811
|
+
};
|
|
2812
|
+
}
|
|
2701
2813
|
async function readJson(req) {
|
|
2702
2814
|
try {
|
|
2703
2815
|
const text = await req.text();
|
|
@@ -2799,8 +2911,15 @@ async function handleV1Request(req, url) {
|
|
|
2799
2911
|
if (resource === "profiles") {
|
|
2800
2912
|
if (!id) {
|
|
2801
2913
|
if (method === "GET") {
|
|
2802
|
-
|
|
2803
|
-
|
|
2914
|
+
if (!url.searchParams.has("limit") && !url.searchParams.has("cursor")) {
|
|
2915
|
+
const profiles = await listProfiles(client);
|
|
2916
|
+
return json({ ...completeLegacyPage(profiles), profiles, count: profiles.length });
|
|
2917
|
+
}
|
|
2918
|
+
const page = await listProfilesPage(client, {
|
|
2919
|
+
limit: url.searchParams.get("limit") ?? undefined,
|
|
2920
|
+
cursor: url.searchParams.get("cursor") ?? undefined
|
|
2921
|
+
});
|
|
2922
|
+
return json({ ...page, profiles: page.items, count: page.items.length });
|
|
2804
2923
|
}
|
|
2805
2924
|
if (method === "POST") {
|
|
2806
2925
|
const body = await readJson(req);
|
|
@@ -2818,14 +2937,12 @@ async function handleV1Request(req, url) {
|
|
|
2818
2937
|
if (id === "resolve") {
|
|
2819
2938
|
if (method !== "GET")
|
|
2820
2939
|
return errorResponse(405, `method ${method} not allowed on /v1/profiles/resolve`);
|
|
2821
|
-
const
|
|
2940
|
+
const resolution = await resolveProfileForMachineRead(client, {
|
|
2822
2941
|
hostname: url.searchParams.get("hostname") ?? undefined,
|
|
2823
2942
|
os: url.searchParams.get("os") ?? undefined,
|
|
2824
2943
|
arch: url.searchParams.get("arch") ?? undefined
|
|
2825
|
-
});
|
|
2826
|
-
|
|
2827
|
-
return errorResponse(404, "no matching machine-aware profile");
|
|
2828
|
-
return json({ profile });
|
|
2944
|
+
}, { limit: url.searchParams.get("limit") ?? undefined });
|
|
2945
|
+
return json(resolution);
|
|
2829
2946
|
}
|
|
2830
2947
|
if (action === "configs") {
|
|
2831
2948
|
const configId = segments[4] ? decodeURIComponent(segments[4]) : undefined;
|
|
@@ -2846,8 +2963,18 @@ async function handleV1Request(req, url) {
|
|
|
2846
2963
|
return errorResponse(404, `unknown profile action: ${action}`);
|
|
2847
2964
|
if (method === "GET") {
|
|
2848
2965
|
const profile = await getProfile(client, id);
|
|
2849
|
-
|
|
2850
|
-
|
|
2966
|
+
if (!url.searchParams.has("limit") && !url.searchParams.has("cursor")) {
|
|
2967
|
+
const legacyConfigs = await getProfileConfigs(client, id);
|
|
2968
|
+
return json({
|
|
2969
|
+
profile: { ...profile, configs: legacyConfigs },
|
|
2970
|
+
configs: completeLegacyPage(legacyConfigs)
|
|
2971
|
+
});
|
|
2972
|
+
}
|
|
2973
|
+
const configs = await getProfileConfigsPage(client, id, {
|
|
2974
|
+
limit: url.searchParams.get("limit") ?? undefined,
|
|
2975
|
+
cursor: url.searchParams.get("cursor") ?? undefined
|
|
2976
|
+
});
|
|
2977
|
+
return json({ profile: { ...profile, configs: configs.items }, configs });
|
|
2851
2978
|
}
|
|
2852
2979
|
if (method === "PATCH" || method === "PUT") {
|
|
2853
2980
|
const body = await readJson(req);
|
|
@@ -3013,6 +3140,66 @@ function buildV1OpenApiDocument(version = getPackageVersion()) {
|
|
|
3013
3140
|
selectors: { type: "object" },
|
|
3014
3141
|
variables: { type: "object" }
|
|
3015
3142
|
}
|
|
3143
|
+
},
|
|
3144
|
+
ProfileWithConfigs: {
|
|
3145
|
+
type: "object",
|
|
3146
|
+
properties: {
|
|
3147
|
+
...profileSchema.properties,
|
|
3148
|
+
configs: { type: "array", items: { $ref: "#/components/schemas/Config" } }
|
|
3149
|
+
}
|
|
3150
|
+
},
|
|
3151
|
+
BoundedProfilePage: {
|
|
3152
|
+
type: "object",
|
|
3153
|
+
required: ["items", "total", "limit", "cursor", "next_cursor", "has_more", "complete", "truncated", "source_bounded"],
|
|
3154
|
+
properties: {
|
|
3155
|
+
profiles: { type: "array", items: { $ref: "#/components/schemas/Profile" } },
|
|
3156
|
+
items: { type: "array", items: { $ref: "#/components/schemas/Profile" } },
|
|
3157
|
+
count: { type: "number" },
|
|
3158
|
+
total: { type: "number" },
|
|
3159
|
+
limit: { type: "number" },
|
|
3160
|
+
cursor: { type: "number" },
|
|
3161
|
+
next_cursor: { type: "number", nullable: true },
|
|
3162
|
+
has_more: { type: "boolean" },
|
|
3163
|
+
complete: { type: "boolean" },
|
|
3164
|
+
truncated: { type: "boolean", const: false },
|
|
3165
|
+
source_bounded: { type: "boolean" }
|
|
3166
|
+
}
|
|
3167
|
+
},
|
|
3168
|
+
BoundedConfigPage: {
|
|
3169
|
+
type: "object",
|
|
3170
|
+
required: ["items", "total", "limit", "cursor", "next_cursor", "has_more", "complete", "truncated", "source_bounded"],
|
|
3171
|
+
properties: {
|
|
3172
|
+
items: { type: "array", items: { $ref: "#/components/schemas/Config" } },
|
|
3173
|
+
total: { type: "number" },
|
|
3174
|
+
limit: { type: "number" },
|
|
3175
|
+
cursor: { type: "number" },
|
|
3176
|
+
next_cursor: { type: "number", nullable: true },
|
|
3177
|
+
has_more: { type: "boolean" },
|
|
3178
|
+
complete: { type: "boolean" },
|
|
3179
|
+
truncated: { type: "boolean", const: false },
|
|
3180
|
+
source_bounded: { type: "boolean" }
|
|
3181
|
+
}
|
|
3182
|
+
},
|
|
3183
|
+
ProfileShowResponse: {
|
|
3184
|
+
type: "object",
|
|
3185
|
+
required: ["profile", "configs"],
|
|
3186
|
+
properties: {
|
|
3187
|
+
profile: { $ref: "#/components/schemas/ProfileWithConfigs" },
|
|
3188
|
+
configs: { $ref: "#/components/schemas/BoundedConfigPage" }
|
|
3189
|
+
}
|
|
3190
|
+
},
|
|
3191
|
+
ProfileResolutionRead: {
|
|
3192
|
+
type: "object",
|
|
3193
|
+
required: ["profile", "scanned", "total", "batch_limit", "source_bounded", "complete", "truncated"],
|
|
3194
|
+
properties: {
|
|
3195
|
+
profile: { oneOf: [{ $ref: "#/components/schemas/Profile" }, { type: "null" }] },
|
|
3196
|
+
scanned: { type: "number", nullable: true },
|
|
3197
|
+
total: { type: "number", nullable: true },
|
|
3198
|
+
batch_limit: { type: "number", nullable: true },
|
|
3199
|
+
source_bounded: { type: "boolean" },
|
|
3200
|
+
complete: { type: "boolean", const: true },
|
|
3201
|
+
truncated: { type: "boolean", const: false }
|
|
3202
|
+
}
|
|
3016
3203
|
}
|
|
3017
3204
|
}
|
|
3018
3205
|
},
|
|
@@ -3127,18 +3314,16 @@ function buildV1OpenApiDocument(version = getPackageVersion()) {
|
|
|
3127
3314
|
"/v1/profiles": {
|
|
3128
3315
|
get: {
|
|
3129
3316
|
operationId: "listProfiles",
|
|
3130
|
-
summary: "List profiles",
|
|
3317
|
+
summary: "List profiles with producer-side bounds",
|
|
3318
|
+
parameters: [
|
|
3319
|
+
{ name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100 } },
|
|
3320
|
+
{ name: "cursor", in: "query", schema: { type: "integer", minimum: 0 } }
|
|
3321
|
+
],
|
|
3131
3322
|
responses: {
|
|
3132
3323
|
"200": {
|
|
3133
3324
|
content: {
|
|
3134
3325
|
"application/json": {
|
|
3135
|
-
schema: {
|
|
3136
|
-
type: "object",
|
|
3137
|
-
properties: {
|
|
3138
|
-
profiles: { type: "array", items: { $ref: "#/components/schemas/Profile" } },
|
|
3139
|
-
count: { type: "number" }
|
|
3140
|
-
}
|
|
3141
|
-
}
|
|
3326
|
+
schema: { $ref: "#/components/schemas/BoundedProfilePage" }
|
|
3142
3327
|
}
|
|
3143
3328
|
}
|
|
3144
3329
|
}
|
|
@@ -3154,12 +3339,37 @@ function buildV1OpenApiDocument(version = getPackageVersion()) {
|
|
|
3154
3339
|
responses: { "201": { content: { "application/json": { schema: { type: "object", properties: { profile: { $ref: "#/components/schemas/Profile" } } } } } } }
|
|
3155
3340
|
}
|
|
3156
3341
|
},
|
|
3342
|
+
"/v1/profiles/resolve": {
|
|
3343
|
+
get: {
|
|
3344
|
+
operationId: "resolveProfile",
|
|
3345
|
+
summary: "Resolve a machine profile by scanning producer-bounded batches",
|
|
3346
|
+
parameters: [
|
|
3347
|
+
{ name: "hostname", in: "query", schema: { type: "string" } },
|
|
3348
|
+
{ name: "os", in: "query", schema: { type: "string" } },
|
|
3349
|
+
{ name: "arch", in: "query", schema: { type: "string" } },
|
|
3350
|
+
{ name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100 } }
|
|
3351
|
+
],
|
|
3352
|
+
responses: {
|
|
3353
|
+
"200": {
|
|
3354
|
+
content: {
|
|
3355
|
+
"application/json": {
|
|
3356
|
+
schema: { $ref: "#/components/schemas/ProfileResolutionRead" }
|
|
3357
|
+
}
|
|
3358
|
+
}
|
|
3359
|
+
}
|
|
3360
|
+
}
|
|
3361
|
+
}
|
|
3362
|
+
},
|
|
3157
3363
|
"/v1/profiles/{id}": {
|
|
3158
3364
|
get: {
|
|
3159
3365
|
operationId: "getProfile",
|
|
3160
3366
|
summary: "Get a profile (with its configs) by id or slug",
|
|
3161
|
-
parameters: [
|
|
3162
|
-
|
|
3367
|
+
parameters: [
|
|
3368
|
+
{ name: "id", in: "path", required: true, schema: { type: "string" } },
|
|
3369
|
+
{ name: "limit", in: "query", schema: { type: "integer", minimum: 1, maximum: 100 } },
|
|
3370
|
+
{ name: "cursor", in: "query", schema: { type: "integer", minimum: 0 } }
|
|
3371
|
+
],
|
|
3372
|
+
responses: { "200": { content: { "application/json": { schema: { $ref: "#/components/schemas/ProfileShowResponse" } } } } }
|
|
3163
3373
|
},
|
|
3164
3374
|
delete: {
|
|
3165
3375
|
operationId: "deleteProfile",
|
package/dist/server/openapi.d.ts
CHANGED
|
@@ -198,6 +198,177 @@ export declare function buildV1OpenApiDocument(version?: string): {
|
|
|
198
198
|
};
|
|
199
199
|
};
|
|
200
200
|
};
|
|
201
|
+
ProfileWithConfigs: {
|
|
202
|
+
type: string;
|
|
203
|
+
properties: {
|
|
204
|
+
configs: {
|
|
205
|
+
type: string;
|
|
206
|
+
items: {
|
|
207
|
+
$ref: string;
|
|
208
|
+
};
|
|
209
|
+
};
|
|
210
|
+
id: {
|
|
211
|
+
readonly type: "string";
|
|
212
|
+
};
|
|
213
|
+
name: {
|
|
214
|
+
readonly type: "string";
|
|
215
|
+
};
|
|
216
|
+
slug: {
|
|
217
|
+
readonly type: "string";
|
|
218
|
+
};
|
|
219
|
+
description: {
|
|
220
|
+
readonly type: "string";
|
|
221
|
+
readonly nullable: true;
|
|
222
|
+
};
|
|
223
|
+
selectors: {
|
|
224
|
+
readonly type: "object";
|
|
225
|
+
};
|
|
226
|
+
variables: {
|
|
227
|
+
readonly type: "object";
|
|
228
|
+
};
|
|
229
|
+
created_at: {
|
|
230
|
+
readonly type: "string";
|
|
231
|
+
};
|
|
232
|
+
updated_at: {
|
|
233
|
+
readonly type: "string";
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
};
|
|
237
|
+
BoundedProfilePage: {
|
|
238
|
+
type: string;
|
|
239
|
+
required: string[];
|
|
240
|
+
properties: {
|
|
241
|
+
profiles: {
|
|
242
|
+
type: string;
|
|
243
|
+
items: {
|
|
244
|
+
$ref: string;
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
items: {
|
|
248
|
+
type: string;
|
|
249
|
+
items: {
|
|
250
|
+
$ref: string;
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
count: {
|
|
254
|
+
type: string;
|
|
255
|
+
};
|
|
256
|
+
total: {
|
|
257
|
+
type: string;
|
|
258
|
+
};
|
|
259
|
+
limit: {
|
|
260
|
+
type: string;
|
|
261
|
+
};
|
|
262
|
+
cursor: {
|
|
263
|
+
type: string;
|
|
264
|
+
};
|
|
265
|
+
next_cursor: {
|
|
266
|
+
type: string;
|
|
267
|
+
nullable: boolean;
|
|
268
|
+
};
|
|
269
|
+
has_more: {
|
|
270
|
+
type: string;
|
|
271
|
+
};
|
|
272
|
+
complete: {
|
|
273
|
+
type: string;
|
|
274
|
+
};
|
|
275
|
+
truncated: {
|
|
276
|
+
type: string;
|
|
277
|
+
const: boolean;
|
|
278
|
+
};
|
|
279
|
+
source_bounded: {
|
|
280
|
+
type: string;
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
BoundedConfigPage: {
|
|
285
|
+
type: string;
|
|
286
|
+
required: string[];
|
|
287
|
+
properties: {
|
|
288
|
+
items: {
|
|
289
|
+
type: string;
|
|
290
|
+
items: {
|
|
291
|
+
$ref: string;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
total: {
|
|
295
|
+
type: string;
|
|
296
|
+
};
|
|
297
|
+
limit: {
|
|
298
|
+
type: string;
|
|
299
|
+
};
|
|
300
|
+
cursor: {
|
|
301
|
+
type: string;
|
|
302
|
+
};
|
|
303
|
+
next_cursor: {
|
|
304
|
+
type: string;
|
|
305
|
+
nullable: boolean;
|
|
306
|
+
};
|
|
307
|
+
has_more: {
|
|
308
|
+
type: string;
|
|
309
|
+
};
|
|
310
|
+
complete: {
|
|
311
|
+
type: string;
|
|
312
|
+
};
|
|
313
|
+
truncated: {
|
|
314
|
+
type: string;
|
|
315
|
+
const: boolean;
|
|
316
|
+
};
|
|
317
|
+
source_bounded: {
|
|
318
|
+
type: string;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
ProfileShowResponse: {
|
|
323
|
+
type: string;
|
|
324
|
+
required: string[];
|
|
325
|
+
properties: {
|
|
326
|
+
profile: {
|
|
327
|
+
$ref: string;
|
|
328
|
+
};
|
|
329
|
+
configs: {
|
|
330
|
+
$ref: string;
|
|
331
|
+
};
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
ProfileResolutionRead: {
|
|
335
|
+
type: string;
|
|
336
|
+
required: string[];
|
|
337
|
+
properties: {
|
|
338
|
+
profile: {
|
|
339
|
+
oneOf: ({
|
|
340
|
+
$ref: string;
|
|
341
|
+
type?: undefined;
|
|
342
|
+
} | {
|
|
343
|
+
type: string;
|
|
344
|
+
$ref?: undefined;
|
|
345
|
+
})[];
|
|
346
|
+
};
|
|
347
|
+
scanned: {
|
|
348
|
+
type: string;
|
|
349
|
+
nullable: boolean;
|
|
350
|
+
};
|
|
351
|
+
total: {
|
|
352
|
+
type: string;
|
|
353
|
+
nullable: boolean;
|
|
354
|
+
};
|
|
355
|
+
batch_limit: {
|
|
356
|
+
type: string;
|
|
357
|
+
nullable: boolean;
|
|
358
|
+
};
|
|
359
|
+
source_bounded: {
|
|
360
|
+
type: string;
|
|
361
|
+
};
|
|
362
|
+
complete: {
|
|
363
|
+
type: string;
|
|
364
|
+
const: boolean;
|
|
365
|
+
};
|
|
366
|
+
truncated: {
|
|
367
|
+
type: string;
|
|
368
|
+
const: boolean;
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
};
|
|
201
372
|
};
|
|
202
373
|
};
|
|
203
374
|
security: {
|
|
@@ -436,23 +607,29 @@ export declare function buildV1OpenApiDocument(version?: string): {
|
|
|
436
607
|
get: {
|
|
437
608
|
operationId: string;
|
|
438
609
|
summary: string;
|
|
610
|
+
parameters: ({
|
|
611
|
+
name: string;
|
|
612
|
+
in: string;
|
|
613
|
+
schema: {
|
|
614
|
+
type: string;
|
|
615
|
+
minimum: number;
|
|
616
|
+
maximum: number;
|
|
617
|
+
};
|
|
618
|
+
} | {
|
|
619
|
+
name: string;
|
|
620
|
+
in: string;
|
|
621
|
+
schema: {
|
|
622
|
+
type: string;
|
|
623
|
+
minimum: number;
|
|
624
|
+
maximum?: undefined;
|
|
625
|
+
};
|
|
626
|
+
})[];
|
|
439
627
|
responses: {
|
|
440
628
|
"200": {
|
|
441
629
|
content: {
|
|
442
630
|
"application/json": {
|
|
443
631
|
schema: {
|
|
444
|
-
|
|
445
|
-
properties: {
|
|
446
|
-
profiles: {
|
|
447
|
-
type: string;
|
|
448
|
-
items: {
|
|
449
|
-
$ref: string;
|
|
450
|
-
};
|
|
451
|
-
};
|
|
452
|
-
count: {
|
|
453
|
-
type: string;
|
|
454
|
-
};
|
|
455
|
-
};
|
|
632
|
+
$ref: string;
|
|
456
633
|
};
|
|
457
634
|
};
|
|
458
635
|
};
|
|
@@ -490,29 +667,78 @@ export declare function buildV1OpenApiDocument(version?: string): {
|
|
|
490
667
|
};
|
|
491
668
|
};
|
|
492
669
|
};
|
|
670
|
+
"/v1/profiles/resolve": {
|
|
671
|
+
get: {
|
|
672
|
+
operationId: string;
|
|
673
|
+
summary: string;
|
|
674
|
+
parameters: ({
|
|
675
|
+
name: string;
|
|
676
|
+
in: string;
|
|
677
|
+
schema: {
|
|
678
|
+
type: string;
|
|
679
|
+
minimum?: undefined;
|
|
680
|
+
maximum?: undefined;
|
|
681
|
+
};
|
|
682
|
+
} | {
|
|
683
|
+
name: string;
|
|
684
|
+
in: string;
|
|
685
|
+
schema: {
|
|
686
|
+
type: string;
|
|
687
|
+
minimum: number;
|
|
688
|
+
maximum: number;
|
|
689
|
+
};
|
|
690
|
+
})[];
|
|
691
|
+
responses: {
|
|
692
|
+
"200": {
|
|
693
|
+
content: {
|
|
694
|
+
"application/json": {
|
|
695
|
+
schema: {
|
|
696
|
+
$ref: string;
|
|
697
|
+
};
|
|
698
|
+
};
|
|
699
|
+
};
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
};
|
|
703
|
+
};
|
|
493
704
|
"/v1/profiles/{id}": {
|
|
494
705
|
get: {
|
|
495
706
|
operationId: string;
|
|
496
707
|
summary: string;
|
|
497
|
-
parameters: {
|
|
708
|
+
parameters: ({
|
|
498
709
|
name: string;
|
|
499
710
|
in: string;
|
|
500
711
|
required: boolean;
|
|
501
712
|
schema: {
|
|
502
713
|
type: string;
|
|
714
|
+
minimum?: undefined;
|
|
715
|
+
maximum?: undefined;
|
|
503
716
|
};
|
|
504
|
-
}
|
|
717
|
+
} | {
|
|
718
|
+
name: string;
|
|
719
|
+
in: string;
|
|
720
|
+
schema: {
|
|
721
|
+
type: string;
|
|
722
|
+
minimum: number;
|
|
723
|
+
maximum: number;
|
|
724
|
+
};
|
|
725
|
+
required?: undefined;
|
|
726
|
+
} | {
|
|
727
|
+
name: string;
|
|
728
|
+
in: string;
|
|
729
|
+
schema: {
|
|
730
|
+
type: string;
|
|
731
|
+
minimum: number;
|
|
732
|
+
maximum?: undefined;
|
|
733
|
+
};
|
|
734
|
+
required?: undefined;
|
|
735
|
+
})[];
|
|
505
736
|
responses: {
|
|
506
737
|
"200": {
|
|
507
738
|
content: {
|
|
508
739
|
"application/json": {
|
|
509
740
|
schema: {
|
|
510
|
-
|
|
511
|
-
properties: {
|
|
512
|
-
profile: {
|
|
513
|
-
$ref: string;
|
|
514
|
-
};
|
|
515
|
-
};
|
|
741
|
+
$ref: string;
|
|
516
742
|
};
|
|
517
743
|
};
|
|
518
744
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/server/openapi.ts"],"names":[],"mappings":"AA4CA,wBAAgB,sBAAsB,CAAC,OAAO,SAAsB
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../src/server/openapi.ts"],"names":[],"mappings":"AA4CA,wBAAgB,sBAAsB,CAAC,OAAO,SAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6SnE"}
|