@alpic-ai/api 0.0.0-dev.gf638a1b → 0.0.0-dev.gf73de62
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.mts +915 -2
- package/dist/index.mjs +126 -107
- package/package.json +23 -7
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import * as z$1 from "zod/v4";
|
|
3
3
|
import { oc } from "@orpc/contract";
|
|
4
4
|
import ms from "ms";
|
|
5
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.
|
|
5
|
+
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.30.0_supports-color@7.2.0_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/auth.js
|
|
6
6
|
/**
|
|
7
7
|
* Reusable URL validation that disallows javascript: scheme
|
|
8
8
|
*/
|
|
@@ -169,11 +169,21 @@ z$1.object({
|
|
|
169
169
|
token: z$1.string(),
|
|
170
170
|
token_type_hint: z$1.string().optional()
|
|
171
171
|
}).strip();
|
|
172
|
-
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region ../domains/dist/index.mjs
|
|
174
|
+
const AI_PLATFORMS = ["chatgpt", "claudeai"];
|
|
175
|
+
const platformSchema = z.enum(AI_PLATFORMS);
|
|
173
176
|
const PLATFORM_LABELS = {
|
|
174
177
|
chatgpt: "ChatGPT",
|
|
175
178
|
claudeai: "Claude.ai"
|
|
176
179
|
};
|
|
180
|
+
const WAF_PLATFORMS = [
|
|
181
|
+
"akamai",
|
|
182
|
+
"cloudflare",
|
|
183
|
+
"fastly"
|
|
184
|
+
];
|
|
185
|
+
const ALLOWED_PLATFORMS = [...AI_PLATFORMS, ...WAF_PLATFORMS];
|
|
186
|
+
const allowedPlatformSchema = z.enum(ALLOWED_PLATFORMS);
|
|
177
187
|
const auditStatusSchema = z.enum([
|
|
178
188
|
"pending",
|
|
179
189
|
"partial",
|
|
@@ -273,34 +283,51 @@ const deploymentSummarySchema = z.object({
|
|
|
273
283
|
createdAt: z.coerce.date(),
|
|
274
284
|
updatedAt: z.coerce.date()
|
|
275
285
|
});
|
|
276
|
-
/**
|
|
277
|
-
* Public environment
|
|
278
|
-
*
|
|
279
|
-
* No OAuth metadata exposed.
|
|
280
|
-
*/
|
|
286
|
+
/** Public environment: answers anonymously and exposes no OAuth metadata. */
|
|
281
287
|
const publicEnvironmentSchema = z.object({
|
|
288
|
+
allowsAnonymous: z.literal(true),
|
|
289
|
+
oAuthMetadata: z.strictObject({})
|
|
290
|
+
});
|
|
291
|
+
/** Protected environment whose external resource metadata URL is returned in the WWW-Authenticate header on the first 401; everything after is handled outside the MCP server scope. */
|
|
292
|
+
const externalResourceMetadataEnvironmentSchema = z.object({
|
|
293
|
+
allowsAnonymous: z.boolean(),
|
|
294
|
+
oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
|
|
295
|
+
scope: z.string().optional()
|
|
296
|
+
});
|
|
297
|
+
/** Protected environment whose own /.well-known/oauth-protected-resource endpoint points at an external authorization server; everything after is handled outside the MCP server scope. */
|
|
298
|
+
const externalAuthorizationServerEnvironmentSchema = z.object({
|
|
299
|
+
allowsAnonymous: z.boolean(),
|
|
300
|
+
oAuthMetadata: z.object({
|
|
301
|
+
externalAuthorizationServerUrl: z.url(),
|
|
302
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
303
|
+
}),
|
|
304
|
+
scope: z.string().optional()
|
|
305
|
+
});
|
|
306
|
+
/** Standalone protected environment: the server itself exposes both the /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server endpoints. */
|
|
307
|
+
const standaloneEnvironmentSchema = z.object({
|
|
308
|
+
allowsAnonymous: z.boolean(),
|
|
309
|
+
oAuthMetadata: z.object({
|
|
310
|
+
authorizationServerMetadata: z.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
|
|
311
|
+
resourceMetadata: OAuthProtectedResourceMetadataSchema.optional()
|
|
312
|
+
}),
|
|
313
|
+
scope: z.string().optional()
|
|
314
|
+
});
|
|
315
|
+
/** Protected environment that enforces authentication but advertises no OAuth discovery metadata; clients must obtain credentials out-of-band. */
|
|
316
|
+
const protectedWithoutDiscoveryEnvironmentSchema = z.object({
|
|
317
|
+
allowsAnonymous: z.literal(false),
|
|
318
|
+
oAuthMetadata: z.strictObject({}),
|
|
319
|
+
scope: z.string().optional()
|
|
320
|
+
});
|
|
321
|
+
const legacyPublicEnvironmentSchema = z.object({
|
|
282
322
|
isPublic: z.literal(true),
|
|
283
323
|
oAuthMetadata: z.undefined().optional()
|
|
284
324
|
});
|
|
285
|
-
|
|
286
|
-
* Protected environment with an external resource metadata URL
|
|
287
|
-
*
|
|
288
|
-
* An external resource metadata URL is returned in the WWW-Authenticate header during the first 401 response.
|
|
289
|
-
* Everything that follows is handled outside of the MCP server scope.
|
|
290
|
-
*/
|
|
291
|
-
const externalResourceMetadataEnvironmentSchema = z.object({
|
|
325
|
+
const legacyExternalResourceMetadataEnvironmentSchema = z.object({
|
|
292
326
|
isPublic: z.literal(false),
|
|
293
327
|
oAuthMetadata: z.object({ externalResourceMetadataUrl: z.url() }),
|
|
294
328
|
scope: z.string().optional()
|
|
295
329
|
});
|
|
296
|
-
|
|
297
|
-
* Protected environment with an external authorization server URL
|
|
298
|
-
*
|
|
299
|
-
* The server itself exposes the /.well-known/oauth-protected-resource endpoint.
|
|
300
|
-
* An external authorization server URL is returned when requesting the endpoint.
|
|
301
|
-
* Everything that follows is handled outside of the MCP server scope.
|
|
302
|
-
*/
|
|
303
|
-
const externalAuthorizationServerEnvironmentSchema = z.object({
|
|
330
|
+
const legacyExternalAuthorizationServerEnvironmentSchema = z.object({
|
|
304
331
|
isPublic: z.literal(false),
|
|
305
332
|
oAuthMetadata: z.object({
|
|
306
333
|
externalAuthorizationServerUrl: z.url(),
|
|
@@ -308,13 +335,7 @@ const externalAuthorizationServerEnvironmentSchema = z.object({
|
|
|
308
335
|
}),
|
|
309
336
|
scope: z.string().optional()
|
|
310
337
|
});
|
|
311
|
-
|
|
312
|
-
* Standalone protected environment
|
|
313
|
-
*
|
|
314
|
-
* The server itself exposes the /.well-known/oauth-protected-resource endpoint.
|
|
315
|
-
* The server itself exposes the /.well-known/oauth-authorization-server endpoint.
|
|
316
|
-
*/
|
|
317
|
-
const standaloneEnvironmentSchema = z.object({
|
|
338
|
+
const legacyStandaloneEnvironmentSchema = z.object({
|
|
318
339
|
isPublic: z.literal(false),
|
|
319
340
|
oAuthMetadata: z.object({
|
|
320
341
|
authorizationServerMetadata: z.union([OAuthMetadataSchema, OpenIdProviderDiscoveryMetadataSchema]),
|
|
@@ -322,14 +343,7 @@ const standaloneEnvironmentSchema = z.object({
|
|
|
322
343
|
}),
|
|
323
344
|
scope: z.string().optional()
|
|
324
345
|
});
|
|
325
|
-
|
|
326
|
-
* Protected environment without OAuth discovery
|
|
327
|
-
*
|
|
328
|
-
* The server enforces authentication but exposes no OAuth discovery metadata.
|
|
329
|
-
* Neither /.well-known/oauth-protected-resource nor /.well-known/oauth-authorization-server
|
|
330
|
-
* are advertised. Clients must obtain credentials out-of-band.
|
|
331
|
-
*/
|
|
332
|
-
const protectedWithoutDiscoveryEnvironmentSchema = z.object({
|
|
346
|
+
const legacyProtectedWithoutDiscoveryEnvironmentSchema = z.object({
|
|
333
347
|
isPublic: z.literal(false),
|
|
334
348
|
oAuthMetadata: z.strictObject({}),
|
|
335
349
|
scope: z.string().optional()
|
|
@@ -339,9 +353,13 @@ z.union([
|
|
|
339
353
|
externalResourceMetadataEnvironmentSchema,
|
|
340
354
|
externalAuthorizationServerEnvironmentSchema,
|
|
341
355
|
standaloneEnvironmentSchema,
|
|
342
|
-
protectedWithoutDiscoveryEnvironmentSchema
|
|
356
|
+
protectedWithoutDiscoveryEnvironmentSchema,
|
|
357
|
+
legacyPublicEnvironmentSchema,
|
|
358
|
+
legacyExternalResourceMetadataEnvironmentSchema,
|
|
359
|
+
legacyExternalAuthorizationServerEnvironmentSchema,
|
|
360
|
+
legacyStandaloneEnvironmentSchema,
|
|
361
|
+
legacyProtectedWithoutDiscoveryEnvironmentSchema
|
|
343
362
|
]);
|
|
344
|
-
const allowedPlatformSchema = platformSchema;
|
|
345
363
|
const playgroundModelSchema = z.enum([
|
|
346
364
|
"global.anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
347
365
|
"global.anthropic.claude-sonnet-4-5-20250929-v1:0",
|
|
@@ -381,7 +399,8 @@ z.object({
|
|
|
381
399
|
collectRequestPayload: z.boolean(),
|
|
382
400
|
collectResponsePayload: z.boolean(),
|
|
383
401
|
collectErrorMessage: z.boolean(),
|
|
384
|
-
collectUserData: z.boolean()
|
|
402
|
+
collectUserData: z.boolean(),
|
|
403
|
+
identityTraitKey: z.string().min(1).max(200).nullable()
|
|
385
404
|
});
|
|
386
405
|
z.object({
|
|
387
406
|
id: z.string(),
|
|
@@ -565,15 +584,7 @@ z.object({
|
|
|
565
584
|
serverFields: serverFieldsSchema$1,
|
|
566
585
|
source: z.enum(["registry", "defaults"])
|
|
567
586
|
});
|
|
568
|
-
/**
|
|
569
|
-
* Returns a variant of a `maxLength`-constrained string that clamps (truncates) instead of
|
|
570
|
-
* rejecting on overflow — used for AI-generated copy where the model routinely overshoots.
|
|
571
|
-
*
|
|
572
|
-
* NOTE: this rebuilds the schema from scratch, carrying over only `maxLength` (as a clamp),
|
|
573
|
-
* `minLength`, and the description. Any other validators on the source field (`.regex()`,
|
|
574
|
-
* `.email()`, custom refinements) are intentionally dropped — this helper is meant for plain
|
|
575
|
-
* free-text length caps only. A field with `null` `maxLength` is returned unchanged.
|
|
576
|
-
*/
|
|
587
|
+
/** Clamps instead of rejecting on max-length overflow (for AI-generated copy that overshoots); intentionally carries over only maxLength, minLength, and description, dropping any other validators. */
|
|
577
588
|
const clampStringField = (field) => {
|
|
578
589
|
const max = field.maxLength;
|
|
579
590
|
if (max === null) return field;
|
|
@@ -600,8 +611,9 @@ const positiveTestCaseSchema = z.object({
|
|
|
600
611
|
}).partial().describe("Each case: Scenario, User prompt, Tool triggered, Expected output.");
|
|
601
612
|
const screenshotEntrySchema = z.object({
|
|
602
613
|
prompt: z.string(),
|
|
603
|
-
url: z.url()
|
|
614
|
+
url: z.url()
|
|
604
615
|
}).describe("Each screenshot: the user prompt that produced it + the image URL.");
|
|
616
|
+
const screenshotDraftEntrySchema = screenshotEntrySchema.extend({ url: z.string() });
|
|
605
617
|
/** Accepts either a valid email or URL. */
|
|
606
618
|
const supportChannelSchema = z.string().refine((value) => z.email().safeParse(value).success || z.url().safeParse(value).success, { error: "Must be a valid email or URL" });
|
|
607
619
|
/** A URL field whose error spells out that the scheme is required. */
|
|
@@ -918,11 +930,7 @@ const chatgptToolJustificationSchema = z.object({
|
|
|
918
930
|
openWorldJustification: z.string().describe("One sentence on whether the tool reaches external systems beyond your own service."),
|
|
919
931
|
destructiveJustification: z.string().describe("One sentence on whether the tool changes data. For a read-only tool, state the full triad: \"No data is created, modified, or deleted.\"")
|
|
920
932
|
}).describe("Per-tool justification of each MCP annotation value (one specific sentence per hint).");
|
|
921
|
-
/**
|
|
922
|
-
* Base copy fields, defined once and reused by both the submission form and per-locale
|
|
923
|
-
* translations so the constraints (tagline ≤ 30 chars) never drift. The translation generation
|
|
924
|
-
* path wraps these in {@link clampStringField} since the LLM tends to overshoot the limit.
|
|
925
|
-
*/
|
|
933
|
+
/** Defined once and reused by both the submission form and per-locale translations so the tagline ≤ 30 chars constraint never drifts. */
|
|
926
934
|
const chatgptTaglineSchema = z.string().max(30);
|
|
927
935
|
const chatgptDescriptionSchema = z.string();
|
|
928
936
|
const chatgptTranslationSchema = z.object({
|
|
@@ -931,10 +939,7 @@ const chatgptTranslationSchema = z.object({
|
|
|
931
939
|
description: chatgptDescriptionSchema
|
|
932
940
|
}).describe("Locale-scoped override for tagline + description. English (US) is the default.");
|
|
933
941
|
chatgptTranslationSchema.extend({ tagline: clampStringField(chatgptTaglineSchema) });
|
|
934
|
-
/**
|
|
935
|
-
* Field order mirrors the ChatGPT (OpenAI) submission spreadsheet, grouped by section.
|
|
936
|
-
* When adding/removing/reordering fields, keep this in sync with the sheet.
|
|
937
|
-
*/
|
|
942
|
+
/** Field order mirrors the ChatGPT (OpenAI) submission spreadsheet, grouped by section; keep it in sync with the sheet. */
|
|
938
943
|
const chatgptSubmissionFormDataSchema = z.object({
|
|
939
944
|
logoLight: z.string().describe("Logo icon for light mode. Square PNG, no borders or rounded corners (clients apply circular cropping)."),
|
|
940
945
|
logoDark: z.string().optional().describe("Optional dark-mode logo icon. Square PNG, same specs as the light icon. Leave empty if the light icon also works on dark backgrounds."),
|
|
@@ -960,6 +965,17 @@ const chatgptSubmissionFormDataSchema = z.object({
|
|
|
960
965
|
allowedCountries: chatgptAllowedCountriesSchema.describe("Availability: all supported countries, or an allow-list / block-list of specific ones (ISO alpha-2)."),
|
|
961
966
|
releaseNotes: z.string().describe("Publicly displayed on the app details page.")
|
|
962
967
|
});
|
|
968
|
+
const chatgptSubmissionDraftSchema = chatgptSubmissionFormDataSchema.partial().extend({
|
|
969
|
+
tagline: z.string().optional(),
|
|
970
|
+
companyUrl: z.string().optional(),
|
|
971
|
+
supportChannel: z.string().optional(),
|
|
972
|
+
privacyPolicyUrl: z.string().optional(),
|
|
973
|
+
termsOfServiceUrl: z.string().optional(),
|
|
974
|
+
demoRecordingUrl: z.string().optional(),
|
|
975
|
+
serverUrl: z.string().optional(),
|
|
976
|
+
screenshots: z.array(screenshotDraftEntrySchema).optional(),
|
|
977
|
+
translations: z.array(chatgptTranslationSchema.extend({ tagline: z.string() })).optional()
|
|
978
|
+
});
|
|
963
979
|
chatgptSubmissionFormDataSchema.pick({
|
|
964
980
|
appName: true,
|
|
965
981
|
developerName: true,
|
|
@@ -1020,11 +1036,7 @@ const claudePolicyAcknowledgementSchema = z.enum([
|
|
|
1020
1036
|
"My connector does not collect conversation data beyond what is needed for its function.",
|
|
1021
1037
|
"Public documentation for this connector will be live by the publish date."
|
|
1022
1038
|
]);
|
|
1023
|
-
/**
|
|
1024
|
-
* Field order mirrors the claude.ai directory submission wizard
|
|
1025
|
-
* (`claude.ai/admin-settings/directory/submissions/new`), grouped by step.
|
|
1026
|
-
* When adding/removing/reordering fields, keep this in sync with the wizard.
|
|
1027
|
-
*/
|
|
1039
|
+
/** Field order mirrors the claude.ai directory submission wizard (`claude.ai/admin-settings/directory/submissions/new`), grouped by step; keep it in sync with the wizard. */
|
|
1028
1040
|
const claudeSubmissionFormDataSchema = z.object({
|
|
1029
1041
|
serverUrl: z.url().describe(`The full https:// URL where your MCP server is hosted and reachable. In the claude.ai wizard this is read live
|
|
1030
1042
|
from the custom connector you select — the connection is used to verify the URL and the tool list at submission time.
|
|
@@ -1086,6 +1098,21 @@ fully populated account.`),
|
|
|
1086
1098
|
submission. Each is an attestation you are legally agreeing to by submitting.`),
|
|
1087
1099
|
additionalNotes: z.string().optional().describe("Anything else the review team should know about your connector. Optional.")
|
|
1088
1100
|
});
|
|
1101
|
+
const claudeSubmissionDraftSchema = claudeSubmissionFormDataSchema.partial().extend({
|
|
1102
|
+
serverUrl: z.string().optional(),
|
|
1103
|
+
name: z.string().optional(),
|
|
1104
|
+
slug: z.string().optional(),
|
|
1105
|
+
oneLiner: z.string().optional(),
|
|
1106
|
+
description: z.string().optional(),
|
|
1107
|
+
iconUrl: z.string().optional(),
|
|
1108
|
+
documentation: z.string().optional(),
|
|
1109
|
+
support: z.string().optional(),
|
|
1110
|
+
privacyPolicy: z.string().optional(),
|
|
1111
|
+
companyWebsite: z.string().optional(),
|
|
1112
|
+
primaryContactEmail: z.string().optional(),
|
|
1113
|
+
categories: z.array(claudeCategorySchema).optional(),
|
|
1114
|
+
screenshots: z.array(screenshotDraftEntrySchema).optional()
|
|
1115
|
+
});
|
|
1089
1116
|
claudeSubmissionFormDataSchema.pick({
|
|
1090
1117
|
serverUrl: true,
|
|
1091
1118
|
name: true,
|
|
@@ -1101,12 +1128,7 @@ claudeSubmissionFormDataSchema.pick({
|
|
|
1101
1128
|
connectionRequirements: claudeSubmissionFormDataSchema.shape.connectionRequirements.optional(),
|
|
1102
1129
|
testInstructions: claudeSubmissionFormDataSchema.shape.testInstructions.optional()
|
|
1103
1130
|
});
|
|
1104
|
-
/**
|
|
1105
|
-
* Narrative fields the LLM-backed generation step produces for Claude submissions.
|
|
1106
|
-
* This schema accepts the slightly loose shape returned by AI generation, then normalizes it into
|
|
1107
|
-
* the strict form shape. Keep transforms here rather than in callers so generation leniency is
|
|
1108
|
-
* colocated with the Claude contract.
|
|
1109
|
-
*/
|
|
1131
|
+
/** Loose shape returned by AI generation for Claude narrative fields; transforms live here so generation leniency stays colocated with the Claude contract. */
|
|
1110
1132
|
const claudeAiGeneratedFormDataRawSchema = z.object({
|
|
1111
1133
|
oneLiner: claudeSubmissionFormDataSchema.shape.oneLiner,
|
|
1112
1134
|
description: claudeSubmissionFormDataSchema.shape.description,
|
|
@@ -1126,14 +1148,14 @@ const submissionMetaFieldsSchema = z.object({
|
|
|
1126
1148
|
});
|
|
1127
1149
|
const claudeSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
|
|
1128
1150
|
platform: z.literal("claudeai"),
|
|
1129
|
-
formData:
|
|
1151
|
+
formData: claudeSubmissionDraftSchema
|
|
1130
1152
|
});
|
|
1131
1153
|
const chatgptSubmissionSchemaInternal = submissionMetaFieldsSchema.extend({
|
|
1132
1154
|
platform: z.literal("chatgpt"),
|
|
1133
|
-
formData:
|
|
1155
|
+
formData: chatgptSubmissionDraftSchema
|
|
1134
1156
|
});
|
|
1135
1157
|
z.discriminatedUnion("platform", [claudeSubmissionSchemaInternal, chatgptSubmissionSchemaInternal]);
|
|
1136
|
-
z.union([
|
|
1158
|
+
z.union([claudeSubmissionDraftSchema, chatgptSubmissionDraftSchema]);
|
|
1137
1159
|
const subscriptionPlanSchema = z.enum([
|
|
1138
1160
|
"pro",
|
|
1139
1161
|
"business",
|
|
@@ -1198,7 +1220,10 @@ const RESERVED_KEYS = [
|
|
|
1198
1220
|
"BUILD_ARG_START_COMMAND",
|
|
1199
1221
|
"ALPIC_HOST",
|
|
1200
1222
|
"ALPIC_CUSTOM_DOMAINS",
|
|
1201
|
-
"ALPIC_INTENT_META_KEY"
|
|
1223
|
+
"ALPIC_INTENT_META_KEY",
|
|
1224
|
+
"ALPIC_FEEDBACK_META_KEY",
|
|
1225
|
+
"ALPIC_EVENTS_META_KEY",
|
|
1226
|
+
"ALPIC_IDENTIFY_META_KEY"
|
|
1202
1227
|
];
|
|
1203
1228
|
const environmentVariableSchema = z.object({
|
|
1204
1229
|
key: z.string().min(2, "Key must be at least 2 characters").regex(/^[a-zA-Z]([a-zA-Z0-9_])+$/, "Key must start with a letter and contain only letters, numbers, and underscores").refine((key) => !RESERVED_KEYS.includes(key), "This key is reserved and cannot be used as an environment variable key"),
|
|
@@ -1514,10 +1539,12 @@ const deployEnvironmentContractV1 = oc.route({
|
|
|
1514
1539
|
successDescription: "The environment has been deployed successfully"
|
|
1515
1540
|
}).errors({
|
|
1516
1541
|
NOT_FOUND: {},
|
|
1517
|
-
BAD_REQUEST: {}
|
|
1542
|
+
BAD_REQUEST: {},
|
|
1543
|
+
CONFLICT: {}
|
|
1518
1544
|
}).input(z.object({
|
|
1519
1545
|
environmentId: z.string().describe("The ID of the environment to deploy"),
|
|
1520
|
-
token: z.string().describe("The token to identify the source archive").optional()
|
|
1546
|
+
token: z.string().describe("The token to identify the source archive").optional(),
|
|
1547
|
+
settings: buildSettingsSchema.extend({ transport: transportSchema }).optional().describe("Project settings detected by the client from the source. When provided, the server skips downloading and extracting the source archive to detect them.")
|
|
1521
1548
|
})).output(deploymentSchema);
|
|
1522
1549
|
const uploadDeploymentArtifactContractV1 = oc.route({
|
|
1523
1550
|
path: "/v1/deployments/upload",
|
|
@@ -1554,6 +1581,21 @@ const getDeploymentContractV1 = oc.route({
|
|
|
1554
1581
|
tags: ["deployments"],
|
|
1555
1582
|
successDescription: "The deployment details"
|
|
1556
1583
|
}).errors({ NOT_FOUND: {} }).input(z.object({ deploymentId: z.string().describe("The ID of the deployment") })).output(deploymentSchema);
|
|
1584
|
+
const logEntrySchema = z.object({
|
|
1585
|
+
timestamp: z.coerce.date(),
|
|
1586
|
+
type: z.enum([
|
|
1587
|
+
"START",
|
|
1588
|
+
"END",
|
|
1589
|
+
"INFO",
|
|
1590
|
+
"ERROR",
|
|
1591
|
+
"WARNING",
|
|
1592
|
+
"DEBUG"
|
|
1593
|
+
]),
|
|
1594
|
+
requestId: z.string(),
|
|
1595
|
+
content: z.string().optional(),
|
|
1596
|
+
method: z.string().optional(),
|
|
1597
|
+
durationInMs: z.number().optional()
|
|
1598
|
+
});
|
|
1557
1599
|
const getLogsContractV1 = oc.route({
|
|
1558
1600
|
path: "/v1/environments/{environmentId}/logs",
|
|
1559
1601
|
method: "GET",
|
|
@@ -1578,21 +1620,7 @@ const getLogsContractV1 = oc.route({
|
|
|
1578
1620
|
search: z.string().optional().describe("Filter pattern to search for in log content"),
|
|
1579
1621
|
nextToken: z.string().optional().describe("Pagination token from a previous response")
|
|
1580
1622
|
})).output(z.object({
|
|
1581
|
-
logs: z.array(
|
|
1582
|
-
timestamp: z.coerce.date(),
|
|
1583
|
-
type: z.enum([
|
|
1584
|
-
"START",
|
|
1585
|
-
"END",
|
|
1586
|
-
"INFO",
|
|
1587
|
-
"ERROR",
|
|
1588
|
-
"WARNING",
|
|
1589
|
-
"DEBUG"
|
|
1590
|
-
]),
|
|
1591
|
-
requestId: z.string(),
|
|
1592
|
-
content: z.string().optional(),
|
|
1593
|
-
method: z.string().optional(),
|
|
1594
|
-
durationInMs: z.number().optional()
|
|
1595
|
-
})),
|
|
1623
|
+
logs: z.array(logEntrySchema),
|
|
1596
1624
|
nextToken: z.string().nullable()
|
|
1597
1625
|
}));
|
|
1598
1626
|
const getLatestLogsContractV1 = oc.route({
|
|
@@ -1615,21 +1643,7 @@ const getLatestLogsContractV1 = oc.route({
|
|
|
1615
1643
|
"DEBUG"
|
|
1616
1644
|
])).optional().describe("Filter by log level"),
|
|
1617
1645
|
search: z.string().optional().describe("Filter pattern to search for in log content")
|
|
1618
|
-
})).output(z.object({ logs: z.array(
|
|
1619
|
-
timestamp: z.coerce.date(),
|
|
1620
|
-
type: z.enum([
|
|
1621
|
-
"START",
|
|
1622
|
-
"END",
|
|
1623
|
-
"INFO",
|
|
1624
|
-
"ERROR",
|
|
1625
|
-
"WARNING",
|
|
1626
|
-
"DEBUG"
|
|
1627
|
-
]),
|
|
1628
|
-
requestId: z.string(),
|
|
1629
|
-
content: z.string().optional(),
|
|
1630
|
-
method: z.string().optional(),
|
|
1631
|
-
durationInMs: z.number().optional()
|
|
1632
|
-
})) }));
|
|
1646
|
+
})).output(z.object({ logs: z.array(logEntrySchema) }));
|
|
1633
1647
|
const getDeploymentLogsContractV1 = oc.route({
|
|
1634
1648
|
path: "/v1/deployments/{deploymentId}/logs",
|
|
1635
1649
|
method: "GET",
|
|
@@ -1855,5 +1869,10 @@ const contract = {
|
|
|
1855
1869
|
get: { v1: getBeaconContractV1 }
|
|
1856
1870
|
}
|
|
1857
1871
|
};
|
|
1872
|
+
const { uploadArtifact: _discard, ...deploymentsForDocs } = contract.deployments;
|
|
1873
|
+
const contractForDocs = {
|
|
1874
|
+
...contract,
|
|
1875
|
+
deployments: deploymentsForDocs
|
|
1876
|
+
};
|
|
1858
1877
|
//#endregion
|
|
1859
|
-
export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, PLATFORM_LABELS, buildSettingsSchema, contract, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
|
1878
|
+
export { AUTH_SCOPE_ANY, AUTH_SCOPE_USER, PLATFORM_LABELS, buildSettingsSchema, contract, contractForDocs, createEnvironmentContractV1, deploymentStatusSchema, environmentVariableSchema, environmentVariablesSchema, playgroundExamplePromptSchema, playgroundHeaderSchema, runtimeSchema, serverFieldsSchema, transportSchema, updateEnvironmentVariableSchema };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpic-ai/api",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.gf73de62",
|
|
4
4
|
"description": "Contract for the Alpic API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -14,22 +14,38 @@
|
|
|
14
14
|
"files": [
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
|
+
"nx": {
|
|
18
|
+
"targets": {
|
|
19
|
+
"build": {
|
|
20
|
+
"cache": true,
|
|
21
|
+
"inputs": [
|
|
22
|
+
"{projectRoot}/src/**/*",
|
|
23
|
+
"{projectRoot}/tsdown.config.ts",
|
|
24
|
+
"{projectRoot}/tsconfig.json",
|
|
25
|
+
"^default"
|
|
26
|
+
],
|
|
27
|
+
"outputs": [
|
|
28
|
+
"{projectRoot}/dist"
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
17
33
|
"author": "Alpic",
|
|
18
34
|
"license": "ISC",
|
|
19
35
|
"dependencies": {
|
|
20
|
-
"@orpc/contract": "^1.14.
|
|
36
|
+
"@orpc/contract": "^1.14.13",
|
|
21
37
|
"ms": "^2.1.3",
|
|
22
38
|
"zod": "^4.4.3"
|
|
23
39
|
},
|
|
24
40
|
"devDependencies": {
|
|
25
|
-
"@orpc/openapi": "^1.14.
|
|
26
|
-
"@orpc/zod": "^1.14.
|
|
41
|
+
"@orpc/openapi": "^1.14.13",
|
|
42
|
+
"@orpc/zod": "^1.14.13",
|
|
27
43
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
28
44
|
"@types/ms": "^2.1.0",
|
|
29
45
|
"shx": "^0.4.0",
|
|
30
|
-
"tsdown": "^0.22.
|
|
46
|
+
"tsdown": "^0.22.14",
|
|
31
47
|
"typescript": "^6.0.3",
|
|
32
|
-
"vitest": "^4.1.
|
|
48
|
+
"vitest": "^4.1.10",
|
|
33
49
|
"@alpic-ai/domains": "0.0.0"
|
|
34
50
|
},
|
|
35
51
|
"scripts": {
|
|
@@ -38,7 +54,7 @@
|
|
|
38
54
|
"test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
|
|
39
55
|
"test:unit": "vitest run",
|
|
40
56
|
"test:format": "biome check --error-on-warnings .",
|
|
41
|
-
"test:type": "
|
|
57
|
+
"test:type": "tsgo --noEmit",
|
|
42
58
|
"publish:npm": "pnpm publish --tag \"${NPM_TAG}\" --access public --no-git-checks"
|
|
43
59
|
}
|
|
44
60
|
}
|