@aglyn/plugins-marketplace 1.2.0 → 1.4.0
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 +1 -1
- package/package.json +14 -14
- package/src/lib/components/listing-content.component.js +11 -3
- package/src/lib/components/listing-content.component.js.map +1 -1
- package/src/lib/components/marketplace-pay-panel.component.d.ts +67 -0
- package/src/lib/components/marketplace-pay-panel.component.js +228 -0
- package/src/lib/components/marketplace-pay-panel.component.js.map +1 -0
- package/src/lib/components/publish-artifact-dialog.component.d.ts +1 -1
- package/src/lib/components/publish-artifact-dialog.component.js +144 -20
- package/src/lib/components/publish-artifact-dialog.component.js.map +1 -1
- package/src/lib/components/publish-starter-fields.component.d.ts +35 -0
- package/src/lib/components/publish-starter-fields.component.js +176 -0
- package/src/lib/components/publish-starter-fields.component.js.map +1 -0
- package/src/lib/components/starter-picker-shelf.component.d.ts +2 -2
- package/src/lib/components/starter-picker-shelf.component.js +28 -6
- package/src/lib/components/starter-picker-shelf.component.js.map +1 -1
- package/src/lib/hooks/use-marketplace-actions.d.ts +9 -3
- package/src/lib/hooks/use-marketplace-actions.js +47 -89
- package/src/lib/hooks/use-marketplace-actions.js.map +1 -1
- package/src/lib/hooks/use-marketplace-pay.d.ts +70 -0
- package/src/lib/hooks/use-marketplace-pay.js +359 -0
- package/src/lib/hooks/use-marketplace-pay.js.map +1 -0
- package/src/lib/hooks/use-starter-publish-facts.d.ts +25 -0
- package/src/lib/hooks/use-starter-publish-facts.js +116 -0
- package/src/lib/hooks/use-starter-publish-facts.js.map +1 -0
- package/src/lib/hooks/use-starter-purchase.d.ts +17 -22
- package/src/lib/hooks/use-starter-purchase.js +26 -73
- package/src/lib/hooks/use-starter-purchase.js.map +1 -1
- package/src/lib/model/marketplace-invoice.d.ts +52 -0
- package/src/lib/model/marketplace-invoice.js +75 -0
- package/src/lib/model/marketplace-invoice.js.map +1 -0
- package/src/lib/model/marketplace-pay.d.ts +42 -0
- package/src/lib/model/marketplace-pay.js +33 -0
- package/src/lib/model/marketplace-pay.js.map +1 -0
- package/src/lib/model/platform-seller.d.ts +37 -0
- package/src/lib/model/platform-seller.js +36 -0
- package/src/lib/model/platform-seller.js.map +1 -0
- package/src/lib/model/publisher-agreement.d.ts +15 -3
- package/src/lib/model/publisher-agreement.js +23 -3
- package/src/lib/model/publisher-agreement.js.map +1 -1
- package/src/lib/model/starter-publish.d.ts +159 -0
- package/src/lib/model/starter-publish.js +189 -0
- package/src/lib/model/starter-publish.js.map +1 -0
- package/src/lib/model/starter-query.d.ts +0 -8
- package/src/lib/model/starter-query.js +0 -10
- package/src/lib/model/starter-query.js.map +1 -1
- package/src/lib/server/billing-webhook.d.ts +6 -0
- package/src/lib/server/billing-webhook.js +269 -211
- package/src/lib/server/billing-webhook.js.map +1 -1
- package/src/lib/server/checkout.d.ts +2 -48
- package/src/lib/server/checkout.js +21 -241
- package/src/lib/server/checkout.js.map +1 -1
- package/src/lib/server/pay.d.ts +18 -0
- package/src/lib/server/pay.js +540 -0
- package/src/lib/server/pay.js.map +1 -0
- package/src/lib/server/platform-org.d.ts +23 -0
- package/src/lib/server/platform-org.js +27 -0
- package/src/lib/server/platform-org.js.map +1 -0
- package/src/lib/server/publish-preconditions.js +4 -1
- package/src/lib/server/publish-preconditions.js.map +1 -1
- package/src/lib/server/publish-starter.js +5 -2
- package/src/lib/server/publish-starter.js.map +1 -1
- package/src/lib/server/publisher-profile.d.ts +5 -0
- package/src/lib/server/publisher-profile.js +20 -1
- package/src/lib/server/publisher-profile.js.map +1 -1
- package/src/lib/server/publisher-standing.d.ts +26 -0
- package/src/lib/server/publisher-standing.js +66 -0
- package/src/lib/server/publisher-standing.js.map +1 -0
- package/src/lib/server/sale.d.ts +119 -0
- package/src/lib/server/sale.js +304 -0
- package/src/lib/server/sale.js.map +1 -0
- package/src/lib/server/starter-publish-facts.d.ts +36 -0
- package/src/lib/server/starter-publish-facts.js +135 -0
- package/src/lib/server/starter-publish-facts.js.map +1 -0
- package/src/lib/server.js +8 -0
- package/src/lib/server.js.map +1 -1
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ It also registers a `rating` custom field type (`registerCustomFieldType`) with
|
|
|
33
33
|
- Install: `marketplace/install`, `install-plugin`, `install-layout`, `install-template`, `install-theme`, `install-dataset-schema`, `install-email-starter`, `install-email-template`, and `update-artifact` for reconciling an installed copy with a newer published version.
|
|
34
34
|
- Publish: `marketplace/publish`, `publish-plugin`, `publish-layout`, `publish-template`, `publish-theme`, `publish-dataset-schema`, `publish-email-starter`, `publish-email-template`, `publisher-profile`, `verification-request`.
|
|
35
35
|
- Listings: `marketplace/listing-versions`, `preview-image`, `reviews`, `report`.
|
|
36
|
-
- Paid listings: `marketplace/checkout` and `marketplace/
|
|
36
|
+
- Paid listings: `marketplace/pay` (in the console, on the workspace's card on file), `marketplace/checkout` (the hosted page, kept for what still links to it), `marketplace/connect` and `marketplace/publisher-standing`, plus a handler on the platform billing webhook (`registerBillingWebhookHandler`).
|
|
37
37
|
|
|
38
38
|
The server entry also registers the server side of the `rating` field type, so its validators run on write paths where no client loaded the plugin.
|
|
39
39
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-marketplace",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,19 +25,19 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.
|
|
29
|
-
"@aglyn/aglyn-markdown-editor": "1.
|
|
30
|
-
"@aglyn/shared-data-enums": "1.
|
|
31
|
-
"@aglyn/shared-data-mdi": "1.
|
|
32
|
-
"@aglyn/shared-ui-jsx": "1.
|
|
33
|
-
"@aglyn/shared-ui-next": "1.
|
|
34
|
-
"@aglyn/shared-ui-snackstack": "1.
|
|
35
|
-
"@aglyn/shared-util-email": "1.
|
|
36
|
-
"@aglyn/shared-util-http": "1.
|
|
37
|
-
"@aglyn/shared-util-timestamp": "1.
|
|
38
|
-
"@aglyn/tenant-data-admin": "1.
|
|
39
|
-
"@aglyn/tenant-feature-instance": "1.
|
|
40
|
-
"@aglyn/tenant-runtime": "1.
|
|
28
|
+
"@aglyn/aglyn": "1.4.0",
|
|
29
|
+
"@aglyn/aglyn-markdown-editor": "1.4.0",
|
|
30
|
+
"@aglyn/shared-data-enums": "1.4.0",
|
|
31
|
+
"@aglyn/shared-data-mdi": "1.4.0",
|
|
32
|
+
"@aglyn/shared-ui-jsx": "1.4.0",
|
|
33
|
+
"@aglyn/shared-ui-next": "1.4.0",
|
|
34
|
+
"@aglyn/shared-ui-snackstack": "1.4.0",
|
|
35
|
+
"@aglyn/shared-util-email": "1.4.0",
|
|
36
|
+
"@aglyn/shared-util-http": "1.4.0",
|
|
37
|
+
"@aglyn/shared-util-timestamp": "1.4.0",
|
|
38
|
+
"@aglyn/tenant-data-admin": "1.4.0",
|
|
39
|
+
"@aglyn/tenant-feature-instance": "1.4.0",
|
|
40
|
+
"@aglyn/tenant-runtime": "1.4.0",
|
|
41
41
|
"@swc/helpers": "0.5.23"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -39,6 +39,7 @@ import ListingReviews from "./listing-reviews.component.js";
|
|
|
39
39
|
import ReportTarget from "./report-target.component.js";
|
|
40
40
|
import PluginSiteSet from "./plugin-site-set.component.js";
|
|
41
41
|
import { MenuItem, TextField } from "@mui/material";
|
|
42
|
+
import { SITE_STARTER_ARTIFACT_TYPE } from "@aglyn/aglyn/app-utils/site-starter";
|
|
42
43
|
import { useMarketplaceActions } from "../hooks/use-marketplace-actions.js";
|
|
43
44
|
import { useArtifactUpdate } from "../hooks/use-artifact-update.js";
|
|
44
45
|
import ArtifactUpdateDialog from "./artifact-update-dialog.component.js";
|
|
@@ -392,7 +393,9 @@ export function ListingReadme({ readme }) {
|
|
|
392
393
|
// than let the server infer it from whichever site the surface happens to
|
|
393
394
|
// be acting through.
|
|
394
395
|
const orgId = useHostOrgId(hostId);
|
|
395
|
-
const { install, installPlan, buy, uninstall } = useMarketplaceActions(hostId, orgId
|
|
396
|
+
const { install, installPlan, buy, uninstall, payPanel, buying } = useMarketplaceActions(hostId, orgId, orgSlug ? buildRoute(Route.MANAGE_BILLING, {
|
|
397
|
+
orgSlug
|
|
398
|
+
}) : null);
|
|
396
399
|
/** The uninstall awaiting its impact check and confirmation (AGL-1027). */ const [pendingUninstall, setPendingUninstall] = useState(null);
|
|
397
400
|
const [installScope, setInstallScope] = useState('org');
|
|
398
401
|
// Confirm before writing install pins (AGL-867): the install is deliberate
|
|
@@ -1489,9 +1492,13 @@ export function ListingReadme({ readme }) {
|
|
|
1489
1492
|
fullWidth: true,
|
|
1490
1493
|
variant: upToDate ? 'outlined' : 'contained',
|
|
1491
1494
|
color: "primary",
|
|
1492
|
-
disabled: Boolean(upToDate) || !(listing == null ? void 0 : listing.profileId) || //
|
|
1495
|
+
disabled: Boolean(upToDate) || !(listing == null ? void 0 : listing.profileId) || // Paying is under way in the panel below.
|
|
1496
|
+
buying || Boolean(payPanel) || // Nothing selected to install to (AGL-773).
|
|
1493
1497
|
orgTargeting && !installed && !mustBuy && installPlanSteps.length === 0,
|
|
1494
|
-
onClick:
|
|
1498
|
+
onClick: // A site starter is bought to create a site
|
|
1499
|
+
// with, so that is the permission it asks for,
|
|
1500
|
+
// as the pay door does (AGL-4049).
|
|
1501
|
+
(artifactType === SITE_STARTER_ARTIFACT_TYPE ? permissions.createHosts : permissions.installPlugins) ? ()=>// Buying opens the payment panel below,
|
|
1495
1502
|
// which is its own confirmation; a free or
|
|
1496
1503
|
// entitled install confirms its targets
|
|
1497
1504
|
// first (AGL-867). Updating a copied
|
|
@@ -1511,6 +1518,7 @@ export function ListingReadme({ readme }) {
|
|
|
1511
1518
|
artifactType === 'theme' ? `Applied (v${installedVersion}) · re-apply` : `${artifactType === 'emailTemplate' ? 'Draft added' : 'Added'} (v${installedVersion}) · add again` : installed ? `Update to v${offeredVersion}` : mustBuy ? licensedElsewhere ? `Buy for this workspace — $${priceUsd}` : `Buy for $${priceUsd}` : unreviewedInstall ? `Install unreviewed v${listing == null ? void 0 : listing.latestVersion} for testing` : orgTargeting || installTargets.length > 1 ? 'Install' : 'Add to this site'
|
|
1512
1519
|
})
|
|
1513
1520
|
}),
|
|
1521
|
+
payPanel,
|
|
1514
1522
|
!orgPluginScope && isPlugin && installed ? /*#__PURE__*/ _jsx(Button, {
|
|
1515
1523
|
fullWidth: true,
|
|
1516
1524
|
size: "small",
|