@antcde/connect-ts 0.4.25 → 0.4.26-rc.1

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.
Files changed (134) hide show
  1. package/build/AntConnect.d.ts +4 -0
  2. package/build/AntConnect.d.ts.map +1 -1
  3. package/build/AntConnect.js +4 -0
  4. package/build/comms/signalTypes.d.ts +18 -0
  5. package/build/comms/signalTypes.d.ts.map +1 -1
  6. package/build/index.d.ts +5 -34
  7. package/build/index.d.ts.map +1 -1
  8. package/build/index.js +8 -3
  9. package/build/service-runtime.d.ts +6 -0
  10. package/build/service-runtime.d.ts.map +1 -0
  11. package/build/service-runtime.js +7 -0
  12. package/build/service-types-app.d.ts +2 -0
  13. package/build/service-types-app.d.ts.map +1 -0
  14. package/build/service-types-app.js +3 -0
  15. package/build/service-types.d.ts +35 -0
  16. package/build/service-types.d.ts.map +1 -0
  17. package/build/service-types.js +7 -0
  18. package/build/services/AppService/factory/accessRequests.d.ts +19 -0
  19. package/build/services/AppService/factory/accessRequests.d.ts.map +1 -0
  20. package/build/services/AppService/factory/accessRequests.js +17 -0
  21. package/build/services/AppService/factory/assignments.d.ts +57 -0
  22. package/build/services/AppService/factory/assignments.d.ts.map +1 -0
  23. package/build/services/AppService/factory/assignments.js +30 -0
  24. package/build/services/AppService/factory/channels.d.ts +35 -0
  25. package/build/services/AppService/factory/channels.d.ts.map +1 -0
  26. package/build/services/AppService/factory/channels.js +18 -0
  27. package/build/services/AppService/factory/formData.d.ts +14 -0
  28. package/build/services/AppService/factory/formData.d.ts.map +1 -0
  29. package/build/services/AppService/factory/formData.js +50 -0
  30. package/build/services/AppService/factory/media.d.ts +17 -0
  31. package/build/services/AppService/factory/media.d.ts.map +1 -0
  32. package/build/services/AppService/factory/media.js +10 -0
  33. package/build/services/AppService/factory/subscriptions.d.ts +73 -0
  34. package/build/services/AppService/factory/subscriptions.d.ts.map +1 -0
  35. package/build/services/AppService/factory/subscriptions.js +39 -0
  36. package/build/services/AppService/index.d.ts +56 -0
  37. package/build/services/AppService/index.d.ts.map +1 -0
  38. package/build/services/AppService/index.js +67 -0
  39. package/build/services/AppService/types/accessRequests.d.ts +158 -0
  40. package/build/services/AppService/types/accessRequests.d.ts.map +1 -0
  41. package/build/services/AppService/types/app.d.ts +124 -0
  42. package/build/services/AppService/types/app.d.ts.map +1 -0
  43. package/build/services/AppService/types/app.js +6 -0
  44. package/build/services/AppService/types/appCategories.d.ts +16 -0
  45. package/build/services/AppService/types/appCategories.d.ts.map +1 -0
  46. package/build/services/AppService/types/appChangelog.d.ts +31 -0
  47. package/build/services/AppService/types/appChangelog.d.ts.map +1 -0
  48. package/build/services/AppService/types/appChangelog.js +1 -0
  49. package/build/services/AppService/types/appList.d.ts +183 -0
  50. package/build/services/AppService/types/appList.d.ts.map +1 -0
  51. package/build/services/AppService/types/appList.js +1 -0
  52. package/build/services/{AppManifest.d.ts → AppService/types/appManifest.d.ts} +16 -1
  53. package/build/services/AppService/types/appManifest.d.ts.map +1 -0
  54. package/build/services/AppService/types/appManifest.js +4 -0
  55. package/build/services/AppService/types/appMedia.d.ts +136 -0
  56. package/build/services/AppService/types/appMedia.d.ts.map +1 -0
  57. package/build/services/AppService/types/appMedia.js +1 -0
  58. package/build/services/AppService/types/appRequests.d.ts +113 -0
  59. package/build/services/AppService/types/appRequests.d.ts.map +1 -0
  60. package/build/services/AppService/types/appRequests.js +1 -0
  61. package/build/services/AppService/types/appScopes.d.ts +165 -0
  62. package/build/services/AppService/types/appScopes.d.ts.map +1 -0
  63. package/build/services/AppService/types/appScopes.js +1 -0
  64. package/build/services/AppService/types/channels.d.ts +45 -0
  65. package/build/services/AppService/types/channels.d.ts.map +1 -0
  66. package/build/services/AppService/types/channels.js +1 -0
  67. package/build/services/AppService/types/pricingTiers.d.ts +111 -0
  68. package/build/services/AppService/types/pricingTiers.d.ts.map +1 -0
  69. package/build/services/AppService/types/pricingTiers.js +1 -0
  70. package/build/services/AppService/types/publisherStats.d.ts +20 -0
  71. package/build/services/AppService/types/publisherStats.d.ts.map +1 -0
  72. package/build/services/AppService/types/publisherStats.js +1 -0
  73. package/build/services/AppService/types/releaseChannels.d.ts +127 -0
  74. package/build/services/AppService/types/releaseChannels.d.ts.map +1 -0
  75. package/build/services/AppService/types/releaseChannels.js +1 -0
  76. package/build/services/AppService/types/seats.d.ts +220 -0
  77. package/build/services/AppService/types/seats.d.ts.map +1 -0
  78. package/build/services/AppService/types/seats.js +4 -0
  79. package/build/services/AppService/types/subscriptions.d.ts +182 -0
  80. package/build/services/AppService/types/subscriptions.d.ts.map +1 -0
  81. package/build/services/AppService/types/subscriptions.js +1 -0
  82. package/build/services/AppService/types.d.ts +16 -0
  83. package/build/services/AppService/types.d.ts.map +1 -0
  84. package/build/services/AppService/types.js +18 -0
  85. package/build/services/DmsService.d.ts +13 -0
  86. package/build/services/DmsService.d.ts.map +1 -1
  87. package/build/services/DmsServiceImpl.d.ts.map +1 -1
  88. package/build/services/DmsServiceImpl.js +8 -0
  89. package/build/services/ProjectService.d.ts +1 -0
  90. package/build/services/ProjectService.d.ts.map +1 -1
  91. package/build/services/ReleaseService.d.ts +1 -0
  92. package/build/services/ReleaseService.d.ts.map +1 -1
  93. package/build/services/SecretService.d.ts +22 -0
  94. package/build/services/SecretService.d.ts.map +1 -0
  95. package/build/services/SecretService.js +21 -0
  96. package/build/services/SecretService.types.d.ts +147 -0
  97. package/build/services/SecretService.types.d.ts.map +1 -0
  98. package/build/services/SecretService.types.js +1 -0
  99. package/build/services/SecretSharing.types.d.ts +112 -0
  100. package/build/services/SecretSharing.types.d.ts.map +1 -0
  101. package/build/services/SecretSharing.types.js +1 -0
  102. package/build/services/TableService.js +7 -7
  103. package/build/services/TaskService.d.ts +3 -3
  104. package/build/services/TaskService.d.ts.map +1 -1
  105. package/build/services/TaskService.js +1 -1
  106. package/build/services/TaskService.types.d.ts +21 -4
  107. package/build/services/TaskService.types.d.ts.map +1 -1
  108. package/build/services/TaskServiceQueries.d.ts +2 -0
  109. package/build/services/TaskServiceQueries.d.ts.map +1 -1
  110. package/build/services/TaskServiceQueries.js +9 -1
  111. package/build/services/TaskTemplate.types.d.ts +74 -1
  112. package/build/services/TaskTemplate.types.d.ts.map +1 -1
  113. package/build/services/UserService.js +4 -4
  114. package/build/services/Webhook/TriggerHistoryService.d.ts +1 -1
  115. package/build/services/Webhook/TriggerHistoryService.d.ts.map +1 -1
  116. package/build/services/Webhook/TriggerSecretService.d.ts +88 -0
  117. package/build/services/Webhook/TriggerSecretService.d.ts.map +1 -0
  118. package/build/services/Webhook/TriggerSecretService.js +9 -0
  119. package/build/services/Webhook/TriggerService.d.ts +28 -0
  120. package/build/services/Webhook/TriggerService.d.ts.map +1 -1
  121. package/build/services/Webhook/TriggerService.js +10 -0
  122. package/build/services/Websockets/StoreEvents.d.ts +31 -0
  123. package/build/services/Websockets/StoreEvents.d.ts.map +1 -0
  124. package/build/services/Websockets/StoreEvents.js +5 -0
  125. package/package.json +6 -6
  126. package/schemas/app-config.schema.json +6 -0
  127. package/build/services/AppManifest.d.ts.map +0 -1
  128. package/build/services/AppService.d.ts +0 -57
  129. package/build/services/AppService.d.ts.map +0 -1
  130. package/build/services/AppService.js +0 -47
  131. package/build/services/AppService.types.d.ts +0 -173
  132. package/build/services/AppService.types.d.ts.map +0 -1
  133. /package/build/services/{AppManifest.js → AppService/types/accessRequests.js} +0 -0
  134. /package/build/services/{AppService.types.js → AppService/types/appCategories.js} +0 -0
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Build a multipart `FormData` body for app-store uploads. Files/Blobs ride as
3
+ * native parts; arrays expand to `key[]` entries; booleans serialise to
4
+ * '1'/'0' (Laravel boolean-validation friendly); null/undefined are skipped.
5
+ * Lets axios set the multipart boundary — never set Content-Type by hand.
6
+ */
7
+ export function toFormData(data) {
8
+ const form = new FormData();
9
+ appendObject(form, data);
10
+ return form;
11
+ }
12
+ /**
13
+ * Return a multipart `FormData` when the payload carries a File/Blob, otherwise
14
+ * the plain object (sent as JSON). Lets a single endpoint accept either a file
15
+ * upload or a scalar-only request without branching at every call site.
16
+ */
17
+ export function maybeFormData(data) {
18
+ return hasBlob(data) ? toFormData(data) : data;
19
+ }
20
+ // Detect a File/Blob at any nesting depth so nested uploads still switch the
21
+ // request to multipart (mirrors toFormData's recursive append).
22
+ function hasBlob(value) {
23
+ if (value instanceof Blob)
24
+ return true;
25
+ if (Array.isArray(value))
26
+ return value.some(hasBlob);
27
+ if (value !== null && typeof value === 'object')
28
+ return Object.values(value).some(hasBlob);
29
+ return false;
30
+ }
31
+ function appendObject(form, obj, prefix) {
32
+ for (const [key, value] of Object.entries(obj))
33
+ appendValue(form, prefix ? `${prefix}[${key}]` : key, value);
34
+ }
35
+ function appendValue(form, key, value) {
36
+ if (value === null || value === undefined)
37
+ return;
38
+ // File extends Blob — `instanceof Blob` covers both and avoids clashing with
39
+ // the unrelated `File` interface declared elsewhere in the SDK.
40
+ if (value instanceof Blob)
41
+ form.append(key, value);
42
+ else if (Array.isArray(value))
43
+ value.forEach(item => appendValue(form, `${key}[]`, item));
44
+ else if (typeof value === 'boolean')
45
+ form.append(key, value ? '1' : '0');
46
+ else if (typeof value === 'object')
47
+ appendObject(form, value, key);
48
+ else
49
+ form.append(key, String(value));
50
+ }
@@ -0,0 +1,17 @@
1
+ import type { AppMedia, AppMediaFormData, ReorderMediaFormData, UpdateAppMediaFormData } from '../types';
2
+ import type { MessageResponse } from "../../../AntConnect";
3
+ import type { AntHttpClient } from "../../../AntHttpClient";
4
+ import type { DataWrapper } from "../../../types";
5
+ /**
6
+ * Screenshot / gallery media on a store listing. Split out of the AppService
7
+ * factory to keep `index.ts` focused; composed into `AppService` there.
8
+ */
9
+ export interface AppMediaFactory {
10
+ fetchAppMedia: (appId: string) => Promise<DataWrapper<AppMedia[]>>;
11
+ uploadAppMedia: (appId: string, mediaData: AppMediaFormData) => Promise<DataWrapper<AppMedia>>;
12
+ updateAppMedia: (appId: string, mediaId: string, mediaData: UpdateAppMediaFormData) => Promise<DataWrapper<AppMedia>>;
13
+ deleteAppMedia: (appId: string, mediaId: string) => Promise<MessageResponse>;
14
+ reorderAppMedia: (appId: string, data: ReorderMediaFormData) => Promise<MessageResponse>;
15
+ }
16
+ export declare function newAppMediaFactory(client: AntHttpClient): AppMediaFactory;
17
+ //# sourceMappingURL=media.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"media.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/factory/media.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,eAAe,EAAE,4BAAoB;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,+BAAuB;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAe;AAG1C;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;IAClE,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,KAAK,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAA;IAC9F,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,sBAAsB,KAAK,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAA;IACrH,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;IAC5E,eAAe,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;CACzF;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe,CAYzE"}
@@ -0,0 +1,10 @@
1
+ import { maybeFormData } from './formData';
2
+ export function newAppMediaFactory(client) {
3
+ return {
4
+ fetchAppMedia: appId => client.get(`/store/apps/${appId}/media`),
5
+ uploadAppMedia: (appId, mediaData) => client.post(`/store/apps/${appId}/media`, maybeFormData(mediaData)),
6
+ updateAppMedia: (appId, mediaId, mediaData) => client.put(`/store/apps/${appId}/media/${mediaId}`, mediaData),
7
+ deleteAppMedia: (appId, mediaId) => client.delete(`/store/apps/${appId}/media/${mediaId}`),
8
+ reorderAppMedia: (appId, data) => client.post(`/store/apps/${appId}/media/reorder`, data),
9
+ };
10
+ }
@@ -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,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AAuB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,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,56 @@
1
+ import type { AppAccessRequestFactory } from './factory/accessRequests';
2
+ import type { AppAssignmentFactory } from './factory/assignments';
3
+ import type { ReleaseChannelFactory } from './factory/channels';
4
+ import type { AppMediaFactory } from './factory/media';
5
+ import type { SubscriptionFactory } from './factory/subscriptions';
6
+ import type { App, AppCategory, AppChangelogEntry, AppImpactAnalysis, AppRunnableContexts, AppTemplate, AppUpdateResult, AppVersionFormData, AvailableUpdatesParams, AvailableUpdatesResponse, BatchUpdateAppsParams, BatchUpdateAppsResponse, CategoryRelationData, FetchAppChangelogParams, FetchAppsParams, ListApp, PublisherStatsApp, UpdateInstalledAppParams } from './types';
7
+ import type { MessageResponse } from "../../AntConnect";
8
+ import type { AntHttpClient } from "../../AntHttpClient";
9
+ import type { DataWrapper } from "../../types";
10
+ export * from './types';
11
+ export interface AppService extends SubscriptionFactory, ReleaseChannelFactory, AppAssignmentFactory, AppAccessRequestFactory, AppMediaFactory {
12
+ createApp: (appData: AppTemplate) => Promise<DataWrapper<App>>;
13
+ updateApp: (id: string, appData: Partial<AppTemplate>) => Promise<DataWrapper<App>>;
14
+ deleteApp: (id: string) => Promise<MessageResponse>;
15
+ /**
16
+ * Force-delete a deprecated app, cascading the uninstall/deactivation across
17
+ * every license and project. Only valid for deprecated apps (409 otherwise).
18
+ */
19
+ forceDeleteApp: (id: string) => Promise<MessageResponse>;
20
+ deleteAppImage: (id: string) => Promise<MessageResponse>;
21
+ createVersion: (appId: string, versionData: AppVersionFormData) => Promise<DataWrapper<App>>;
22
+ deleteVersion: (appId: string, versionId: string) => Promise<MessageResponse>;
23
+ fetchImpactAnalysis: (appId: string) => Promise<DataWrapper<AppImpactAnalysis>>;
24
+ fetchAppContent: (appId: string, versionId: string, path: string) => Promise<any>;
25
+ fetchVersionReadme: (appId: string, versionId: string) => Promise<any>;
26
+ fetchVersionConfig: (appId: string, versionId: string) => Promise<any>;
27
+ fetchVersionChangelog: (appId: string, versionId: string) => Promise<any>;
28
+ fetchApps: (params: FetchAppsParams, requestConfig?: Record<string, any>) => Promise<DataWrapper<ListApp[]>>;
29
+ fetchApp: (appId: string, requestConfig?: Record<string, any>) => Promise<App>;
30
+ fetchAppProjects: (appId: string, requestConfig?: Record<string, any>) => Promise<DataWrapper<AppRunnableContexts>>;
31
+ fetchPublisherStats: () => Promise<DataWrapper<PublisherStatsApp[]>>;
32
+ installApp: (licenseId: string, versionId: string, channelId?: string) => Promise<DataWrapper<App>>;
33
+ uninstallApp: (licenseId: string, versionId: string, force?: boolean) => Promise<DataWrapper<App>>;
34
+ activateApp: (projectId: string, versionId: string, channelId?: string) => Promise<DataWrapper<App>>;
35
+ deactivateApp: (projectId: string, versionId: string) => Promise<DataWrapper<App>>;
36
+ setLicenseAppAutoUpdate: (licenseId: string, appId: string, enabled: boolean) => Promise<DataWrapper<App>>;
37
+ setProjectAppAutoUpdate: (projectId: string, appId: string, enabled: boolean) => Promise<DataWrapper<App>>;
38
+ setLicenseAppChannel: (licenseId: string, appId: string, channelId: string) => Promise<DataWrapper<App>>;
39
+ setProjectAppChannel: (projectId: string, appId: string, channelId: string) => Promise<DataWrapper<App>>;
40
+ linkApp: (taskId: string, appId: string) => Promise<DataWrapper<App>>;
41
+ unlinkApp: (taskId: string, appId: string) => Promise<DataWrapper<App>>;
42
+ /** Save (or clear) the app's restorable view state on a task↔app link. */
43
+ saveAppState: (taskId: string, appId: string, state: Record<string, string> | null) => Promise<DataWrapper<App>>;
44
+ deprecateApp: (appId: string, message?: string) => Promise<DataWrapper<App>>;
45
+ undeprecateApp: (appId: string) => Promise<DataWrapper<App>>;
46
+ updateInstalledApp: (appId: string, params?: UpdateInstalledAppParams, requestConfig?: Record<string, any>) => Promise<DataWrapper<AppUpdateResult>>;
47
+ batchUpdateApps: (params?: BatchUpdateAppsParams) => Promise<DataWrapper<BatchUpdateAppsResponse>>;
48
+ fetchAvailableUpdates: (params?: AvailableUpdatesParams) => Promise<DataWrapper<AvailableUpdatesResponse>>;
49
+ fetchCategories: (params?: any) => Promise<DataWrapper<AppCategory[]>>;
50
+ fetchCategory: (categoryId: string) => Promise<AppCategory>;
51
+ updateAppCategories: (appId: string, data: CategoryRelationData) => Promise<DataWrapper<App>>;
52
+ fetchAppChangelog: (appId: string, params?: FetchAppChangelogParams) => Promise<DataWrapper<AppChangelogEntry[]>>;
53
+ }
54
+ export declare function newAppService(client: AntHttpClient): AppService;
55
+ export default AppService;
56
+ //# 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,uBAAuB,CAAA;AACjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EACV,GAAG,EACH,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,OAAO,EACP,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAoB;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,4BAAuB;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAe;AAS1C,cAAc,SAAS,CAAA;AAEvB,MAAM,WAAW,UAAW,SAC1B,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,eAAe;IAEf,SAAS,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAC9D,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,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AAE,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;IAI1G,eAAe,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,KAAK,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;IACtE,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;IAC3D,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,KAAK,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAG7F,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,CAyF/D;AAED,eAAe,UAAU,CAAA"}
@@ -0,0 +1,67 @@
1
+ import qs from 'qs';
2
+ import { newAppAccessRequestFactory } from './factory/accessRequests';
3
+ import { newAppAssignmentFactory } from './factory/assignments';
4
+ import { newReleaseChannelFactory } from './factory/channels';
5
+ import { maybeFormData, toFormData } from './factory/formData';
6
+ import { newAppMediaFactory } from './factory/media';
7
+ import { newSubscriptionFactory } from './factory/subscriptions';
8
+ export * from './types';
9
+ export function newAppService(client) {
10
+ return {
11
+ ...newSubscriptionFactory(client),
12
+ ...newReleaseChannelFactory(client),
13
+ ...newAppAssignmentFactory(client),
14
+ ...newAppAccessRequestFactory(client),
15
+ ...newAppMediaFactory(client),
16
+ // An icon File is sent as multipart; a scalar-only edit stays JSON. updateApp
17
+ // is a PUT, but PHP doesn't parse multipart PUT bodies, so spoof it with POST
18
+ // + `_method=PUT` when a file rides along.
19
+ createApp: appData => client.post('/store/apps', maybeFormData(appData)),
20
+ updateApp: (id, appData) => appData.image instanceof Blob
21
+ ? client.post(`/store/apps/${id}`, toFormData({ ...appData, _method: 'PUT' }))
22
+ : client.put(`/store/apps/${id}`, appData),
23
+ deleteApp: id => client.delete(`/store/apps/${id}`),
24
+ forceDeleteApp: id => client.delete(`/store/apps/${id}/force`),
25
+ deleteAppImage: id => client.delete(`/store/apps/${id}/deleteAppImage`),
26
+ createVersion: (appId, versionData) => client.post(`/store/apps/${appId}/versions`, maybeFormData(versionData)),
27
+ deleteVersion: (appId, versionId) => client.delete(`/store/apps/${appId}/versions/${versionId}`),
28
+ fetchImpactAnalysis: appId => client.get(`/store/apps/${appId}/impact-analysis`),
29
+ fetchAppContent: (appId, versionId, path) => client.get(`/store/apps/${appId}/versions/${versionId}/contents/${path}`),
30
+ fetchVersionReadme: (appId, versionId) => client.get(`/store/apps/${appId}/versions/${versionId}/readme`),
31
+ fetchVersionConfig: (appId, versionId) => client.get(`/store/apps/${appId}/versions/${versionId}/config`),
32
+ fetchVersionChangelog: (appId, versionId) => client.get(`/store/apps/${appId}/versions/${versionId}/changelog`),
33
+ fetchApps: (params = {}, requestConfig) => {
34
+ const queryString = qs.stringify(params, { skipNulls: true, arrayFormat: 'brackets' });
35
+ return client.get(`/store/apps${queryString ? `?${queryString}` : ''}`, requestConfig);
36
+ },
37
+ fetchApp: (appId, requestConfig) => client.get(`/store/apps/${appId}`, requestConfig),
38
+ fetchAppProjects: (appId, requestConfig) => client.get(`/store/apps/${appId}/projects`, requestConfig),
39
+ fetchPublisherStats: () => client.get('/store/publisher/stats'),
40
+ installApp: (licenseId, versionId, channelId) => client.post(`/store/resources/apps-versions/${versionId}/licenses/${licenseId}`, channelId ? { channel_id: channelId } : undefined),
41
+ uninstallApp: (licenseId, versionId, force) => client.delete(`/store/resources/apps-versions/${versionId}/licenses/${licenseId}${force ? '?force=true' : ''}`),
42
+ activateApp: (projectId, versionId, channelId) => client.post(`/store/resources/apps-versions/${versionId}/projects/${projectId}`, channelId ? { channel_id: channelId } : undefined),
43
+ deactivateApp: (projectId, versionId) => client.delete(`/store/resources/apps-versions/${versionId}/projects/${projectId}`),
44
+ setLicenseAppAutoUpdate: (licenseId, appId, enabled) => client.post(`/store/resources/apps/${appId}/licenses/${licenseId}/auto-update`, { enabled }),
45
+ setProjectAppAutoUpdate: (projectId, appId, enabled) => client.post(`/store/resources/apps/${appId}/projects/${projectId}/auto-update`, { enabled }),
46
+ setLicenseAppChannel: (licenseId, appId, channelId) => client.post(`/store/resources/apps/${appId}/licenses/${licenseId}/channel`, { channel_id: channelId }),
47
+ setProjectAppChannel: (projectId, appId, channelId) => client.post(`/store/resources/apps/${appId}/projects/${projectId}/channel`, { channel_id: channelId }),
48
+ linkApp: (taskId, appId) => client.post(`/store/resources/apps/${appId}/tasks/${taskId}`),
49
+ unlinkApp: (taskId, appId) => client.delete(`/store/resources/apps/${appId}/tasks/${taskId}`),
50
+ saveAppState: (taskId, appId, state) => client.patch(`/store/resources/apps/${appId}/tasks/${taskId}`, { app_state: state }),
51
+ deprecateApp: (appId, message) => client.post(`/store/apps/${appId}/deprecate`, { message }),
52
+ undeprecateApp: appId => client.post(`/store/apps/${appId}/undeprecate`),
53
+ updateInstalledApp: (appId, params = {}, requestConfig) => client.post(`/store/apps/${appId}/update`, params, requestConfig),
54
+ batchUpdateApps: (params = {}) => client.post('/store/resources/apps/batch-update', params),
55
+ fetchAvailableUpdates: (params = {}) => client.get('/store/resources/apps/updates-available', { params }),
56
+ fetchCategories: (params = {}) => {
57
+ const queryString = qs.stringify(params, { skipNulls: true, arrayFormat: 'brackets' });
58
+ return client.get(`/store/app-categories${queryString ? `?${queryString}` : ''}`);
59
+ },
60
+ fetchCategory: categoryId => client.get(`/store/app-categories/${categoryId}`),
61
+ updateAppCategories: (appId, data) => client.post(`/store/apps/${appId}/categories`, data),
62
+ fetchAppChangelog: (appId, params = {}) => {
63
+ const queryString = qs.stringify(params, { skipNulls: true });
64
+ return client.get(`/store/apps/${appId}/changelog${queryString ? `?${queryString}` : ''}`);
65
+ },
66
+ };
67
+ }
@@ -0,0 +1,158 @@
1
+ import type { AppTrustLevel } from './app';
2
+ import type { AppScope } from './appScopes';
3
+ export type AccessRequestStatus = 'pending' | 'approved' | 'denied' | 'revoked' | 'expired';
4
+ /**
5
+ * Scope an approval grants the requester.
6
+ *
7
+ * NOTE: the backend currently does not consume `access_scope` on approval — the
8
+ * `app_access_requests.access_scope` column was dropped and approval always
9
+ * grants license-level access. This type exists so the store-v3 inbox UI type-
10
+ * checks; wire real backend support before relying on `license_and_projects`.
11
+ */
12
+ export type AccessScope = 'license_only' | 'license_and_projects';
13
+ export interface AccessRequest {
14
+ id: string;
15
+ app_id: string;
16
+ app: {
17
+ id: string;
18
+ title: string;
19
+ icon: string;
20
+ trust_level: AppTrustLevel;
21
+ license: {
22
+ id: string;
23
+ name: string;
24
+ };
25
+ };
26
+ requester_user: {
27
+ id: string;
28
+ name: string;
29
+ email: string;
30
+ };
31
+ requester_license: {
32
+ id: string;
33
+ name: string;
34
+ };
35
+ status: AccessRequestStatus;
36
+ message: string | null;
37
+ response_message: string | null;
38
+ responded_by: {
39
+ id: string;
40
+ name: string;
41
+ } | null;
42
+ responded_at: string | null;
43
+ expires_at: string | null;
44
+ created_at: string;
45
+ updated_at: string;
46
+ }
47
+ /**
48
+ * The requesting license's OWN latest access request for an app, as embedded on
49
+ * `App.my_access_request` / `ListApp.my_access_request`.
50
+ *
51
+ * A deliberate SUBSET of {@link AccessRequest} — the embedded copy carries only
52
+ * what a card/banner needs to pick a CTA ("Request access" / "Pending" /
53
+ * "Approved" / "Denied") and explain a rejection. It does NOT carry `app`,
54
+ * `requester_user`, `requester_license`, `message`, `responded_by` or
55
+ * `updated_at`; those exist only on the publisher inbox endpoints
56
+ * (`fetchAccessRequests` / `fetchAppAccessRequests`), which return the full
57
+ * `AccessRequest`. Typing this as `AccessRequest` reads `undefined` at runtime.
58
+ */
59
+ export interface MyAccessRequestSummary {
60
+ id: string;
61
+ status: AccessRequestStatus;
62
+ /** ISO 8601, or null when the grant does not expire. */
63
+ expires_at: string | null;
64
+ /** ISO 8601 when the publisher answered; null while pending. */
65
+ responded_at: string | null;
66
+ /** ISO 8601 when the request was submitted. */
67
+ created_at: string | null;
68
+ /**
69
+ * The publisher's reason, rendered under the CTA on a denied/revoked request.
70
+ * Null while pending or when the publisher gave no reason.
71
+ */
72
+ response_message: string | null;
73
+ }
74
+ export interface CreateAccessRequestData {
75
+ message?: string;
76
+ }
77
+ export interface RespondAccessRequestData {
78
+ action: 'approve' | 'deny';
79
+ response_message?: string;
80
+ expires_at?: string;
81
+ /** See {@link AccessScope} — currently ignored by the backend on approval. */
82
+ access_scope?: AccessScope;
83
+ }
84
+ export interface FetchAccessRequestsParams {
85
+ status?: AccessRequestStatus;
86
+ }
87
+ export type AppUpdateStatus = 'updated' | 'no_update' | 'forbidden' | 'not_found' | 'failed';
88
+ export interface AppUpdateResult {
89
+ app_id: string;
90
+ /**
91
+ * The install scope that was acted on (AAD-906) — echoes the requested
92
+ * `scope`, or the one resolved from the ambient context when none was given.
93
+ * Null only when the app itself could not be found.
94
+ */
95
+ scope: AppScope | null;
96
+ status: AppUpdateStatus;
97
+ app_version_id: string | null;
98
+ message?: string;
99
+ dry_run?: boolean;
100
+ }
101
+ /**
102
+ * Body for `updateInstalledApp`. Omit `scope` to keep the pre-AAD-906
103
+ * behaviour, where the ambient `X-Project-ID` header picks the install.
104
+ */
105
+ export interface UpdateInstalledAppParams {
106
+ scope?: AppScope;
107
+ }
108
+ export type BatchUpdateAppResult = AppUpdateResult;
109
+ export interface BatchUpdateAppsResponse {
110
+ summary: {
111
+ total: number;
112
+ updated: number;
113
+ no_update: number;
114
+ failed: number;
115
+ dry_run: boolean;
116
+ };
117
+ results: BatchUpdateAppResult[];
118
+ }
119
+ export interface BatchUpdateAppsParams {
120
+ app_ids?: string[];
121
+ /** Restrict the batch to one install scope; omit for the ambient context. */
122
+ scope?: AppScope;
123
+ dry_run?: boolean;
124
+ }
125
+ /** One install with a pending update — keyed by (app, scope), not by app. */
126
+ export interface AvailableUpdate {
127
+ app_id: string;
128
+ name: string;
129
+ /**
130
+ * Which install this entry is about (AAD-906). In a project context the feed
131
+ * returns BOTH the license install and the project install when both are
132
+ * behind, so entries are only meaningful together with this field.
133
+ */
134
+ scope: AppScope;
135
+ /** The ResourceApp link this entry describes. */
136
+ resource_app_id: string | null;
137
+ /** The release channel this install advances from; null when unpinned. */
138
+ channel_id: string | null;
139
+ /**
140
+ * Versions held BY THIS SCOPE. Plural because a project-scope app accumulates
141
+ * one license row per enabled version, so the license "install" is a pool.
142
+ */
143
+ current_version_ids: string[];
144
+ target_version_id: string;
145
+ target_version: string;
146
+ }
147
+ export interface AvailableUpdatesResponse {
148
+ /** Number of INSTALLS behind — a dual-scope app behind at both counts 2. */
149
+ count: number;
150
+ /** Number of distinct apps behind. Use this for a per-app badge. */
151
+ app_count: number;
152
+ results: AvailableUpdate[];
153
+ }
154
+ /** Query for `fetchAvailableUpdates`. Omit `scope` for every reachable scope. */
155
+ export interface AvailableUpdatesParams {
156
+ scope?: AppScope;
157
+ }
158
+ //# 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,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAA;AAE3F;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,sBAAsB,CAAA;AAEjE,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE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