Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…rotocols Three new protocol files covering the complete marketplace ecosystem: - Developer Portal: account management, API keys, release channels, listing CRUD, analytics - Marketplace Admin: review workflow, curation, governance, platform health metrics - App Store (Customer): reviews/ratings, discovery/recommendations, subscriptions, installed apps Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
@copilot cloud 本身也是基于本协议规范开发,认证,组织管理,API-key等尽量使用 better-auth 规范,不要重复造轮子 |
…auth aligned) - Remove DeveloperAccountSchema, DeveloperApiKeySchema, ApiKeyScopeSchema, DeveloperAccountStatusSchema from developer-portal.zod.ts - Add ApiKeySchema to Identity module following better-auth's API key plugin - Add PublisherProfileSchema that links Identity.Organization to marketplace - Update developer-portal.zod.ts docs to reference Identity namespace Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Refactored in
|
There was a problem hiding this comment.
Pull request overview
Adds new Cloud protocol surface area (Developer Portal, Marketplace Admin, App Store) and extends the Identity module with an API key schema to support cloud marketplace workflows.
Changes:
- Introduces three new Cloud protocol modules: developer-portal, marketplace-admin, app-store (+ tests).
- Exports new Cloud modules from
packages/spec/src/cloud/index.ts. - Adds
ApiKeySchemato Identity (+ tests) for better-auth-aligned API key support.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/spec/src/identity/identity.zod.ts | Adds ApiKeySchema definition to Identity protocol. |
| packages/spec/src/identity/identity.test.ts | Adds validation/type inference tests for ApiKeySchema. |
| packages/spec/src/cloud/marketplace-admin.zod.ts | Defines marketplace administration/review/curation/governance/analytics schemas. |
| packages/spec/src/cloud/marketplace-admin.test.ts | Adds tests for marketplace-admin schemas. |
| packages/spec/src/cloud/index.ts | Exports newly added cloud protocol modules. |
| packages/spec/src/cloud/developer-portal.zod.ts | Defines developer-portal publisher profile, listing CRUD, release channels, analytics schemas. |
| packages/spec/src/cloud/developer-portal.test.ts | Adds tests for developer-portal schemas. |
| packages/spec/src/cloud/app-store.zod.ts | Defines customer-facing app-store schemas (reviews, discovery, subscriptions, installed apps). |
| packages/spec/src/cloud/app-store.test.ts | Adds tests for app-store schemas. |
| description: z.string().optional(), | ||
| category: z.string().optional(), | ||
| tags: z.array(z.string()).optional(), | ||
| iconUrl: z.string().url().optional(), |
There was a problem hiding this comment.
category is currently z.string().optional(), but the shared MarketplaceCategorySchema exists in cloud/marketplace.zod.ts. Consider using it here as well so updates and filtering stay consistent across protocols.
| pricing: z.enum([ | ||
| 'free', 'freemium', 'paid', 'subscription', 'usage-based', 'contact-sales', | ||
| ]).optional(), | ||
| priceInCents: z.number().int().min(0).optional(), |
There was a problem hiding this comment.
pricing here redefines the pricing model enum instead of using the shared PricingModelSchema from cloud/marketplace.zod.ts. Reusing the common enum reduces the chance of the update request accepting values the listing/create endpoints don’t.
| /** Sort by */ | ||
| sortBy: z.enum(['name', 'installed-date', 'updated-date']).default('name'), | ||
|
|
There was a problem hiding this comment.
ListInstalledAppsRequestSchema.sortBy allows 'updated-date', but InstalledAppSummarySchema doesn’t expose any updated/last-upgraded timestamp (only installedAt). Either add an updatedAt/upgradedAt field to InstalledAppSummarySchema (kernel has InstalledPackage.updatedAt) or remove 'updated-date' from the sort options so clients can interpret the ordering.
| /** | ||
| * Key expiration timestamp (null = never expires) | ||
| */ | ||
| expiresAt: z.string().datetime().optional().describe('Expiration timestamp'), |
There was a problem hiding this comment.
The field comment says expiresAt can be null to mean “never expires”, but the schema only allows an omitted field (optional) and will reject null. Either update the doc to say the field is omitted when it never expires, or change the schema to accept null explicitly.
| expiresAt: z.string().datetime().optional().describe('Expiration timestamp'), | |
| expiresAt: z.string().datetime().nullable().optional().describe('Expiration timestamp'), |
| /** Category */ | ||
| category: z.string().describe('Marketplace category'), | ||
|
|
There was a problem hiding this comment.
category is currently z.string(), but the cloud marketplace protocol already defines MarketplaceCategorySchema. Using the shared enum here keeps validation and allowed values consistent across Marketplace, Developer Portal, and App Store.
| /** Pricing model */ | ||
| pricing: z.enum([ | ||
| 'free', 'freemium', 'paid', 'subscription', 'usage-based', 'contact-sales', | ||
| ]).default('free'), | ||
|
|
There was a problem hiding this comment.
pricing duplicates the pricing model enum that already exists in cloud/marketplace.zod.ts as PricingModelSchema. Reusing the shared schema avoids divergence (e.g., adding/removing a pricing model in one place).
cloud/developer-portal.zod.ts— Developer Portal Protocol (PublisherProfile, release channels, listing CRUD, publishing analytics)cloud/marketplace-admin.zod.ts— Marketplace Administration Protocol (review workflow, curation, governance, platform analytics)cloud/app-store.zod.ts— App Store (Customer) Protocol (reviews/ratings, discovery/recommendations, subscriptions, installed apps)ApiKeySchemato Identity module following better-auth API key plugin patternPublisherProfileSchemalinking Identity.Organization to marketplace publisher💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.