@phis/ui 0.8.0 → 0.8.2
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 +9 -2
- package/components/cms/phi-cms-layout-renderer.js +15 -7
- package/components/cms/phi-cms-render-diagnostic-client.d.ts +3 -1
- package/components/cms/phi-cms-render-diagnostic-client.js +4 -3
- package/components/cms/phi-cms-render-diagnostic.d.ts +8 -2
- package/components/cms/phi-cms-render-diagnostic.js +12 -2
- package/components/cms/phi-cms-render-error-boundary.d.ts +2 -0
- package/components/cms/phi-cms-render-error-boundary.js +1 -1
- package/components/cms/phi-cms-root-layout.js +3 -1
- package/components/controls/phi-media-picker-control.d.ts +9 -0
- package/components/controls/phi-media-picker-control.js +1 -1
- package/components/controls/phi-popover-control.js +4 -1
- package/components/controls/phi-table-control.d.ts +7 -1
- package/components/controls/phi-table-control.js +26 -11
- package/components/forms/form-descriptor-field-check.d.ts +18 -0
- package/components/forms/form-descriptor-field-check.js +41 -0
- package/components/forms/form-descriptor-runtime-client.js +11 -10
- package/components/forms/form-record-source.d.ts +38 -0
- package/components/forms/form-record-source.js +48 -0
- package/components/forms/shared-form-descriptors.d.ts +0 -34
- package/components/forms/shared-form-descriptors.js +0 -6
- package/components/forms/shared-form-ids.d.ts +1 -1
- package/components/forms/shared-form-ids.js +1 -1
- package/components/media/media-settings-labels.d.ts +1 -0
- package/components/media/media-settings-labels.js +2 -0
- package/components/media/media-upload-flow.d.ts +62 -5
- package/components/media/media-upload-flow.js +62 -24
- package/components/media/phi-area-upload-widget.d.ts +44 -1
- package/components/media/phi-area-upload-widget.js +32 -7
- package/components/media/phi-media-picker-binding.d.ts +41 -33
- package/components/media/phi-media-picker-binding.js +2 -1
- package/components/media/phi-media-upload.d.ts +10 -3
- package/components/media/phi-media-upload.js +11 -8
- package/components/media/use-media-library-add-picker.d.ts +33 -32
- package/components/overlays/phi-overlay-container-client.js +11 -9
- package/components/regions/presets/phi-settings-page-shell-tree.d.ts +7 -0
- package/components/regions/presets/phi-settings-page-shell-tree.js +3 -3
- package/components/shell/phi-icon-names.d.ts +3 -0
- package/components/shell/phi-icon-names.js +3 -0
- package/components/shell/phi-icon.d.ts +5 -7
- package/components/shell/phi-icon.js +8 -21
- package/components/shell/phi-widget-icon.js +1 -0
- package/components/tables/client/phi-table-binding-params.d.ts +24 -0
- package/components/tables/client/phi-table-binding-params.js +39 -0
- package/components/tables/client/phi-table-binding.d.ts +1 -3
- package/components/tables/client/phi-table-binding.js +5 -9
- package/components/widgets/client/html-editor-link-node.d.ts +12 -0
- package/components/widgets/client/html-editor-link-node.js +60 -0
- package/components/widgets/client/html-editor.js +10 -6
- package/components/widgets/client/shared/phi-button-icons.d.ts +6 -4
- package/components/widgets/client/shared/phi-button-icons.js +8 -12
- package/components/widgets/client/shared/phi-collection-binding-params.d.ts +8 -0
- package/components/widgets/client/shared/phi-collection-binding-params.js +13 -0
- package/components/widgets/client/shared/phi-collection-provider.d.ts +11 -1
- package/components/widgets/client/shared/phi-collection-provider.js +5 -0
- package/components/widgets/client/shared/phi-collection-view-binding.d.ts +1 -0
- package/components/widgets/client/shared/phi-collection-view-binding.js +33 -26
- package/components/widgets/client/shared/phi-command-buttons.d.ts +16 -0
- package/components/widgets/client/shared/phi-command-buttons.js +9 -1
- package/components/widgets/label-sets/admin-users.d.ts +1 -0
- package/components/widgets/label-sets/admin-users.js +2 -0
- package/components/widgets/label-sets/builder-modules.js +4 -0
- package/components/widgets/label-sets/profile.d.ts +0 -16
- package/components/widgets/label-sets/profile.js +0 -37
- package/components/widgets/label-sets/registration.d.ts +0 -1
- package/components/widgets/label-sets/registration.js +0 -2
- package/components/widgets/label-sets/revisions.js +2 -0
- package/components/widgets/label-sets/signals.js +2 -0
- package/components/widgets/label-types/builder-modules.d.ts +4 -0
- package/components/widgets/label-types/builder-modules.js +2 -0
- package/components/widgets/label-types/revisions.d.ts +2 -0
- package/components/widgets/label-types/revisions.js +2 -1
- package/components/widgets/label-types/signals.d.ts +2 -0
- package/components/widgets/label-types/signals.js +1 -0
- package/components/widgets/shared/widget-failure-audience.d.ts +7 -0
- package/components/widgets/shared/widget-failure-audience.js +21 -0
- package/components/widgets/shared/widget-failure-client.js +5 -2
- package/components/widgets/shared/widget-failure-notice-client.d.ts +6 -0
- package/components/widgets/shared/widget-failure-notice-client.js +10 -0
- package/components/widgets/shared/widget-failure-notice.d.ts +6 -0
- package/components/widgets/shared/widget-failure-notice.js +17 -0
- package/components/widgets/shared/widget-failure-staff.d.ts +3 -0
- package/components/widgets/shared/widget-failure-staff.js +18 -0
- package/components/widgets/shared/widget-failure.d.ts +9 -6
- package/components/widgets/shared/widget-failure.js +0 -9
- package/components/widgets/shared/widget-failure.server.d.ts +4 -2
- package/components/widgets/shared/widget-failure.server.js +8 -3
- package/constants/cms-widget-types.d.ts +1 -0
- package/constants/cms-widget-types.js +3 -0
- package/constants/customer-file.d.ts +12 -3
- package/constants/customer-file.js +12 -3
- package/constants/runtime-module-ownership.js +5 -3
- package/constants/site-address.d.ts +9 -0
- package/constants/site-address.js +10 -0
- package/constants/table-loading.d.ts +14 -0
- package/constants/table-loading.js +14 -0
- package/constants.d.ts +2 -1
- package/constants.js +3 -1
- package/gateway/site-cms-write-validation.js +19 -3
- package/gateway/site-proxy.d.ts +12 -0
- package/gateway/site-proxy.js +20 -0
- package/helpers/announced-action.d.ts +17 -0
- package/helpers/announced-action.js +29 -0
- package/helpers/phi-metadata.d.ts +0 -8
- package/helpers/phi-metadata.js +1 -10
- package/helpers/phi-site-description.d.ts +11 -0
- package/helpers/phi-site-description.js +13 -0
- package/helpers/preset-form-check.d.ts +14 -0
- package/helpers/preset-form-check.js +12 -0
- package/helpers/preset-table-check.d.ts +19 -15
- package/helpers/preset-table-check.js +33 -39
- package/helpers/record-widget-binding.d.ts +10 -0
- package/helpers/record-widget-binding.js +35 -0
- package/helpers/record-widget.d.ts +1 -10
- package/helpers/record-widget.js +4 -33
- package/helpers/table-widget-binding.d.ts +12 -0
- package/helpers/table-widget-binding.js +296 -0
- package/helpers/tree-widget-binding.d.ts +19 -0
- package/helpers/tree-widget-binding.js +72 -0
- package/helpers/typed-confirmation.d.ts +9 -0
- package/helpers/typed-confirmation.js +13 -0
- package/helpers/widget-binding-check.d.ts +22 -0
- package/helpers/widget-binding-check.js +91 -0
- package/module-page-check.d.ts +2 -0
- package/module-page-check.js +2 -0
- package/net/phi-next-proxy.d.ts +7 -0
- package/net/phi-next-proxy.js +1 -1
- package/next/root-route.js +2 -1
- package/package.json +27 -14
- package/plugins/runtime-modules/accounting/ids.d.ts +7 -4
- package/plugins/runtime-modules/accounting/ids.js +14 -3
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.d.ts +21 -9
- package/plugins/runtime-modules/accounting/trees/accounting-customer-file-label-set.js +29 -15
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.d.ts +11 -8
- package/plugins/runtime-modules/accounting/trees/phi-default-accounting-customer-file-page-tree.js +206 -137
- package/plugins/runtime-modules/app/client-data-providers.js +1 -1
- package/plugins/runtime-modules/app/data-providers.d.ts +14 -69
- package/plugins/runtime-modules/app/data-providers.js +19 -54
- package/plugins/runtime-modules/app/definition.d.ts +8 -80
- package/plugins/runtime-modules/app/forms.d.ts +1 -16
- package/plugins/runtime-modules/app/forms.js +0 -59
- package/plugins/runtime-modules/app/ids.d.ts +2 -1
- package/plugins/runtime-modules/app/ids.js +3 -2
- package/plugins/runtime-modules/app/module.d.ts +8 -80
- package/plugins/runtime-modules/app/services/addresses-collection.d.ts +59 -0
- package/plugins/runtime-modules/app/services/{addresses-table.js → addresses-collection.js} +23 -19
- package/plugins/runtime-modules/app/trees/account-addresses-panel.d.ts +10 -6
- package/plugins/runtime-modules/app/trees/account-addresses-panel.js +37 -73
- package/plugins/runtime-modules/app/trees/addresses-label-set.d.ts +0 -5
- package/plugins/runtime-modules/app/trees/addresses-label-set.js +2 -6
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.d.ts +1 -2
- package/plugins/runtime-modules/app/trees/phi-default-app-profile-page-tree.js +1 -17
- package/plugins/runtime-modules/app/trees/profile-label-set.d.ts +0 -2
- package/plugins/runtime-modules/app/trees/profile-label-set.js +2 -14
- package/plugins/runtime-modules/area-contributions/admin.d.ts +1 -1
- package/plugins/runtime-modules/area-contributions/admin.js +2 -0
- package/plugins/runtime-modules/asset/trees/phi-default-admin-media-settings-page-tree.js +5 -0
- package/plugins/runtime-modules/avatar/addresses.d.ts +1 -1
- package/plugins/runtime-modules/builder/clients/inspector-config-field.js +16 -6
- package/plugins/runtime-modules/builder/clients/inspector-image-field.js +3 -1
- package/plugins/runtime-modules/builder/clients/inspector-section-widget.js +3 -1
- package/plugins/runtime-modules/builder/controller/signal-wiring-controller.js +5 -1
- package/plugins/runtime-modules/builder/signal-wiring-options.js +9 -2
- package/plugins/runtime-modules/builder/trees/phi-builder-inspector-area-overlay-tree.server.js +5 -0
- package/plugins/runtime-modules/builder/trees/phi-default-builder-area-preset-tree.js +14 -1
- package/plugins/runtime-modules/cdn/authoring-widgets.d.ts +3 -0
- package/plugins/runtime-modules/cdn/authoring-widgets.js +7 -0
- package/plugins/runtime-modules/cdn/authoring.d.ts +1 -0
- package/plugins/runtime-modules/cdn/authoring.js +8 -0
- package/plugins/runtime-modules/cdn/bytes.d.ts +5 -0
- package/plugins/runtime-modules/cdn/bytes.js +17 -0
- package/plugins/runtime-modules/cdn/client-data-providers.d.ts +7 -0
- package/plugins/runtime-modules/cdn/client-data-providers.js +9 -0
- package/plugins/runtime-modules/cdn/data-providers.d.ts +134 -0
- package/plugins/runtime-modules/cdn/data-providers.js +117 -0
- package/plugins/runtime-modules/cdn/definition.d.ts +140 -0
- package/plugins/runtime-modules/cdn/definition.js +23 -0
- package/plugins/runtime-modules/cdn/ids.d.ts +18 -0
- package/plugins/runtime-modules/cdn/ids.js +20 -0
- package/plugins/runtime-modules/cdn/module.d.ts +131 -0
- package/plugins/runtime-modules/cdn/module.js +4 -0
- package/plugins/runtime-modules/cdn/platform.d.ts +25 -0
- package/plugins/runtime-modules/cdn/platform.js +73 -0
- package/plugins/runtime-modules/cdn/presets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/presets.js +20 -0
- package/plugins/runtime-modules/cdn/server.d.ts +1 -0
- package/plugins/runtime-modules/cdn/server.js +14 -0
- package/plugins/runtime-modules/cdn/services/table.d.ts +11 -0
- package/plugins/runtime-modules/cdn/services/table.js +296 -0
- package/plugins/runtime-modules/cdn/services/upload.d.ts +20 -0
- package/plugins/runtime-modules/cdn/services/upload.js +146 -0
- package/plugins/runtime-modules/cdn/table-params.d.ts +10 -0
- package/plugins/runtime-modules/cdn/table-params.js +10 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.d.ts +95 -0
- package/plugins/runtime-modules/cdn/trees/admin-cdn-label-set.js +156 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.d.ts +18 -0
- package/plugins/runtime-modules/cdn/trees/phi-default-admin-cdn-page-tree.js +479 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.d.ts +12 -0
- package/plugins/runtime-modules/cdn/widgets/upload/client.js +138 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.d.ts +29 -0
- package/plugins/runtime-modules/cdn/widgets/upload/config.js +43 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.d.ts +24 -0
- package/plugins/runtime-modules/cdn/widgets/upload/label-types.js +1 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.d.ts +4 -0
- package/plugins/runtime-modules/cdn/widgets/upload/labels.js +72 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.d.ts +3 -0
- package/plugins/runtime-modules/cdn/widgets/upload/plugin.js +7 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.d.ts +8 -0
- package/plugins/runtime-modules/cdn/widgets/upload/server.js +17 -0
- package/plugins/runtime-modules/cdn/widgets.d.ts +2 -0
- package/plugins/runtime-modules/cdn/widgets.js +13 -0
- package/plugins/runtime-modules/client-authoring-providers/admin.d.ts +1 -1
- package/plugins/runtime-modules/client-authoring-providers/admin.js +6 -0
- package/plugins/runtime-modules/client-manifests/admin.js +11 -1
- package/plugins/runtime-modules/client-manifests/common.js +6 -0
- package/plugins/runtime-modules/core/widgets/card/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/asset-binding.js +1 -1
- package/plugins/runtime-modules/core/widgets/collection-view/client.js +5 -2
- package/plugins/runtime-modules/core/widgets/collection-view/config.js +8 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.d.ts +55 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-binding.js +175 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.d.ts +48 -0
- package/plugins/runtime-modules/core/widgets/collection-view/site-address-tiles.js +67 -0
- package/plugins/runtime-modules/core/widgets/command-toolbar/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/description/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/entry-list/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/float-button/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/form/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/form/config.js +14 -1
- package/plugins/runtime-modules/core/widgets/gallery/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/markdown/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/record/client.js +2 -6
- package/plugins/runtime-modules/core/widgets/result/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/simple-text/config.d.ts +1 -1
- package/plugins/runtime-modules/core/widgets/table/client.js +36 -52
- package/plugins/runtime-modules/core/widgets/table/config.d.ts +3 -3
- package/plugins/runtime-modules/core/widgets/table/config.js +3 -0
- package/plugins/runtime-modules/core/widgets/thread-conversation/client.js +2 -2
- package/plugins/runtime-modules/core/widgets/thread-conversation/config.d.ts +6 -2
- package/plugins/runtime-modules/core/widgets/thread-conversation/config.js +6 -1
- package/plugins/runtime-modules/core/widgets/thread-widget-config.d.ts +10 -0
- package/plugins/runtime-modules/core/widgets/thread-widget-config.js +6 -0
- package/plugins/runtime-modules/core/widgets/tree/client.js +6 -6
- package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.d.ts +2 -0
- package/plugins/runtime-modules/localization/trees/editor-translations-widget-label-set.js +2 -0
- package/plugins/runtime-modules/localization/trees/phi-default-editor-translations-page-tree.js +5 -0
- package/plugins/runtime-modules/revisions/controller/binding.d.ts +37 -0
- package/plugins/runtime-modules/revisions/controller/binding.js +75 -0
- package/plugins/runtime-modules/revisions/controller/client.d.ts +5 -0
- package/plugins/runtime-modules/revisions/controller/client.js +74 -50
- package/plugins/runtime-modules/revisions/controller/definition.d.ts +5 -0
- package/plugins/runtime-modules/revisions/controller/definition.js +10 -0
- package/plugins/runtime-modules/revisions/forms.js +1 -1
- package/plugins/runtime-modules/revisions/page-ids.d.ts +1 -1
- package/plugins/runtime-modules/revisions/page-ids.js +4 -1
- package/plugins/runtime-modules/revisions/services/options.js +14 -4
- package/plugins/runtime-modules/revisions/services/table.js +41 -21
- package/plugins/runtime-modules/revisions/trees/phi-default-builder-revisions-page-tree.js +76 -3
- package/plugins/runtime-modules/theme/controller/runtime.js +14 -2
- package/plugins/runtime-modules/theme/widgets/brand-controls/client.js +39 -13
- package/plugins/runtime-modules/threads/client-data-providers.js +5 -0
- package/plugins/runtime-modules/threads/controller/client.js +62 -2
- package/plugins/runtime-modules/threads/controller/definition.js +48 -0
- package/plugins/runtime-modules/threads/data-providers.d.ts +22 -37
- package/plugins/runtime-modules/threads/data-providers.js +35 -24
- package/plugins/runtime-modules/threads/definition.d.ts +22 -37
- package/plugins/runtime-modules/threads/ids.d.ts +2 -0
- package/plugins/runtime-modules/threads/ids.js +2 -0
- package/plugins/runtime-modules/threads/services/customer-file-addresses.d.ts +30 -0
- package/plugins/runtime-modules/threads/services/customer-file-addresses.js +59 -0
- package/plugins/runtime-modules/threads/services/customer-file-read.d.ts +22 -0
- package/plugins/runtime-modules/threads/services/customer-file-read.js +101 -0
- package/plugins/runtime-modules/threads/services/customer-file-table.d.ts +14 -80
- package/plugins/runtime-modules/threads/services/customer-file-table.js +27 -112
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.d.ts +4 -0
- package/plugins/runtime-modules/user-management/trees/admin-users-access-label-set.js +4 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-access-page-tree.js +15 -0
- package/plugins/runtime-modules/user-management/trees/phi-default-admin-users-page-tree.js +5 -0
- package/server-helpers/runtime.js +0 -1
- package/styles/controls.css +4 -2
- package/styles/layout.css +7 -0
- package/theme/phi-antd-token-resolver.d.ts +8 -0
- package/theme/phi-antd-token-resolver.js +10 -0
- package/theme/phi-theme-color.d.ts +19 -0
- package/theme/phi-theme-color.js +42 -0
- package/theme/phi-theme-gradients.js +4 -22
- package/theme/phi-theme-palette-defaults.d.ts +16 -0
- package/theme/phi-theme-palette-defaults.js +103 -0
- package/types/cms-plugins.d.ts +6 -1
- package/types/collection-provider.d.ts +27 -0
- package/types/collection-signal-values.d.ts +2 -0
- package/types/collection-signal-values.js +23 -0
- package/types/collection-view-widget.d.ts +9 -0
- package/types/core-widget-placements.d.ts +6 -0
- package/types/signals.d.ts +2 -0
- package/types/signals.js +2 -0
- package/types/table-widget.d.ts +17 -3
- package/types/table-widget.js +0 -282
- package/types/tree-widget.d.ts +0 -1
- package/types/tree-widget.js +0 -60
- package/types/widget-runtime.d.ts +0 -1
- package/types.d.ts +1 -1
- package/types.js +1 -1
- package/plugins/runtime-modules/app/services/addresses-table.d.ts +0 -135
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const UNITS = ["B", "KiB", "MiB", "GiB", "TiB"];
|
|
2
|
+
/**
|
|
3
|
+
* A size as the CDN page says it: binary units, as the parts and the Media limits are counted, written
|
|
4
|
+
* with the reader's digits. Whole bytes below one KiB, one decimal above.
|
|
5
|
+
*/
|
|
6
|
+
export function formatPhiCdnBytes(bytes, locale) {
|
|
7
|
+
if (!Number.isFinite(bytes) || bytes < 0)
|
|
8
|
+
return "";
|
|
9
|
+
let value = bytes;
|
|
10
|
+
let unit = 0;
|
|
11
|
+
while (value >= 1024 && unit < UNITS.length - 1) {
|
|
12
|
+
value /= 1024;
|
|
13
|
+
unit += 1;
|
|
14
|
+
}
|
|
15
|
+
const digits = new Intl.NumberFormat(locale, { maximumFractionDigits: unit === 0 ? 0 : 1 }).format(value);
|
|
16
|
+
return `${digits} ${UNITS[unit]}`;
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS, PHI_CDN_RUNTIME_MODULE_ID } from "./ids";
|
|
3
|
+
export const PHI_CDN_RUNTIME_DATA_PROVIDER_CLIENT_DEFINITIONS = [
|
|
4
|
+
{
|
|
5
|
+
key: PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS.table,
|
|
6
|
+
ownerModuleId: PHI_CDN_RUNTIME_MODULE_ID,
|
|
7
|
+
loadLive: async () => (await import("./services/table")).PhiCdnTableProviderClient,
|
|
8
|
+
},
|
|
9
|
+
];
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Site's CDN catalogue and the check of its bucket, over Core's Admin routes
|
|
3
|
+
* (`/api/site/admin/cdn`, phis-server; Admins and Maintainers). Every write is Core's to allow: the
|
|
4
|
+
* Page only offers it.
|
|
5
|
+
*
|
|
6
|
+
* `files` is the catalogue: every file offered under the Site's name, copied into the bucket (`cdn`) or
|
|
7
|
+
* linked where its source keeps it (`link`), with what became of it. A key is the file's whole identity
|
|
8
|
+
* and is never written twice, so withdrawing and deleting keep the row: the key stays taken.
|
|
9
|
+
*
|
|
10
|
+
* `check` is one run of the bucket against the catalogue, read when its dialog opens. Its rows are what
|
|
11
|
+
* it found -- an object the catalogue does not hold, a file the bucket does not hold, a size that differs
|
|
12
|
+
* -- and an unrecorded object Core can take into the catalogue offers `adopt`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const PHI_CDN_RUNTIME_DATA_PROVIDER_DESCRIPTORS: {
|
|
15
|
+
key: `${string}/${string}`;
|
|
16
|
+
ownerModuleId: "@phis/ui/modules/cdn";
|
|
17
|
+
kind: "table";
|
|
18
|
+
executionMode: "live";
|
|
19
|
+
authoringMode: "none";
|
|
20
|
+
title: string;
|
|
21
|
+
description: string;
|
|
22
|
+
resources: ({
|
|
23
|
+
resourceKey: "files";
|
|
24
|
+
title: string;
|
|
25
|
+
rowIdentityPath: string;
|
|
26
|
+
recordRead: true;
|
|
27
|
+
fields: ({
|
|
28
|
+
key: string;
|
|
29
|
+
title: string;
|
|
30
|
+
type: "string";
|
|
31
|
+
required: true;
|
|
32
|
+
} | {
|
|
33
|
+
key: string;
|
|
34
|
+
title: string;
|
|
35
|
+
type: "number";
|
|
36
|
+
required?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
key: string;
|
|
39
|
+
title: string;
|
|
40
|
+
type: "string";
|
|
41
|
+
required?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
key: string;
|
|
44
|
+
title: string;
|
|
45
|
+
type: "json";
|
|
46
|
+
required?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
key: string;
|
|
49
|
+
title: string;
|
|
50
|
+
type: "datetime";
|
|
51
|
+
required?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
key: string;
|
|
54
|
+
title: string;
|
|
55
|
+
type: "boolean";
|
|
56
|
+
required?: undefined;
|
|
57
|
+
})[];
|
|
58
|
+
query: {
|
|
59
|
+
search: true;
|
|
60
|
+
filterFields: string[];
|
|
61
|
+
sorting: "single";
|
|
62
|
+
pagination: "offset";
|
|
63
|
+
total: true;
|
|
64
|
+
};
|
|
65
|
+
actions: ({
|
|
66
|
+
key: string;
|
|
67
|
+
title: string;
|
|
68
|
+
scope: "row";
|
|
69
|
+
intent: "read";
|
|
70
|
+
confirmation?: undefined;
|
|
71
|
+
disabledWhen?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
key: string;
|
|
74
|
+
title: string;
|
|
75
|
+
scope: "row";
|
|
76
|
+
intent: "destructive";
|
|
77
|
+
confirmation: "required";
|
|
78
|
+
disabledWhen: {
|
|
79
|
+
source: "row";
|
|
80
|
+
valuePath: string;
|
|
81
|
+
operator: "truthy";
|
|
82
|
+
};
|
|
83
|
+
})[];
|
|
84
|
+
summaryFields?: undefined;
|
|
85
|
+
} | {
|
|
86
|
+
resourceKey: "check";
|
|
87
|
+
title: string;
|
|
88
|
+
rowIdentityPath: string;
|
|
89
|
+
fields: ({
|
|
90
|
+
key: string;
|
|
91
|
+
title: string;
|
|
92
|
+
type: "string";
|
|
93
|
+
required: true;
|
|
94
|
+
} | {
|
|
95
|
+
key: string;
|
|
96
|
+
title: string;
|
|
97
|
+
type: "string";
|
|
98
|
+
required?: undefined;
|
|
99
|
+
} | {
|
|
100
|
+
key: string;
|
|
101
|
+
title: string;
|
|
102
|
+
type: "boolean";
|
|
103
|
+
required?: undefined;
|
|
104
|
+
})[];
|
|
105
|
+
summaryFields: ({
|
|
106
|
+
key: string;
|
|
107
|
+
title: string;
|
|
108
|
+
type: "number";
|
|
109
|
+
} | {
|
|
110
|
+
key: string;
|
|
111
|
+
title: string;
|
|
112
|
+
type: "boolean";
|
|
113
|
+
})[];
|
|
114
|
+
query: {
|
|
115
|
+
search: false;
|
|
116
|
+
filterFields: never[];
|
|
117
|
+
sorting: "none";
|
|
118
|
+
pagination: "none";
|
|
119
|
+
total?: undefined;
|
|
120
|
+
};
|
|
121
|
+
actions: {
|
|
122
|
+
key: string;
|
|
123
|
+
title: string;
|
|
124
|
+
scope: "row";
|
|
125
|
+
intent: "write";
|
|
126
|
+
visibleWhen: {
|
|
127
|
+
source: "row";
|
|
128
|
+
valuePath: string;
|
|
129
|
+
operator: "truthy";
|
|
130
|
+
};
|
|
131
|
+
}[];
|
|
132
|
+
recordRead?: undefined;
|
|
133
|
+
})[];
|
|
134
|
+
}[];
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS, PHI_CDN_RUNTIME_MODULE_ID, PHI_CDN_TABLE_RESOURCE_KEYS, } from "./ids";
|
|
2
|
+
/**
|
|
3
|
+
* The Site's CDN catalogue and the check of its bucket, over Core's Admin routes
|
|
4
|
+
* (`/api/site/admin/cdn`, phis-server; Admins and Maintainers). Every write is Core's to allow: the
|
|
5
|
+
* Page only offers it.
|
|
6
|
+
*
|
|
7
|
+
* `files` is the catalogue: every file offered under the Site's name, copied into the bucket (`cdn`) or
|
|
8
|
+
* linked where its source keeps it (`link`), with what became of it. A key is the file's whole identity
|
|
9
|
+
* and is never written twice, so withdrawing and deleting keep the row: the key stays taken.
|
|
10
|
+
*
|
|
11
|
+
* `check` is one run of the bucket against the catalogue, read when its dialog opens. Its rows are what
|
|
12
|
+
* it found -- an object the catalogue does not hold, a file the bucket does not hold, a size that differs
|
|
13
|
+
* -- and an unrecorded object Core can take into the catalogue offers `adopt`.
|
|
14
|
+
*/
|
|
15
|
+
export const PHI_CDN_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
16
|
+
{
|
|
17
|
+
key: PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS.table,
|
|
18
|
+
ownerModuleId: PHI_CDN_RUNTIME_MODULE_ID,
|
|
19
|
+
kind: "table",
|
|
20
|
+
executionMode: "live",
|
|
21
|
+
authoringMode: "none",
|
|
22
|
+
title: "CDN",
|
|
23
|
+
description: "The Site's CDN catalogue and the check of its bucket.",
|
|
24
|
+
resources: [
|
|
25
|
+
{
|
|
26
|
+
resourceKey: PHI_CDN_TABLE_RESOURCE_KEYS.files,
|
|
27
|
+
title: "CDN files",
|
|
28
|
+
rowIdentityPath: "key",
|
|
29
|
+
recordRead: true,
|
|
30
|
+
fields: [
|
|
31
|
+
{ key: "key", title: "Key", type: "string", required: true },
|
|
32
|
+
{ key: "name", title: "Name", type: "string", required: true },
|
|
33
|
+
{ key: "version", title: "Version", type: "string", required: true },
|
|
34
|
+
{ key: "fileName", title: "File", type: "string", required: true },
|
|
35
|
+
{ key: "sizeBytes", title: "Size in bytes", type: "number" },
|
|
36
|
+
{ key: "sizeLabel", title: "Size", type: "string" },
|
|
37
|
+
{ key: "storage", title: "Storage", type: "string" },
|
|
38
|
+
// `PhisCdnFileOs` and `PhisCdnFileArch` bits as one tag each: `macos`, `arm64`.
|
|
39
|
+
{ key: "platform", title: "Platform", type: "json" },
|
|
40
|
+
{ key: "sha256", title: "SHA-256", type: "string" },
|
|
41
|
+
{ key: "contentType", title: "Content type", type: "string" },
|
|
42
|
+
{ key: "publishedAt", title: "Published", type: "datetime" },
|
|
43
|
+
{ key: "url", title: "Address", type: "string" },
|
|
44
|
+
{ key: "state", title: "State", type: "string" },
|
|
45
|
+
// The kind (`cli`, `upload`) or, for an Add-on's file, the Add-on's id.
|
|
46
|
+
{ key: "origin", title: "Origin", type: "string" },
|
|
47
|
+
{ key: "addonId", title: "Add-on", type: "string" },
|
|
48
|
+
{ key: "actorUserId", title: "Uploaded by", type: "number" },
|
|
49
|
+
{ key: "sourceUrl", title: "Source address", type: "string" },
|
|
50
|
+
{ key: "withdrawDisabled", title: "Withdrawn already", type: "boolean" },
|
|
51
|
+
{ key: "deleteDisabled", title: "Deleted already", type: "boolean" },
|
|
52
|
+
],
|
|
53
|
+
query: {
|
|
54
|
+
search: true,
|
|
55
|
+
filterFields: ["state", "name"],
|
|
56
|
+
sorting: "single",
|
|
57
|
+
pagination: "offset",
|
|
58
|
+
total: true,
|
|
59
|
+
},
|
|
60
|
+
actions: [
|
|
61
|
+
{ key: "copy-url", title: "Copy address", scope: "row", intent: "read" },
|
|
62
|
+
{
|
|
63
|
+
key: "withdraw",
|
|
64
|
+
title: "Withdraw",
|
|
65
|
+
scope: "row",
|
|
66
|
+
intent: "destructive",
|
|
67
|
+
confirmation: "required",
|
|
68
|
+
disabledWhen: { source: "row", valuePath: "withdrawDisabled", operator: "truthy" },
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
key: "delete",
|
|
72
|
+
title: "Delete",
|
|
73
|
+
scope: "row",
|
|
74
|
+
intent: "destructive",
|
|
75
|
+
confirmation: "required",
|
|
76
|
+
disabledWhen: { source: "row", valuePath: "deleteDisabled", operator: "truthy" },
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
resourceKey: PHI_CDN_TABLE_RESOURCE_KEYS.check,
|
|
82
|
+
title: "CDN check",
|
|
83
|
+
rowIdentityPath: "id",
|
|
84
|
+
fields: [
|
|
85
|
+
{ key: "id", title: "Finding", type: "string", required: true },
|
|
86
|
+
{ key: "key", title: "Key", type: "string", required: true },
|
|
87
|
+
// `unrecorded`, `missing` or `size-mismatch`.
|
|
88
|
+
{ key: "finding", title: "Finding", type: "string", required: true },
|
|
89
|
+
{ key: "sizeLabel", title: "Size", type: "string" },
|
|
90
|
+
{ key: "recordedLabel", title: "Recorded size", type: "string" },
|
|
91
|
+
{ key: "reason", title: "Reason", type: "string" },
|
|
92
|
+
{ key: "adoptable", title: "Can be adopted", type: "boolean" },
|
|
93
|
+
],
|
|
94
|
+
summaryFields: [
|
|
95
|
+
{ key: "objects", title: "Objects in the bucket", type: "number" },
|
|
96
|
+
{ key: "recorded", title: "Copied files in the catalogue", type: "number" },
|
|
97
|
+
{ key: "consistent", title: "Bucket and catalogue agree", type: "boolean" },
|
|
98
|
+
],
|
|
99
|
+
query: {
|
|
100
|
+
search: false,
|
|
101
|
+
filterFields: [],
|
|
102
|
+
sorting: "none",
|
|
103
|
+
pagination: "none",
|
|
104
|
+
},
|
|
105
|
+
actions: [
|
|
106
|
+
{
|
|
107
|
+
key: "adopt",
|
|
108
|
+
title: "Adopt",
|
|
109
|
+
scope: "row",
|
|
110
|
+
intent: "write",
|
|
111
|
+
visibleWhen: { source: "row", valuePath: "adoptable", operator: "truthy" },
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
];
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Site's CDN on the Admin page `CDN`: what is published, uploads, withdrawing and deleting, and the
|
|
3
|
+
* check of the bucket against the catalogue.
|
|
4
|
+
*
|
|
5
|
+
* Off by default and in no Area's default list: a Site switches it on in the Admin Area once its
|
|
6
|
+
* operator attached a CDN (`phis cdn attach`). It is bound to Core alone, like the other Core Modules;
|
|
7
|
+
* a Site without a CDN gets the page with the sentence that says how one is attached, rather than a
|
|
8
|
+
* Module it cannot choose -- whether a Site has one is per Site, and the Module catalogue is not.
|
|
9
|
+
*/
|
|
10
|
+
export declare const PHI_CDN_RUNTIME_MODULE_DEFINITION: {
|
|
11
|
+
kind: "module";
|
|
12
|
+
eligibleAreas: readonly ["admin"];
|
|
13
|
+
serverBinding: import("../../../types").PhiRuntimeModuleServerBinding;
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
category: "foundation";
|
|
17
|
+
iconFamily: string;
|
|
18
|
+
dataProviders: {
|
|
19
|
+
key: `${string}/${string}`;
|
|
20
|
+
ownerModuleId: "@phis/ui/modules/cdn";
|
|
21
|
+
kind: "table";
|
|
22
|
+
executionMode: "live";
|
|
23
|
+
authoringMode: "none";
|
|
24
|
+
title: string;
|
|
25
|
+
description: string;
|
|
26
|
+
resources: ({
|
|
27
|
+
resourceKey: "files";
|
|
28
|
+
title: string;
|
|
29
|
+
rowIdentityPath: string;
|
|
30
|
+
recordRead: true;
|
|
31
|
+
fields: ({
|
|
32
|
+
key: string;
|
|
33
|
+
title: string;
|
|
34
|
+
type: "string";
|
|
35
|
+
required: true;
|
|
36
|
+
} | {
|
|
37
|
+
key: string;
|
|
38
|
+
title: string;
|
|
39
|
+
type: "number";
|
|
40
|
+
required?: undefined;
|
|
41
|
+
} | {
|
|
42
|
+
key: string;
|
|
43
|
+
title: string;
|
|
44
|
+
type: "string";
|
|
45
|
+
required?: undefined;
|
|
46
|
+
} | {
|
|
47
|
+
key: string;
|
|
48
|
+
title: string;
|
|
49
|
+
type: "json";
|
|
50
|
+
required?: undefined;
|
|
51
|
+
} | {
|
|
52
|
+
key: string;
|
|
53
|
+
title: string;
|
|
54
|
+
type: "datetime";
|
|
55
|
+
required?: undefined;
|
|
56
|
+
} | {
|
|
57
|
+
key: string;
|
|
58
|
+
title: string;
|
|
59
|
+
type: "boolean";
|
|
60
|
+
required?: undefined;
|
|
61
|
+
})[];
|
|
62
|
+
query: {
|
|
63
|
+
search: true;
|
|
64
|
+
filterFields: string[];
|
|
65
|
+
sorting: "single";
|
|
66
|
+
pagination: "offset";
|
|
67
|
+
total: true;
|
|
68
|
+
};
|
|
69
|
+
actions: ({
|
|
70
|
+
key: string;
|
|
71
|
+
title: string;
|
|
72
|
+
scope: "row";
|
|
73
|
+
intent: "read";
|
|
74
|
+
confirmation?: undefined;
|
|
75
|
+
disabledWhen?: undefined;
|
|
76
|
+
} | {
|
|
77
|
+
key: string;
|
|
78
|
+
title: string;
|
|
79
|
+
scope: "row";
|
|
80
|
+
intent: "destructive";
|
|
81
|
+
confirmation: "required";
|
|
82
|
+
disabledWhen: {
|
|
83
|
+
source: "row";
|
|
84
|
+
valuePath: string;
|
|
85
|
+
operator: "truthy";
|
|
86
|
+
};
|
|
87
|
+
})[];
|
|
88
|
+
summaryFields?: undefined;
|
|
89
|
+
} | {
|
|
90
|
+
resourceKey: "check";
|
|
91
|
+
title: string;
|
|
92
|
+
rowIdentityPath: string;
|
|
93
|
+
fields: ({
|
|
94
|
+
key: string;
|
|
95
|
+
title: string;
|
|
96
|
+
type: "string";
|
|
97
|
+
required: true;
|
|
98
|
+
} | {
|
|
99
|
+
key: string;
|
|
100
|
+
title: string;
|
|
101
|
+
type: "string";
|
|
102
|
+
required?: undefined;
|
|
103
|
+
} | {
|
|
104
|
+
key: string;
|
|
105
|
+
title: string;
|
|
106
|
+
type: "boolean";
|
|
107
|
+
required?: undefined;
|
|
108
|
+
})[];
|
|
109
|
+
summaryFields: ({
|
|
110
|
+
key: string;
|
|
111
|
+
title: string;
|
|
112
|
+
type: "number";
|
|
113
|
+
} | {
|
|
114
|
+
key: string;
|
|
115
|
+
title: string;
|
|
116
|
+
type: "boolean";
|
|
117
|
+
})[];
|
|
118
|
+
query: {
|
|
119
|
+
search: false;
|
|
120
|
+
filterFields: never[];
|
|
121
|
+
sorting: "none";
|
|
122
|
+
pagination: "none";
|
|
123
|
+
total?: undefined;
|
|
124
|
+
};
|
|
125
|
+
actions: {
|
|
126
|
+
key: string;
|
|
127
|
+
title: string;
|
|
128
|
+
scope: "row";
|
|
129
|
+
intent: "write";
|
|
130
|
+
visibleWhen: {
|
|
131
|
+
source: "row";
|
|
132
|
+
valuePath: string;
|
|
133
|
+
operator: "truthy";
|
|
134
|
+
};
|
|
135
|
+
}[];
|
|
136
|
+
recordRead?: undefined;
|
|
137
|
+
})[];
|
|
138
|
+
}[];
|
|
139
|
+
moduleId: "@phis/ui/modules/cdn";
|
|
140
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { PHI_CDN_RUNTIME_MODULE_IDENTITY } from "./ids";
|
|
2
|
+
import { PHI_CORE_SERVER_BINDING } from "../../../types/server-capabilities";
|
|
3
|
+
import { PHI_CDN_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "./data-providers";
|
|
4
|
+
/**
|
|
5
|
+
* The Site's CDN on the Admin page `CDN`: what is published, uploads, withdrawing and deleting, and the
|
|
6
|
+
* check of the bucket against the catalogue.
|
|
7
|
+
*
|
|
8
|
+
* Off by default and in no Area's default list: a Site switches it on in the Admin Area once its
|
|
9
|
+
* operator attached a CDN (`phis cdn attach`). It is bound to Core alone, like the other Core Modules;
|
|
10
|
+
* a Site without a CDN gets the page with the sentence that says how one is attached, rather than a
|
|
11
|
+
* Module it cannot choose -- whether a Site has one is per Site, and the Module catalogue is not.
|
|
12
|
+
*/
|
|
13
|
+
export const PHI_CDN_RUNTIME_MODULE_DEFINITION = {
|
|
14
|
+
...PHI_CDN_RUNTIME_MODULE_IDENTITY,
|
|
15
|
+
kind: "module",
|
|
16
|
+
eligibleAreas: ["admin"],
|
|
17
|
+
serverBinding: PHI_CORE_SERVER_BINDING,
|
|
18
|
+
title: "CDN",
|
|
19
|
+
description: "Files published once and served from the Site's CDN host.",
|
|
20
|
+
category: "foundation",
|
|
21
|
+
iconFamily: "cdn",
|
|
22
|
+
dataProviders: PHI_CDN_RUNTIME_DATA_PROVIDER_DESCRIPTORS,
|
|
23
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const PHI_CDN_RUNTIME_MODULE_ID: "@phis/ui/modules/cdn";
|
|
2
|
+
/**
|
|
3
|
+
* The Module's identity as its Label Sets inherit it (`definePhiRuntimeModuleLabelSet`), stated beside
|
|
4
|
+
* the id so a Label Set a tree reads does not import the definition that imports the tree.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PHI_CDN_RUNTIME_MODULE_IDENTITY: {
|
|
7
|
+
readonly moduleId: "@phis/ui/modules/cdn";
|
|
8
|
+
};
|
|
9
|
+
export declare const PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS: {
|
|
10
|
+
readonly table: `${string}/${string}`;
|
|
11
|
+
};
|
|
12
|
+
/** The resources of the table Provider: the catalogue, and what one check of the bucket found. */
|
|
13
|
+
export declare const PHI_CDN_TABLE_RESOURCE_KEYS: {
|
|
14
|
+
readonly files: "files";
|
|
15
|
+
readonly check: "check";
|
|
16
|
+
};
|
|
17
|
+
/** The Admin Page the Module brings, and the key its nodes' preset ids are derived from. */
|
|
18
|
+
export declare const PHI_CDN_ADMIN_PAGE_PRESET_KEY = "admin-cdn-page";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PHI_SHARED_PACKAGE_NAME } from "../../../types/signals";
|
|
2
|
+
import { createPhiSharedRuntimeDataProviderKey } from "../../../constants/runtime-data-provider-key";
|
|
3
|
+
export const PHI_CDN_RUNTIME_MODULE_ID = `${PHI_SHARED_PACKAGE_NAME}/modules/cdn`;
|
|
4
|
+
/**
|
|
5
|
+
* The Module's identity as its Label Sets inherit it (`definePhiRuntimeModuleLabelSet`), stated beside
|
|
6
|
+
* the id so a Label Set a tree reads does not import the definition that imports the tree.
|
|
7
|
+
*/
|
|
8
|
+
export const PHI_CDN_RUNTIME_MODULE_IDENTITY = {
|
|
9
|
+
moduleId: PHI_CDN_RUNTIME_MODULE_ID,
|
|
10
|
+
};
|
|
11
|
+
export const PHI_CDN_RUNTIME_DATA_PROVIDER_KEYS = {
|
|
12
|
+
table: createPhiSharedRuntimeDataProviderKey("tables", "cdn"),
|
|
13
|
+
};
|
|
14
|
+
/** The resources of the table Provider: the catalogue, and what one check of the bucket found. */
|
|
15
|
+
export const PHI_CDN_TABLE_RESOURCE_KEYS = {
|
|
16
|
+
files: "files",
|
|
17
|
+
check: "check",
|
|
18
|
+
};
|
|
19
|
+
/** The Admin Page the Module brings, and the key its nodes' preset ids are derived from. */
|
|
20
|
+
export const PHI_CDN_ADMIN_PAGE_PRESET_KEY = "admin-cdn-page";
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export declare const PHI_CDN_RUNTIME_MODULE: {
|
|
2
|
+
kind: "module";
|
|
3
|
+
eligibleAreas: readonly ["admin"];
|
|
4
|
+
serverBinding: import("../../../types").PhiRuntimeModuleServerBinding;
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
category: "foundation";
|
|
8
|
+
iconFamily: string;
|
|
9
|
+
dataProviders: {
|
|
10
|
+
key: `${string}/${string}`;
|
|
11
|
+
ownerModuleId: "@phis/ui/modules/cdn";
|
|
12
|
+
kind: "table";
|
|
13
|
+
executionMode: "live";
|
|
14
|
+
authoringMode: "none";
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
resources: ({
|
|
18
|
+
resourceKey: "files";
|
|
19
|
+
title: string;
|
|
20
|
+
rowIdentityPath: string;
|
|
21
|
+
recordRead: true;
|
|
22
|
+
fields: ({
|
|
23
|
+
key: string;
|
|
24
|
+
title: string;
|
|
25
|
+
type: "string";
|
|
26
|
+
required: true;
|
|
27
|
+
} | {
|
|
28
|
+
key: string;
|
|
29
|
+
title: string;
|
|
30
|
+
type: "number";
|
|
31
|
+
required?: undefined;
|
|
32
|
+
} | {
|
|
33
|
+
key: string;
|
|
34
|
+
title: string;
|
|
35
|
+
type: "string";
|
|
36
|
+
required?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
key: string;
|
|
39
|
+
title: string;
|
|
40
|
+
type: "json";
|
|
41
|
+
required?: undefined;
|
|
42
|
+
} | {
|
|
43
|
+
key: string;
|
|
44
|
+
title: string;
|
|
45
|
+
type: "datetime";
|
|
46
|
+
required?: undefined;
|
|
47
|
+
} | {
|
|
48
|
+
key: string;
|
|
49
|
+
title: string;
|
|
50
|
+
type: "boolean";
|
|
51
|
+
required?: undefined;
|
|
52
|
+
})[];
|
|
53
|
+
query: {
|
|
54
|
+
search: true;
|
|
55
|
+
filterFields: string[];
|
|
56
|
+
sorting: "single";
|
|
57
|
+
pagination: "offset";
|
|
58
|
+
total: true;
|
|
59
|
+
};
|
|
60
|
+
actions: ({
|
|
61
|
+
key: string;
|
|
62
|
+
title: string;
|
|
63
|
+
scope: "row";
|
|
64
|
+
intent: "read";
|
|
65
|
+
confirmation?: undefined;
|
|
66
|
+
disabledWhen?: undefined;
|
|
67
|
+
} | {
|
|
68
|
+
key: string;
|
|
69
|
+
title: string;
|
|
70
|
+
scope: "row";
|
|
71
|
+
intent: "destructive";
|
|
72
|
+
confirmation: "required";
|
|
73
|
+
disabledWhen: {
|
|
74
|
+
source: "row";
|
|
75
|
+
valuePath: string;
|
|
76
|
+
operator: "truthy";
|
|
77
|
+
};
|
|
78
|
+
})[];
|
|
79
|
+
summaryFields?: undefined;
|
|
80
|
+
} | {
|
|
81
|
+
resourceKey: "check";
|
|
82
|
+
title: string;
|
|
83
|
+
rowIdentityPath: string;
|
|
84
|
+
fields: ({
|
|
85
|
+
key: string;
|
|
86
|
+
title: string;
|
|
87
|
+
type: "string";
|
|
88
|
+
required: true;
|
|
89
|
+
} | {
|
|
90
|
+
key: string;
|
|
91
|
+
title: string;
|
|
92
|
+
type: "string";
|
|
93
|
+
required?: undefined;
|
|
94
|
+
} | {
|
|
95
|
+
key: string;
|
|
96
|
+
title: string;
|
|
97
|
+
type: "boolean";
|
|
98
|
+
required?: undefined;
|
|
99
|
+
})[];
|
|
100
|
+
summaryFields: ({
|
|
101
|
+
key: string;
|
|
102
|
+
title: string;
|
|
103
|
+
type: "number";
|
|
104
|
+
} | {
|
|
105
|
+
key: string;
|
|
106
|
+
title: string;
|
|
107
|
+
type: "boolean";
|
|
108
|
+
})[];
|
|
109
|
+
query: {
|
|
110
|
+
search: false;
|
|
111
|
+
filterFields: never[];
|
|
112
|
+
sorting: "none";
|
|
113
|
+
pagination: "none";
|
|
114
|
+
total?: undefined;
|
|
115
|
+
};
|
|
116
|
+
actions: {
|
|
117
|
+
key: string;
|
|
118
|
+
title: string;
|
|
119
|
+
scope: "row";
|
|
120
|
+
intent: "write";
|
|
121
|
+
visibleWhen: {
|
|
122
|
+
source: "row";
|
|
123
|
+
valuePath: string;
|
|
124
|
+
operator: "truthy";
|
|
125
|
+
};
|
|
126
|
+
}[];
|
|
127
|
+
recordRead?: undefined;
|
|
128
|
+
})[];
|
|
129
|
+
}[];
|
|
130
|
+
moduleId: "@phis/ui/modules/cdn";
|
|
131
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A file's platform as the CDN page shows and asks it: the `PhisCdnFileOs` and `PhisCdnFileArch` bits of
|
|
3
|
+
* the contract, one word each. The words are keys, not names -- the Page's Label Set says what each is
|
|
4
|
+
* called -- so the table's tags, the record's and the upload dialog's checkboxes read from one list.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PHI_CDN_OS_KEYS: readonly [readonly ["linux", number], readonly ["windows", number], readonly ["macos", number], readonly ["android", number], readonly ["ios", number], readonly ["chromeos", number], readonly ["other", number]];
|
|
7
|
+
export declare const PHI_CDN_ARCH_KEYS: readonly [readonly ["x64", number], readonly ["arm64", number], readonly ["x86", number], readonly ["arm32", number], readonly ["riscv64", number]];
|
|
8
|
+
export type PhiCdnOsKey = (typeof PHI_CDN_OS_KEYS)[number][0];
|
|
9
|
+
export type PhiCdnArchKey = (typeof PHI_CDN_ARCH_KEYS)[number][0];
|
|
10
|
+
export declare function readPhiCdnOsKeys(bits: number): PhiCdnOsKey[];
|
|
11
|
+
export declare function readPhiCdnArchKeys(bits: number): PhiCdnArchKey[];
|
|
12
|
+
export declare function writePhiCdnOsBits(keys: readonly string[]): number;
|
|
13
|
+
export declare function writePhiCdnArchBits(keys: readonly string[]): number;
|
|
14
|
+
/** The OS tags, then the architecture tags, of one file: what the table's `platform` column draws. */
|
|
15
|
+
export declare function readPhiCdnPlatformTags(os: number, arch: number): string[];
|
|
16
|
+
/**
|
|
17
|
+
* What a file name says of its platform, for the upload dialog to start from: the OS from the extension
|
|
18
|
+
* (`.dmg`/`.pkg` macOS, `.exe`/`.msi` Windows, `.deb`/`.rpm` Linux, `.apk` Android), the architecture
|
|
19
|
+
* from a word in the name. A guess the person corrects, never what is recorded unasked; 0 where the
|
|
20
|
+
* name says nothing.
|
|
21
|
+
*/
|
|
22
|
+
export declare function guessPhiCdnPlatform(fileName: string): {
|
|
23
|
+
os: number;
|
|
24
|
+
arch: number;
|
|
25
|
+
};
|