@antcde/connect-ts 0.4.27-rc.1 → 0.4.27-rc.3
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 +2 -0
- package/build/AntConnect.d.ts.map +1 -1
- package/build/AntConnect.js +2 -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/ai/types.js +1 -0
- package/build/comms/client.js +1 -1
- package/build/comms/hostAPI.js +1 -1
- package/build/comms/models.d.ts +20 -2
- package/build/comms/models.d.ts.map +1 -1
- package/build/index.d.ts +3 -1
- package/build/index.d.ts.map +1 -1
- package/build/service-runtime.d.ts +3 -0
- package/build/service-runtime.d.ts.map +1 -1
- package/build/service-runtime.js +3 -0
- package/build/service-types-app.d.ts +1 -1
- package/build/service-types-app.d.ts.map +1 -1
- package/build/service-types.d.ts +2 -1
- package/build/service-types.d.ts.map +1 -1
- 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/resourceAccess.d.ts +21 -0
- package/build/services/AppService/factory/resourceAccess.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceAccess.js +44 -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 +62 -0
- package/build/services/AppService/factory/resourceSnapshot.d.ts.map +1 -0
- package/build/services/AppService/factory/resourceSnapshot.js +34 -0
- package/build/services/AppService/factory/resources.d.ts +154 -0
- package/build/services/AppService/factory/resources.d.ts.map +1 -0
- package/build/services/AppService/factory/resources.js +40 -0
- package/build/services/AppService/index.d.ts +2 -1
- package/build/services/AppService/index.d.ts.map +1 -1
- package/build/services/AppService/index.js +9 -2
- package/build/services/AppService/types/appList.d.ts +28 -0
- package/build/services/AppService/types/appList.d.ts.map +1 -1
- package/build/services/AppService/types/appManifest.d.ts +46 -0
- package/build/services/AppService/types/appManifest.d.ts.map +1 -1
- package/build/services/AppService/types/appRequests.d.ts +13 -0
- package/build/services/AppService/types/appRequests.d.ts.map +1 -1
- package/build/services/AppService/types/resourceEntitlements.d.ts +109 -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 +223 -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/sellableResources.d.ts +189 -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/snapshotPayload.d.ts +146 -0
- package/build/services/AppService/types/snapshotPayload.d.ts.map +1 -0
- package/build/services/AppService/types/snapshotPayload.js +16 -0
- package/build/services/AppService/types/snapshotSources.d.ts +98 -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.d.ts +6 -0
- package/build/services/AppService/types.d.ts.map +1 -1
- package/build/services/AppService/types.js +6 -0
- package/build/services/TokenService.d.ts +0 -1
- package/build/services/TokenService.d.ts.map +1 -1
- package/build/services/TokenService.js +0 -2
- package/build/services/UserService.d.ts +3 -0
- package/build/services/UserService.d.ts.map +1 -1
- package/build/services/Websockets/StoreEvents.d.ts +14 -1
- package/build/services/Websockets/StoreEvents.d.ts.map +1 -1
- package/build/services/userPreferences.d.ts +37 -0
- package/build/services/userPreferences.d.ts.map +1 -0
- package/build/services/userPreferences.js +39 -0
- package/package.json +3 -2
- package/schemas/app-config.schema.json +79 -8
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import qs from 'qs';
|
|
2
|
+
export function newResourceChannelFactory(client) {
|
|
3
|
+
const base = (resourceId) => `/store/resources/${resourceId}/channels`;
|
|
4
|
+
return {
|
|
5
|
+
fetchResourceChannels: resourceId => client.get(base(resourceId)),
|
|
6
|
+
createResourceChannel: (resourceId, data) => client.post(base(resourceId), data),
|
|
7
|
+
updateResourceChannel: (resourceId, channelId, data) => client.put(`${base(resourceId)}/${channelId}`, data),
|
|
8
|
+
deleteResourceChannel: (resourceId, channelId) => client.delete(`${base(resourceId)}/${channelId}`),
|
|
9
|
+
publishResourceVersion: (resourceId, channelId, versionId) => client.post(`${base(resourceId)}/${channelId}/publish`, { version_id: versionId }),
|
|
10
|
+
unpublishResourceChannel: (resourceId, channelId) => client.delete(`${base(resourceId)}/${channelId}/active-version`),
|
|
11
|
+
fetchResourceUnpublishImpact: (resourceId, channelId) => client.get(`${base(resourceId)}/${channelId}/unpublish-impact`),
|
|
12
|
+
fetchResourceChannelMembers: (resourceId, channelId, params = {}) => {
|
|
13
|
+
const queryString = qs.stringify(params, { skipNulls: true });
|
|
14
|
+
return client.get(`${base(resourceId)}/${channelId}/members${queryString ? `?${queryString}` : ''}`);
|
|
15
|
+
},
|
|
16
|
+
addResourceChannelMember: (resourceId, channelId, licenseId) => client.post(`${base(resourceId)}/${channelId}/members`, { license_id: licenseId }),
|
|
17
|
+
removeResourceChannelMember: (resourceId, channelId, licenseId) => client.delete(`${base(resourceId)}/${channelId}/members/${licenseId}`),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { AcquireResourceData, ResourceEntitlementSummary, ResourceSubscription } from '../types';
|
|
2
|
+
import type { CreatePricingTierData, PricingTier, UpdatePricingTierData } from '../types/pricingTiers';
|
|
3
|
+
import type { MessageResponse } from "../../../AntConnect";
|
|
4
|
+
import type { AntHttpClient } from "../../../AntHttpClient";
|
|
5
|
+
import type { DataWrapper } from "../../../types";
|
|
6
|
+
/**
|
|
7
|
+
* Pricing and purchase for sellable resources (AAD-898).
|
|
8
|
+
*
|
|
9
|
+
* Split out of `resources.ts` for file size when AAD-939 landed, along the same
|
|
10
|
+
* seam the backend already uses: commerce is REUSED from apps (`pricing_tiers` and
|
|
11
|
+
* `subscriptions` are polymorphic), whereas the rest of `resources.ts` is
|
|
12
|
+
* resource-specific. Folded into `SellableResourceFactory`, so callers still reach
|
|
13
|
+
* everything as `c.apps.*` and the public surface is unchanged.
|
|
14
|
+
*
|
|
15
|
+
* Money is handled offline: there is no payment processor, and a paid purchase is
|
|
16
|
+
* approval-gated by the publisher.
|
|
17
|
+
*/
|
|
18
|
+
export interface ResourceCommerceFactory {
|
|
19
|
+
/** Storefront-public: a prospective buyer may read these. */
|
|
20
|
+
fetchResourcePricingTiers: (resourceId: string) => Promise<DataWrapper<PricingTier[]>>;
|
|
21
|
+
/**
|
|
22
|
+
* Free and flat only. A seat tier is rejected with 422 on `errors.pricing_model`
|
|
23
|
+
* — resource entitlements are license-level and seats do not exist for them.
|
|
24
|
+
* Sending `seat_based: true` is rejected the same way.
|
|
25
|
+
*/
|
|
26
|
+
createResourcePricingTier: (resourceId: string, data: CreatePricingTierData) => Promise<DataWrapper<PricingTier>>;
|
|
27
|
+
updateResourcePricingTier: (resourceId: string, tierId: string, data: UpdatePricingTierData) => Promise<DataWrapper<PricingTier>>;
|
|
28
|
+
deleteResourcePricingTier: (resourceId: string, tierId: string) => Promise<MessageResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Acquire the resource.
|
|
31
|
+
*
|
|
32
|
+
* FREE resource: omit `pricing_tier_id`; you get an entitlement immediately.
|
|
33
|
+
* SUBSCRIPTION resource: pass the tier; you get a `pending_approval`
|
|
34
|
+
* subscription that grants NO access until the publisher approves it.
|
|
35
|
+
*/
|
|
36
|
+
acquireResource: (resourceId: string, data?: AcquireResourceData) => Promise<DataWrapper<ResourceSubscription | ResourceEntitlementSummary>>;
|
|
37
|
+
fetchCurrentResourceSubscription: (resourceId: string) => Promise<DataWrapper<ResourceSubscription | null>>;
|
|
38
|
+
/** Publisher approval inbox. */
|
|
39
|
+
fetchPendingResourceSubscriptions: (resourceId: string) => Promise<DataWrapper<ResourceSubscription[]>>;
|
|
40
|
+
/** Publisher: every subscription on this resource. */
|
|
41
|
+
fetchResourceSubscriptions: (resourceId: string) => Promise<DataWrapper<ResourceSubscription[]>>;
|
|
42
|
+
/** Publisher: approving is what creates the entitlement and unlocks reads. */
|
|
43
|
+
approveResourceSubscription: (resourceId: string, subscriptionId: string) => Promise<DataWrapper<ResourceSubscription>>;
|
|
44
|
+
denyResourceSubscription: (resourceId: string, subscriptionId: string) => Promise<DataWrapper<ResourceSubscription>>;
|
|
45
|
+
cancelResourceSubscription: (resourceId: string, subscriptionId: string) => Promise<DataWrapper<ResourceSubscription>>;
|
|
46
|
+
reactivateResourceSubscription: (resourceId: string, subscriptionId: string) => Promise<DataWrapper<ResourceSubscription>>;
|
|
47
|
+
confirmResourceRenewal: (resourceId: string, subscriptionId: string, data?: {
|
|
48
|
+
external_payment_ref?: string;
|
|
49
|
+
}) => Promise<DataWrapper<ResourceSubscription>>;
|
|
50
|
+
}
|
|
51
|
+
export declare function newResourceCommerceFactory(client: AntHttpClient): ResourceCommerceFactory;
|
|
52
|
+
//# sourceMappingURL=resourceCommerce.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceCommerce.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/factory/resourceCommerce.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AACrG,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AACtG,OAAO,KAAK,EAAE,eAAe,EAAE,4BAAoB;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,+BAAuB;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAe;AAE1C;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,uBAAuB;IAEtC,6DAA6D;IAC7D,yBAAyB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC,CAAA;IACtF;;;;OAIG;IACH,yBAAyB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,KAAK,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAA;IACjH,yBAAyB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,KAAK,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAA;IACjI,yBAAyB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAA;IAG3F;;;;;;OAMG;IACH,eAAe,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,mBA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-0,0 +1,18 @@
|
|
|
1
|
+
export function newResourceCommerceFactory(client) {
|
|
2
|
+
const base = (resourceId) => `/store/resources/${resourceId}`;
|
|
3
|
+
return {
|
|
4
|
+
fetchResourcePricingTiers: resourceId => client.get(`${base(resourceId)}/pricing-tiers`),
|
|
5
|
+
createResourcePricingTier: (resourceId, data) => client.post(`${base(resourceId)}/pricing-tiers`, data),
|
|
6
|
+
updateResourcePricingTier: (resourceId, tierId, data) => client.put(`${base(resourceId)}/pricing-tiers/${tierId}`, data),
|
|
7
|
+
deleteResourcePricingTier: (resourceId, tierId) => client.delete(`${base(resourceId)}/pricing-tiers/${tierId}`),
|
|
8
|
+
acquireResource: (resourceId, data = {}) => client.post(`${base(resourceId)}/subscriptions`, data),
|
|
9
|
+
fetchCurrentResourceSubscription: resourceId => client.get(`${base(resourceId)}/subscriptions/current`),
|
|
10
|
+
fetchPendingResourceSubscriptions: resourceId => client.get(`${base(resourceId)}/subscriptions/pending`),
|
|
11
|
+
fetchResourceSubscriptions: resourceId => client.get(`${base(resourceId)}/subscriptions`),
|
|
12
|
+
approveResourceSubscription: (resourceId, subscriptionId) => client.post(`${base(resourceId)}/subscriptions/${subscriptionId}/approve`),
|
|
13
|
+
denyResourceSubscription: (resourceId, subscriptionId) => client.post(`${base(resourceId)}/subscriptions/${subscriptionId}/deny`),
|
|
14
|
+
cancelResourceSubscription: (resourceId, subscriptionId) => client.post(`${base(resourceId)}/subscriptions/${subscriptionId}/cancel`),
|
|
15
|
+
reactivateResourceSubscription: (resourceId, subscriptionId) => client.post(`${base(resourceId)}/subscriptions/${subscriptionId}/reactivate`),
|
|
16
|
+
confirmResourceRenewal: (resourceId, subscriptionId, data = {}) => client.post(`${base(resourceId)}/subscriptions/${subscriptionId}/confirm-renewal`, data),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { SnapshotPayloadConfig, SnapshotPayloadSchema, SnapshotPreview } from '../types/snapshotPayload';
|
|
2
|
+
import type { SnapshotSource } from '../types/snapshotSources';
|
|
3
|
+
import type { AntHttpClient } from "../../../AntHttpClient";
|
|
4
|
+
import type { DataWrapper } from "../../../types";
|
|
5
|
+
/**
|
|
6
|
+
* Snapshot payloads (AAD-939) — publishing a dataset from a linked table.
|
|
7
|
+
*
|
|
8
|
+
* Split out of `resources.ts` for file size; folded into `SellableResourceFactory`
|
|
9
|
+
* so callers still reach everything as `c.apps.*` and the public surface is
|
|
10
|
+
* unchanged.
|
|
11
|
+
*
|
|
12
|
+
* **The publish flow is: preview → create → POLL → publish.** Skipping the poll is
|
|
13
|
+
* the mistake this whole contract is shaped to prevent — see
|
|
14
|
+
* `createResourceVersion` in `resources.ts`.
|
|
15
|
+
*/
|
|
16
|
+
export interface ResourceSnapshotFactory {
|
|
17
|
+
/**
|
|
18
|
+
* The tables this publisher can build a dataset from.
|
|
19
|
+
*
|
|
20
|
+
* Use this for the source picker rather than the generic table listing: that one
|
|
21
|
+
* carries no project attribution (so same-named tables in different projects are
|
|
22
|
+
* indistinguishable), no row count, and no publishable-column count — filling
|
|
23
|
+
* those in from it meant one request per table.
|
|
24
|
+
*
|
|
25
|
+
* Rows with `is_publishable: false` have nothing publishable in them. Show them
|
|
26
|
+
* disabled rather than filtering them out, so a publisher looking for a table they
|
|
27
|
+
* know exists finds it and learns why it cannot be used.
|
|
28
|
+
*
|
|
29
|
+
* The set returned is exactly the set `createResourceVersion` will accept, so the
|
|
30
|
+
* picker can never offer a table the create then refuses. 404 on a resource whose
|
|
31
|
+
* `payload_type` is not `snapshot`.
|
|
32
|
+
*/
|
|
33
|
+
fetchSnapshotSources: (resourceId: string, requestConfig?: Record<string, any>) => Promise<DataWrapper<SnapshotSource[]>>;
|
|
34
|
+
/**
|
|
35
|
+
* Dry-run a column selection before creating a version from it.
|
|
36
|
+
*
|
|
37
|
+
* Returns the row count, an estimated size, the ceilings, the declared schema and
|
|
38
|
+
* a truncated sample. Publisher-only; 404 on a resource whose `payload_type` is
|
|
39
|
+
* not `snapshot`.
|
|
40
|
+
*
|
|
41
|
+
* **Show `exceeds_limits` before letting the publisher continue.** Above either
|
|
42
|
+
* ceiling the backend REFUSES the version rather than truncating it — a partial
|
|
43
|
+
* dataset is indistinguishable from a complete one once published — so a
|
|
44
|
+
* publisher who is not warned here meets a wall at the last step instead.
|
|
45
|
+
*
|
|
46
|
+
* Unlike creating a version, this does NOT require the personal-data declaration:
|
|
47
|
+
* the publisher is still assembling a selection.
|
|
48
|
+
*/
|
|
49
|
+
previewResourceSnapshot: (resourceId: string, payloadConfig: Omit<SnapshotPayloadConfig, 'declarations'> & Partial<Pick<SnapshotPayloadConfig, 'declarations'>>, requestConfig?: Record<string, any>) => Promise<DataWrapper<SnapshotPreview>>;
|
|
50
|
+
}
|
|
51
|
+
export declare function newResourceSnapshotFactory(client: AntHttpClient): ResourceSnapshotFactory;
|
|
52
|
+
/**
|
|
53
|
+
* Narrow a version's `payload_schema` to a snapshot schema.
|
|
54
|
+
*
|
|
55
|
+
* `ResourceVersion.payload_schema` is typed for snapshots because they are the only
|
|
56
|
+
* payload type that records one today, but AAD-899 may store a different shape — so
|
|
57
|
+
* a component rendering the field list should narrow rather than assume. Use this
|
|
58
|
+
* instead of a cast: `as` would happily assert a shape that is not there, and the
|
|
59
|
+
* crash lands in whichever component reads `fields` first.
|
|
60
|
+
*/
|
|
61
|
+
export declare function isSnapshotPayloadSchema(value: unknown): value is SnapshotPayloadSchema;
|
|
62
|
+
//# sourceMappingURL=resourceSnapshot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceSnapshot.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/factory/resourceSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC7G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,aAAa,EAAE,+BAAuB;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAe;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;;;;;;;;OAeG;IACH,oBAAoB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,OAAO,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC,CAAA;IAEzH;;;;;;;;;;;;;;OAcG;IACH,uBAAuB,EAAE,CACvB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,IAAI,CAAC,qBAAqB,EAAE,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,qBAAqB,EAAE,cAAc,CAAC,CAAC,EACjH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAChC,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAA;CAC3C;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,aAAa,GAAG,uBAAuB,CAQzF;AAMD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CAgBtF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function newResourceSnapshotFactory(client) {
|
|
2
|
+
return {
|
|
3
|
+
fetchSnapshotSources: (resourceId, requestConfig) => client.get(`/store/resources/${resourceId}/snapshot-sources`, requestConfig),
|
|
4
|
+
previewResourceSnapshot: (resourceId, payloadConfig, requestConfig) => client.post(`/store/resources/${resourceId}/snapshot-preview`, { payload_config: payloadConfig }, requestConfig),
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
function isRecord(value) {
|
|
8
|
+
return typeof value === 'object' && value !== null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Narrow a version's `payload_schema` to a snapshot schema.
|
|
12
|
+
*
|
|
13
|
+
* `ResourceVersion.payload_schema` is typed for snapshots because they are the only
|
|
14
|
+
* payload type that records one today, but AAD-899 may store a different shape — so
|
|
15
|
+
* a component rendering the field list should narrow rather than assume. Use this
|
|
16
|
+
* instead of a cast: `as` would happily assert a shape that is not there, and the
|
|
17
|
+
* crash lands in whichever component reads `fields` first.
|
|
18
|
+
*/
|
|
19
|
+
export function isSnapshotPayloadSchema(value) {
|
|
20
|
+
if (!isRecord(value))
|
|
21
|
+
return false;
|
|
22
|
+
// Every field the predicate asserts is verified. A guard that narrows to
|
|
23
|
+
// something it never checked is how `schema.fields.map` becomes a runtime error.
|
|
24
|
+
return typeof value.schema_version === 'number'
|
|
25
|
+
&& typeof value.row_count === 'number'
|
|
26
|
+
&& typeof value.byte_size === 'number'
|
|
27
|
+
&& Array.isArray(value.fields)
|
|
28
|
+
&& value.fields.every(field => isRecord(field)
|
|
29
|
+
&& typeof field.key === 'string'
|
|
30
|
+
&& typeof field.type === 'string'
|
|
31
|
+
&& typeof field.nullable === 'boolean'
|
|
32
|
+
&& typeof field.order === 'number'
|
|
33
|
+
&& typeof field.source_column_id === 'string');
|
|
34
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import type { CreateResourceVersionData, CreateSellableResourceData, FetchResourcesParams, ResourceAccessEntry, ResourceConsumer, ResourceEntitlement, ResourceVersion, RetryResourceVersionData, SellableResource, SellableResourceListItem, StoreCapabilities, UpdateSellableResourceData } from '../types';
|
|
2
|
+
import type { ResourceChannelFactory } from './resourceChannels';
|
|
3
|
+
import type { ResourceCommerceFactory } from './resourceCommerce';
|
|
4
|
+
import type { ResourceSnapshotFactory } from './resourceSnapshot';
|
|
5
|
+
import type { MessageResponse } from "../../../AntConnect";
|
|
6
|
+
import type { AntHttpClient } from "../../../AntHttpClient";
|
|
7
|
+
import type { DataWrapper } from "../../../types";
|
|
8
|
+
/**
|
|
9
|
+
* Sellable resources (AAD-898) — the Store's second sellable thing.
|
|
10
|
+
*
|
|
11
|
+
* **The whole surface is behind a backend feature flag, default off.** Call
|
|
12
|
+
* `fetchStoreCapabilities()` first and render nothing resource-related when
|
|
13
|
+
* `resources_enabled` is false. Every route below returns 404 while the flag is
|
|
14
|
+
* off, so a 404 here does NOT mean "not found" — probing is not a way to detect
|
|
15
|
+
* the flag.
|
|
16
|
+
*
|
|
17
|
+
* Scope headers are never passed as arguments: `X-License-ID` is applied
|
|
18
|
+
* centrally by the app's request interceptor, and the backend resolves the
|
|
19
|
+
* caller's license from it. That is the whole entitlement context.
|
|
20
|
+
*/
|
|
21
|
+
export interface SellableResourceFactory extends ResourceChannelFactory, ResourceCommerceFactory, ResourceSnapshotFactory {
|
|
22
|
+
/**
|
|
23
|
+
* Which optional Store surfaces this deployment has on. NOT behind the flag —
|
|
24
|
+
* this is how you learn whether the flag is on.
|
|
25
|
+
*/
|
|
26
|
+
fetchStoreCapabilities: () => Promise<DataWrapper<StoreCapabilities>>;
|
|
27
|
+
fetchResources: (params?: FetchResourcesParams, requestConfig?: Record<string, any>) => Promise<DataWrapper<SellableResourceListItem[]>>;
|
|
28
|
+
fetchResource: (resourceId: string, requestConfig?: Record<string, any>) => Promise<DataWrapper<SellableResource>>;
|
|
29
|
+
createResource: (data: CreateSellableResourceData) => Promise<DataWrapper<SellableResource>>;
|
|
30
|
+
updateResource: (resourceId: string, data: UpdateSellableResourceData) => Promise<DataWrapper<SellableResource>>;
|
|
31
|
+
/** 409 when any license still holds an entitlement — revoke them first. */
|
|
32
|
+
deleteResource: (resourceId: string) => Promise<MessageResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Read what the resource sells, at THIS license's pinned version.
|
|
35
|
+
*
|
|
36
|
+
* On refusal the response body is a `ResourceAccessError` carrying a
|
|
37
|
+
* `reason` — branch on that, not on the status code, since three distinct
|
|
38
|
+
* states share 403. Use `isResourceAccessError()` to narrow an axios error.
|
|
39
|
+
*
|
|
40
|
+
* A `snapshot` resource returns data since AAD-939. An `endpoint` resource still
|
|
41
|
+
* returns 501 `payload_backend_not_implemented` until AAD-899 — not a bug, it
|
|
42
|
+
* means the access layer resolved and no backend is registered for that type.
|
|
43
|
+
*
|
|
44
|
+
* An entitled read of an empty dataset is a 200 with an empty body — "empty"
|
|
45
|
+
* and "not entitled" never look the same.
|
|
46
|
+
*
|
|
47
|
+
* **Formats (AAD-939).** `json` is canonical and comes back in the usual
|
|
48
|
+
* `{ data }` envelope. `csv` returns a RAW `text/csv` body with no envelope, so
|
|
49
|
+
* request it with `responseType: 'text'` and do not read `.data`. An unsupported
|
|
50
|
+
* format is a 422, never a silent fall back to JSON.
|
|
51
|
+
*
|
|
52
|
+
* **Conditional GET.** A pinned version's content is immutable, so the response
|
|
53
|
+
* carries a strong `ETag`; echo it back as `If-None-Match` for a 304. JSON and CSV
|
|
54
|
+
* have separate validators.
|
|
55
|
+
*
|
|
56
|
+
* **Size.** A dataset may be up to 100 MB. There is no paging yet, so a browser
|
|
57
|
+
* consumer should not assume a small body.
|
|
58
|
+
*/
|
|
59
|
+
readResourceData: (resourceId: string, params?: {
|
|
60
|
+
format?: 'json' | 'csv';
|
|
61
|
+
}, requestConfig?: Record<string, any>) => Promise<DataWrapper<unknown>>;
|
|
62
|
+
/**
|
|
63
|
+
* The publisher's full version catalogue.
|
|
64
|
+
*
|
|
65
|
+
* ⚠️ **PUBLISHER-ONLY — a buyer gets 403.** This was `view` (which every license
|
|
66
|
+
* that can see the listing passes), so an entitled buyer could enumerate every
|
|
67
|
+
* draft the publisher had registered and never released. It is now gated on the
|
|
68
|
+
* publishing hat, and an unrelated license's admin is refused too.
|
|
69
|
+
*
|
|
70
|
+
* **Do not call this from a consumer surface.** Everything a buyer needs is on
|
|
71
|
+
* the detail payload: `entitlement.pinned_version` is what they read,
|
|
72
|
+
* `channels[].active_version` is what is on offer, and `SellableResource.versions`
|
|
73
|
+
* carries the FULL version for exactly those two — see there.
|
|
74
|
+
*/
|
|
75
|
+
fetchResourceVersions: (resourceId: string) => Promise<DataWrapper<ResourceVersion[]>>;
|
|
76
|
+
/**
|
|
77
|
+
* Poll this after creating a version whose payload is prepared asynchronously
|
|
78
|
+
* (AAD-939) — `payload_state` moves `pending` -> `ready` | `failed`.
|
|
79
|
+
*/
|
|
80
|
+
fetchResourceVersion: (resourceId: string, versionId: string) => Promise<DataWrapper<ResourceVersion>>;
|
|
81
|
+
/**
|
|
82
|
+
* Register a version.
|
|
83
|
+
*
|
|
84
|
+
* **For a `snapshot` resource this returns `payload_state: 'pending'` and the
|
|
85
|
+
* artifact is built by a QUEUED JOB (AAD-939).** Do not treat the response as
|
|
86
|
+
* servable: poll `fetchResourceVersion()` until `payload_state` leaves `pending`,
|
|
87
|
+
* and arm Publish from the poll — publishing a version that is not `ready` is a
|
|
88
|
+
* 422 on `errors.version_id`.
|
|
89
|
+
*
|
|
90
|
+
* On `failed`, `payload_error` is publisher-facing and specific (for example
|
|
91
|
+
* "This selection produces 3,241,884 rows. The limit is 500,000."). Show it
|
|
92
|
+
* verbatim; it is written to be shown.
|
|
93
|
+
*
|
|
94
|
+
* Validate the selection with `previewResourceSnapshot()` first so the publisher
|
|
95
|
+
* sees the row count and size before committing to a version number.
|
|
96
|
+
*/
|
|
97
|
+
createResourceVersion: (resourceId: string, data: CreateResourceVersionData) => Promise<DataWrapper<ResourceVersion>>;
|
|
98
|
+
/**
|
|
99
|
+
* Delete a version.
|
|
100
|
+
*
|
|
101
|
+
* **409, not a silent unpublish (AAD-950).** Refused while a channel is serving
|
|
102
|
+
* the version — the message names the channel — and while any license is pinned
|
|
103
|
+
* to it. Pull the channel with `unpublishResourceChannel()` first, deliberately,
|
|
104
|
+
* so the publisher sees the blast radius via `fetchResourceUnpublishImpact()`
|
|
105
|
+
* instead of it happening behind a delete.
|
|
106
|
+
*
|
|
107
|
+
* The version number is freed for reuse ONLY if the version was never live. One
|
|
108
|
+
* that was published and later removed keeps its number reserved permanently, and
|
|
109
|
+
* re-creating it is a 409 saying so — a buyer may hold that dataset, and the
|
|
110
|
+
* version string is how they identify it.
|
|
111
|
+
*/
|
|
112
|
+
deleteResourceVersion: (resourceId: string, versionId: string) => Promise<MessageResponse>;
|
|
113
|
+
/**
|
|
114
|
+
* Re-run a failed materialisation, KEEPING the version number (AAD-950).
|
|
115
|
+
*
|
|
116
|
+
* The escape from a failed publish. 409 unless `payload_state` is `failed`
|
|
117
|
+
* (`ready` has nothing to retry, `pending` already has a job running); 422 on a
|
|
118
|
+
* resource with no payload to prepare.
|
|
119
|
+
*
|
|
120
|
+
* Returns the version back in `pending` — resume the same poll you run after
|
|
121
|
+
* `createResourceVersion()`; there is no second state machine.
|
|
122
|
+
*
|
|
123
|
+
* Pass `payload_config` to REPLACE the stored selection. Send it whenever the
|
|
124
|
+
* failure was caused by the selection itself rather than by a transient fault —
|
|
125
|
+
* `source_table_missing` and `unpublishable_column_type` will reproduce forever on
|
|
126
|
+
* a bare replay. It is held to the same contract as on create, personal-data
|
|
127
|
+
* declaration included.
|
|
128
|
+
*/
|
|
129
|
+
retryResourceVersion: (resourceId: string, versionId: string, data?: RetryResourceVersionData) => Promise<DataWrapper<ResourceVersion>>;
|
|
130
|
+
fetchResourceEntitlements: (resourceId: string) => Promise<DataWrapper<ResourceEntitlement[]>>;
|
|
131
|
+
/** Lifetime call totals per consuming license. Not a time series. */
|
|
132
|
+
fetchResourceConsumers: (resourceId: string) => Promise<DataWrapper<ResourceConsumer[]>>;
|
|
133
|
+
revokeResourceEntitlement: (resourceId: string, entitlementId: string) => Promise<DataWrapper<ResourceEntitlement>>;
|
|
134
|
+
/**
|
|
135
|
+
* Force every cached entitlement decision for this resource to be recomputed.
|
|
136
|
+
* Revoking already does this; use it when state changed outside the normal
|
|
137
|
+
* paths, or to avoid waiting out the 60–300s decision TTL.
|
|
138
|
+
*/
|
|
139
|
+
flushResourceEntitlementCache: (resourceId: string) => Promise<MessageResponse>;
|
|
140
|
+
/** Everything this license holds, with the version each is pinned to. */
|
|
141
|
+
fetchMyResourceAccess: () => Promise<DataWrapper<ResourceAccessEntry[]>>;
|
|
142
|
+
/**
|
|
143
|
+
* Opt in to the version this license's channel now serves.
|
|
144
|
+
*
|
|
145
|
+
* The only routine way a pin moves forward — publishing does not move it, and
|
|
146
|
+
* that is the guarantee the buyer bought. Also the recovery action after a
|
|
147
|
+
* `version_withdrawn` block. 409 when already current.
|
|
148
|
+
*/
|
|
149
|
+
moveResourceToChannelVersion: (resourceId: string) => Promise<DataWrapper<ResourceEntitlement>>;
|
|
150
|
+
switchResourceChannel: (resourceId: string, channelId: string) => Promise<DataWrapper<ResourceEntitlement>>;
|
|
151
|
+
setResourceAutoUpdate: (resourceId: string, enabled: boolean) => Promise<DataWrapper<ResourceEntitlement>>;
|
|
152
|
+
}
|
|
153
|
+
export declare function newSellableResourceFactory(client: AntHttpClient): SellableResourceFactory;
|
|
154
|
+
//# sourceMappingURL=resources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resources.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/factory/resources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,wBAAwB,EACxB,gBAAgB,EAChB,wBAAwB,EACxB,iBAAiB,EACjB,0BAA0B,EAC3B,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,4BAAoB;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,+BAAuB;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAe;AAM1C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,uBAAwB,SAAQ,sBAAsB,EAAE,uBAA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,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAA;IAC3G,qBAAqB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAAA;CAC3G;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,aAAa,GAAG,uBAAuB,CAgDzF"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import qs from 'qs';
|
|
2
|
+
import { newResourceChannelFactory } from './resourceChannels';
|
|
3
|
+
import { newResourceCommerceFactory } from './resourceCommerce';
|
|
4
|
+
import { newResourceSnapshotFactory } from './resourceSnapshot';
|
|
5
|
+
export function newSellableResourceFactory(client) {
|
|
6
|
+
const base = (resourceId) => `/store/resources/${resourceId}`;
|
|
7
|
+
return {
|
|
8
|
+
// Commerce (AAD-898) and snapshot payloads (AAD-939) live in their own files for
|
|
9
|
+
// size; folded in here so the public surface stays one factory.
|
|
10
|
+
...newResourceChannelFactory(client),
|
|
11
|
+
...newResourceCommerceFactory(client),
|
|
12
|
+
...newResourceSnapshotFactory(client),
|
|
13
|
+
fetchStoreCapabilities: () => client.get('/store/capabilities'),
|
|
14
|
+
fetchResources: (params = {}, requestConfig) => {
|
|
15
|
+
const queryString = qs.stringify(params, { skipNulls: true, arrayFormat: 'brackets' });
|
|
16
|
+
return client.get(`/store/resources${queryString ? `?${queryString}` : ''}`, requestConfig);
|
|
17
|
+
},
|
|
18
|
+
fetchResource: (resourceId, requestConfig) => client.get(base(resourceId), requestConfig),
|
|
19
|
+
createResource: data => client.post('/store/resources', data),
|
|
20
|
+
updateResource: (resourceId, data) => client.put(base(resourceId), data),
|
|
21
|
+
deleteResource: resourceId => client.delete(base(resourceId)),
|
|
22
|
+
readResourceData: (resourceId, params = {}, requestConfig) => {
|
|
23
|
+
const queryString = qs.stringify(params, { skipNulls: true });
|
|
24
|
+
return client.get(`${base(resourceId)}/data${queryString ? `?${queryString}` : ''}`, requestConfig);
|
|
25
|
+
},
|
|
26
|
+
fetchResourceVersions: resourceId => client.get(`${base(resourceId)}/versions`),
|
|
27
|
+
fetchResourceVersion: (resourceId, versionId) => client.get(`${base(resourceId)}/versions/${versionId}`),
|
|
28
|
+
createResourceVersion: (resourceId, data) => client.post(`${base(resourceId)}/versions`, data),
|
|
29
|
+
deleteResourceVersion: (resourceId, versionId) => client.delete(`${base(resourceId)}/versions/${versionId}`),
|
|
30
|
+
retryResourceVersion: (resourceId, versionId, data = {}) => client.post(`${base(resourceId)}/versions/${versionId}/retry`, data),
|
|
31
|
+
fetchResourceEntitlements: resourceId => client.get(`${base(resourceId)}/entitlements`),
|
|
32
|
+
fetchResourceConsumers: resourceId => client.get(`${base(resourceId)}/consumers`),
|
|
33
|
+
revokeResourceEntitlement: (resourceId, entitlementId) => client.post(`${base(resourceId)}/entitlements/${entitlementId}/revoke`),
|
|
34
|
+
flushResourceEntitlementCache: resourceId => client.post(`${base(resourceId)}/entitlements/flush-cache`),
|
|
35
|
+
fetchMyResourceAccess: () => client.get('/store/resources/my-access'),
|
|
36
|
+
moveResourceToChannelVersion: resourceId => client.post(`${base(resourceId)}/entitlement/version`),
|
|
37
|
+
switchResourceChannel: (resourceId, channelId) => client.post(`${base(resourceId)}/entitlement/channel`, { channel_id: channelId }),
|
|
38
|
+
setResourceAutoUpdate: (resourceId, enabled) => client.post(`${base(resourceId)}/entitlement/auto-update`, { enabled }),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
@@ -2,13 +2,14 @@ import type { AppAccessRequestFactory } from './factory/accessRequests';
|
|
|
2
2
|
import type { AppAssignmentFactory } from './factory/assignments';
|
|
3
3
|
import type { ReleaseChannelFactory } from './factory/channels';
|
|
4
4
|
import type { AppMediaFactory } from './factory/media';
|
|
5
|
+
import type { SellableResourceFactory } from './factory/resources';
|
|
5
6
|
import type { SubscriptionFactory } from './factory/subscriptions';
|
|
6
7
|
import type { App, AppCategory, AppChangelogEntry, AppConfigResource, AppImpactAnalysis, AppResourceStatus, AppResourceSyncResult, AppRunnableContexts, AppTemplate, AppUpdateResult, AppVersionFormData, AvailableUpdatesParams, AvailableUpdatesResponse, BatchUpdateAppsParams, BatchUpdateAppsResponse, CategoryRelationData, FetchAppChangelogParams, FetchAppsParams, ListApp, PublisherStatsApp, UpdateInstalledAppParams } from './types';
|
|
7
8
|
import type { MessageResponse } from "../../AntConnect";
|
|
8
9
|
import type { AntHttpClient } from "../../AntHttpClient";
|
|
9
10
|
import type { DataWrapper } from "../../types";
|
|
10
11
|
export * from './types';
|
|
11
|
-
export interface AppService extends SubscriptionFactory, ReleaseChannelFactory, AppAssignmentFactory, AppAccessRequestFactory, AppMediaFactory {
|
|
12
|
+
export interface AppService extends SubscriptionFactory, SellableResourceFactory, ReleaseChannelFactory, AppAssignmentFactory, AppAccessRequestFactory, AppMediaFactory {
|
|
12
13
|
createApp: (appData: AppTemplate) => Promise<DataWrapper<App>>;
|
|
13
14
|
updateApp: (id: string, appData: Partial<AppTemplate>) => Promise<DataWrapper<App>>;
|
|
14
15
|
deleteApp: (id: string) => Promise<MessageResponse>;
|
|
@@ -1 +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,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,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;
|
|
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,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EACV,GAAG,EACH,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,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,EAA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,aAAa,GAAG,UAAU,CAoG/D;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -4,11 +4,13 @@ import { newAppAssignmentFactory } from './factory/assignments';
|
|
|
4
4
|
import { newReleaseChannelFactory } from './factory/channels';
|
|
5
5
|
import { maybeFormData, toFormData } from './factory/formData';
|
|
6
6
|
import { newAppMediaFactory } from './factory/media';
|
|
7
|
+
import { newSellableResourceFactory } from './factory/resources';
|
|
7
8
|
import { newSubscriptionFactory } from './factory/subscriptions';
|
|
8
9
|
export * from './types';
|
|
9
10
|
export function newAppService(client) {
|
|
10
11
|
return {
|
|
11
12
|
...newSubscriptionFactory(client),
|
|
13
|
+
...newSellableResourceFactory(client),
|
|
12
14
|
...newReleaseChannelFactory(client),
|
|
13
15
|
...newAppAssignmentFactory(client),
|
|
14
16
|
...newAppAccessRequestFactory(client),
|
|
@@ -33,8 +35,13 @@ export function newAppService(client) {
|
|
|
33
35
|
getAppResourceStatus: (appId, resource) => client.get(`/store/apps/${appId}/config/${resource}/status`),
|
|
34
36
|
syncAppResource: (appId, resource) => client.post(`/store/apps/${appId}/config/${resource}/sync`),
|
|
35
37
|
fetchApps: (params = {}, requestConfig) => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
// `config` is CSV, not bracket-array — pull it out of the default
|
|
39
|
+
// `arrayFormat: 'brackets'` serialization and append it joined.
|
|
40
|
+
const { config, ...rest } = params;
|
|
41
|
+
const queryString = qs.stringify(rest, { skipNulls: true, arrayFormat: 'brackets' });
|
|
42
|
+
const configString = config?.length ? `config=${config.join(',')}` : '';
|
|
43
|
+
const query = [queryString, configString].filter(Boolean).join('&');
|
|
44
|
+
return client.get(`/store/apps${query ? `?${query}` : ''}`, requestConfig);
|
|
38
45
|
},
|
|
39
46
|
fetchApp: (appId, requestConfig) => client.get(`/store/apps/${appId}`, requestConfig),
|
|
40
47
|
fetchAppProjects: (appId, requestConfig) => client.get(`/store/apps/${appId}/projects`, requestConfig),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MyAccessRequestSummary } from './accessRequests';
|
|
2
2
|
import type { AccessLevel, AppAvailability, AppLicense, AppTrustLevel, RequestBlockedReason } from './app';
|
|
3
3
|
import type { AppCategory } from './appCategories';
|
|
4
|
+
import type { AppManifestCapabilities, AppManifestSignals } from './appManifest';
|
|
4
5
|
import type { AppVersionSummary } from './appMedia';
|
|
5
6
|
import type { AppInProject, AppOnLicense, AppScope } from './appScopes';
|
|
6
7
|
import type { AccessibleChannel } from './channels';
|
|
@@ -155,6 +156,25 @@ export interface ListApp {
|
|
|
155
156
|
* `cheapest_tier`, which is needed everywhere.
|
|
156
157
|
*/
|
|
157
158
|
tier_summary?: AppTierSummary | null;
|
|
159
|
+
/**
|
|
160
|
+
* Ranking fields shared with `SellableResourceListItem`, so a merged Discover
|
|
161
|
+
* list can sort both kinds on one key (AAD-898).
|
|
162
|
+
*
|
|
163
|
+
* ⚠️ **All three are OPTIONAL because they are emitted only when the
|
|
164
|
+
* sellable-resource flag is ON.** With the flag off they are absent from the
|
|
165
|
+
* payload entirely — that is what keeps `/store/apps` byte-identical to before
|
|
166
|
+
* the feature existed. Never assume they are present: guard, don't default to
|
|
167
|
+
* a value that would silently misorder the list.
|
|
168
|
+
*/
|
|
169
|
+
created_at?: string;
|
|
170
|
+
updated_at?: string;
|
|
171
|
+
/**
|
|
172
|
+
* Distinct external licenses with this app installed — the neutral popularity
|
|
173
|
+
* scalar. `SellableResourceListItem.consumer_count` carries the same field name
|
|
174
|
+
* and the same meaning (its distinct non-revoked entitlements), so `popular`
|
|
175
|
+
* ranks both kinds comparably.
|
|
176
|
+
*/
|
|
177
|
+
consumer_count?: number;
|
|
158
178
|
/**
|
|
159
179
|
* Currently installed version of the `update_scope` install — pair with
|
|
160
180
|
* `update_to_version` for the update banner. A trimmed summary, not a full
|
|
@@ -179,5 +199,13 @@ export interface ListApp {
|
|
|
179
199
|
seats_total?: number | null;
|
|
180
200
|
/** Currently-assigned seats. `my_access` only; see `seats_total`. */
|
|
181
201
|
seats_used?: number | null;
|
|
202
|
+
/**
|
|
203
|
+
* URL-driven capabilities from the launch version's app-config.json. Present
|
|
204
|
+
* only when the list was fetched with `?config=capabilities` (or `all`);
|
|
205
|
+
* undefined otherwise. Consumed by the AI overlay to build per-app tools.
|
|
206
|
+
*/
|
|
207
|
+
capabilities?: AppManifestCapabilities;
|
|
208
|
+
/** Declared comms signal topics (present with `?config=signals` / `all`). */
|
|
209
|
+
signals?: AppManifestSignals;
|
|
182
210
|
}
|
|
183
211
|
//# sourceMappingURL=appList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appList.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/appList.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AAC1G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AAY7D;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,iFAAiF;IACjF,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,gFAAgF;IAChF,UAAU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;;OAIG;IACH,aAAa,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;IAC1C;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;IACpC;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC9C,4DAA4D;IAC5D,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC5C;;;;OAIG;IACH,YAAY,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAA;IAC5C;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,uBAAuB,CAAA;IACtC,6EAA6E;IAC7E,OAAO,CAAC,EAAE,kBAAkB,CAAA;CAC7B"}
|
|
@@ -40,15 +40,61 @@ export interface AppManifestColumn {
|
|
|
40
40
|
hint?: string;
|
|
41
41
|
field_name?: string;
|
|
42
42
|
}
|
|
43
|
+
/** Where a manifest-declared table is generated when the app is installed. */
|
|
44
|
+
export type AppManifestTableContext = 'project' | 'license';
|
|
43
45
|
export interface AppManifestTable {
|
|
44
46
|
name: string;
|
|
47
|
+
/** 'project' creates the table in the project on install, 'license' at license level. Defaults to 'project'. */
|
|
48
|
+
context?: AppManifestTableContext;
|
|
45
49
|
master_table?: boolean;
|
|
46
50
|
columns: AppManifestColumn[];
|
|
47
51
|
}
|
|
52
|
+
export type AppManifestQueryParamType = 'string' | 'number' | 'boolean' | 'date' | 'time' | 'datetime';
|
|
53
|
+
/**
|
|
54
|
+
* Who may drive a query param. `read` params only REFLECT app state on the
|
|
55
|
+
* URL (the app promises to keep them in sync) — the AI and the confirm form
|
|
56
|
+
* may show them but not set them. `write`/`readwrite` params are commandable.
|
|
57
|
+
*/
|
|
58
|
+
export type AppManifestQueryParamAccess = 'read' | 'write' | 'readwrite';
|
|
59
|
+
/**
|
|
60
|
+
* A single query param the app understands. Feeds both the host snapshot
|
|
61
|
+
* filter and the AI overlay, which turns it into a tool parameter schema.
|
|
62
|
+
* On the URL every value is a string: `number`/`boolean`/`date`/`time`/
|
|
63
|
+
* `datetime` are rendering + validation hints; `multiple` values serialize CSV.
|
|
64
|
+
*/
|
|
65
|
+
export interface AppManifestQueryParam {
|
|
66
|
+
type: AppManifestQueryParamType;
|
|
67
|
+
description?: string;
|
|
68
|
+
/** Allowed values — becomes an enum constraint for the AI. */
|
|
69
|
+
enum?: string[];
|
|
70
|
+
/** Accept several values (multi-select / CSV on the wire). */
|
|
71
|
+
multiple?: boolean;
|
|
72
|
+
required?: boolean;
|
|
73
|
+
/** Defaults to 'readwrite' (back-compat: existing manifests stay commandable). */
|
|
74
|
+
access?: AppManifestQueryParamAccess;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A named action the app can be deep-linked into. `params` references keys
|
|
78
|
+
* declared in `queryParams`.
|
|
79
|
+
*/
|
|
80
|
+
export interface AppManifestIntent {
|
|
81
|
+
id: string;
|
|
82
|
+
description: string;
|
|
83
|
+
params?: string[];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* What the app can be driven to do via the URL. Consumed by the AI overlay
|
|
87
|
+
* to build per-app tools and by the host to validate app-state snapshots.
|
|
88
|
+
*/
|
|
89
|
+
export interface AppManifestCapabilities {
|
|
90
|
+
queryParams?: Record<string, AppManifestQueryParam>;
|
|
91
|
+
intents?: AppManifestIntent[];
|
|
92
|
+
}
|
|
48
93
|
export interface AppManifest {
|
|
49
94
|
version: string;
|
|
50
95
|
tagline?: string;
|
|
51
96
|
tables?: AppManifestTable[];
|
|
52
97
|
signals?: AppManifestSignals;
|
|
98
|
+
capabilities?: AppManifestCapabilities;
|
|
53
99
|
}
|
|
54
100
|
//# sourceMappingURL=appManifest.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"appManifest.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/appManifest.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEhD,wDAAwD;AACxD,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,SAAS,CAAA;AAEzD,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,SAAS,CAAA;AAE1D,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,KAAK,CAAC,EAAE,qBAAqB,CAAA;IAC7B,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,EAAE,CAAA;IACvC,sDAAsD;IACtD,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;CAC1C;AAED,6DAA6D;AAC7D,MAAM,MAAM,qBAAqB,GAC3B,SAAS,GACT,MAAM,GACN,YAAY,GACZ,SAAS,GACT,MAAM,GACN,MAAM,GACN,OAAO,GACP,UAAU,GACV,UAAU,GACV,OAAO,GACP,SAAS,GACT,OAAO,CAAA;AAEb,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,qBAAqB,CAAA;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,iBAAiB,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC3B,OAAO,CAAC,EAAE,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"appManifest.d.ts","sourceRoot":"","sources":["../../../../src/services/AppService/types/appManifest.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEhD,wDAAwD;AACxD,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,SAAS,CAAA;AAEzD,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,SAAS,CAAA;AAE1D,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,KAAK,CAAC,EAAE,qBAAqB,CAAA;IAC7B,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,yBAAyB,EAAE,CAAA;IACvC,sDAAsD;IACtD,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAA;CAC1C;AAED,6DAA6D;AAC7D,MAAM,MAAM,qBAAqB,GAC3B,SAAS,GACT,MAAM,GACN,YAAY,GACZ,SAAS,GACT,MAAM,GACN,MAAM,GACN,OAAO,GACP,UAAU,GACV,UAAU,GACV,OAAO,GACP,SAAS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