@apifn/admin 0.1.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/dist/index.d.ts +235 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +265 -0
- package/dist/index.js.map +1 -0
- package/dist/operator-service.d.ts +145 -0
- package/dist/operator-service.d.ts.map +1 -0
- package/dist/operator-service.js +213 -0
- package/dist/operator-service.js.map +1 -0
- package/package.json +48 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { createCapabilityAdminClient, type AdminCapabilityAdapter, type AdminClient, type AdminClientRequestOptions, type AdminOperationDefinition } from "@superfunctions/admin";
|
|
2
|
+
import type { ApiFnCompareSpecInput, ApiFnDiffView, ApiFnEnvironmentRecord, ApiFnOperatorService, ApiFnPageInput, ApiFnRegisterSpecInput, ApiFnSpecView, ApiFnUpsertEnvironmentInput } from "./operator-service.js";
|
|
3
|
+
export * from "./operator-service.js";
|
|
4
|
+
type IdInput = {
|
|
5
|
+
id: string;
|
|
6
|
+
};
|
|
7
|
+
type Page<T> = {
|
|
8
|
+
items: T[];
|
|
9
|
+
nextCursor: string | null;
|
|
10
|
+
};
|
|
11
|
+
type Item<T> = {
|
|
12
|
+
item: T;
|
|
13
|
+
};
|
|
14
|
+
type Accepted = {
|
|
15
|
+
accepted: true;
|
|
16
|
+
};
|
|
17
|
+
type AcceptedItem<T> = Accepted & {
|
|
18
|
+
item: T;
|
|
19
|
+
};
|
|
20
|
+
declare const operations: readonly [AdminOperationDefinition<ApiFnPageInput, Page<ApiFnSpecView>> & {
|
|
21
|
+
readonly id: "apifn.specs.list";
|
|
22
|
+
}, AdminOperationDefinition<IdInput, Item<ApiFnSpecView>> & {
|
|
23
|
+
readonly id: "apifn.specs.get";
|
|
24
|
+
}, AdminOperationDefinition<ApiFnRegisterSpecInput, AcceptedItem<ApiFnSpecView>> & {
|
|
25
|
+
readonly id: "apifn.specs.register";
|
|
26
|
+
}, AdminOperationDefinition<ApiFnCompareSpecInput, Item<ApiFnDiffView>> & {
|
|
27
|
+
readonly id: "apifn.specs.compare";
|
|
28
|
+
}, AdminOperationDefinition<IdInput, Accepted> & {
|
|
29
|
+
readonly id: "apifn.specs.delete";
|
|
30
|
+
}, AdminOperationDefinition<ApiFnPageInput, Page<ApiFnEnvironmentRecord>> & {
|
|
31
|
+
readonly id: "apifn.environments.list";
|
|
32
|
+
}, AdminOperationDefinition<IdInput, Item<ApiFnEnvironmentRecord>> & {
|
|
33
|
+
readonly id: "apifn.environments.get";
|
|
34
|
+
}, AdminOperationDefinition<ApiFnUpsertEnvironmentInput, AcceptedItem<ApiFnEnvironmentRecord>> & {
|
|
35
|
+
readonly id: "apifn.environments.upsert";
|
|
36
|
+
}, AdminOperationDefinition<IdInput, Accepted> & {
|
|
37
|
+
readonly id: "apifn.environments.delete";
|
|
38
|
+
}];
|
|
39
|
+
export declare const apiFnAdminResources: readonly [{
|
|
40
|
+
readonly id: "specs";
|
|
41
|
+
readonly label: "API Specs";
|
|
42
|
+
readonly description: "Validated OpenAPI specifications owned by the active scope.";
|
|
43
|
+
readonly icon: "apifn:specs";
|
|
44
|
+
readonly risk: "standard";
|
|
45
|
+
readonly minimumScope: "project";
|
|
46
|
+
readonly idField: "id";
|
|
47
|
+
readonly displayFields: readonly ["id", "name", "version", "endpointCount", "updatedAt"];
|
|
48
|
+
readonly searchableFields: readonly ["id", "name", "title"];
|
|
49
|
+
readonly filterableFields: readonly ["version"];
|
|
50
|
+
readonly sortableFields: readonly ["name", "updatedAt"];
|
|
51
|
+
readonly sensitiveFields: readonly [];
|
|
52
|
+
}, {
|
|
53
|
+
readonly id: "environments";
|
|
54
|
+
readonly label: "API Environments";
|
|
55
|
+
readonly description: "Non-secret HTTP endpoints used to exercise a scope-owned API.";
|
|
56
|
+
readonly icon: "apifn:environments";
|
|
57
|
+
readonly risk: "standard";
|
|
58
|
+
readonly minimumScope: "project";
|
|
59
|
+
readonly idField: "id";
|
|
60
|
+
readonly displayFields: readonly ["id", "name", "baseUrl", "enabled"];
|
|
61
|
+
readonly searchableFields: readonly ["id", "name", "baseUrl"];
|
|
62
|
+
readonly filterableFields: readonly ["enabled"];
|
|
63
|
+
readonly sortableFields: readonly ["name", "updatedAt"];
|
|
64
|
+
readonly sensitiveFields: readonly [];
|
|
65
|
+
}];
|
|
66
|
+
export type ApiFnAdminOperationId = (typeof operations)[number]["id"];
|
|
67
|
+
export declare const apiFnAdminActions: readonly [AdminOperationDefinition<ApiFnPageInput, Page<ApiFnSpecView>> & {
|
|
68
|
+
readonly id: "apifn.specs.list";
|
|
69
|
+
}, AdminOperationDefinition<IdInput, Item<ApiFnSpecView>> & {
|
|
70
|
+
readonly id: "apifn.specs.get";
|
|
71
|
+
}, AdminOperationDefinition<ApiFnRegisterSpecInput, AcceptedItem<ApiFnSpecView>> & {
|
|
72
|
+
readonly id: "apifn.specs.register";
|
|
73
|
+
}, AdminOperationDefinition<ApiFnCompareSpecInput, Item<ApiFnDiffView>> & {
|
|
74
|
+
readonly id: "apifn.specs.compare";
|
|
75
|
+
}, AdminOperationDefinition<IdInput, Accepted> & {
|
|
76
|
+
readonly id: "apifn.specs.delete";
|
|
77
|
+
}, AdminOperationDefinition<ApiFnPageInput, Page<ApiFnEnvironmentRecord>> & {
|
|
78
|
+
readonly id: "apifn.environments.list";
|
|
79
|
+
}, AdminOperationDefinition<IdInput, Item<ApiFnEnvironmentRecord>> & {
|
|
80
|
+
readonly id: "apifn.environments.get";
|
|
81
|
+
}, AdminOperationDefinition<ApiFnUpsertEnvironmentInput, AcceptedItem<ApiFnEnvironmentRecord>> & {
|
|
82
|
+
readonly id: "apifn.environments.upsert";
|
|
83
|
+
}, AdminOperationDefinition<IdInput, Accepted> & {
|
|
84
|
+
readonly id: "apifn.environments.delete";
|
|
85
|
+
}];
|
|
86
|
+
export declare const apiFnAdminCapability: {
|
|
87
|
+
readonly schemaVersion: "1.0";
|
|
88
|
+
readonly id: "apifn";
|
|
89
|
+
readonly displayName: "ApiFn";
|
|
90
|
+
readonly version: "1.1.0";
|
|
91
|
+
readonly description: "Validated OpenAPI registry and environment operator service.";
|
|
92
|
+
readonly category: "developer-tools";
|
|
93
|
+
readonly availability: "optional-product";
|
|
94
|
+
readonly scopeLevels: readonly ["installation", "workspace", "project", "environment"];
|
|
95
|
+
readonly dependencies: readonly [];
|
|
96
|
+
readonly resources: readonly [{
|
|
97
|
+
readonly id: "specs";
|
|
98
|
+
readonly label: "API Specs";
|
|
99
|
+
readonly description: "Validated OpenAPI specifications owned by the active scope.";
|
|
100
|
+
readonly icon: "apifn:specs";
|
|
101
|
+
readonly risk: "standard";
|
|
102
|
+
readonly minimumScope: "project";
|
|
103
|
+
readonly idField: "id";
|
|
104
|
+
readonly displayFields: readonly ["id", "name", "version", "endpointCount", "updatedAt"];
|
|
105
|
+
readonly searchableFields: readonly ["id", "name", "title"];
|
|
106
|
+
readonly filterableFields: readonly ["version"];
|
|
107
|
+
readonly sortableFields: readonly ["name", "updatedAt"];
|
|
108
|
+
readonly sensitiveFields: readonly [];
|
|
109
|
+
}, {
|
|
110
|
+
readonly id: "environments";
|
|
111
|
+
readonly label: "API Environments";
|
|
112
|
+
readonly description: "Non-secret HTTP endpoints used to exercise a scope-owned API.";
|
|
113
|
+
readonly icon: "apifn:environments";
|
|
114
|
+
readonly risk: "standard";
|
|
115
|
+
readonly minimumScope: "project";
|
|
116
|
+
readonly idField: "id";
|
|
117
|
+
readonly displayFields: readonly ["id", "name", "baseUrl", "enabled"];
|
|
118
|
+
readonly searchableFields: readonly ["id", "name", "baseUrl"];
|
|
119
|
+
readonly filterableFields: readonly ["enabled"];
|
|
120
|
+
readonly sortableFields: readonly ["name", "updatedAt"];
|
|
121
|
+
readonly sensitiveFields: readonly [];
|
|
122
|
+
}];
|
|
123
|
+
readonly navigation: readonly [{
|
|
124
|
+
readonly id: "apifn";
|
|
125
|
+
readonly label: "ApiFn";
|
|
126
|
+
readonly path: "/modules/apifn";
|
|
127
|
+
readonly icon: "apifn";
|
|
128
|
+
readonly description: "Operate API contracts and targets.";
|
|
129
|
+
readonly order: 100;
|
|
130
|
+
}];
|
|
131
|
+
readonly operations: readonly [AdminOperationDefinition<ApiFnPageInput, Page<ApiFnSpecView>> & {
|
|
132
|
+
readonly id: "apifn.specs.list";
|
|
133
|
+
}, AdminOperationDefinition<IdInput, Item<ApiFnSpecView>> & {
|
|
134
|
+
readonly id: "apifn.specs.get";
|
|
135
|
+
}, AdminOperationDefinition<ApiFnRegisterSpecInput, AcceptedItem<ApiFnSpecView>> & {
|
|
136
|
+
readonly id: "apifn.specs.register";
|
|
137
|
+
}, AdminOperationDefinition<ApiFnCompareSpecInput, Item<ApiFnDiffView>> & {
|
|
138
|
+
readonly id: "apifn.specs.compare";
|
|
139
|
+
}, AdminOperationDefinition<IdInput, Accepted> & {
|
|
140
|
+
readonly id: "apifn.specs.delete";
|
|
141
|
+
}, AdminOperationDefinition<ApiFnPageInput, Page<ApiFnEnvironmentRecord>> & {
|
|
142
|
+
readonly id: "apifn.environments.list";
|
|
143
|
+
}, AdminOperationDefinition<IdInput, Item<ApiFnEnvironmentRecord>> & {
|
|
144
|
+
readonly id: "apifn.environments.get";
|
|
145
|
+
}, AdminOperationDefinition<ApiFnUpsertEnvironmentInput, AcceptedItem<ApiFnEnvironmentRecord>> & {
|
|
146
|
+
readonly id: "apifn.environments.upsert";
|
|
147
|
+
}, AdminOperationDefinition<IdInput, Accepted> & {
|
|
148
|
+
readonly id: "apifn.environments.delete";
|
|
149
|
+
}];
|
|
150
|
+
};
|
|
151
|
+
type ApiFnCapabilityClient = ReturnType<typeof createCapabilityAdminClient<typeof apiFnAdminCapability>>;
|
|
152
|
+
export interface ApiFnAdminClient extends ApiFnCapabilityClient {
|
|
153
|
+
readonly specs: {
|
|
154
|
+
list(input?: ApiFnPageInput, options?: AdminClientRequestOptions): ReturnType<ApiFnCapabilityClient["operations"]["apifn.specs.list"]>;
|
|
155
|
+
get(input: IdInput, options?: AdminClientRequestOptions): ReturnType<ApiFnCapabilityClient["operations"]["apifn.specs.get"]>;
|
|
156
|
+
register(input: ApiFnRegisterSpecInput, options?: AdminClientRequestOptions): ReturnType<ApiFnCapabilityClient["operations"]["apifn.specs.register"]>;
|
|
157
|
+
compare(input: ApiFnCompareSpecInput, options?: AdminClientRequestOptions): ReturnType<ApiFnCapabilityClient["operations"]["apifn.specs.compare"]>;
|
|
158
|
+
delete(input: IdInput, options?: AdminClientRequestOptions): ReturnType<ApiFnCapabilityClient["operations"]["apifn.specs.delete"]>;
|
|
159
|
+
};
|
|
160
|
+
readonly environments: {
|
|
161
|
+
list(input?: ApiFnPageInput, options?: AdminClientRequestOptions): ReturnType<ApiFnCapabilityClient["operations"]["apifn.environments.list"]>;
|
|
162
|
+
get(input: IdInput, options?: AdminClientRequestOptions): ReturnType<ApiFnCapabilityClient["operations"]["apifn.environments.get"]>;
|
|
163
|
+
upsert(input: ApiFnUpsertEnvironmentInput, options?: AdminClientRequestOptions): ReturnType<ApiFnCapabilityClient["operations"]["apifn.environments.upsert"]>;
|
|
164
|
+
delete(input: IdInput, options?: AdminClientRequestOptions): ReturnType<ApiFnCapabilityClient["operations"]["apifn.environments.delete"]>;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
export declare function createApiFnAdminClient(adminClient: AdminClient): ApiFnAdminClient;
|
|
168
|
+
export declare function createApiFnAdminAdapter(service: ApiFnOperatorService): AdminCapabilityAdapter<typeof apiFnAdminCapability>;
|
|
169
|
+
export declare const adminCapability: {
|
|
170
|
+
readonly schemaVersion: "1.0";
|
|
171
|
+
readonly id: "apifn";
|
|
172
|
+
readonly displayName: "ApiFn";
|
|
173
|
+
readonly version: "1.1.0";
|
|
174
|
+
readonly description: "Validated OpenAPI registry and environment operator service.";
|
|
175
|
+
readonly category: "developer-tools";
|
|
176
|
+
readonly availability: "optional-product";
|
|
177
|
+
readonly scopeLevels: readonly ["installation", "workspace", "project", "environment"];
|
|
178
|
+
readonly dependencies: readonly [];
|
|
179
|
+
readonly resources: readonly [{
|
|
180
|
+
readonly id: "specs";
|
|
181
|
+
readonly label: "API Specs";
|
|
182
|
+
readonly description: "Validated OpenAPI specifications owned by the active scope.";
|
|
183
|
+
readonly icon: "apifn:specs";
|
|
184
|
+
readonly risk: "standard";
|
|
185
|
+
readonly minimumScope: "project";
|
|
186
|
+
readonly idField: "id";
|
|
187
|
+
readonly displayFields: readonly ["id", "name", "version", "endpointCount", "updatedAt"];
|
|
188
|
+
readonly searchableFields: readonly ["id", "name", "title"];
|
|
189
|
+
readonly filterableFields: readonly ["version"];
|
|
190
|
+
readonly sortableFields: readonly ["name", "updatedAt"];
|
|
191
|
+
readonly sensitiveFields: readonly [];
|
|
192
|
+
}, {
|
|
193
|
+
readonly id: "environments";
|
|
194
|
+
readonly label: "API Environments";
|
|
195
|
+
readonly description: "Non-secret HTTP endpoints used to exercise a scope-owned API.";
|
|
196
|
+
readonly icon: "apifn:environments";
|
|
197
|
+
readonly risk: "standard";
|
|
198
|
+
readonly minimumScope: "project";
|
|
199
|
+
readonly idField: "id";
|
|
200
|
+
readonly displayFields: readonly ["id", "name", "baseUrl", "enabled"];
|
|
201
|
+
readonly searchableFields: readonly ["id", "name", "baseUrl"];
|
|
202
|
+
readonly filterableFields: readonly ["enabled"];
|
|
203
|
+
readonly sortableFields: readonly ["name", "updatedAt"];
|
|
204
|
+
readonly sensitiveFields: readonly [];
|
|
205
|
+
}];
|
|
206
|
+
readonly navigation: readonly [{
|
|
207
|
+
readonly id: "apifn";
|
|
208
|
+
readonly label: "ApiFn";
|
|
209
|
+
readonly path: "/modules/apifn";
|
|
210
|
+
readonly icon: "apifn";
|
|
211
|
+
readonly description: "Operate API contracts and targets.";
|
|
212
|
+
readonly order: 100;
|
|
213
|
+
}];
|
|
214
|
+
readonly operations: readonly [AdminOperationDefinition<ApiFnPageInput, Page<ApiFnSpecView>> & {
|
|
215
|
+
readonly id: "apifn.specs.list";
|
|
216
|
+
}, AdminOperationDefinition<IdInput, Item<ApiFnSpecView>> & {
|
|
217
|
+
readonly id: "apifn.specs.get";
|
|
218
|
+
}, AdminOperationDefinition<ApiFnRegisterSpecInput, AcceptedItem<ApiFnSpecView>> & {
|
|
219
|
+
readonly id: "apifn.specs.register";
|
|
220
|
+
}, AdminOperationDefinition<ApiFnCompareSpecInput, Item<ApiFnDiffView>> & {
|
|
221
|
+
readonly id: "apifn.specs.compare";
|
|
222
|
+
}, AdminOperationDefinition<IdInput, Accepted> & {
|
|
223
|
+
readonly id: "apifn.specs.delete";
|
|
224
|
+
}, AdminOperationDefinition<ApiFnPageInput, Page<ApiFnEnvironmentRecord>> & {
|
|
225
|
+
readonly id: "apifn.environments.list";
|
|
226
|
+
}, AdminOperationDefinition<IdInput, Item<ApiFnEnvironmentRecord>> & {
|
|
227
|
+
readonly id: "apifn.environments.get";
|
|
228
|
+
}, AdminOperationDefinition<ApiFnUpsertEnvironmentInput, AcceptedItem<ApiFnEnvironmentRecord>> & {
|
|
229
|
+
readonly id: "apifn.environments.upsert";
|
|
230
|
+
}, AdminOperationDefinition<IdInput, Accepted> & {
|
|
231
|
+
readonly id: "apifn.environments.delete";
|
|
232
|
+
}];
|
|
233
|
+
};
|
|
234
|
+
export declare const createAdminAdapter: typeof createApiFnAdminAdapter;
|
|
235
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,2BAA2B,EAE3B,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAG9B,KAAK,wBAAwB,EAE9B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,qBAAqB,EACrB,aAAa,EACb,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,aAAa,EACb,2BAA2B,EAC5B,MAAM,uBAAuB,CAAC;AAE/B,cAAc,u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,gBAAgB,CAiBjF;AAMD,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,oBAAoB,GAAG,sBAAsB,CAAC,OAAO,oBAAoB,CAAC,CAY1H;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAuB,CAAC;AACpD,eAAO,MAAM,kBAAkB,gCAA0B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { createAdminCapabilityAdapter, createCapabilityAdminClient, defineAdminCapability, } from "@superfunctions/admin";
|
|
2
|
+
export * from "./operator-service.js";
|
|
3
|
+
const scopeSchema = {
|
|
4
|
+
type: "object",
|
|
5
|
+
properties: {
|
|
6
|
+
installationId: { type: "string" },
|
|
7
|
+
workspaceId: { type: "string" },
|
|
8
|
+
projectId: { type: "string" },
|
|
9
|
+
environmentId: { type: ["string", "null"] },
|
|
10
|
+
},
|
|
11
|
+
required: ["installationId", "workspaceId", "projectId", "environmentId"],
|
|
12
|
+
additionalProperties: false,
|
|
13
|
+
};
|
|
14
|
+
const pageInputSchema = {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
cursor: { type: "string", minLength: 1 },
|
|
18
|
+
limit: { type: "integer", minimum: 1, maximum: 100 },
|
|
19
|
+
},
|
|
20
|
+
additionalProperties: false,
|
|
21
|
+
};
|
|
22
|
+
const idSchema = {
|
|
23
|
+
type: "object",
|
|
24
|
+
properties: { id: { type: "string", minLength: 1 } },
|
|
25
|
+
required: ["id"],
|
|
26
|
+
additionalProperties: false,
|
|
27
|
+
};
|
|
28
|
+
const documentSchema = {
|
|
29
|
+
oneOf: [
|
|
30
|
+
{ type: "string", minLength: 1 },
|
|
31
|
+
{ type: "object", additionalProperties: true },
|
|
32
|
+
],
|
|
33
|
+
};
|
|
34
|
+
const specViewSchema = {
|
|
35
|
+
type: "object",
|
|
36
|
+
properties: {
|
|
37
|
+
id: { type: "string" },
|
|
38
|
+
scope: scopeSchema,
|
|
39
|
+
name: { type: "string" },
|
|
40
|
+
version: { type: "string" },
|
|
41
|
+
title: { type: "string" },
|
|
42
|
+
endpointCount: { type: "integer", minimum: 0 },
|
|
43
|
+
createdAt: { type: "string" },
|
|
44
|
+
updatedAt: { type: "string" },
|
|
45
|
+
},
|
|
46
|
+
required: ["id", "scope", "name", "version", "title", "endpointCount", "createdAt", "updatedAt"],
|
|
47
|
+
additionalProperties: false,
|
|
48
|
+
};
|
|
49
|
+
const environmentSchema = {
|
|
50
|
+
type: "object",
|
|
51
|
+
properties: {
|
|
52
|
+
id: { type: "string" },
|
|
53
|
+
scope: scopeSchema,
|
|
54
|
+
name: { type: "string" },
|
|
55
|
+
baseUrl: { type: "string" },
|
|
56
|
+
enabled: { type: "boolean" },
|
|
57
|
+
createdAt: { type: "string" },
|
|
58
|
+
updatedAt: { type: "string" },
|
|
59
|
+
},
|
|
60
|
+
required: ["id", "scope", "name", "baseUrl", "enabled", "createdAt", "updatedAt"],
|
|
61
|
+
additionalProperties: false,
|
|
62
|
+
};
|
|
63
|
+
const diffEntrySchema = {
|
|
64
|
+
type: "object",
|
|
65
|
+
properties: {
|
|
66
|
+
type: { type: "string", enum: ["added", "removed", "modified"] },
|
|
67
|
+
breaking: { type: "boolean" },
|
|
68
|
+
path: { type: "string" },
|
|
69
|
+
description: { type: "string" },
|
|
70
|
+
},
|
|
71
|
+
required: ["type", "breaking", "path", "description"],
|
|
72
|
+
additionalProperties: false,
|
|
73
|
+
};
|
|
74
|
+
const diffSchema = {
|
|
75
|
+
type: "object",
|
|
76
|
+
properties: {
|
|
77
|
+
breaking: { type: "array", items: diffEntrySchema },
|
|
78
|
+
nonBreaking: { type: "array", items: diffEntrySchema },
|
|
79
|
+
hasBreakingChanges: { type: "boolean" },
|
|
80
|
+
summary: {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
added: { type: "integer", minimum: 0 },
|
|
84
|
+
removed: { type: "integer", minimum: 0 },
|
|
85
|
+
modified: { type: "integer", minimum: 0 },
|
|
86
|
+
breaking: { type: "integer", minimum: 0 },
|
|
87
|
+
nonBreaking: { type: "integer", minimum: 0 },
|
|
88
|
+
},
|
|
89
|
+
required: ["added", "removed", "modified", "breaking", "nonBreaking"],
|
|
90
|
+
additionalProperties: false,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
required: ["breaking", "nonBreaking", "hasBreakingChanges", "summary"],
|
|
94
|
+
additionalProperties: false,
|
|
95
|
+
};
|
|
96
|
+
const registerSchema = {
|
|
97
|
+
type: "object",
|
|
98
|
+
properties: {
|
|
99
|
+
id: { type: "string", minLength: 1 },
|
|
100
|
+
name: { type: "string", minLength: 1 },
|
|
101
|
+
document: documentSchema,
|
|
102
|
+
},
|
|
103
|
+
required: ["id", "name", "document"],
|
|
104
|
+
additionalProperties: false,
|
|
105
|
+
};
|
|
106
|
+
const compareSchema = {
|
|
107
|
+
type: "object",
|
|
108
|
+
properties: { id: { type: "string", minLength: 1 }, candidate: documentSchema },
|
|
109
|
+
required: ["id", "candidate"],
|
|
110
|
+
additionalProperties: false,
|
|
111
|
+
};
|
|
112
|
+
const environmentInputSchema = {
|
|
113
|
+
type: "object",
|
|
114
|
+
properties: {
|
|
115
|
+
id: { type: "string", minLength: 1 },
|
|
116
|
+
name: { type: "string", minLength: 1 },
|
|
117
|
+
baseUrl: { type: "string", minLength: 1 },
|
|
118
|
+
enabled: { type: "boolean" },
|
|
119
|
+
},
|
|
120
|
+
required: ["id", "name", "baseUrl"],
|
|
121
|
+
additionalProperties: false,
|
|
122
|
+
};
|
|
123
|
+
function pageSchema(item) {
|
|
124
|
+
return {
|
|
125
|
+
type: "object",
|
|
126
|
+
properties: {
|
|
127
|
+
items: { type: "array", items: item },
|
|
128
|
+
nextCursor: { type: ["string", "null"] },
|
|
129
|
+
},
|
|
130
|
+
required: ["items", "nextCursor"],
|
|
131
|
+
additionalProperties: false,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
function itemSchema(item) {
|
|
135
|
+
return { type: "object", properties: { item }, required: ["item"], additionalProperties: false };
|
|
136
|
+
}
|
|
137
|
+
function acceptedSchema(item) {
|
|
138
|
+
return {
|
|
139
|
+
type: "object",
|
|
140
|
+
properties: { accepted: { type: "boolean", const: true }, ...(item ? { item } : {}) },
|
|
141
|
+
required: item ? ["accepted", "item"] : ["accepted"],
|
|
142
|
+
additionalProperties: false,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
function operation() {
|
|
146
|
+
return (value) => value;
|
|
147
|
+
}
|
|
148
|
+
const readSafety = { classification: "read", idempotent: true, requiresConfirmation: false, audit: "optional" };
|
|
149
|
+
const writeSafety = { classification: "write", idempotent: true, requiresConfirmation: false, audit: "required" };
|
|
150
|
+
const destructiveSafety = (reason) => ({
|
|
151
|
+
classification: "destructive",
|
|
152
|
+
idempotent: true,
|
|
153
|
+
requiresConfirmation: true,
|
|
154
|
+
confirmation: { risk: "high", method: "recent-auth", reason, maxAgeSeconds: 300 },
|
|
155
|
+
audit: "required",
|
|
156
|
+
});
|
|
157
|
+
const operations = [
|
|
158
|
+
operation()({
|
|
159
|
+
id: "apifn.specs.list", title: "List API specs", description: "List scope-owned OpenAPI specifications.",
|
|
160
|
+
inputSchema: pageInputSchema, outputSchema: pageSchema(specViewSchema), route: { method: "GET", path: "/resources/specs" },
|
|
161
|
+
permission: "apifn.specs.read", minimumScope: "project", safety: readSafety,
|
|
162
|
+
pagination: { mode: "cursor", defaultLimit: 50, maxLimit: 100 },
|
|
163
|
+
mcp: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, target: { resource: "specs", collection: true },
|
|
164
|
+
}),
|
|
165
|
+
operation()({
|
|
166
|
+
id: "apifn.specs.get", title: "Get API spec", description: "Get validated spec metadata.",
|
|
167
|
+
inputSchema: idSchema, outputSchema: itemSchema(specViewSchema), route: { method: "GET", path: "/resources/specs/:id" },
|
|
168
|
+
permission: "apifn.specs.read", minimumScope: "project", safety: readSafety,
|
|
169
|
+
mcp: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, target: { resource: "specs", idInput: "id" },
|
|
170
|
+
}),
|
|
171
|
+
operation()({
|
|
172
|
+
id: "apifn.specs.register", title: "Register API spec", description: "Parse, validate, and persist an OpenAPI specification.",
|
|
173
|
+
inputSchema: registerSchema, outputSchema: acceptedSchema(specViewSchema), route: { method: "POST", path: "/resources/specs/actions/register" },
|
|
174
|
+
permission: "apifn.specs.write", minimumScope: "project", safety: writeSafety,
|
|
175
|
+
mcp: { readOnlyHint: false, destructiveHint: false, idempotentHint: true }, redaction: { inputFields: ["document"] },
|
|
176
|
+
target: { resource: "specs", idInput: "id" },
|
|
177
|
+
}),
|
|
178
|
+
operation()({
|
|
179
|
+
id: "apifn.specs.compare", title: "Compare API spec", description: "Diff a candidate against a persisted OpenAPI baseline.",
|
|
180
|
+
inputSchema: compareSchema, outputSchema: itemSchema(diffSchema), route: { method: "POST", path: "/resources/specs/actions/compare" },
|
|
181
|
+
permission: "apifn.specs.read", minimumScope: "project", safety: { ...readSafety, audit: "required" },
|
|
182
|
+
mcp: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, redaction: { inputFields: ["candidate"] },
|
|
183
|
+
target: { resource: "specs", idInput: "id" },
|
|
184
|
+
}),
|
|
185
|
+
operation()({
|
|
186
|
+
id: "apifn.specs.delete", title: "Delete API spec", description: "Delete a persisted API baseline.",
|
|
187
|
+
inputSchema: idSchema, outputSchema: acceptedSchema(), route: { method: "POST", path: "/resources/specs/actions/delete" },
|
|
188
|
+
permission: "apifn.specs.delete", minimumScope: "project", safety: destructiveSafety("Deleting an API baseline removes contract history."),
|
|
189
|
+
mcp: { readOnlyHint: false, destructiveHint: true, idempotentHint: true }, target: { resource: "specs", idInput: "id" },
|
|
190
|
+
}),
|
|
191
|
+
operation()({
|
|
192
|
+
id: "apifn.environments.list", title: "List environments", description: "List scope-owned API endpoints.",
|
|
193
|
+
inputSchema: pageInputSchema, outputSchema: pageSchema(environmentSchema), route: { method: "GET", path: "/resources/environments" },
|
|
194
|
+
permission: "apifn.environments.read", minimumScope: "project", safety: readSafety,
|
|
195
|
+
pagination: { mode: "cursor", defaultLimit: 50, maxLimit: 100 },
|
|
196
|
+
mcp: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, target: { resource: "environments", collection: true },
|
|
197
|
+
}),
|
|
198
|
+
operation()({
|
|
199
|
+
id: "apifn.environments.get", title: "Get environment", description: "Get one scope-owned API endpoint.",
|
|
200
|
+
inputSchema: idSchema, outputSchema: itemSchema(environmentSchema), route: { method: "GET", path: "/resources/environments/:id" },
|
|
201
|
+
permission: "apifn.environments.read", minimumScope: "project", safety: readSafety,
|
|
202
|
+
mcp: { readOnlyHint: true, destructiveHint: false, idempotentHint: true }, target: { resource: "environments", idInput: "id" },
|
|
203
|
+
}),
|
|
204
|
+
operation()({
|
|
205
|
+
id: "apifn.environments.upsert", title: "Upsert environment", description: "Create or update a non-secret API endpoint.",
|
|
206
|
+
inputSchema: environmentInputSchema, outputSchema: acceptedSchema(environmentSchema), route: { method: "POST", path: "/resources/environments/actions/upsert" },
|
|
207
|
+
permission: "apifn.environments.write", minimumScope: "project", safety: writeSafety,
|
|
208
|
+
mcp: { readOnlyHint: false, destructiveHint: false, idempotentHint: true }, target: { resource: "environments", idInput: "id" },
|
|
209
|
+
}),
|
|
210
|
+
operation()({
|
|
211
|
+
id: "apifn.environments.delete", title: "Delete environment", description: "Delete a scope-owned API endpoint.",
|
|
212
|
+
inputSchema: idSchema, outputSchema: acceptedSchema(), route: { method: "POST", path: "/resources/environments/actions/delete" },
|
|
213
|
+
permission: "apifn.environments.delete", minimumScope: "project", safety: destructiveSafety("Deleting an API environment removes its operator target."),
|
|
214
|
+
mcp: { readOnlyHint: false, destructiveHint: true, idempotentHint: true }, target: { resource: "environments", idInput: "id" },
|
|
215
|
+
}),
|
|
216
|
+
];
|
|
217
|
+
export const apiFnAdminResources = [
|
|
218
|
+
{ id: "specs", label: "API Specs", description: "Validated OpenAPI specifications owned by the active scope.", icon: "apifn:specs", risk: "standard", minimumScope: "project", idField: "id", displayFields: ["id", "name", "version", "endpointCount", "updatedAt"], searchableFields: ["id", "name", "title"], filterableFields: ["version"], sortableFields: ["name", "updatedAt"], sensitiveFields: [] },
|
|
219
|
+
{ id: "environments", label: "API Environments", description: "Non-secret HTTP endpoints used to exercise a scope-owned API.", icon: "apifn:environments", risk: "standard", minimumScope: "project", idField: "id", displayFields: ["id", "name", "baseUrl", "enabled"], searchableFields: ["id", "name", "baseUrl"], filterableFields: ["enabled"], sortableFields: ["name", "updatedAt"], sensitiveFields: [] },
|
|
220
|
+
];
|
|
221
|
+
export const apiFnAdminActions = operations;
|
|
222
|
+
export const apiFnAdminCapability = defineAdminCapability({
|
|
223
|
+
schemaVersion: "1.0", id: "apifn", displayName: "ApiFn", version: "1.1.0",
|
|
224
|
+
description: "Validated OpenAPI registry and environment operator service.", category: "developer-tools", availability: "optional-product",
|
|
225
|
+
scopeLevels: ["installation", "workspace", "project", "environment"], dependencies: [], resources: apiFnAdminResources,
|
|
226
|
+
navigation: [{ id: "apifn", label: "ApiFn", path: "/modules/apifn", icon: "apifn", description: "Operate API contracts and targets.", order: 100 }],
|
|
227
|
+
operations,
|
|
228
|
+
});
|
|
229
|
+
export function createApiFnAdminClient(adminClient) {
|
|
230
|
+
const client = createCapabilityAdminClient(apiFnAdminCapability, adminClient);
|
|
231
|
+
return Object.assign(client, {
|
|
232
|
+
specs: {
|
|
233
|
+
list: (input = {}, options) => client.invoke("apifn.specs.list", input, options),
|
|
234
|
+
get: (input, options) => client.invoke("apifn.specs.get", input, options),
|
|
235
|
+
register: (input, options) => client.invoke("apifn.specs.register", input, options),
|
|
236
|
+
compare: (input, options) => client.invoke("apifn.specs.compare", input, options),
|
|
237
|
+
delete: (input, options) => client.invoke("apifn.specs.delete", input, options),
|
|
238
|
+
},
|
|
239
|
+
environments: {
|
|
240
|
+
list: (input = {}, options) => client.invoke("apifn.environments.list", input, options),
|
|
241
|
+
get: (input, options) => client.invoke("apifn.environments.get", input, options),
|
|
242
|
+
upsert: (input, options) => client.invoke("apifn.environments.upsert", input, options),
|
|
243
|
+
delete: (input, options) => client.invoke("apifn.environments.delete", input, options),
|
|
244
|
+
},
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function bind(handler) {
|
|
248
|
+
return ({ input, context }) => handler(input, context);
|
|
249
|
+
}
|
|
250
|
+
export function createApiFnAdminAdapter(service) {
|
|
251
|
+
return createAdminCapabilityAdapter(apiFnAdminCapability, {
|
|
252
|
+
"apifn.specs.list": bind(service.listSpecs),
|
|
253
|
+
"apifn.specs.get": bind(service.getSpec),
|
|
254
|
+
"apifn.specs.register": bind(service.registerSpec),
|
|
255
|
+
"apifn.specs.compare": bind(service.compareSpec),
|
|
256
|
+
"apifn.specs.delete": bind(service.deleteSpec),
|
|
257
|
+
"apifn.environments.list": bind(service.listEnvironments),
|
|
258
|
+
"apifn.environments.get": bind(service.getEnvironment),
|
|
259
|
+
"apifn.environments.upsert": bind(service.upsertEnvironment),
|
|
260
|
+
"apifn.environments.delete": bind(service.deleteEnvironment),
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
export const adminCapability = apiFnAdminCapability;
|
|
264
|
+
export const createAdminAdapter = createApiFnAdminAdapter;
|
|
265
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,qBAAqB,GAQtB,MAAM,uBAAuB,CAAC;AAY/B,cAAc,uBAAuB,CAAC;AAQtC,MAAM,WAAW,GAAsB;IACrC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAClC,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QAC/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AAM,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AACpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import { type OpenAPIDocument } from "@apifn/core";
|
|
2
|
+
import { type AdminOperationContext } from "@superfunctions/admin";
|
|
3
|
+
export interface ApiFnOperatorScope {
|
|
4
|
+
installationId: string;
|
|
5
|
+
workspaceId: string;
|
|
6
|
+
projectId: string;
|
|
7
|
+
environmentId: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface ApiFnPageInput {
|
|
10
|
+
cursor?: string;
|
|
11
|
+
limit?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ApiFnSpecRecord {
|
|
14
|
+
id: string;
|
|
15
|
+
scope: ApiFnOperatorScope;
|
|
16
|
+
name: string;
|
|
17
|
+
version: string;
|
|
18
|
+
document: OpenAPIDocument;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ApiFnSpecView {
|
|
23
|
+
id: string;
|
|
24
|
+
scope: ApiFnOperatorScope;
|
|
25
|
+
name: string;
|
|
26
|
+
version: string;
|
|
27
|
+
title: string;
|
|
28
|
+
endpointCount: number;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ApiFnEnvironmentRecord {
|
|
33
|
+
id: string;
|
|
34
|
+
scope: ApiFnOperatorScope;
|
|
35
|
+
name: string;
|
|
36
|
+
baseUrl: string;
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ApiFnDiffEntryView {
|
|
42
|
+
type: "added" | "removed" | "modified";
|
|
43
|
+
breaking: boolean;
|
|
44
|
+
path: string;
|
|
45
|
+
description: string;
|
|
46
|
+
}
|
|
47
|
+
export interface ApiFnDiffView {
|
|
48
|
+
breaking: ApiFnDiffEntryView[];
|
|
49
|
+
nonBreaking: ApiFnDiffEntryView[];
|
|
50
|
+
hasBreakingChanges: boolean;
|
|
51
|
+
summary: {
|
|
52
|
+
added: number;
|
|
53
|
+
removed: number;
|
|
54
|
+
modified: number;
|
|
55
|
+
breaking: number;
|
|
56
|
+
nonBreaking: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/** Durable persistence boundary owned by ApiFn. */
|
|
60
|
+
export interface ApiFnOperatorStore {
|
|
61
|
+
listSpecs(scope: ApiFnOperatorScope): Promise<ApiFnSpecRecord[]>;
|
|
62
|
+
getSpec(scope: ApiFnOperatorScope, id: string): Promise<ApiFnSpecRecord | null>;
|
|
63
|
+
putSpec(record: ApiFnSpecRecord): Promise<void>;
|
|
64
|
+
deleteSpec(scope: ApiFnOperatorScope, id: string): Promise<boolean>;
|
|
65
|
+
listEnvironments(scope: ApiFnOperatorScope): Promise<ApiFnEnvironmentRecord[]>;
|
|
66
|
+
getEnvironment(scope: ApiFnOperatorScope, id: string): Promise<ApiFnEnvironmentRecord | null>;
|
|
67
|
+
putEnvironment(record: ApiFnEnvironmentRecord): Promise<void>;
|
|
68
|
+
deleteEnvironment(scope: ApiFnOperatorScope, id: string): Promise<boolean>;
|
|
69
|
+
}
|
|
70
|
+
/** Explicit in-memory implementation for tests and local development. */
|
|
71
|
+
export declare class MemoryApiFnOperatorStore implements ApiFnOperatorStore {
|
|
72
|
+
private readonly specs;
|
|
73
|
+
private readonly environments;
|
|
74
|
+
private key;
|
|
75
|
+
listSpecs(scope: ApiFnOperatorScope): Promise<ApiFnSpecRecord[]>;
|
|
76
|
+
getSpec(scope: ApiFnOperatorScope, id: string): Promise<ApiFnSpecRecord | null>;
|
|
77
|
+
putSpec(record: ApiFnSpecRecord): Promise<void>;
|
|
78
|
+
deleteSpec(scope: ApiFnOperatorScope, id: string): Promise<boolean>;
|
|
79
|
+
listEnvironments(scope: ApiFnOperatorScope): Promise<ApiFnEnvironmentRecord[]>;
|
|
80
|
+
getEnvironment(scope: ApiFnOperatorScope, id: string): Promise<ApiFnEnvironmentRecord | null>;
|
|
81
|
+
putEnvironment(record: ApiFnEnvironmentRecord): Promise<void>;
|
|
82
|
+
deleteEnvironment(scope: ApiFnOperatorScope, id: string): Promise<boolean>;
|
|
83
|
+
}
|
|
84
|
+
export interface ApiFnOperatorServiceOptions {
|
|
85
|
+
store: ApiFnOperatorStore;
|
|
86
|
+
now?: () => Date;
|
|
87
|
+
}
|
|
88
|
+
export interface ApiFnRegisterSpecInput {
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
document: string | Record<string, unknown>;
|
|
92
|
+
}
|
|
93
|
+
export interface ApiFnCompareSpecInput {
|
|
94
|
+
id: string;
|
|
95
|
+
candidate: string | Record<string, unknown>;
|
|
96
|
+
}
|
|
97
|
+
export interface ApiFnUpsertEnvironmentInput {
|
|
98
|
+
id: string;
|
|
99
|
+
name: string;
|
|
100
|
+
baseUrl: string;
|
|
101
|
+
enabled?: boolean;
|
|
102
|
+
}
|
|
103
|
+
export declare function createApiFnOperatorService(options: ApiFnOperatorServiceOptions): {
|
|
104
|
+
listSpecs(input: ApiFnPageInput, context: AdminOperationContext): Promise<{
|
|
105
|
+
items: ApiFnSpecView[];
|
|
106
|
+
nextCursor: string | null;
|
|
107
|
+
}>;
|
|
108
|
+
getSpec(input: {
|
|
109
|
+
id: string;
|
|
110
|
+
}, context: AdminOperationContext): Promise<{
|
|
111
|
+
item: ApiFnSpecView;
|
|
112
|
+
}>;
|
|
113
|
+
registerSpec(input: ApiFnRegisterSpecInput, context: AdminOperationContext): Promise<{
|
|
114
|
+
accepted: true;
|
|
115
|
+
item: ApiFnSpecView;
|
|
116
|
+
}>;
|
|
117
|
+
compareSpec(input: ApiFnCompareSpecInput, context: AdminOperationContext): Promise<{
|
|
118
|
+
item: ApiFnDiffView;
|
|
119
|
+
}>;
|
|
120
|
+
deleteSpec(input: {
|
|
121
|
+
id: string;
|
|
122
|
+
}, context: AdminOperationContext): Promise<{
|
|
123
|
+
accepted: true;
|
|
124
|
+
}>;
|
|
125
|
+
listEnvironments(input: ApiFnPageInput, context: AdminOperationContext): Promise<{
|
|
126
|
+
items: ApiFnEnvironmentRecord[];
|
|
127
|
+
nextCursor: string | null;
|
|
128
|
+
}>;
|
|
129
|
+
getEnvironment(input: {
|
|
130
|
+
id: string;
|
|
131
|
+
}, context: AdminOperationContext): Promise<{
|
|
132
|
+
item: ApiFnEnvironmentRecord;
|
|
133
|
+
}>;
|
|
134
|
+
upsertEnvironment(input: ApiFnUpsertEnvironmentInput, context: AdminOperationContext): Promise<{
|
|
135
|
+
accepted: true;
|
|
136
|
+
item: ApiFnEnvironmentRecord;
|
|
137
|
+
}>;
|
|
138
|
+
deleteEnvironment(input: {
|
|
139
|
+
id: string;
|
|
140
|
+
}, context: AdminOperationContext): Promise<{
|
|
141
|
+
accepted: true;
|
|
142
|
+
}>;
|
|
143
|
+
};
|
|
144
|
+
export type ApiFnOperatorService = ReturnType<typeof createApiFnOperatorService>;
|
|
145
|
+
//# sourceMappingURL=operator-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator-service.d.ts","sourceRoot":"","sources":["../src/operator-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EAKL,KAAK,qBAAqB,EAE3B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,kBAAkB;IACjC,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AACD,MAAM,WAAW,cAAc;IAAG,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE;AAEnE,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IAC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C;sBAsBX;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,WAAW,qBAAqB;;;4BAOxC,cAAc,WAAW,qBAAqB;;;;0BAKhD;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,WAAW,qBAAqB;;;6BAM3C,2BAA2B,WAAW,qBAAqB;;;;6BA6B3D;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,WAAW,qBAAqB;;;EAOhF;AAED,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { diffOpenAPI, parseOpenAPI, validateOpenAPI, } from "@apifn/core";
|
|
2
|
+
import { AdminError, adminScopeRootId, decodeAdminCursor, encodeAdminCursor, } from "@superfunctions/admin";
|
|
3
|
+
/** Explicit in-memory implementation for tests and local development. */
|
|
4
|
+
export class MemoryApiFnOperatorStore {
|
|
5
|
+
specs = new Map();
|
|
6
|
+
environments = new Map();
|
|
7
|
+
key(scope, id) {
|
|
8
|
+
return `${scope.installationId}\0${scope.workspaceId}\0${scope.projectId}\0${scope.environmentId ?? ""}\0${id}`;
|
|
9
|
+
}
|
|
10
|
+
async listSpecs(scope) {
|
|
11
|
+
const prefix = this.key(scope, "");
|
|
12
|
+
return [...this.specs.values()]
|
|
13
|
+
.filter((value) => this.key(value.scope, "") === prefix)
|
|
14
|
+
.map((value) => structuredClone(value));
|
|
15
|
+
}
|
|
16
|
+
async getSpec(scope, id) {
|
|
17
|
+
const value = this.specs.get(this.key(scope, id));
|
|
18
|
+
return value ? structuredClone(value) : null;
|
|
19
|
+
}
|
|
20
|
+
async putSpec(record) {
|
|
21
|
+
this.specs.set(this.key(record.scope, record.id), structuredClone(record));
|
|
22
|
+
}
|
|
23
|
+
async deleteSpec(scope, id) {
|
|
24
|
+
return this.specs.delete(this.key(scope, id));
|
|
25
|
+
}
|
|
26
|
+
async listEnvironments(scope) {
|
|
27
|
+
const prefix = this.key(scope, "");
|
|
28
|
+
return [...this.environments.values()]
|
|
29
|
+
.filter((value) => this.key(value.scope, "") === prefix)
|
|
30
|
+
.map((value) => structuredClone(value));
|
|
31
|
+
}
|
|
32
|
+
async getEnvironment(scope, id) {
|
|
33
|
+
const value = this.environments.get(this.key(scope, id));
|
|
34
|
+
return value ? structuredClone(value) : null;
|
|
35
|
+
}
|
|
36
|
+
async putEnvironment(record) {
|
|
37
|
+
this.environments.set(this.key(record.scope, record.id), structuredClone(record));
|
|
38
|
+
}
|
|
39
|
+
async deleteEnvironment(scope, id) {
|
|
40
|
+
return this.environments.delete(this.key(scope, id));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function requireScope(context) {
|
|
44
|
+
const { workspaceId, projectId, environmentId } = context.scope;
|
|
45
|
+
const installationId = adminScopeRootId(context.scope);
|
|
46
|
+
if (!installationId || !workspaceId || !projectId) {
|
|
47
|
+
throw new AdminError("invalid_argument", "ApiFn administration requires installation, workspace, and project scope identifiers.");
|
|
48
|
+
}
|
|
49
|
+
return { installationId, workspaceId, projectId, environmentId: environmentId ?? null };
|
|
50
|
+
}
|
|
51
|
+
function specView(record) {
|
|
52
|
+
const endpointCount = Object.values(record.document.paths ?? {}).reduce((count, item) => count + Object.keys(item ?? {}).filter((key) => ["get", "put", "post", "delete", "patch", "options", "head", "trace"].includes(key)).length, 0);
|
|
53
|
+
return {
|
|
54
|
+
id: record.id,
|
|
55
|
+
scope: record.scope,
|
|
56
|
+
name: record.name,
|
|
57
|
+
version: record.version,
|
|
58
|
+
title: record.document.info.title,
|
|
59
|
+
endpointCount,
|
|
60
|
+
createdAt: record.createdAt,
|
|
61
|
+
updatedAt: record.updatedAt,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function cursorScope(scope) {
|
|
65
|
+
return {
|
|
66
|
+
installationId: scope.installationId,
|
|
67
|
+
workspaceId: scope.workspaceId,
|
|
68
|
+
projectId: scope.projectId,
|
|
69
|
+
...(scope.environmentId ? { environmentId: scope.environmentId } : {}),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
function page(items, input, scope, resource) {
|
|
73
|
+
const limit = Math.min(Math.max(input.limit ?? 50, 1), 100);
|
|
74
|
+
const decoded = input.cursor === undefined
|
|
75
|
+
? { offset: 0, resource }
|
|
76
|
+
: decodeAdminCursor(input.cursor, cursorScope(scope));
|
|
77
|
+
if (!decoded || typeof decoded !== "object" || Array.isArray(decoded)) {
|
|
78
|
+
throw new AdminError("invalid_argument", "ApiFn cursor is invalid.");
|
|
79
|
+
}
|
|
80
|
+
const position = decoded;
|
|
81
|
+
const offset = position.offset;
|
|
82
|
+
if (typeof offset !== "number" || !Number.isSafeInteger(offset) || offset < 0) {
|
|
83
|
+
throw new AdminError("invalid_argument", "ApiFn cursor is invalid.");
|
|
84
|
+
}
|
|
85
|
+
if (position.resource !== resource) {
|
|
86
|
+
throw new AdminError("invalid_argument", "ApiFn cursor is invalid for this resource.");
|
|
87
|
+
}
|
|
88
|
+
const ordered = [...items].sort((left, right) => left.id.localeCompare(right.id));
|
|
89
|
+
const values = ordered.slice(offset, offset + limit);
|
|
90
|
+
const next = offset + values.length;
|
|
91
|
+
return {
|
|
92
|
+
items: values,
|
|
93
|
+
nextCursor: next < ordered.length
|
|
94
|
+
? encodeAdminCursor(cursorScope(scope), { offset: next, resource })
|
|
95
|
+
: null,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function required(value, label) {
|
|
99
|
+
if (!value.trim())
|
|
100
|
+
throw new AdminError("invalid_argument", `${label} is required.`);
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
export function createApiFnOperatorService(options) {
|
|
104
|
+
const now = () => (options.now?.() ?? new Date()).toISOString();
|
|
105
|
+
return {
|
|
106
|
+
async listSpecs(input, context) {
|
|
107
|
+
const scope = requireScope(context);
|
|
108
|
+
const values = await options.store.listSpecs(scope);
|
|
109
|
+
return page(values.map(specView), input, scope, "specs");
|
|
110
|
+
},
|
|
111
|
+
async getSpec(input, context) {
|
|
112
|
+
const value = await options.store.getSpec(requireScope(context), input.id);
|
|
113
|
+
if (!value)
|
|
114
|
+
throw new AdminError("not_found", "ApiFn spec was not found.");
|
|
115
|
+
return { item: specView(value) };
|
|
116
|
+
},
|
|
117
|
+
async registerSpec(input, context) {
|
|
118
|
+
const scope = requireScope(context);
|
|
119
|
+
const document = parseOpenAPI(input.document);
|
|
120
|
+
const errors = await validateOpenAPI(document);
|
|
121
|
+
if (errors.length > 0) {
|
|
122
|
+
throw new AdminError("invalid_argument", "OpenAPI validation failed.", { details: { errors } });
|
|
123
|
+
}
|
|
124
|
+
const existing = await options.store.getSpec(scope, input.id);
|
|
125
|
+
const timestamp = now();
|
|
126
|
+
const record = {
|
|
127
|
+
id: required(input.id, "id"),
|
|
128
|
+
scope,
|
|
129
|
+
name: required(input.name, "name"),
|
|
130
|
+
version: document.info.version,
|
|
131
|
+
document,
|
|
132
|
+
createdAt: existing?.createdAt ?? timestamp,
|
|
133
|
+
updatedAt: timestamp,
|
|
134
|
+
};
|
|
135
|
+
await options.store.putSpec(record);
|
|
136
|
+
return { accepted: true, item: specView(record) };
|
|
137
|
+
},
|
|
138
|
+
async compareSpec(input, context) {
|
|
139
|
+
const value = await options.store.getSpec(requireScope(context), input.id);
|
|
140
|
+
if (!value)
|
|
141
|
+
throw new AdminError("not_found", "ApiFn baseline spec was not found.");
|
|
142
|
+
const candidate = parseOpenAPI(input.candidate);
|
|
143
|
+
const errors = await validateOpenAPI(candidate);
|
|
144
|
+
if (errors.length > 0) {
|
|
145
|
+
throw new AdminError("invalid_argument", "Candidate OpenAPI validation failed.", { details: { errors } });
|
|
146
|
+
}
|
|
147
|
+
const result = diffOpenAPI(value.document, candidate);
|
|
148
|
+
const safeEntry = ({ type, breaking, path, description }) => ({
|
|
149
|
+
type, breaking, path, description,
|
|
150
|
+
});
|
|
151
|
+
return {
|
|
152
|
+
item: {
|
|
153
|
+
breaking: result.breaking.map(safeEntry),
|
|
154
|
+
nonBreaking: result.nonBreaking.map(safeEntry),
|
|
155
|
+
hasBreakingChanges: result.hasBreakingChanges,
|
|
156
|
+
summary: result.summary,
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
},
|
|
160
|
+
async deleteSpec(input, context) {
|
|
161
|
+
if (!await options.store.deleteSpec(requireScope(context), input.id)) {
|
|
162
|
+
throw new AdminError("not_found", "ApiFn spec was not found.");
|
|
163
|
+
}
|
|
164
|
+
return { accepted: true };
|
|
165
|
+
},
|
|
166
|
+
async listEnvironments(input, context) {
|
|
167
|
+
const scope = requireScope(context);
|
|
168
|
+
return page(await options.store.listEnvironments(scope), input, scope, "environments");
|
|
169
|
+
},
|
|
170
|
+
async getEnvironment(input, context) {
|
|
171
|
+
const value = await options.store.getEnvironment(requireScope(context), input.id);
|
|
172
|
+
if (!value)
|
|
173
|
+
throw new AdminError("not_found", "ApiFn environment was not found.");
|
|
174
|
+
return { item: value };
|
|
175
|
+
},
|
|
176
|
+
async upsertEnvironment(input, context) {
|
|
177
|
+
const scope = requireScope(context);
|
|
178
|
+
let parsed;
|
|
179
|
+
try {
|
|
180
|
+
parsed = new URL(input.baseUrl);
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
throw new AdminError("invalid_argument", "baseUrl must be an absolute URL.");
|
|
184
|
+
}
|
|
185
|
+
if (!["http:", "https:"].includes(parsed.protocol)) {
|
|
186
|
+
throw new AdminError("invalid_argument", "baseUrl must use HTTP or HTTPS.");
|
|
187
|
+
}
|
|
188
|
+
if (parsed.username || parsed.password) {
|
|
189
|
+
throw new AdminError("invalid_argument", "baseUrl must not include credentials.");
|
|
190
|
+
}
|
|
191
|
+
const existing = await options.store.getEnvironment(scope, input.id);
|
|
192
|
+
const timestamp = now();
|
|
193
|
+
const record = {
|
|
194
|
+
id: required(input.id, "id"),
|
|
195
|
+
scope,
|
|
196
|
+
name: required(input.name, "name"),
|
|
197
|
+
baseUrl: parsed.toString(),
|
|
198
|
+
enabled: input.enabled ?? true,
|
|
199
|
+
createdAt: existing?.createdAt ?? timestamp,
|
|
200
|
+
updatedAt: timestamp,
|
|
201
|
+
};
|
|
202
|
+
await options.store.putEnvironment(record);
|
|
203
|
+
return { accepted: true, item: record };
|
|
204
|
+
},
|
|
205
|
+
async deleteEnvironment(input, context) {
|
|
206
|
+
if (!await options.store.deleteEnvironment(requireScope(context), input.id)) {
|
|
207
|
+
throw new AdminError("not_found", "ApiFn environment was not found.");
|
|
208
|
+
}
|
|
209
|
+
return { accepted: true };
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
//# sourceMappingURL=operator-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operator-service.js","sourceRoot":"","sources":["../src/operator-service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,YAAY,EACZ,eAAe,GAEhB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,GAGlB,MAAM,uBAAuB,CAAC;AA+D/B,yEAAyE;AACzE,MAAM,OAAO,wBAAwB;IAClB,KAAK,GAAG,IAAI,GAAG,EAA2B,CAAC;IAC3C,YAAY,GAAG,IAAI,GAAG,EAAkC,CAAC;IAElE,GAAG,CAAC,KAAyB,EAAE,EAAU;QAC/C,OAAO,GAAG,KAAK,CAAC,cAAc,KAAK,KAAK,CAAC,WAAW,KAAK,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,aAAa,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;IAClH,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,KAAyB;QACvC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACnC,OAAO,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;aAC5B,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,C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,MAAM,SAAS,GAAG,GAAG,EAAE,CAAC;YACxB,MAAM,MAAM,GAA2B;gBACrC,EAAE,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,EAAE,IAAI,CAAC;gBAC5B,KAAK;gBACL,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,CAAC;gBAClC,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE;gBAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,IAAI;gBAC9B,SAAS,EAAE,QAAQ,EAAE,SAAS,IAAI,SAAS;gBAC3C,SAAS,EAAE,SAAS;aACrB,CAAC;YACF,MAAM,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YAC3C,OAAO,EAAE,QAAQ,EAAE,IAAa,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACnD,CAAC;QAED,KAAK,CAAC,iBAAiB,CAAC,KAAqB,EAAE,OAA8B;YAC3E,IAAI,CAAC,MAAM,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;gBAC5E,MAAM,IAAI,UAAU,CAAC,WAAW,EAAE,kCAAkC,CAAC,CAAC;YACxE,CAAC;YACD,OAAO,EAAE,QAAQ,EAAE,IAAa,EAAE,CAAC;QACrC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@apifn/admin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Function-owned Super Console administration capability for ApiFn",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"test": "vitest run",
|
|
20
|
+
"test:watch": "vitest --watch",
|
|
21
|
+
"typecheck": "tsc --noEmit",
|
|
22
|
+
"clean": "rm -rf dist"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"apifn",
|
|
26
|
+
"admin",
|
|
27
|
+
"super-console",
|
|
28
|
+
"superfunctions"
|
|
29
|
+
],
|
|
30
|
+
"author": "21n",
|
|
31
|
+
"license": "MIT",
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@apifn/core": "0.0.3"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@superfunctions/admin": "^0.1.4"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@apifn/collections": "0.0.2",
|
|
43
|
+
"@superfunctions/admin": "^0.1.4",
|
|
44
|
+
"typescript": "^5.6.0",
|
|
45
|
+
"vitest": "^3.2.4"
|
|
46
|
+
},
|
|
47
|
+
"gitHead": "42a6d4536385c678ec76132f47ad13d2df0b9b93"
|
|
48
|
+
}
|