@antcde/connect-ts 0.4.26 → 0.4.27-rc.10
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/README.md +67 -3
- package/build/AntConnect.d.ts +8 -0
- package/build/AntConnect.d.ts.map +1 -1
- package/build/AntConnect.js +8 -0
- package/build/AntHttpClient.d.ts +0 -5
- package/build/AntHttpClient.d.ts.map +1 -1
- package/build/AntHttpClient.js +0 -5
- package/build/ai/index.d.ts +5 -0
- package/build/ai/index.d.ts.map +1 -0
- package/build/ai/index.js +3 -0
- package/build/ai/mutationDescriptors.d.ts +3 -0
- package/build/ai/mutationDescriptors.d.ts.map +1 -0
- package/build/ai/mutationDescriptors.js +207 -0
- package/build/ai/mutationTargets.d.ts +21 -0
- package/build/ai/mutationTargets.d.ts.map +1 -0
- package/build/ai/mutationTargets.js +72 -0
- package/build/ai/queryDescriptors.d.ts +3 -0
- package/build/ai/queryDescriptors.d.ts.map +1 -0
- package/build/ai/queryDescriptors.js +174 -0
- package/build/ai/types.d.ts +35 -0
- package/build/ai/types.d.ts.map +1 -0
- package/build/comms/client.d.ts.map +1 -1
- package/build/comms/client.js +39 -41
- package/build/comms/connection.d.ts +32 -0
- package/build/comms/connection.d.ts.map +1 -0
- package/build/comms/connection.js +159 -0
- package/build/comms/handshake.d.ts +16 -0
- package/build/comms/handshake.d.ts.map +1 -0
- package/build/comms/handshake.js +73 -0
- package/build/comms/host.d.ts.map +1 -1
- package/build/comms/host.js +22 -26
- package/build/comms/hostAPI.js +1 -1
- package/build/comms/hostSlot.d.ts +23 -0
- package/build/comms/hostSlot.d.ts.map +1 -0
- package/build/comms/hostSlot.js +55 -0
- package/build/comms/models.d.ts +31 -2
- package/build/comms/models.d.ts.map +1 -1
- package/build/comms/signalChangeTypes.d.ts +27 -1
- package/build/comms/signalChangeTypes.d.ts.map +1 -1
- package/build/comms/signalChangeTypes.js +7 -0
- package/build/comms/signalTypes.d.ts +21 -3
- package/build/comms/signalTypes.d.ts.map +1 -1
- package/build/comms/transport.d.ts +18 -2
- package/build/comms/transport.d.ts.map +1 -1
- package/build/comms/transport.js +25 -10
- package/build/index.d.ts +8 -35
- package/build/index.d.ts.map +1 -1
- package/build/index.js +8 -3
- package/build/service-runtime.d.ts +9 -0
- package/build/service-runtime.d.ts.map +1 -0
- package/build/service-runtime.js +10 -0
- package/build/service-types-app.d.ts +2 -0
- package/build/service-types-app.d.ts.map +1 -0
- package/build/service-types-app.js +3 -0
- package/build/service-types.d.ts +37 -0
- package/build/service-types.d.ts.map +1 -0
- package/build/service-types.js +7 -0
- package/build/services/AiService.d.ts +18 -0
- package/build/services/AiService.d.ts.map +1 -0
- package/build/services/AiService.js +9 -0
- package/build/services/AppService/factory/accessRequests.d.ts +19 -0
- package/build/services/AppService/factory/accessRequests.d.ts.map +1 -0
- package/build/services/AppService/factory/accessRequests.js +17 -0
- package/build/services/AppService/factory/assignments.d.ts +57 -0
- package/build/services/AppService/factory/assignments.d.ts.map +1 -0
- package/build/services/AppService/factory/assignments.js +30 -0
- package/build/services/AppService/factory/categories.d.ts +30 -0
- package/build/services/AppService/factory/categories.d.ts.map +1 -0
- package/build/services/AppService/factory/categories.js +11 -0
- package/build/services/AppService/factory/channels.d.ts +35 -0
- package/build/services/AppService/factory/channels.d.ts.map +1 -0
- package/build/services/AppService/factory/channels.js +18 -0
- package/build/services/AppService/factory/formData.d.ts +14 -0
- package/build/services/AppService/factory/formData.d.ts.map +1 -0
- package/build/services/AppService/factory/formData.js +50 -0
- package/build/services/AppService/factory/media.d.ts +17 -0
- package/build/services/AppService/factory/media.d.ts.map +1 -0
- package/build/services/AppService/factory/media.js +10 -0
- package/build/services/AppService/factory/resourceAccess.d.ts +21 -0
- package/build/services/AppService/factory/resourceAccess.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceAccess.js +49 -0
- package/build/services/AppService/factory/resourceAssignments.d.ts +66 -0
- package/build/services/AppService/factory/resourceAssignments.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceAssignments.js +12 -0
- package/build/services/AppService/factory/resourceChannels.d.ts +89 -0
- package/build/services/AppService/factory/resourceChannels.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceChannels.js +19 -0
- package/build/services/AppService/factory/resourceCommerce.d.ts +52 -0
- package/build/services/AppService/factory/resourceCommerce.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceCommerce.js +18 -0
- package/build/services/AppService/factory/resourceSnapshot.d.ts +75 -0
- package/build/services/AppService/factory/resourceSnapshot.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceSnapshot.js +55 -0
- package/build/services/AppService/factory/resourceUploads.d.ts +37 -0
- package/build/services/AppService/factory/resourceUploads.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceUploads.js +8 -0
- package/build/services/AppService/factory/resources.d.ts +167 -0
- package/build/services/AppService/factory/resources.d.ts.map +1 -0
- package/build/services/AppService/factory/resources.js +45 -0
- package/build/services/AppService/factory/subscriptions.d.ts +73 -0
- package/build/services/AppService/factory/subscriptions.d.ts.map +1 -0
- package/build/services/AppService/factory/subscriptions.js +39 -0
- package/build/services/AppService/factory/taxonomy.d.ts +25 -0
- package/build/services/AppService/factory/taxonomy.d.ts.map +1 -0
- package/build/services/AppService/factory/taxonomy.js +5 -0
- package/build/services/AppService/index.d.ts +58 -0
- package/build/services/AppService/index.d.ts.map +1 -0
- package/build/services/AppService/index.js +74 -0
- package/build/services/AppService/types/accessRequests.d.ts +164 -0
- package/build/services/AppService/types/accessRequests.d.ts.map +1 -0
- package/build/services/AppService/types/app.d.ts +124 -0
- package/build/services/AppService/types/app.d.ts.map +1 -0
- package/build/services/AppService/types/app.js +6 -0
- package/build/services/AppService/types/appCategories.d.ts +44 -0
- package/build/services/AppService/types/appCategories.d.ts.map +1 -0
- package/build/services/AppService/types/appCategories.js +1 -0
- package/build/services/AppService/types/appChangelog.d.ts +31 -0
- package/build/services/AppService/types/appChangelog.d.ts.map +1 -0
- package/build/services/AppService/types/appChangelog.js +1 -0
- package/build/services/AppService/types/appConfigStatus.d.ts +68 -0
- package/build/services/AppService/types/appConfigStatus.d.ts.map +1 -0
- package/build/services/AppService/types/appConfigStatus.js +11 -0
- package/build/services/AppService/types/appList.d.ts +211 -0
- package/build/services/AppService/types/appList.d.ts.map +1 -0
- package/build/services/AppService/types/appList.js +1 -0
- package/build/services/AppService/types/appManifest.d.ts +100 -0
- package/build/services/AppService/types/appManifest.d.ts.map +1 -0
- package/build/services/AppService/types/appManifest.js +4 -0
- package/build/services/AppService/types/appMedia.d.ts +136 -0
- package/build/services/AppService/types/appMedia.d.ts.map +1 -0
- package/build/services/AppService/types/appMedia.js +1 -0
- package/build/services/AppService/types/appRequests.d.ts +126 -0
- package/build/services/AppService/types/appRequests.d.ts.map +1 -0
- package/build/services/AppService/types/appRequests.js +1 -0
- package/build/services/AppService/types/appScopes.d.ts +165 -0
- package/build/services/AppService/types/appScopes.d.ts.map +1 -0
- package/build/services/AppService/types/appScopes.js +1 -0
- package/build/services/AppService/types/channels.d.ts +45 -0
- package/build/services/AppService/types/channels.d.ts.map +1 -0
- package/build/services/AppService/types/channels.js +1 -0
- package/build/services/AppService/types/pricingTiers.d.ts +111 -0
- package/build/services/AppService/types/pricingTiers.d.ts.map +1 -0
- package/build/services/AppService/types/pricingTiers.js +1 -0
- package/build/services/AppService/types/publisherStats.d.ts +20 -0
- package/build/services/AppService/types/publisherStats.d.ts.map +1 -0
- package/build/services/AppService/types/publisherStats.js +1 -0
- package/build/services/AppService/types/releaseChannels.d.ts +127 -0
- package/build/services/AppService/types/releaseChannels.d.ts.map +1 -0
- package/build/services/AppService/types/releaseChannels.js +1 -0
- package/build/services/AppService/types/resourceAssignments.d.ts +38 -0
- package/build/services/AppService/types/resourceAssignments.d.ts.map +1 -0
- package/build/services/AppService/types/resourceAssignments.js +10 -0
- package/build/services/AppService/types/resourceEntitlements.d.ts +118 -0
- package/build/services/AppService/types/resourceEntitlements.d.ts.map +1 -0
- package/build/services/AppService/types/resourceEntitlements.js +1 -0
- package/build/services/AppService/types/resourceReleases.d.ts +230 -0
- package/build/services/AppService/types/resourceReleases.d.ts.map +1 -0
- package/build/services/AppService/types/resourceReleases.js +1 -0
- package/build/services/AppService/types/resourceRequests.d.ts +115 -0
- package/build/services/AppService/types/resourceRequests.d.ts.map +1 -0
- package/build/services/AppService/types/resourceRequests.js +1 -0
- package/build/services/AppService/types/seats.d.ts +220 -0
- package/build/services/AppService/types/seats.d.ts.map +1 -0
- package/build/services/AppService/types/seats.js +4 -0
- package/build/services/AppService/types/sellableResources.d.ts +231 -0
- package/build/services/AppService/types/sellableResources.d.ts.map +1 -0
- package/build/services/AppService/types/sellableResources.js +1 -0
- package/build/services/AppService/types/snapshotFileSource.d.ts +110 -0
- package/build/services/AppService/types/snapshotFileSource.d.ts.map +1 -0
- package/build/services/AppService/types/snapshotFileSource.js +8 -0
- package/build/services/AppService/types/snapshotPayload.d.ts +166 -0
- package/build/services/AppService/types/snapshotPayload.d.ts.map +1 -0
- package/build/services/AppService/types/snapshotPayload.js +19 -0
- package/build/services/AppService/types/snapshotSources.d.ts +116 -0
- package/build/services/AppService/types/snapshotSources.d.ts.map +1 -0
- package/build/services/AppService/types/snapshotSources.js +7 -0
- package/build/services/AppService/types/snapshotUploads.d.ts +109 -0
- package/build/services/AppService/types/snapshotUploads.d.ts.map +1 -0
- package/build/services/AppService/types/snapshotUploads.js +20 -0
- package/build/services/AppService/types/subscriptions.d.ts +182 -0
- package/build/services/AppService/types/subscriptions.d.ts.map +1 -0
- package/build/services/AppService/types/subscriptions.js +1 -0
- package/build/services/AppService/types/taxonomy.d.ts +76 -0
- package/build/services/AppService/types/taxonomy.d.ts.map +1 -0
- package/build/services/AppService/types/taxonomy.js +1 -0
- package/build/services/AppService/types.d.ts +27 -0
- package/build/services/AppService/types.d.ts.map +1 -0
- package/build/services/AppService/types.js +29 -0
- package/build/services/DmsService.d.ts +6 -151
- package/build/services/DmsService.d.ts.map +1 -1
- package/build/services/DmsService.types.d.ts +169 -0
- package/build/services/DmsService.types.d.ts.map +1 -0
- package/build/services/DmsService.types.js +1 -0
- package/build/services/DmsServiceImpl.d.ts.map +1 -1
- package/build/services/DmsServiceImpl.js +8 -0
- package/build/services/LicenseService.d.ts +1 -1
- package/build/services/LicenseService.d.ts.map +1 -1
- package/build/services/LicenseService.js +1 -1
- package/build/services/OAuthClientService.d.ts +20 -0
- package/build/services/OAuthClientService.d.ts.map +1 -0
- package/build/services/OAuthClientService.js +12 -0
- package/build/services/OAuthClientService.types.d.ts +37 -0
- package/build/services/OAuthClientService.types.d.ts.map +1 -0
- package/build/services/OAuthClientService.types.js +4 -0
- package/build/services/ProjectService.d.ts +21 -0
- package/build/services/ProjectService.d.ts.map +1 -1
- package/build/services/ProjectService.js +1 -0
- package/build/services/ReleaseService.d.ts +1 -0
- package/build/services/ReleaseService.d.ts.map +1 -1
- package/build/services/SecretService.d.ts +22 -0
- package/build/services/SecretService.d.ts.map +1 -0
- package/build/services/SecretService.js +21 -0
- package/build/services/SecretService.types.d.ts +147 -0
- package/build/services/SecretService.types.d.ts.map +1 -0
- package/build/services/SecretService.types.js +1 -0
- package/build/services/SecretSharing.types.d.ts +112 -0
- package/build/services/SecretSharing.types.d.ts.map +1 -0
- package/build/services/SecretSharing.types.js +1 -0
- package/build/services/TableService.js +7 -7
- package/build/services/TaskService.d.ts +3 -3
- package/build/services/TaskService.d.ts.map +1 -1
- package/build/services/TaskService.js +1 -1
- package/build/services/TaskService.requests.d.ts +61 -0
- package/build/services/TaskService.requests.d.ts.map +1 -0
- package/build/services/TaskService.requests.js +1 -0
- package/build/services/TaskService.types.d.ts +21 -53
- package/build/services/TaskService.types.d.ts.map +1 -1
- package/build/services/TaskServiceQueries.d.ts +2 -0
- package/build/services/TaskServiceQueries.d.ts.map +1 -1
- package/build/services/TaskServiceQueries.js +13 -2
- package/build/services/TaskTemplate.types.d.ts +74 -1
- package/build/services/TaskTemplate.types.d.ts.map +1 -1
- package/build/services/TokenService.d.ts +5 -1
- package/build/services/TokenService.d.ts.map +1 -1
- package/build/services/TokenService.js +1 -2
- package/build/services/UserService.d.ts +3 -0
- package/build/services/UserService.d.ts.map +1 -1
- package/build/services/UserService.js +4 -4
- package/build/services/Webhook/EventService.d.ts +7 -0
- package/build/services/Webhook/EventService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerHistoryService.d.ts +1 -1
- package/build/services/Webhook/TriggerHistoryService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerSecretService.d.ts +88 -0
- package/build/services/Webhook/TriggerSecretService.d.ts.map +1 -0
- package/build/services/Webhook/TriggerSecretService.js +9 -0
- package/build/services/Webhook/TriggerService.d.ts +108 -0
- package/build/services/Webhook/TriggerService.d.ts.map +1 -1
- package/build/services/Webhook/TriggerService.js +25 -0
- package/build/services/Websockets/StoreEvents.d.ts +44 -0
- package/build/services/Websockets/StoreEvents.d.ts.map +1 -0
- package/build/services/Websockets/StoreEvents.js +5 -0
- package/build/services/userPreferences.d.ts +47 -0
- package/build/services/userPreferences.d.ts.map +1 -0
- package/build/services/userPreferences.js +42 -0
- package/package.json +8 -7
- package/schemas/app-config.schema.json +85 -8
- package/build/services/AppManifest.d.ts +0 -39
- package/build/services/AppManifest.d.ts.map +0 -1
- package/build/services/AppService.d.ts +0 -57
- package/build/services/AppService.d.ts.map +0 -1
- package/build/services/AppService.js +0 -47
- package/build/services/AppService.types.d.ts +0 -173
- package/build/services/AppService.types.d.ts.map +0 -1
- /package/build/{services/AppManifest.js → ai/types.js} +0 -0
- /package/build/services/{AppService.types.js → AppService/types/accessRequests.js} +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { AssignSeatData, AvailableSeatUser, ConfirmPaymentData, CreatePricingTierData, CreateSubscriptionData, FetchAppSubscriptionsParams, PricingTier, RequestSeatChangeData, RequestTierChangeData, Subscription, SubscriptionSeat, UpdatePricingTierData, UpdateSubscriptionData } from '../types';
|
|
2
|
+
import type { MessageResponse } from "../../../AntConnect";
|
|
3
|
+
import type { AntHttpClient } from "../../../AntHttpClient";
|
|
4
|
+
import type { DataWrapper } from "../../../types";
|
|
5
|
+
export interface SubscriptionFactory {
|
|
6
|
+
fetchPricingTiers: (appId: string, requestConfig?: Record<string, any>) => Promise<DataWrapper<PricingTier[]>>;
|
|
7
|
+
createPricingTier: (appId: string, data: CreatePricingTierData) => Promise<DataWrapper<PricingTier>>;
|
|
8
|
+
updatePricingTier: (appId: string, tierId: string, data: UpdatePricingTierData) => Promise<DataWrapper<PricingTier>>;
|
|
9
|
+
deletePricingTier: (appId: string, tierId: string) => Promise<MessageResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the current subscription for the current license, or `data: null`
|
|
12
|
+
* when none exists. Prefers an active/trial/grace subscription; falls back to
|
|
13
|
+
* a `pending_approval` purchase request so the App Detail page can render the
|
|
14
|
+
* "pending approval" state instead of the purchase CTA. "No subscription yet"
|
|
15
|
+
* is a normal state — callers must handle null without treating it as an error.
|
|
16
|
+
*/
|
|
17
|
+
fetchCurrentSubscription: (appId: string) => Promise<DataWrapper<Subscription | null>>;
|
|
18
|
+
fetchSubscription: (appId: string, subscriptionId: string) => Promise<DataWrapper<Subscription>>;
|
|
19
|
+
/**
|
|
20
|
+
* Buyer requests to purchase a tier. The returned subscription is
|
|
21
|
+
* `pending_approval` — access is NOT granted until the publisher approves.
|
|
22
|
+
*/
|
|
23
|
+
createSubscription: (appId: string, data: CreateSubscriptionData) => Promise<DataWrapper<Subscription>>;
|
|
24
|
+
updateSubscription: (appId: string, subscriptionId: string, data: UpdateSubscriptionData) => Promise<DataWrapper<Subscription>>;
|
|
25
|
+
cancelSubscription: (appId: string, subscriptionId: string) => Promise<DataWrapper<Subscription>>;
|
|
26
|
+
/**
|
|
27
|
+
* Buyer recovery: reactivate a cancelled subscription that is still inside
|
|
28
|
+
* its paid period. Restores `trial`/`active` without a new purchase. The BE
|
|
29
|
+
* returns 409 if the subscription is not cancelled or its period has already
|
|
30
|
+
* ended (in that case create a fresh subscription instead).
|
|
31
|
+
*/
|
|
32
|
+
reactivateSubscription: (appId: string, subscriptionId: string) => Promise<DataWrapper<Subscription>>;
|
|
33
|
+
/** Publisher inbox — pending purchase requests awaiting approval for this app. */
|
|
34
|
+
fetchPendingApprovals: (appId: string) => Promise<DataWrapper<Subscription[]>>;
|
|
35
|
+
/**
|
|
36
|
+
* Publisher list of the app's subscriptions (active/trial/grace/expired/
|
|
37
|
+
* cancelled). Excludes `pending_approval` by default — use `fetchPendingApprovals`
|
|
38
|
+
* for the inbox. Drives the "Active subscriptions" list + renewal confirmation.
|
|
39
|
+
*/
|
|
40
|
+
fetchAppSubscriptions: (appId: string, params?: FetchAppSubscriptionsParams) => Promise<DataWrapper<Subscription[]>>;
|
|
41
|
+
/** Publisher approves a pending purchase request — grants access (trial/active). */
|
|
42
|
+
approvePurchase: (appId: string, subscriptionId: string) => Promise<DataWrapper<Subscription>>;
|
|
43
|
+
/** Publisher denies a pending purchase request — no access is granted (cancelled). */
|
|
44
|
+
denyPurchase: (appId: string, subscriptionId: string) => Promise<DataWrapper<Subscription>>;
|
|
45
|
+
/**
|
|
46
|
+
* Publisher confirms the next recurring offline payment was received,
|
|
47
|
+
* advancing the billing period. NOTE: this is a PUBLISHER (seller) action —
|
|
48
|
+
* it replaces the former buyer-side `confirmSubscriptionPayment`.
|
|
49
|
+
*/
|
|
50
|
+
confirmRenewal: (appId: string, subscriptionId: string, data?: ConfirmPaymentData) => Promise<DataWrapper<Subscription>>;
|
|
51
|
+
/** Buyer requests a tier change. Returns 202 — change is applied on confirm. */
|
|
52
|
+
requestTierChange: (appId: string, subscriptionId: string, data: RequestTierChangeData) => Promise<DataWrapper<Subscription>>;
|
|
53
|
+
/** Publisher confirms a pending tier change request (records the offline payment). */
|
|
54
|
+
confirmTierChange: (appId: string, subscriptionId: string, data?: ConfirmPaymentData) => Promise<DataWrapper<Subscription>>;
|
|
55
|
+
/** Publisher rejects a pending tier change request. */
|
|
56
|
+
rejectTierChange: (appId: string, subscriptionId: string) => Promise<DataWrapper<Subscription>>;
|
|
57
|
+
/**
|
|
58
|
+
* Buyer requests a seat INCREASE (buying more seats — offline payment).
|
|
59
|
+
* Returns 202; the new seat count is applied only when the publisher confirms.
|
|
60
|
+
* Seat decreases use `updateSubscription` (no charge).
|
|
61
|
+
*/
|
|
62
|
+
requestSeatChange: (appId: string, subscriptionId: string, data: RequestSeatChangeData) => Promise<DataWrapper<Subscription>>;
|
|
63
|
+
/** Publisher confirms the offline payment — applies the new seat count. */
|
|
64
|
+
confirmSeatChange: (appId: string, subscriptionId: string, data?: ConfirmPaymentData) => Promise<DataWrapper<Subscription>>;
|
|
65
|
+
/** Publisher rejects a pending seat change request. */
|
|
66
|
+
rejectSeatChange: (appId: string, subscriptionId: string) => Promise<DataWrapper<Subscription>>;
|
|
67
|
+
fetchSubscriptionSeats: (appId: string, subscriptionId: string) => Promise<DataWrapper<SubscriptionSeat[]>>;
|
|
68
|
+
assignSubscriptionSeat: (appId: string, subscriptionId: string, data: AssignSeatData) => Promise<DataWrapper<SubscriptionSeat>>;
|
|
69
|
+
removeSubscriptionSeat: (appId: string, subscriptionId: string, seatId: string) => Promise<MessageResponse>;
|
|
70
|
+
fetchAvailableSeatUsers: (appId: string, subscriptionId: string) => Promise<DataWrapper<AvailableSeatUser[]>>;
|
|
71
|
+
}
|
|
72
|
+
export declare function newSubscriptionFactory(client: AntHttpClient): SubscriptionFactory;
|
|
73
|
+
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/factory/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,WAAW,EACX,qBAAqB,EACrB,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,sBAAsB,EACvB,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,iBAAiB,EAAE,CAAC,CAAC,CAAA;CAC9G;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,GAAG,mBAAmB,CAkEjF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import qs from 'qs';
|
|
2
|
+
export function newSubscriptionFactory(client) {
|
|
3
|
+
return {
|
|
4
|
+
// Pricing tiers
|
|
5
|
+
fetchPricingTiers: (appId, requestConfig) => client.get(`/store/apps/${appId}/pricing-tiers`, requestConfig),
|
|
6
|
+
createPricingTier: (appId, data) => client.post(`/store/apps/${appId}/pricing-tiers`, data),
|
|
7
|
+
updatePricingTier: (appId, tierId, data) => client.put(`/store/apps/${appId}/pricing-tiers/${tierId}`, data),
|
|
8
|
+
deletePricingTier: (appId, tierId) => client.delete(`/store/apps/${appId}/pricing-tiers/${tierId}`),
|
|
9
|
+
// Subscriptions
|
|
10
|
+
fetchCurrentSubscription: appId => client.get(`/store/apps/${appId}/subscriptions/current`),
|
|
11
|
+
fetchSubscription: (appId, subscriptionId) => client.get(`/store/apps/${appId}/subscriptions/${subscriptionId}`),
|
|
12
|
+
createSubscription: (appId, data) => client.post(`/store/apps/${appId}/subscriptions`, data),
|
|
13
|
+
updateSubscription: (appId, subscriptionId, data) => client.put(`/store/apps/${appId}/subscriptions/${subscriptionId}`, data),
|
|
14
|
+
cancelSubscription: (appId, subscriptionId) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/cancel`),
|
|
15
|
+
reactivateSubscription: (appId, subscriptionId) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/reactivate`, {}),
|
|
16
|
+
// Purchase approval (offline payment)
|
|
17
|
+
fetchPendingApprovals: appId => client.get(`/store/apps/${appId}/subscriptions/pending`),
|
|
18
|
+
fetchAppSubscriptions: (appId, params = {}) => {
|
|
19
|
+
const queryString = qs.stringify(params, { skipNulls: true });
|
|
20
|
+
return client.get(`/store/apps/${appId}/subscriptions${queryString ? `?${queryString}` : ''}`);
|
|
21
|
+
},
|
|
22
|
+
approvePurchase: (appId, subscriptionId) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/approve`, {}),
|
|
23
|
+
denyPurchase: (appId, subscriptionId) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/deny`, {}),
|
|
24
|
+
confirmRenewal: (appId, subscriptionId, data = {}) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/confirm-renewal`, data),
|
|
25
|
+
// Tier change flow
|
|
26
|
+
requestTierChange: (appId, subscriptionId, data) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/request-tier-change`, data),
|
|
27
|
+
confirmTierChange: (appId, subscriptionId, data = {}) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/confirm-tier-change`, data),
|
|
28
|
+
rejectTierChange: (appId, subscriptionId) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/reject-tier-change`, {}),
|
|
29
|
+
// Seat change flow (increase = offline payment, publisher-approved)
|
|
30
|
+
requestSeatChange: (appId, subscriptionId, data) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/request-seat-change`, data),
|
|
31
|
+
confirmSeatChange: (appId, subscriptionId, data = {}) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/confirm-seat-change`, data),
|
|
32
|
+
rejectSeatChange: (appId, subscriptionId) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/reject-seat-change`, {}),
|
|
33
|
+
// Subscription seats
|
|
34
|
+
fetchSubscriptionSeats: (appId, subscriptionId) => client.get(`/store/apps/${appId}/subscriptions/${subscriptionId}/seats`),
|
|
35
|
+
assignSubscriptionSeat: (appId, subscriptionId, data) => client.post(`/store/apps/${appId}/subscriptions/${subscriptionId}/seats`, data),
|
|
36
|
+
removeSubscriptionSeat: (appId, subscriptionId, seatId) => client.delete(`/store/apps/${appId}/subscriptions/${subscriptionId}/seats/${seatId}`),
|
|
37
|
+
fetchAvailableSeatUsers: (appId, subscriptionId) => client.get(`/store/apps/${appId}/subscriptions/${subscriptionId}/seats/available-users`),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { StoreTaxonomy } from '../types';
|
|
2
|
+
import type { AntHttpClient } from "../../../AntHttpClient";
|
|
3
|
+
import type { DataWrapper } from "../../../types";
|
|
4
|
+
/**
|
|
5
|
+
* How Discover is navigated (AAD-935 item 1). Split out of the AppService
|
|
6
|
+
* factory to keep `index.ts` focused; composed into `AppService` there.
|
|
7
|
+
*/
|
|
8
|
+
export interface StoreTaxonomyFactory {
|
|
9
|
+
/**
|
|
10
|
+
* The top-level kinds and their subcategories.
|
|
11
|
+
*
|
|
12
|
+
* **Ungated, and safe to call before you know whether resources are
|
|
13
|
+
* enabled** — that is the reason it exists. With the flag off it returns the
|
|
14
|
+
* single `apps` kind whose subcategories are the same rows
|
|
15
|
+
* `fetchCategories()` returns, so rendering the tree gives you today's flat
|
|
16
|
+
* category rail. Do not gate the call on `fetchStoreCapabilities()`; read the
|
|
17
|
+
* number of kinds instead.
|
|
18
|
+
*
|
|
19
|
+
* Navigation only: neither `fetchApps` nor `fetchResources` changes shape
|
|
20
|
+
* because of it, and the client still stamps `kind` when it merges them.
|
|
21
|
+
*/
|
|
22
|
+
fetchStoreTaxonomy: () => Promise<DataWrapper<StoreTaxonomy>>;
|
|
23
|
+
}
|
|
24
|
+
export declare function newStoreTaxonomyFactory(client: AntHttpClient): StoreTaxonomyFactory;
|
|
25
|
+
//# sourceMappingURL=taxonomy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"taxonomy.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/factory/taxonomy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,+BAAuB;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAe;AAE1C;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;OAYG;IACH,kBAAkB,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAA;CAC9D;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,aAAa,GAAG,oBAAoB,CAInF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { AppAccessRequestFactory } from './factory/accessRequests';
|
|
2
|
+
import type { AppAssignmentFactory } from './factory/assignments';
|
|
3
|
+
import type { AppCategoryFactory } from './factory/categories';
|
|
4
|
+
import type { ReleaseChannelFactory } from './factory/channels';
|
|
5
|
+
import type { AppMediaFactory } from './factory/media';
|
|
6
|
+
import type { SellableResourceFactory } from './factory/resources';
|
|
7
|
+
import type { SubscriptionFactory } from './factory/subscriptions';
|
|
8
|
+
import type { StoreTaxonomyFactory } from './factory/taxonomy';
|
|
9
|
+
import type { App, AppChangelogEntry, AppConfigResource, AppImpactAnalysis, AppResourceStatus, AppResourceSyncResult, AppRunnableContexts, AppTemplate, AppUpdateResult, AppVersionFormData, AvailableUpdatesParams, AvailableUpdatesResponse, BatchUpdateAppsParams, BatchUpdateAppsResponse, FetchAppChangelogParams, FetchAppsParams, ListApp, PublisherStatsApp, UpdateInstalledAppParams } from './types';
|
|
10
|
+
import type { MessageResponse } from "../../AntConnect";
|
|
11
|
+
import type { AntHttpClient } from "../../AntHttpClient";
|
|
12
|
+
import type { DataWrapper } from "../../types";
|
|
13
|
+
export * from './types';
|
|
14
|
+
export interface AppService extends SubscriptionFactory, SellableResourceFactory, ReleaseChannelFactory, AppAssignmentFactory, AppAccessRequestFactory, AppMediaFactory, AppCategoryFactory, StoreTaxonomyFactory {
|
|
15
|
+
createApp: (appData: AppTemplate) => Promise<DataWrapper<App>>;
|
|
16
|
+
updateApp: (id: string, appData: Partial<AppTemplate>) => Promise<DataWrapper<App>>;
|
|
17
|
+
deleteApp: (id: string) => Promise<MessageResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Force-delete a deprecated app, cascading the uninstall/deactivation across
|
|
20
|
+
* every license and project. Only valid for deprecated apps (409 otherwise).
|
|
21
|
+
*/
|
|
22
|
+
forceDeleteApp: (id: string) => Promise<MessageResponse>;
|
|
23
|
+
deleteAppImage: (id: string) => Promise<MessageResponse>;
|
|
24
|
+
createVersion: (appId: string, versionData: AppVersionFormData) => Promise<DataWrapper<App>>;
|
|
25
|
+
deleteVersion: (appId: string, versionId: string) => Promise<MessageResponse>;
|
|
26
|
+
fetchImpactAnalysis: (appId: string) => Promise<DataWrapper<AppImpactAnalysis>>;
|
|
27
|
+
fetchAppContent: (appId: string, versionId: string, path: string) => Promise<any>;
|
|
28
|
+
fetchVersionReadme: (appId: string, versionId: string) => Promise<any>;
|
|
29
|
+
fetchVersionConfig: (appId: string, versionId: string) => Promise<any>;
|
|
30
|
+
fetchVersionChangelog: (appId: string, versionId: string) => Promise<any>;
|
|
31
|
+
getAppResourceStatus: (appId: string, resource: AppConfigResource) => Promise<AppResourceStatus>;
|
|
32
|
+
syncAppResource: (appId: string, resource: AppConfigResource) => Promise<AppResourceSyncResult>;
|
|
33
|
+
fetchApps: (params: FetchAppsParams, requestConfig?: Record<string, any>) => Promise<DataWrapper<ListApp[]>>;
|
|
34
|
+
fetchApp: (appId: string, requestConfig?: Record<string, any>) => Promise<App>;
|
|
35
|
+
fetchAppProjects: (appId: string, requestConfig?: Record<string, any>) => Promise<DataWrapper<AppRunnableContexts>>;
|
|
36
|
+
fetchPublisherStats: () => Promise<DataWrapper<PublisherStatsApp[]>>;
|
|
37
|
+
installApp: (licenseId: string, versionId: string, channelId?: string) => Promise<DataWrapper<App>>;
|
|
38
|
+
uninstallApp: (licenseId: string, versionId: string, force?: boolean) => Promise<DataWrapper<App>>;
|
|
39
|
+
activateApp: (projectId: string, versionId: string, channelId?: string) => Promise<DataWrapper<App>>;
|
|
40
|
+
deactivateApp: (projectId: string, versionId: string) => Promise<DataWrapper<App>>;
|
|
41
|
+
setLicenseAppAutoUpdate: (licenseId: string, appId: string, enabled: boolean) => Promise<DataWrapper<App>>;
|
|
42
|
+
setProjectAppAutoUpdate: (projectId: string, appId: string, enabled: boolean) => Promise<DataWrapper<App>>;
|
|
43
|
+
setLicenseAppChannel: (licenseId: string, appId: string, channelId: string) => Promise<DataWrapper<App>>;
|
|
44
|
+
setProjectAppChannel: (projectId: string, appId: string, channelId: string) => Promise<DataWrapper<App>>;
|
|
45
|
+
linkApp: (taskId: string, appId: string) => Promise<DataWrapper<App>>;
|
|
46
|
+
unlinkApp: (taskId: string, appId: string) => Promise<DataWrapper<App>>;
|
|
47
|
+
/** Save (or clear) the app's restorable view state on a task↔app link. */
|
|
48
|
+
saveAppState: (taskId: string, appId: string, state: Record<string, string> | null) => Promise<DataWrapper<App>>;
|
|
49
|
+
deprecateApp: (appId: string, message?: string) => Promise<DataWrapper<App>>;
|
|
50
|
+
undeprecateApp: (appId: string) => Promise<DataWrapper<App>>;
|
|
51
|
+
updateInstalledApp: (appId: string, params?: UpdateInstalledAppParams, requestConfig?: Record<string, any>) => Promise<DataWrapper<AppUpdateResult>>;
|
|
52
|
+
batchUpdateApps: (params?: BatchUpdateAppsParams) => Promise<DataWrapper<BatchUpdateAppsResponse>>;
|
|
53
|
+
fetchAvailableUpdates: (params?: AvailableUpdatesParams) => Promise<DataWrapper<AvailableUpdatesResponse>>;
|
|
54
|
+
fetchAppChangelog: (appId: string, params?: FetchAppChangelogParams) => Promise<DataWrapper<AppChangelogEntry[]>>;
|
|
55
|
+
}
|
|
56
|
+
export declare function newAppService(client: AntHttpClient): AppService;
|
|
57
|
+
export default AppService;
|
|
58
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/AppService/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AACvE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uB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M,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAA;IAGpJ,eAAe,EAAE,CAAC,MAAM,CAAC,EAAE,qBAAqB,KAAK,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC,CAAA;IAGlG,qBAAqB,EAAE,CAAC,MAAM,CAAC,EAAE,sBAAsB,KAAK,OAAO,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC,CAAA;IAG1G,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAA;CAClH;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,UAAU,CA8F/D;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import qs from 'qs';
|
|
2
|
+
import { newAppAccessRequestFactory } from './factory/accessRequests';
|
|
3
|
+
import { newAppAssignmentFactory } from './factory/assignments';
|
|
4
|
+
import { newAppCategoryFactory } from './factory/categories';
|
|
5
|
+
import { newReleaseChannelFactory } from './factory/channels';
|
|
6
|
+
import { maybeFormData, toFormData } from './factory/formData';
|
|
7
|
+
import { newAppMediaFactory } from './factory/media';
|
|
8
|
+
import { newSellableResourceFactory } from './factory/resources';
|
|
9
|
+
import { newSubscriptionFactory } from './factory/subscriptions';
|
|
10
|
+
import { newStoreTaxonomyFactory } from './factory/taxonomy';
|
|
11
|
+
export * from './types';
|
|
12
|
+
export function newAppService(client) {
|
|
13
|
+
return {
|
|
14
|
+
...newSubscriptionFactory(client),
|
|
15
|
+
...newSellableResourceFactory(client),
|
|
16
|
+
...newReleaseChannelFactory(client),
|
|
17
|
+
...newAppAssignmentFactory(client),
|
|
18
|
+
...newAppAccessRequestFactory(client),
|
|
19
|
+
...newAppMediaFactory(client),
|
|
20
|
+
...newAppCategoryFactory(client),
|
|
21
|
+
...newStoreTaxonomyFactory(client),
|
|
22
|
+
// An icon File is sent as multipart; a scalar-only edit stays JSON. updateApp
|
|
23
|
+
// is a PUT, but PHP doesn't parse multipart PUT bodies, so spoof it with POST
|
|
24
|
+
// + `_method=PUT` when a file rides along.
|
|
25
|
+
createApp: appData => client.post('/store/apps', maybeFormData(appData)),
|
|
26
|
+
updateApp: (id, appData) => appData.image instanceof Blob
|
|
27
|
+
? client.post(`/store/apps/${id}`, toFormData({ ...appData, _method: 'PUT' }))
|
|
28
|
+
: client.put(`/store/apps/${id}`, appData),
|
|
29
|
+
deleteApp: id => client.delete(`/store/apps/${id}`),
|
|
30
|
+
forceDeleteApp: id => client.delete(`/store/apps/${id}/force`),
|
|
31
|
+
deleteAppImage: id => client.delete(`/store/apps/${id}/deleteAppImage`),
|
|
32
|
+
createVersion: (appId, versionData) => client.post(`/store/apps/${appId}/versions`, maybeFormData(versionData)),
|
|
33
|
+
deleteVersion: (appId, versionId) => client.delete(`/store/apps/${appId}/versions/${versionId}`),
|
|
34
|
+
fetchImpactAnalysis: appId => client.get(`/store/apps/${appId}/impact-analysis`),
|
|
35
|
+
fetchAppContent: (appId, versionId, path) => client.get(`/store/apps/${appId}/versions/${versionId}/contents/${path}`),
|
|
36
|
+
fetchVersionReadme: (appId, versionId) => client.get(`/store/apps/${appId}/versions/${versionId}/readme`),
|
|
37
|
+
fetchVersionConfig: (appId, versionId) => client.get(`/store/apps/${appId}/versions/${versionId}/config`),
|
|
38
|
+
fetchVersionChangelog: (appId, versionId) => client.get(`/store/apps/${appId}/versions/${versionId}/changelog`),
|
|
39
|
+
getAppResourceStatus: (appId, resource) => client.get(`/store/apps/${appId}/config/${resource}/status`),
|
|
40
|
+
syncAppResource: (appId, resource) => client.post(`/store/apps/${appId}/config/${resource}/sync`),
|
|
41
|
+
fetchApps: (params = {}, requestConfig) => {
|
|
42
|
+
// `config` is CSV, not bracket-array — pull it out of the default
|
|
43
|
+
// `arrayFormat: 'brackets'` serialization and append it joined.
|
|
44
|
+
const { config, ...rest } = params;
|
|
45
|
+
const queryString = qs.stringify(rest, { skipNulls: true, arrayFormat: 'brackets' });
|
|
46
|
+
const configString = config?.length ? `config=${config.join(',')}` : '';
|
|
47
|
+
const query = [queryString, configString].filter(Boolean).join('&');
|
|
48
|
+
return client.get(`/store/apps${query ? `?${query}` : ''}`, requestConfig);
|
|
49
|
+
},
|
|
50
|
+
fetchApp: (appId, requestConfig) => client.get(`/store/apps/${appId}`, requestConfig),
|
|
51
|
+
fetchAppProjects: (appId, requestConfig) => client.get(`/store/apps/${appId}/projects`, requestConfig),
|
|
52
|
+
fetchPublisherStats: () => client.get('/store/publisher/stats'),
|
|
53
|
+
installApp: (licenseId, versionId, channelId) => client.post(`/store/resources/apps-versions/${versionId}/licenses/${licenseId}`, channelId ? { channel_id: channelId } : undefined),
|
|
54
|
+
uninstallApp: (licenseId, versionId, force) => client.delete(`/store/resources/apps-versions/${versionId}/licenses/${licenseId}${force ? '?force=true' : ''}`),
|
|
55
|
+
activateApp: (projectId, versionId, channelId) => client.post(`/store/resources/apps-versions/${versionId}/projects/${projectId}`, channelId ? { channel_id: channelId } : undefined),
|
|
56
|
+
deactivateApp: (projectId, versionId) => client.delete(`/store/resources/apps-versions/${versionId}/projects/${projectId}`),
|
|
57
|
+
setLicenseAppAutoUpdate: (licenseId, appId, enabled) => client.post(`/store/resources/apps/${appId}/licenses/${licenseId}/auto-update`, { enabled }),
|
|
58
|
+
setProjectAppAutoUpdate: (projectId, appId, enabled) => client.post(`/store/resources/apps/${appId}/projects/${projectId}/auto-update`, { enabled }),
|
|
59
|
+
setLicenseAppChannel: (licenseId, appId, channelId) => client.post(`/store/resources/apps/${appId}/licenses/${licenseId}/channel`, { channel_id: channelId }),
|
|
60
|
+
setProjectAppChannel: (projectId, appId, channelId) => client.post(`/store/resources/apps/${appId}/projects/${projectId}/channel`, { channel_id: channelId }),
|
|
61
|
+
linkApp: (taskId, appId) => client.post(`/store/resources/apps/${appId}/tasks/${taskId}`),
|
|
62
|
+
unlinkApp: (taskId, appId) => client.delete(`/store/resources/apps/${appId}/tasks/${taskId}`),
|
|
63
|
+
saveAppState: (taskId, appId, state) => client.patch(`/store/resources/apps/${appId}/tasks/${taskId}`, { app_state: state }),
|
|
64
|
+
deprecateApp: (appId, message) => client.post(`/store/apps/${appId}/deprecate`, { message }),
|
|
65
|
+
undeprecateApp: appId => client.post(`/store/apps/${appId}/undeprecate`),
|
|
66
|
+
updateInstalledApp: (appId, params = {}, requestConfig) => client.post(`/store/apps/${appId}/update`, params, requestConfig),
|
|
67
|
+
batchUpdateApps: (params = {}) => client.post('/store/resources/apps/batch-update', params),
|
|
68
|
+
fetchAvailableUpdates: (params = {}) => client.get('/store/resources/apps/updates-available', { params }),
|
|
69
|
+
fetchAppChangelog: (appId, params = {}) => {
|
|
70
|
+
const queryString = qs.stringify(params, { skipNulls: true });
|
|
71
|
+
return client.get(`/store/apps/${appId}/changelog${queryString ? `?${queryString}` : ''}`);
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { AppTrustLevel } from './app';
|
|
2
|
+
import type { AppScope } from './appScopes';
|
|
3
|
+
/**
|
|
4
|
+
* `revoked` = publisher pulled a granted access. `cancelled` = the REQUESTER
|
|
5
|
+
* withdrew their own pending request (kept as a status, not deleted, so it stays
|
|
6
|
+
* visible in "My requests" and the publisher inbox).
|
|
7
|
+
*/
|
|
8
|
+
export type AccessRequestStatus = 'pending' | 'approved' | 'denied' | 'revoked' | 'expired' | 'cancelled';
|
|
9
|
+
/**
|
|
10
|
+
* Scope an approval grants the requester.
|
|
11
|
+
*
|
|
12
|
+
* NOTE: the backend currently does not consume `access_scope` on approval — the
|
|
13
|
+
* `app_access_requests.access_scope` column was dropped and approval always
|
|
14
|
+
* grants license-level access. This type exists so the store-v3 inbox UI type-
|
|
15
|
+
* checks; wire real backend support before relying on `license_and_projects`.
|
|
16
|
+
*/
|
|
17
|
+
export type AccessScope = 'license_only' | 'license_and_projects';
|
|
18
|
+
export interface AccessRequest {
|
|
19
|
+
id: string;
|
|
20
|
+
app_id: string;
|
|
21
|
+
app: {
|
|
22
|
+
id: string;
|
|
23
|
+
title: string;
|
|
24
|
+
icon: string;
|
|
25
|
+
trust_level: AppTrustLevel;
|
|
26
|
+
license: {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
requester_user: {
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
email: string;
|
|
35
|
+
};
|
|
36
|
+
requester_license: {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
theme?: string;
|
|
40
|
+
};
|
|
41
|
+
status: AccessRequestStatus;
|
|
42
|
+
message: string | null;
|
|
43
|
+
response_message: string | null;
|
|
44
|
+
responded_by: {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
} | null;
|
|
48
|
+
responded_at: string | null;
|
|
49
|
+
expires_at: string | null;
|
|
50
|
+
created_at: string;
|
|
51
|
+
updated_at: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The requesting license's OWN latest access request for an app, as embedded on
|
|
55
|
+
* `App.my_access_request` / `ListApp.my_access_request`.
|
|
56
|
+
*
|
|
57
|
+
* A deliberate SUBSET of {@link AccessRequest} — the embedded copy carries only
|
|
58
|
+
* what a card/banner needs to pick a CTA ("Request access" / "Pending" /
|
|
59
|
+
* "Approved" / "Denied") and explain a rejection. It does NOT carry `app`,
|
|
60
|
+
* `requester_user`, `requester_license`, `message`, `responded_by` or
|
|
61
|
+
* `updated_at`; those exist only on the publisher inbox endpoints
|
|
62
|
+
* (`fetchAccessRequests` / `fetchAppAccessRequests`), which return the full
|
|
63
|
+
* `AccessRequest`. Typing this as `AccessRequest` reads `undefined` at runtime.
|
|
64
|
+
*/
|
|
65
|
+
export interface MyAccessRequestSummary {
|
|
66
|
+
id: string;
|
|
67
|
+
status: AccessRequestStatus;
|
|
68
|
+
/** ISO 8601, or null when the grant does not expire. */
|
|
69
|
+
expires_at: string | null;
|
|
70
|
+
/** ISO 8601 when the publisher answered; null while pending. */
|
|
71
|
+
responded_at: string | null;
|
|
72
|
+
/** ISO 8601 when the request was submitted. */
|
|
73
|
+
created_at: string | null;
|
|
74
|
+
/**
|
|
75
|
+
* The publisher's reason, rendered under the CTA on a denied/revoked request.
|
|
76
|
+
* Null while pending or when the publisher gave no reason.
|
|
77
|
+
*/
|
|
78
|
+
response_message: string | null;
|
|
79
|
+
}
|
|
80
|
+
export interface CreateAccessRequestData {
|
|
81
|
+
message?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface RespondAccessRequestData {
|
|
84
|
+
action: 'approve' | 'deny';
|
|
85
|
+
response_message?: string;
|
|
86
|
+
expires_at?: string;
|
|
87
|
+
/** See {@link AccessScope} — currently ignored by the backend on approval. */
|
|
88
|
+
access_scope?: AccessScope;
|
|
89
|
+
}
|
|
90
|
+
export interface FetchAccessRequestsParams {
|
|
91
|
+
status?: AccessRequestStatus;
|
|
92
|
+
}
|
|
93
|
+
export type AppUpdateStatus = 'updated' | 'no_update' | 'forbidden' | 'not_found' | 'failed';
|
|
94
|
+
export interface AppUpdateResult {
|
|
95
|
+
app_id: string;
|
|
96
|
+
/**
|
|
97
|
+
* The install scope that was acted on (AAD-906) — echoes the requested
|
|
98
|
+
* `scope`, or the one resolved from the ambient context when none was given.
|
|
99
|
+
* Null only when the app itself could not be found.
|
|
100
|
+
*/
|
|
101
|
+
scope: AppScope | null;
|
|
102
|
+
status: AppUpdateStatus;
|
|
103
|
+
app_version_id: string | null;
|
|
104
|
+
message?: string;
|
|
105
|
+
dry_run?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Body for `updateInstalledApp`. Omit `scope` to keep the pre-AAD-906
|
|
109
|
+
* behaviour, where the ambient `X-Project-ID` header picks the install.
|
|
110
|
+
*/
|
|
111
|
+
export interface UpdateInstalledAppParams {
|
|
112
|
+
scope?: AppScope;
|
|
113
|
+
}
|
|
114
|
+
export type BatchUpdateAppResult = AppUpdateResult;
|
|
115
|
+
export interface BatchUpdateAppsResponse {
|
|
116
|
+
summary: {
|
|
117
|
+
total: number;
|
|
118
|
+
updated: number;
|
|
119
|
+
no_update: number;
|
|
120
|
+
failed: number;
|
|
121
|
+
dry_run: boolean;
|
|
122
|
+
};
|
|
123
|
+
results: BatchUpdateAppResult[];
|
|
124
|
+
}
|
|
125
|
+
export interface BatchUpdateAppsParams {
|
|
126
|
+
app_ids?: string[];
|
|
127
|
+
/** Restrict the batch to one install scope; omit for the ambient context. */
|
|
128
|
+
scope?: AppScope;
|
|
129
|
+
dry_run?: boolean;
|
|
130
|
+
}
|
|
131
|
+
/** One install with a pending update — keyed by (app, scope), not by app. */
|
|
132
|
+
export interface AvailableUpdate {
|
|
133
|
+
app_id: string;
|
|
134
|
+
name: string;
|
|
135
|
+
/**
|
|
136
|
+
* Which install this entry is about (AAD-906). In a project context the feed
|
|
137
|
+
* returns BOTH the license install and the project install when both are
|
|
138
|
+
* behind, so entries are only meaningful together with this field.
|
|
139
|
+
*/
|
|
140
|
+
scope: AppScope;
|
|
141
|
+
/** The ResourceApp link this entry describes. */
|
|
142
|
+
resource_app_id: string | null;
|
|
143
|
+
/** The release channel this install advances from; null when unpinned. */
|
|
144
|
+
channel_id: string | null;
|
|
145
|
+
/**
|
|
146
|
+
* Versions held BY THIS SCOPE. Plural because a project-scope app accumulates
|
|
147
|
+
* one license row per enabled version, so the license "install" is a pool.
|
|
148
|
+
*/
|
|
149
|
+
current_version_ids: string[];
|
|
150
|
+
target_version_id: string;
|
|
151
|
+
target_version: string;
|
|
152
|
+
}
|
|
153
|
+
export interface AvailableUpdatesResponse {
|
|
154
|
+
/** Number of INSTALLS behind — a dual-scope app behind at both counts 2. */
|
|
155
|
+
count: number;
|
|
156
|
+
/** Number of distinct apps behind. Use this for a per-app badge. */
|
|
157
|
+
app_count: number;
|
|
158
|
+
results: AvailableUpdate[];
|
|
159
|
+
}
|
|
160
|
+
/** Query for `fetchAvailableUpdates`. Omit `scope` for every reachable scope. */
|
|
161
|
+
export interface AvailableUpdatesParams {
|
|
162
|
+
scope?: AppScope;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=accessRequests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessRequests.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/accessRequests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAE3C;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,CAAA;AAEzG;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,sBAAsB,CAAA;AAEjE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,aAAa,CAAC;QAAC,OAAO,EAAE;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;IACnH,cAAc,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAI3D,iBAAiB,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;IAC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e,EAAE,CAAA;CAC3B;AAED,iFAAiF;AACjF,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,QAAQ,CAAA;CACjB"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { ResourceLabel } from '../../LabelService';
|
|
2
|
+
import type { MyAccessRequestSummary } from './accessRequests';
|
|
3
|
+
import type { AppCategory } from './appCategories';
|
|
4
|
+
import type { AppMedia, AppVersion } from './appMedia';
|
|
5
|
+
import type { AppInProject, AppOnLicense, AppScope } from './appScopes';
|
|
6
|
+
import type { AppChannel } from './channels';
|
|
7
|
+
import type { AccessBlock } from './seats';
|
|
8
|
+
import type { AppSubscriptionSummary } from './subscriptions';
|
|
9
|
+
export type AccessLevel = 'community' | 'enterprise';
|
|
10
|
+
export type AppAvailability = 'always_available' | 'request_access' | 'private';
|
|
11
|
+
export type AppTrustLevel = 'standard' | 'verified' | 'certified';
|
|
12
|
+
/**
|
|
13
|
+
* Why a NEW access request is blocked, or null when one can be submitted (or
|
|
14
|
+
* the app does not use the request-access model, in which case it is not
|
|
15
|
+
* applicable). Consistent on both `App` and `ListApp`. Use this to render a
|
|
16
|
+
* meaningful state instead of a dead "Unavailable":
|
|
17
|
+
* - `already_installed` — the license already has the app installed
|
|
18
|
+
* - `already_requested` — a request is pending the publisher's response
|
|
19
|
+
* - `access_granted` — a prior request was approved (access is live)
|
|
20
|
+
*/
|
|
21
|
+
export type RequestBlockedReason = 'already_installed' | 'already_requested' | 'access_granted' | null;
|
|
22
|
+
export interface AppLicense {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
theme: string;
|
|
26
|
+
}
|
|
27
|
+
export interface App {
|
|
28
|
+
id: string;
|
|
29
|
+
title: string;
|
|
30
|
+
tagline: string;
|
|
31
|
+
description: string;
|
|
32
|
+
color: string;
|
|
33
|
+
icon: string;
|
|
34
|
+
image: any;
|
|
35
|
+
/**
|
|
36
|
+
* Scopes this app runs in. Both entries = multi-scope (usable at license level
|
|
37
|
+
* and per project, gated independently). This is the single source of truth
|
|
38
|
+
* for app scope.
|
|
39
|
+
*/
|
|
40
|
+
supported_scopes: AppScope[];
|
|
41
|
+
access_level: AccessLevel;
|
|
42
|
+
availability: AppAvailability;
|
|
43
|
+
trust_level: AppTrustLevel;
|
|
44
|
+
is_deprecated: boolean;
|
|
45
|
+
deprecation_message: string | null;
|
|
46
|
+
can_configure_by_license: boolean;
|
|
47
|
+
can_request_access: boolean;
|
|
48
|
+
/** Why `can_request_access` is false (request-access apps only). See type doc. */
|
|
49
|
+
request_blocked_reason: RequestBlockedReason;
|
|
50
|
+
/**
|
|
51
|
+
* Canonical entitlement flag: the license currently has the right to
|
|
52
|
+
* install/use this app — installed, a live subscription (active/trial/grace,
|
|
53
|
+
* and for seat-based tiers the viewer holds a seat), an approved access
|
|
54
|
+
* grant, or a free always-available app. Consistent with `ListApp.has_access`.
|
|
55
|
+
*/
|
|
56
|
+
has_access: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Set when the viewer is blocked from using the app; null otherwise. Narrow on
|
|
59
|
+
* `reason` first — see `AccessBlock`. The detail endpoint returns the resource
|
|
60
|
+
* UNWRAPPED, so this sits at the response top level, not under `data`.
|
|
61
|
+
*/
|
|
62
|
+
access_block?: AccessBlock | null;
|
|
63
|
+
/** The viewer's license's own latest request — a summary, not the inbox resource. */
|
|
64
|
+
my_access_request?: MyAccessRequestSummary | null;
|
|
65
|
+
license_id?: string;
|
|
66
|
+
created_at?: string;
|
|
67
|
+
updated_at?: string;
|
|
68
|
+
path: string;
|
|
69
|
+
license: AppLicense;
|
|
70
|
+
is_owned_app: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Derived: can the current user open/use this app right now?
|
|
73
|
+
* Non-project app → `on_license.installed`; project app → `in_project.activated`
|
|
74
|
+
* (false without a project context). This is the launcher/OS-shell flag.
|
|
75
|
+
* For the app-detail Install/Activate/Open button decision see `AppInProject`.
|
|
76
|
+
*/
|
|
77
|
+
can_open: boolean;
|
|
78
|
+
/** License-scope install state + capabilities (always present). */
|
|
79
|
+
on_license: AppOnLicense;
|
|
80
|
+
/**
|
|
81
|
+
* Project-scope activation state; null unless the app supports project scope +
|
|
82
|
+
* project context. See `AppInProject` for the install-vs-activation button
|
|
83
|
+
* decision (AAD-887): a license install is not a project activation.
|
|
84
|
+
*/
|
|
85
|
+
in_project: AppInProject | null;
|
|
86
|
+
/**
|
|
87
|
+
* Does ANY addressable install have an update? An OR roll-up across the
|
|
88
|
+
* license link and the current project's link (AAD-906) — safe as a "show an
|
|
89
|
+
* update affordance at all" gate, but NOT a statement about any one install.
|
|
90
|
+
*
|
|
91
|
+
* ⚠️ True here does not mean the scope-less update call will act: a
|
|
92
|
+
* dual-scope app current in the project but stale at the license reads true
|
|
93
|
+
* while the ambient endpoint targets the project. Read `on_license` /
|
|
94
|
+
* `in_project` for per-install truth, and pass `update_scope` (or an explicit
|
|
95
|
+
* scope) to `updateInstalledApp`.
|
|
96
|
+
*/
|
|
97
|
+
update_available: boolean;
|
|
98
|
+
/** Target version for the scope named by `update_scope`; null when current. */
|
|
99
|
+
update_available_version_id: string | null;
|
|
100
|
+
/**
|
|
101
|
+
* Which install scope the flat `update_available` pair describes, or null
|
|
102
|
+
* when nothing is behind. Pass this back as `scope` to `updateInstalledApp`.
|
|
103
|
+
*/
|
|
104
|
+
update_scope: AppScope | null;
|
|
105
|
+
is_featured: boolean;
|
|
106
|
+
versions: AppVersion[];
|
|
107
|
+
categories: AppCategory[];
|
|
108
|
+
media?: AppMedia[];
|
|
109
|
+
labels: ResourceLabel[];
|
|
110
|
+
active_channel?: {
|
|
111
|
+
id: string;
|
|
112
|
+
name: string;
|
|
113
|
+
color?: string | null;
|
|
114
|
+
} | null;
|
|
115
|
+
/** Release channels the current viewer can install from (single-app detail). */
|
|
116
|
+
channels?: AppChannel[];
|
|
117
|
+
/** The user's remembered channel for this app (the switcher default). */
|
|
118
|
+
preferred_channel_id?: string | null;
|
|
119
|
+
install_count?: number;
|
|
120
|
+
access_model?: 'free' | 'subscription';
|
|
121
|
+
subscription?: AppSubscriptionSummary | null;
|
|
122
|
+
latest_changelog?: string | null;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAE7D,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,YAAY,CAAA;AACpD,MAAM,MAAM,eAAe,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,SAAS,CAAA;AAC/E,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,CAAA;AAEjE;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,GAC1B,mBAAmB,GACnB,mBAAmB,GACnB,gBAAgB,GAChB,IAAI,CAAA;AAEV,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,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AQ,EAAE,UAAU,EAAE,CAAA;IACtB,UAAU,EAAE,WAAW,EAAE,CAAA;IACzB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAA;IAClB,MAAM,EAAE,aAAa,EAAE,CAAA;IACvB,cAAc,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,GAAG,IAAI,CAAA;IAC3E,gFAAgF;IAChF,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAA;IACvB,yEAAyE;IACzE,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,GAAG,cAAc,CAAA;IACtC,YAAY,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAA;IAC5C,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CACjC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
// The `GET /store/apps` list row (ListApp, AppTierSummary) lives in
|
|
3
|
+
// `./appList.ts`. Publisher form / store-query request shapes
|
|
4
|
+
// (AppImpactAnalysis, AppTemplate, AppFormData, AppSortOption, FetchAppsParams,
|
|
5
|
+
// UninstallConflict) live in `./appRequests.ts`. Both are re-exported from the
|
|
6
|
+
// `./types` barrel, so import paths are unchanged.
|