@capivv/mcp-server 0.5.23 → 0.5.25
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/client.d.ts +9 -1
- package/dist/client.js +23 -0
- package/dist/tools/find-user.d.ts +3 -0
- package/dist/tools/find-user.js +18 -0
- package/dist/tools/grant-entitlement.d.ts +3 -0
- package/dist/tools/grant-entitlement.js +26 -0
- package/dist/tools/index.js +23 -0
- package/dist/tools/list-users.d.ts +3 -0
- package/dist/tools/list-users.js +14 -0
- package/dist/tools/revoke-entitlement.d.ts +3 -0
- package/dist/tools/revoke-entitlement.js +15 -0
- package/dist/tools/set-apple-subscription-level.d.ts +3 -0
- package/dist/tools/set-apple-subscription-level.js +22 -0
- package/dist/tools/set-iap-review-screenshot.js +2 -0
- package/dist/tools/set-review-screenshot.d.ts +3 -0
- package/dist/tools/set-review-screenshot.js +50 -0
- package/dist/tools/set-subscription-review-screenshot.js +2 -0
- package/dist/types.d.ts +61 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Config } from './config.js';
|
|
2
|
-
import type { App, Product, Entitlement, Offering, Rule, Experiment, ExperimentSummary, AnalyticsOverview, OnboardingResponse, ImportPreviewResponse, CreateAppRequest, CreateEntitlementRequest, CreateProductRequest, CreateOfferingRequest, CreateRuleRequest, ValidateRuleRequest, ValidateRuleResponse, WhoamiResponse, ApiKeyUsageResponse, Paywall, CreatePaywallRequest, UpdatePaywallRequest, PaywallStats, Promotion, CreatePromotionRequest, UpdatePromotionRequest, RescueFlow, CreateRescueFlowRequest, UpdateRescueFlowRequest, RescueStats, PricingStrategy, CreatePricingStrategyRequest, PricingPreviewResult, PricingRecomputeRequest, PricingRecomputeResult, PricingPushResult, PricingChangeRequest, SetCountryPriceOverrideRequest, ExperimentWithVariants, CreateExperimentRequest, UpdateExperimentRequest, UpdateAppRequest, UpdateEntitlementRequest, UpdateOfferingRequest, AutopilotRunResult, SyncSuggestion, SyncSuggestionsCount, TriggerSyncResult, IntegrationSummary, ConnectAppleIntegrationRequest, ConnectAppleIntegrationResult, ConnectGoogleIntegrationRequest, ConnectGoogleIntegrationResult, SetSubscriptionReviewScreenshotRequest, SetSubscriptionReviewScreenshotResult, SubscriptionStateInfo, TouchSubscriptionResult, ProbeSubmissionRequest, ProbeSubmissionResult, SetAppPrivacyUrlRequest, SetAppPrivacyUrlResult, SetIapReviewScreenshotRequest, SetIapReviewScreenshotResult, IapStateInfo, ListAppleSubscriptionsResult, ListAppleIapsResult, DeleteAppleResult } from './types.js';
|
|
2
|
+
import type { App, Product, Entitlement, Offering, Rule, Experiment, ExperimentSummary, AnalyticsOverview, OnboardingResponse, ImportPreviewResponse, CreateAppRequest, CreateEntitlementRequest, CreateProductRequest, CreateOfferingRequest, CreateRuleRequest, ValidateRuleRequest, ValidateRuleResponse, WhoamiResponse, ApiKeyUsageResponse, Paywall, CreatePaywallRequest, UpdatePaywallRequest, PaywallStats, Promotion, CreatePromotionRequest, UpdatePromotionRequest, RescueFlow, CreateRescueFlowRequest, UpdateRescueFlowRequest, RescueStats, PricingStrategy, CreatePricingStrategyRequest, PricingPreviewResult, PricingRecomputeRequest, PricingRecomputeResult, PricingPushResult, PricingChangeRequest, SetCountryPriceOverrideRequest, ExperimentWithVariants, CreateExperimentRequest, UpdateExperimentRequest, UpdateAppRequest, UpdateEntitlementRequest, UpdateOfferingRequest, AutopilotRunResult, SyncSuggestion, SyncSuggestionsCount, TriggerSyncResult, IntegrationSummary, ConnectAppleIntegrationRequest, ConnectAppleIntegrationResult, ConnectGoogleIntegrationRequest, ConnectGoogleIntegrationResult, SetSubscriptionReviewScreenshotRequest, SetSubscriptionReviewScreenshotResult, SubscriptionStateInfo, TouchSubscriptionResult, ProbeSubmissionRequest, ProbeSubmissionResult, SetAppPrivacyUrlRequest, SetAppPrivacyUrlResult, SetIapReviewScreenshotRequest, SetIapReviewScreenshotResult, IapStateInfo, ListAppleSubscriptionsResult, ListAppleIapsResult, DeleteAppleResult, ListAppUsersResult, FindUserResult, GrantEntitlementRequest, GrantEntitlementResult, RevokeEntitlementRequest, SetAppleSubscriptionLevelRequest, SetAppleSubscriptionLevelResult, SetReviewScreenshotRequest, SetReviewScreenshotResult } from './types.js';
|
|
3
3
|
export declare class ApiError extends Error {
|
|
4
4
|
status: number;
|
|
5
5
|
code: string;
|
|
@@ -102,4 +102,12 @@ export declare class CapivvClient {
|
|
|
102
102
|
listAppleIaps(appId: string): Promise<ListAppleIapsResult>;
|
|
103
103
|
deleteAppleSubscription(appleSubscriptionId: string): Promise<DeleteAppleResult>;
|
|
104
104
|
deleteAppleIap(appleIapId: string): Promise<DeleteAppleResult>;
|
|
105
|
+
listAppUsers(limit?: number, offset?: number): Promise<ListAppUsersResult>;
|
|
106
|
+
findAppUser(query: string): Promise<FindUserResult>;
|
|
107
|
+
grantEntitlement(req: GrantEntitlementRequest): Promise<GrantEntitlementResult>;
|
|
108
|
+
revokeEntitlement(req: RevokeEntitlementRequest): Promise<{
|
|
109
|
+
success: boolean;
|
|
110
|
+
}>;
|
|
111
|
+
setAppleSubscriptionLevel(req: SetAppleSubscriptionLevelRequest): Promise<SetAppleSubscriptionLevelResult>;
|
|
112
|
+
setReviewScreenshot(req: SetReviewScreenshotRequest): Promise<SetReviewScreenshotResult>;
|
|
105
113
|
}
|
package/dist/client.js
CHANGED
|
@@ -378,4 +378,27 @@ export class CapivvClient {
|
|
|
378
378
|
async deleteAppleIap(appleIapId) {
|
|
379
379
|
return this.delete(`/dashboard/iap/${encodeURIComponent(appleIapId)}`);
|
|
380
380
|
}
|
|
381
|
+
// ---- V0.5.24 — Issue #2 (Ludmilla) ----
|
|
382
|
+
async listAppUsers(limit = 50, offset = 0) {
|
|
383
|
+
return this.get(`/dashboard/users?limit=${limit}&offset=${offset}`);
|
|
384
|
+
}
|
|
385
|
+
async findAppUser(query) {
|
|
386
|
+
return this.get(`/dashboard/users/find?q=${encodeURIComponent(query)}`);
|
|
387
|
+
}
|
|
388
|
+
async grantEntitlement(req) {
|
|
389
|
+
const { user_id, entitlement_id, ...body } = req;
|
|
390
|
+
return this.post(`/dashboard/users/${encodeURIComponent(user_id)}/entitlements/${encodeURIComponent(entitlement_id)}/grant`, body);
|
|
391
|
+
}
|
|
392
|
+
async revokeEntitlement(req) {
|
|
393
|
+
const { user_id, entitlement_id, reason } = req;
|
|
394
|
+
return this.post(`/dashboard/users/${encodeURIComponent(user_id)}/entitlements/${encodeURIComponent(entitlement_id)}/revoke`, { reason });
|
|
395
|
+
}
|
|
396
|
+
async setAppleSubscriptionLevel(req) {
|
|
397
|
+
const { apple_subscription_id, level } = req;
|
|
398
|
+
return this.post(`/dashboard/subscriptions/${encodeURIComponent(apple_subscription_id)}/level`, { level });
|
|
399
|
+
}
|
|
400
|
+
async setReviewScreenshot(req) {
|
|
401
|
+
const { external_id, ...body } = req;
|
|
402
|
+
return this.post(`/dashboard/products/by-external-id/${encodeURIComponent(external_id)}/review-screenshot`, body);
|
|
403
|
+
}
|
|
381
404
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerFindUserTool(server, client) {
|
|
3
|
+
server.tool('capivv_find_user', [
|
|
4
|
+
'Resolve a Capivv user_id from an external_id or email — primary unblocker for "give Pro to ludmilla@example.com" workflows.',
|
|
5
|
+
'',
|
|
6
|
+
'Tries external_id first (exact match — your customer-controlled identifier passed to Capivv.identify). Falls back to email (case-insensitive). Returns `{ user, matched_on: "external_id" | "email" }` so you know which field hit.',
|
|
7
|
+
'',
|
|
8
|
+
'Returns `user: null` (no error) when no match is found. Pair with capivv_grant_entitlement to give that user an entitlement.',
|
|
9
|
+
].join(' '), {
|
|
10
|
+
query: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1)
|
|
13
|
+
.describe('An external_id (exact match) or email address (case-insensitive).'),
|
|
14
|
+
}, async ({ query }) => {
|
|
15
|
+
const result = await client.findAppUser(query);
|
|
16
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerGrantEntitlementTool(server, client) {
|
|
3
|
+
server.tool('capivv_grant_entitlement', [
|
|
4
|
+
'Manually grant an entitlement to a specific user — bypassing a purchase.',
|
|
5
|
+
'',
|
|
6
|
+
'Common use cases: dev/tester needs Pro for local testing, App Reviewer demo account, comp / VIP grant, support escalation after a refund. Recorded in the audit log with the optional `reason` you supply, so granted access can be tracked for compliance.',
|
|
7
|
+
'',
|
|
8
|
+
'Pair with capivv_find_user (resolve user_id from email) and capivv_list_entitlements (find entitlement_id). Set `expires_at` to ISO-8601 for time-limited grants (typical for App Reviewer demos: 30-day window); omit for indefinite (lifetime comp).',
|
|
9
|
+
'',
|
|
10
|
+
'Idempotent — granting the same entitlement to the same user updates expiry and reason instead of creating a duplicate.',
|
|
11
|
+
].join(' '), {
|
|
12
|
+
user_id: z.string().describe('Capivv user UUID. Use capivv_find_user to resolve from email/external_id.'),
|
|
13
|
+
entitlement_id: z.string().describe('Entitlement UUID. Use capivv_list_entitlements to find it.'),
|
|
14
|
+
expires_at: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('ISO-8601 expiry (e.g. "2026-08-01T00:00:00Z"). Omit for indefinite grants.'),
|
|
18
|
+
reason: z
|
|
19
|
+
.string()
|
|
20
|
+
.optional()
|
|
21
|
+
.describe('Free-form audit reason ("App Reviewer demo", "comp for X", "refund support escalation").'),
|
|
22
|
+
}, async (args) => {
|
|
23
|
+
const result = await client.grantEntitlement(args);
|
|
24
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
25
|
+
});
|
|
26
|
+
}
|
package/dist/tools/index.js
CHANGED
|
@@ -80,6 +80,12 @@ import { registerProbeSubmissionTool } from './probe-submission.js';
|
|
|
80
80
|
import { registerSetAppPrivacyUrlTool } from './set-app-privacy-url.js';
|
|
81
81
|
import { registerSetIapReviewScreenshotTool } from './set-iap-review-screenshot.js';
|
|
82
82
|
import { registerGetIapStateTool } from './get-iap-state.js';
|
|
83
|
+
import { registerGrantEntitlementTool } from './grant-entitlement.js';
|
|
84
|
+
import { registerRevokeEntitlementTool } from './revoke-entitlement.js';
|
|
85
|
+
import { registerListUsersTool } from './list-users.js';
|
|
86
|
+
import { registerFindUserTool } from './find-user.js';
|
|
87
|
+
import { registerSetAppleSubscriptionLevelTool } from './set-apple-subscription-level.js';
|
|
88
|
+
import { registerSetReviewScreenshotTool } from './set-review-screenshot.js';
|
|
83
89
|
import { registerListAppleSubscriptionsTool } from './list-apple-subscriptions.js';
|
|
84
90
|
import { registerListAppleIapsTool } from './list-apple-iaps.js';
|
|
85
91
|
import { registerDeleteAppleSubscriptionTool } from './delete-apple-subscription.js';
|
|
@@ -215,4 +221,21 @@ export function registerAllTools(server, client) {
|
|
|
215
221
|
registerListAppleIapsTool(server, client);
|
|
216
222
|
registerDeleteAppleSubscriptionTool(server, client);
|
|
217
223
|
registerDeleteAppleIapTool(server, client);
|
|
224
|
+
// V0.5.24 — issue #2 (Ludmilla): MCP gaps that forced workarounds in
|
|
225
|
+
// a real product session.
|
|
226
|
+
// - grant/revoke entitlement: dev/tester/reviewer/comp/refund flows
|
|
227
|
+
// - list/find user: resolve user_id from email or external_id (the
|
|
228
|
+
// primitive that unblocks "give Pro to ludmilla@example.com")
|
|
229
|
+
// - set apple subscription level: fix Apple's instant-upgrade UX
|
|
230
|
+
// when ASC shows every product at Level 1
|
|
231
|
+
registerGrantEntitlementTool(server, client);
|
|
232
|
+
registerRevokeEntitlementTool(server, client);
|
|
233
|
+
registerListUsersTool(server, client);
|
|
234
|
+
registerFindUserTool(server, client);
|
|
235
|
+
registerSetAppleSubscriptionLevelTool(server, client);
|
|
236
|
+
// V0.5.25 — issue #4: unified review-screenshot upload routing by
|
|
237
|
+
// product type from Capivv's DB. The two existing tools
|
|
238
|
+
// (set_subscription_review_screenshot / set_iap_review_screenshot)
|
|
239
|
+
// remain as escape hatches but their docstrings now redirect here.
|
|
240
|
+
registerSetReviewScreenshotTool(server, client);
|
|
218
241
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerListUsersTool(server, client) {
|
|
3
|
+
server.tool('capivv_list_users', [
|
|
4
|
+
'List app users (the people who use your app, identified via Capivv.identify in the SDK). Paginated.',
|
|
5
|
+
'',
|
|
6
|
+
'For finding a single user by email or external_id, prefer capivv_find_user — it does a single targeted lookup instead of paging.',
|
|
7
|
+
].join(' '), {
|
|
8
|
+
limit: z.number().int().min(1).max(200).optional().describe('Max users per page (default 50, max 200).'),
|
|
9
|
+
offset: z.number().int().min(0).optional().describe('Pagination offset (default 0).'),
|
|
10
|
+
}, async ({ limit, offset }) => {
|
|
11
|
+
const result = await client.listAppUsers(limit ?? 50, offset ?? 0);
|
|
12
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerRevokeEntitlementTool(server, client) {
|
|
3
|
+
server.tool('capivv_revoke_entitlement', [
|
|
4
|
+
'Revoke an entitlement from a specific user (the inverse of capivv_grant_entitlement). Use for refunds, expired comps, or when a tester no longer needs access.',
|
|
5
|
+
'',
|
|
6
|
+
'Recorded in the audit log with the optional `reason`. Idempotent — revoking an already-revoked entitlement is a no-op.',
|
|
7
|
+
].join(' '), {
|
|
8
|
+
user_id: z.string().describe('Capivv user UUID.'),
|
|
9
|
+
entitlement_id: z.string().describe('Entitlement UUID to revoke.'),
|
|
10
|
+
reason: z.string().optional().describe('Free-form audit reason.'),
|
|
11
|
+
}, async (args) => {
|
|
12
|
+
const result = await client.revokeEntitlement(args);
|
|
13
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerSetAppleSubscriptionLevelTool(server, client) {
|
|
3
|
+
server.tool('capivv_set_apple_subscription_level', [
|
|
4
|
+
"Set Apple's subscription `groupLevel` (PATCH /v1/subscriptions/{id}). Required for instant-upgrade + proration to work — without it Apple treats every Level-1 product as a crossgrade and the per-pack → Pro upgrade UX breaks.",
|
|
5
|
+
'',
|
|
6
|
+
"Apple convention: Level 1 is the most-upgraded tier (e.g. Pro), Level 2/3/... go downward. Within a subscription group, all products at the same level are cross-graded; switching between levels triggers Apple's instant-upgrade + prorate flow.",
|
|
7
|
+
'',
|
|
8
|
+
"Get apple_subscription_id from the `store_create.store_product_id` field of capivv_create_product (when product_type is subscription) or from App Store Connect's URL.",
|
|
9
|
+
].join(' '), {
|
|
10
|
+
apple_subscription_id: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('Apple subscription ID (e.g. "6764778053") — NOT the Capivv product UUID.'),
|
|
13
|
+
level: z
|
|
14
|
+
.number()
|
|
15
|
+
.int()
|
|
16
|
+
.min(1)
|
|
17
|
+
.describe('Apple groupLevel. 1 = highest tier (e.g. Pro). 2 = next, etc.'),
|
|
18
|
+
}, async (args) => {
|
|
19
|
+
const result = await client.setAppleSubscriptionLevel(args);
|
|
20
|
+
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export function registerSetIapReviewScreenshotTool(server, client) {
|
|
3
3
|
server.tool('capivv_set_iap_review_screenshot', [
|
|
4
|
+
'**Lower-level escape hatch — prefer `capivv_set_review_screenshot` unless you already have the Apple IAP numeric id.** This tool only works for consumables/non-consumables; calling it with a subscription id will silently fail. The unified tool reads product type from Capivv\'s DB and routes correctly.',
|
|
5
|
+
'',
|
|
4
6
|
'Upload the App Store review screenshot for an in-app purchase (consumable or non-consumable). Mirrors capivv_set_subscription_review_screenshot but uses the IAP endpoint.',
|
|
5
7
|
'',
|
|
6
8
|
'Apple expects 640x920 (or larger) PNG / JPEG. Provide either `image_url` (Capivv backend fetches it via HTTPS) or `image_base64` (raw bytes inline). The backend handles the 3-step Apple flow: reserve → PUT bytes to S3 → PATCH uploaded=true with MD5.',
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export function registerSetReviewScreenshotTool(server, client) {
|
|
3
|
+
server.tool('capivv_set_review_screenshot', [
|
|
4
|
+
"**Preferred way to attach an App Store review screenshot to a product.** Single tool that routes to the right Apple endpoint based on Capivv's stored product type — sub vs IAP. Use this instead of capivv_set_subscription_review_screenshot / capivv_set_iap_review_screenshot when you don't already know the product type.",
|
|
5
|
+
'',
|
|
6
|
+
'Why it exists: customers with mixed product sets (e.g. 2 auto-renewable subs + 1 lifetime IAP) tripped over the two-tool split — agents reached for the subscription tool for everything, the IAP screenshot silently never uploaded, and Apple rejected the app at review for missing IAP metadata. This unified tool eliminates that class of error: pass the product\'s external_id (e.g. "com.example.pro.lifetime") and Capivv figures out the type.',
|
|
7
|
+
'',
|
|
8
|
+
'Apple expects 640x920 PNG/JPEG. Provide image_url (HTTPS, backend fetches up to 10MB) OR image_base64 (raw bytes inline). The backend handles the 3-step Apple flow (reserve → S3 upload → PATCH uploaded=true with MD5).',
|
|
9
|
+
].join(' '), {
|
|
10
|
+
app_id: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe('Capivv app UUID. external_id is unique per app, not globally. Get this from capivv_list_apps.'),
|
|
13
|
+
external_id: z
|
|
14
|
+
.string()
|
|
15
|
+
.describe('The product\'s external_id (the identifier you used when creating the product — e.g. "com.example.pro.monthly"). Capivv reads the product type from its DB and routes to the right Apple endpoint.'),
|
|
16
|
+
image_url: z
|
|
17
|
+
.string()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Public HTTPS URL of the screenshot. Mutually exclusive with image_base64.'),
|
|
20
|
+
image_base64: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Base64-encoded raw image bytes. Use for private storage. Mutually exclusive with image_url.'),
|
|
24
|
+
file_name: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Filename Apple stores. Defaults to "screenshot.png".'),
|
|
28
|
+
}, async (args) => {
|
|
29
|
+
if (!args.image_url && !args.image_base64) {
|
|
30
|
+
return {
|
|
31
|
+
isError: true,
|
|
32
|
+
content: [
|
|
33
|
+
{
|
|
34
|
+
type: 'text',
|
|
35
|
+
text: 'Provide either image_url (HTTPS) or image_base64 (raw bytes).',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const result = await client.setReviewScreenshot(args);
|
|
41
|
+
return {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: 'text',
|
|
45
|
+
text: JSON.stringify(result, null, 2),
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export function registerSetSubscriptionReviewScreenshotTool(server, client) {
|
|
3
3
|
server.tool('capivv_set_subscription_review_screenshot', [
|
|
4
|
+
'**Lower-level escape hatch — prefer `capivv_set_review_screenshot` unless you already have the Apple subscription numeric id.** This tool only works for auto-renewing subscriptions; calling it with an IAP id will silently fail or upload to the wrong product. The unified tool reads product type from Capivv\'s DB and routes correctly.',
|
|
5
|
+
'',
|
|
4
6
|
'Upload the App Store review screenshot for a subscription. Apple requires this before an auto-renewing subscription can leave MISSING_METADATA and be submitted for review.',
|
|
5
7
|
'',
|
|
6
8
|
'Apple expects 640x920 (or larger) PNG / JPEG. Provide either `image_url` (Capivv backend fetches it via HTTPS) or `image_base64` (raw bytes inline). The backend handles the 3-step Apple flow: reserve → PUT bytes to S3 → PATCH uploaded=true with MD5.',
|
package/dist/types.d.ts
CHANGED
|
@@ -680,3 +680,64 @@ export interface DeleteAppleResult {
|
|
|
680
680
|
deleted: boolean;
|
|
681
681
|
apple_id: string;
|
|
682
682
|
}
|
|
683
|
+
export interface AppUser {
|
|
684
|
+
id: string;
|
|
685
|
+
external_id: string;
|
|
686
|
+
attributes: Record<string, unknown>;
|
|
687
|
+
first_seen_at: string;
|
|
688
|
+
last_seen_at: string;
|
|
689
|
+
created_at: string;
|
|
690
|
+
}
|
|
691
|
+
export interface ListAppUsersResult {
|
|
692
|
+
users: AppUser[];
|
|
693
|
+
total: number;
|
|
694
|
+
}
|
|
695
|
+
export interface FindUserResult {
|
|
696
|
+
/** The matched user, or null if no user matched the query. */
|
|
697
|
+
user: AppUser | null;
|
|
698
|
+
/** Which field matched: "external_id" or "email" — null when no match. */
|
|
699
|
+
matched_on: 'external_id' | 'email' | null;
|
|
700
|
+
}
|
|
701
|
+
export interface GrantEntitlementRequest {
|
|
702
|
+
user_id: string;
|
|
703
|
+
entitlement_id: string;
|
|
704
|
+
/** ISO-8601 expiry. Omit for indefinite (lifetime comp / dev grant). */
|
|
705
|
+
expires_at?: string;
|
|
706
|
+
/** Free-form audit reason (App Reviewer demo / refund / etc.). */
|
|
707
|
+
reason?: string;
|
|
708
|
+
}
|
|
709
|
+
export interface GrantEntitlementResult {
|
|
710
|
+
success: boolean;
|
|
711
|
+
user_id: string;
|
|
712
|
+
entitlement_id: string;
|
|
713
|
+
entitlement: string;
|
|
714
|
+
expires_at?: string;
|
|
715
|
+
}
|
|
716
|
+
export interface RevokeEntitlementRequest {
|
|
717
|
+
user_id: string;
|
|
718
|
+
entitlement_id: string;
|
|
719
|
+
reason?: string;
|
|
720
|
+
}
|
|
721
|
+
export interface SetAppleSubscriptionLevelRequest {
|
|
722
|
+
apple_subscription_id: string;
|
|
723
|
+
/** Apple groupLevel — 1 is the highest tier (e.g. Pro), increments downward. */
|
|
724
|
+
level: number;
|
|
725
|
+
}
|
|
726
|
+
export interface SetAppleSubscriptionLevelResult {
|
|
727
|
+
apple_subscription_id: string;
|
|
728
|
+
level: number;
|
|
729
|
+
}
|
|
730
|
+
export interface SetReviewScreenshotRequest {
|
|
731
|
+
app_id: string;
|
|
732
|
+
external_id: string;
|
|
733
|
+
image_url?: string;
|
|
734
|
+
image_base64?: string;
|
|
735
|
+
file_name?: string;
|
|
736
|
+
}
|
|
737
|
+
export interface SetReviewScreenshotResult {
|
|
738
|
+
external_id: string;
|
|
739
|
+
product_type: 'subscription' | 'consumable' | 'non_consumable';
|
|
740
|
+
apple_product_id: string;
|
|
741
|
+
screenshot_id: string;
|
|
742
|
+
bytes_uploaded: number;
|
|
743
|
+
}
|