@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
|
@@ -31,46 +31,11 @@ export declare const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
31
31
|
type: "string";
|
|
32
32
|
required?: undefined;
|
|
33
33
|
})[];
|
|
34
|
-
|
|
35
|
-
search: false;
|
|
36
|
-
filterFields: string[];
|
|
37
|
-
sorting: "none";
|
|
38
|
-
pagination: "none";
|
|
39
|
-
total?: undefined;
|
|
40
|
-
};
|
|
41
|
-
rowActivation?: undefined;
|
|
42
|
-
} | {
|
|
43
|
-
resourceKey: "addresses";
|
|
44
|
-
title: string;
|
|
45
|
-
rowIdentityPath: string;
|
|
46
|
-
fields: ({
|
|
34
|
+
summaryFields: {
|
|
47
35
|
key: string;
|
|
48
36
|
title: string;
|
|
49
37
|
type: "number";
|
|
50
|
-
|
|
51
|
-
options?: undefined;
|
|
52
|
-
} | {
|
|
53
|
-
key: string;
|
|
54
|
-
title: string;
|
|
55
|
-
type: "string";
|
|
56
|
-
required?: undefined;
|
|
57
|
-
options?: undefined;
|
|
58
|
-
} | {
|
|
59
|
-
key: string;
|
|
60
|
-
title: string;
|
|
61
|
-
type: "enum[]";
|
|
62
|
-
options: {
|
|
63
|
-
value: string;
|
|
64
|
-
label: string;
|
|
65
|
-
}[];
|
|
66
|
-
required?: undefined;
|
|
67
|
-
} | {
|
|
68
|
-
key: string;
|
|
69
|
-
title: string;
|
|
70
|
-
type: "datetime";
|
|
71
|
-
required?: undefined;
|
|
72
|
-
options?: undefined;
|
|
73
|
-
})[];
|
|
38
|
+
}[];
|
|
74
39
|
query: {
|
|
75
40
|
search: false;
|
|
76
41
|
filterFields: string[];
|
|
@@ -119,5 +84,25 @@ export declare const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS: ({
|
|
|
119
84
|
pagination: "offset";
|
|
120
85
|
total: false;
|
|
121
86
|
};
|
|
87
|
+
summaryFields?: undefined;
|
|
122
88
|
})[];
|
|
89
|
+
} | {
|
|
90
|
+
key: `${string}/${string}`;
|
|
91
|
+
ownerModuleId: "@phis/ui/modules/threads";
|
|
92
|
+
kind: "collection";
|
|
93
|
+
executionMode: "live";
|
|
94
|
+
authoringMode: "none";
|
|
95
|
+
title: string;
|
|
96
|
+
description: string;
|
|
97
|
+
resources: {
|
|
98
|
+
resourceKey: "addresses";
|
|
99
|
+
title: string;
|
|
100
|
+
itemIdentityPath: string;
|
|
101
|
+
itemRendererKey: `${string}/${string}`;
|
|
102
|
+
defaultForWidget: true;
|
|
103
|
+
query: {
|
|
104
|
+
search: false;
|
|
105
|
+
pagination: false;
|
|
106
|
+
};
|
|
107
|
+
}[];
|
|
123
108
|
})[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS, PHI_THREADS_RUNTIME_MODULE_ID, } from "./ids";
|
|
2
2
|
import { PhisThreadKind, PhisThreadStatus } from "../../../constants/threads";
|
|
3
3
|
import { PHI_CUSTOMER_FILE_RESOURCE_KEYS } from "../../../constants/customer-file";
|
|
4
|
+
import { PHI_SITE_ADDRESS_ITEM_RENDERER_KEY } from "../../../constants/site-address";
|
|
4
5
|
/** Who this viewer may write to, for this Module's own Form that opens a conversation. */
|
|
5
6
|
export const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
6
7
|
{
|
|
@@ -14,11 +15,11 @@ export const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
14
15
|
},
|
|
15
16
|
/*
|
|
16
17
|
* Staff's customer file on one member of the Site (`GET /api/site/members/{userId}/file`, for the
|
|
17
|
-
* holders of `accounting` or `support`): the person as the staff road of `users:v1` answers them,
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* holders of `accounting` or `support`): the person as the staff road of `users:v1` answers them, and
|
|
19
|
+
* the threads -- the person's file first, then every conversation they take part in that the actor
|
|
20
|
+
* sees. Two resources because a Table lists one kind of row; each reads the same route for the member
|
|
21
|
+
* its `userId` filter names, and none reads anything without one. Core writes every read to the Site's
|
|
22
|
+
* access log. Their addresses are the Collection below, from the same read.
|
|
22
23
|
*/
|
|
23
24
|
{
|
|
24
25
|
key: PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFile,
|
|
@@ -42,29 +43,13 @@ export const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
42
43
|
{ key: "phone", title: "Business phone", type: "string" },
|
|
43
44
|
{ key: "mobile", title: "Mobile", type: "string" },
|
|
44
45
|
],
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
resourceKey: PHI_CUSTOMER_FILE_RESOURCE_KEYS.addresses,
|
|
49
|
-
title: "Addresses",
|
|
50
|
-
rowIdentityPath: "id",
|
|
51
|
-
fields: [
|
|
52
|
-
{ key: "id", title: "ID", type: "number", required: true },
|
|
53
|
-
{ key: "name", title: "Name", type: "string" },
|
|
54
|
-
{ key: "lines", title: "Address", type: "string" },
|
|
55
|
-
{
|
|
56
|
-
key: "purposes",
|
|
57
|
-
title: "Purposes",
|
|
58
|
-
type: "enum[]",
|
|
59
|
-
options: ["billing", "shipping", "defaultBilling", "defaultShipping"].map((value) => ({ value, label: value })),
|
|
60
|
-
},
|
|
61
|
-
{ key: "createdAt", title: "Added", type: "datetime" },
|
|
62
|
-
],
|
|
46
|
+
// The member's number, for the line under the person: the one Core, the access log and support name.
|
|
47
|
+
summaryFields: [{ key: "userId", title: "Member number", type: "number" }],
|
|
63
48
|
query: { search: false, filterFields: ["userId"], sorting: "none", pagination: "none" },
|
|
64
49
|
},
|
|
65
50
|
{
|
|
66
51
|
resourceKey: PHI_CUSTOMER_FILE_RESOURCE_KEYS.threads,
|
|
67
|
-
title: "
|
|
52
|
+
title: "Conversations",
|
|
68
53
|
rowIdentityPath: "id",
|
|
69
54
|
// Choosing one opens it in the conversation beside the list, as the inbox does.
|
|
70
55
|
rowActivation: true,
|
|
@@ -95,4 +80,30 @@ export const PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS = [
|
|
|
95
80
|
},
|
|
96
81
|
],
|
|
97
82
|
},
|
|
83
|
+
/*
|
|
84
|
+
* The member's current addresses, where the actor may read them, as Core's address tiles draw them
|
|
85
|
+
* (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`): read-only, so the resource declares no action and the tiles
|
|
86
|
+
* offer none. The member is the binding param `userId`, which the Conversations Controller forwards from
|
|
87
|
+
* the person Table's choice (COLLECTIONS.md, "Filtered by another Widget's choice"), and the answer is the
|
|
88
|
+
* same request the Tables and the Controller make for that choice, joined (`readPhiCustomerFile`).
|
|
89
|
+
*/
|
|
90
|
+
{
|
|
91
|
+
key: PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFileAddresses,
|
|
92
|
+
ownerModuleId: PHI_THREADS_RUNTIME_MODULE_ID,
|
|
93
|
+
kind: "collection",
|
|
94
|
+
executionMode: "live",
|
|
95
|
+
authoringMode: "none",
|
|
96
|
+
title: "Customer file addresses",
|
|
97
|
+
description: "The chosen member's current billing and shipping addresses, as staff may read them.",
|
|
98
|
+
resources: [
|
|
99
|
+
{
|
|
100
|
+
resourceKey: PHI_CUSTOMER_FILE_RESOURCE_KEYS.addresses,
|
|
101
|
+
title: "Addresses",
|
|
102
|
+
itemIdentityPath: "id",
|
|
103
|
+
itemRendererKey: PHI_SITE_ADDRESS_ITEM_RENDERER_KEY,
|
|
104
|
+
defaultForWidget: true,
|
|
105
|
+
query: { search: false, pagination: false },
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
},
|
|
98
109
|
];
|
|
@@ -53,46 +53,11 @@ export declare const PHI_THREADS_RUNTIME_MODULE_DEFINITION: {
|
|
|
53
53
|
type: "string";
|
|
54
54
|
required?: undefined;
|
|
55
55
|
})[];
|
|
56
|
-
|
|
57
|
-
search: false;
|
|
58
|
-
filterFields: string[];
|
|
59
|
-
sorting: "none";
|
|
60
|
-
pagination: "none";
|
|
61
|
-
total?: undefined;
|
|
62
|
-
};
|
|
63
|
-
rowActivation?: undefined;
|
|
64
|
-
} | {
|
|
65
|
-
resourceKey: "addresses";
|
|
66
|
-
title: string;
|
|
67
|
-
rowIdentityPath: string;
|
|
68
|
-
fields: ({
|
|
56
|
+
summaryFields: {
|
|
69
57
|
key: string;
|
|
70
58
|
title: string;
|
|
71
59
|
type: "number";
|
|
72
|
-
|
|
73
|
-
options?: undefined;
|
|
74
|
-
} | {
|
|
75
|
-
key: string;
|
|
76
|
-
title: string;
|
|
77
|
-
type: "string";
|
|
78
|
-
required?: undefined;
|
|
79
|
-
options?: undefined;
|
|
80
|
-
} | {
|
|
81
|
-
key: string;
|
|
82
|
-
title: string;
|
|
83
|
-
type: "enum[]";
|
|
84
|
-
options: {
|
|
85
|
-
value: string;
|
|
86
|
-
label: string;
|
|
87
|
-
}[];
|
|
88
|
-
required?: undefined;
|
|
89
|
-
} | {
|
|
90
|
-
key: string;
|
|
91
|
-
title: string;
|
|
92
|
-
type: "datetime";
|
|
93
|
-
required?: undefined;
|
|
94
|
-
options?: undefined;
|
|
95
|
-
})[];
|
|
60
|
+
}[];
|
|
96
61
|
query: {
|
|
97
62
|
search: false;
|
|
98
63
|
filterFields: string[];
|
|
@@ -141,7 +106,27 @@ export declare const PHI_THREADS_RUNTIME_MODULE_DEFINITION: {
|
|
|
141
106
|
pagination: "offset";
|
|
142
107
|
total: false;
|
|
143
108
|
};
|
|
109
|
+
summaryFields?: undefined;
|
|
144
110
|
})[];
|
|
111
|
+
} | {
|
|
112
|
+
key: `${string}/${string}`;
|
|
113
|
+
ownerModuleId: "@phis/ui/modules/threads";
|
|
114
|
+
kind: "collection";
|
|
115
|
+
executionMode: "live";
|
|
116
|
+
authoringMode: "none";
|
|
117
|
+
title: string;
|
|
118
|
+
description: string;
|
|
119
|
+
resources: {
|
|
120
|
+
resourceKey: "addresses";
|
|
121
|
+
title: string;
|
|
122
|
+
itemIdentityPath: string;
|
|
123
|
+
itemRendererKey: `${string}/${string}`;
|
|
124
|
+
defaultForWidget: true;
|
|
125
|
+
query: {
|
|
126
|
+
search: false;
|
|
127
|
+
pagination: false;
|
|
128
|
+
};
|
|
129
|
+
}[];
|
|
145
130
|
})[];
|
|
146
131
|
formProviders: {
|
|
147
132
|
handlers: {
|
|
@@ -17,4 +17,6 @@ export declare const PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS: {
|
|
|
17
17
|
readonly candidates: `${string}/${string}`;
|
|
18
18
|
/** Staff's customer file on one member, the Foundation name (`constants/customer-file.ts`). */
|
|
19
19
|
readonly customerFile: `${string}/${string}`;
|
|
20
|
+
/** The member's addresses as tiles, the Foundation name too. */
|
|
21
|
+
readonly customerFileAddresses: `${string}/${string}`;
|
|
20
22
|
};
|
|
@@ -22,4 +22,6 @@ export const PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS = {
|
|
|
22
22
|
candidates: createPhiSharedRuntimeDataProviderKey("options", "thread-candidates"),
|
|
23
23
|
/** Staff's customer file on one member, the Foundation name (`constants/customer-file.ts`). */
|
|
24
24
|
customerFile: PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS.table,
|
|
25
|
+
/** The member's addresses as tiles, the Foundation name too. */
|
|
26
|
+
customerFileAddresses: PHI_CUSTOMER_FILE_DATA_PROVIDER_KEYS.addresses,
|
|
25
27
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { PhiCollectionProviderData, PhiCollectionProviderQueryRequest } from "../../../../types/collection-provider";
|
|
2
|
+
/**
|
|
3
|
+
* The chosen member's addresses, read-only, as tiles (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`): from the first
|
|
4
|
+
* page of their file, the request the person Table, the conversations Table and the Conversations Controller
|
|
5
|
+
* make for the same choice -- joined, never asked again (`readPhiCustomerFile`), so one choice is still one
|
|
6
|
+
* entry in the access log. The member is the binding param `userId` the Controller forwards.
|
|
7
|
+
*
|
|
8
|
+
* Nobody chosen reads nothing. The reader's own file, which Core refuses, answers no addresses with the
|
|
9
|
+
* Page's own-file sentence as the tiles' empty sentence (`meta.emptyDescription`), as each Table says it
|
|
10
|
+
* where its rows would be; any other failure is the source's.
|
|
11
|
+
*/
|
|
12
|
+
export declare function queryPhiCustomerFileAddresses({ resourceKey, params, signal }: PhiCollectionProviderQueryRequest): Promise<PhiCollectionProviderData>;
|
|
13
|
+
export declare const PHI_THREADS_CUSTOMER_FILE_ADDRESSES_PROVIDER_REGISTRATION: {
|
|
14
|
+
key: `${string}/${string}`;
|
|
15
|
+
resources: {
|
|
16
|
+
resourceKey: "addresses";
|
|
17
|
+
title: string;
|
|
18
|
+
itemIdentityPath: string;
|
|
19
|
+
itemRendererKey: `${string}/${string}`;
|
|
20
|
+
defaultForWidget: true;
|
|
21
|
+
query: {
|
|
22
|
+
search: false;
|
|
23
|
+
pagination: false;
|
|
24
|
+
};
|
|
25
|
+
}[];
|
|
26
|
+
query: typeof queryPhiCustomerFileAddresses;
|
|
27
|
+
};
|
|
28
|
+
export declare const PhiThreadsCustomerFileAddressesProviderClient: import("react").ComponentType<{
|
|
29
|
+
children: import("react").ReactNode;
|
|
30
|
+
}>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
3
|
+
import { readPhiPositiveInteger, readPhiTableRows, } from "../../../../components/widgets/client/shared/phi-table-provider-request";
|
|
4
|
+
import { createPhiCollectionProviderClient, } from "../../../../components/widgets/client/shared/phi-collection-provider";
|
|
5
|
+
import { toPhiSiteAddressRow } from "../../../../helpers/site-address-row";
|
|
6
|
+
import { PHI_CUSTOMER_FILE_MEMBER_PARAM, PHI_CUSTOMER_FILE_OWN_FILE_PARAM, PHI_CUSTOMER_FILE_RESOURCE_KEYS as RESOURCES, } from "../../../../constants/customer-file";
|
|
7
|
+
import { PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS } from "../data-providers";
|
|
8
|
+
import { PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS } from "../ids";
|
|
9
|
+
import { buildPhiCustomerFileFirstPagePath, PhiCustomerFileOwnFileRefusal, readPhiCustomerFile, } from "./customer-file-read";
|
|
10
|
+
function answer(items, emptyDescription) {
|
|
11
|
+
return {
|
|
12
|
+
resourceKey: RESOURCES.addresses,
|
|
13
|
+
items,
|
|
14
|
+
total: items.length,
|
|
15
|
+
loading: false,
|
|
16
|
+
error: null,
|
|
17
|
+
...(emptyDescription ? { meta: { emptyDescription } } : {}),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The chosen member's addresses, read-only, as tiles (`PHI_SITE_ADDRESS_ITEM_RENDERER_KEY`): from the first
|
|
22
|
+
* page of their file, the request the person Table, the conversations Table and the Conversations Controller
|
|
23
|
+
* make for the same choice -- joined, never asked again (`readPhiCustomerFile`), so one choice is still one
|
|
24
|
+
* entry in the access log. The member is the binding param `userId` the Controller forwards.
|
|
25
|
+
*
|
|
26
|
+
* Nobody chosen reads nothing. The reader's own file, which Core refuses, answers no addresses with the
|
|
27
|
+
* Page's own-file sentence as the tiles' empty sentence (`meta.emptyDescription`), as each Table says it
|
|
28
|
+
* where its rows would be; any other failure is the source's.
|
|
29
|
+
*/
|
|
30
|
+
export async function queryPhiCustomerFileAddresses({ resourceKey, params, signal }) {
|
|
31
|
+
if (resourceKey !== RESOURCES.addresses) {
|
|
32
|
+
throw new Error(`Unknown customer file addresses resource "${resourceKey}".`);
|
|
33
|
+
}
|
|
34
|
+
const userId = readPhiPositiveInteger(params?.[PHI_CUSTOMER_FILE_MEMBER_PARAM]);
|
|
35
|
+
if (!userId)
|
|
36
|
+
return answer([]);
|
|
37
|
+
try {
|
|
38
|
+
const result = await readPhiCustomerFile(buildPhiCustomerFileFirstPagePath(userId), signal);
|
|
39
|
+
if (!isPhiRecord(result) || !isPhiRecord(result.person)) {
|
|
40
|
+
throw new Error("The customer file answer is invalid.");
|
|
41
|
+
}
|
|
42
|
+
return answer(readPhiTableRows(result.person.addresses).map(toPhiSiteAddressRow));
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (!(error instanceof PhiCustomerFileOwnFileRefusal))
|
|
46
|
+
throw error;
|
|
47
|
+
const notice = params?.[PHI_CUSTOMER_FILE_OWN_FILE_PARAM];
|
|
48
|
+
return answer([], typeof notice === "string" && notice.trim() ? notice : error.message);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const descriptor = PHI_THREADS_RUNTIME_DATA_PROVIDER_DESCRIPTORS
|
|
52
|
+
.find((candidate) => candidate.key === PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFileAddresses);
|
|
53
|
+
const resources = descriptor?.kind === "collection" ? descriptor.resources : [];
|
|
54
|
+
export const PHI_THREADS_CUSTOMER_FILE_ADDRESSES_PROVIDER_REGISTRATION = {
|
|
55
|
+
key: PHI_THREADS_RUNTIME_DATA_PROVIDER_KEYS.customerFileAddresses,
|
|
56
|
+
resources,
|
|
57
|
+
query: queryPhiCustomerFileAddresses,
|
|
58
|
+
};
|
|
59
|
+
export const PhiThreadsCustomerFileAddressesProviderClient = createPhiCollectionProviderClient(PHI_THREADS_CUSTOMER_FILE_ADDRESSES_PROVIDER_REGISTRATION);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** The page size the customer file is read at; the Page's conversations Table names the same, Core takes up to 100. */
|
|
2
|
+
export declare const PHI_CUSTOMER_FILE_THREADS_PAGE_SIZE = 25;
|
|
3
|
+
/** The member's file, a page of the conversations they take part in included. */
|
|
4
|
+
export declare function buildPhiCustomerFilePath(userId: number, page: URLSearchParams | null): string;
|
|
5
|
+
/**
|
|
6
|
+
* The first page, as every reader of one choice asks for it: the person, their addresses, the file panel
|
|
7
|
+
* and the conversations Table on a new choice all name this path, so they share one request.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildPhiCustomerFileFirstPagePath(userId: number): string;
|
|
10
|
+
export declare class PhiCustomerFileOwnFileRefusal extends Error {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The route's answer for this caller. A caller that aborts leaves the request to the others; the request
|
|
14
|
+
* itself is aborted only when the last of them has gone, and is then no longer joined.
|
|
15
|
+
*/
|
|
16
|
+
export declare function readPhiCustomerFile(path: string, signal: AbortSignal | undefined): Promise<Record<string, unknown> | null>;
|
|
17
|
+
/**
|
|
18
|
+
* The id of the member's file, from the same first-page read the Page's Tables make for the choice, or
|
|
19
|
+
* null where there is none to show: Core refused the reader's own file, or answered no file. Anything
|
|
20
|
+
* else that goes wrong is thrown, as the Tables are told.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readPhiCustomerFileThreadId(userId: number, signal: AbortSignal | undefined): Promise<number | null>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { readPhiJsonError, readPhiJsonPayload } from "../../../../helpers/client-json-request";
|
|
3
|
+
import { buildPhiTablePageParams, createPhiTableProviderRequestInit, readPhiPositiveInteger, } from "../../../../components/widgets/client/shared/phi-table-provider-request";
|
|
4
|
+
import { readPhiTableProviderResponse, } from "../../../../components/widgets/client/shared/phi-table-provider-response";
|
|
5
|
+
import { isPhiRecord } from "../../../../helpers/is-record";
|
|
6
|
+
const RESPONSE_OPTIONS = { subject: "Customer file" };
|
|
7
|
+
/** The page size the customer file is read at; the Page's conversations Table names the same, Core takes up to 100. */
|
|
8
|
+
export const PHI_CUSTOMER_FILE_THREADS_PAGE_SIZE = 25;
|
|
9
|
+
/** The member's file, a page of the conversations they take part in included. */
|
|
10
|
+
export function buildPhiCustomerFilePath(userId, page) {
|
|
11
|
+
const path = `/api/site/members/${userId}/file`;
|
|
12
|
+
return page ? `${path}?${page}` : path;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The first page, as every reader of one choice asks for it: the person, their addresses, the file panel
|
|
16
|
+
* and the conversations Table on a new choice all name this path, so they share one request.
|
|
17
|
+
*/
|
|
18
|
+
export function buildPhiCustomerFileFirstPagePath(userId) {
|
|
19
|
+
return buildPhiCustomerFilePath(userId, buildPhiTablePageParams({}, PHI_CUSTOMER_FILE_THREADS_PAGE_SIZE));
|
|
20
|
+
}
|
|
21
|
+
/*
|
|
22
|
+
* Core's refusal of the reader's own file (`403`): the route answers that and nothing else to someone who
|
|
23
|
+
* may open files at all, and nobody else reaches this Page or its member picker.
|
|
24
|
+
*/
|
|
25
|
+
export class PhiCustomerFileOwnFileRefusal extends Error {
|
|
26
|
+
}
|
|
27
|
+
/*
|
|
28
|
+
* The reads of one route in flight, by its path. The Page's Tables and the Conversations Controller, which
|
|
29
|
+
* opens the file, ask for the same member at the same time -- the person Table's choice reaches all of them
|
|
30
|
+
* at once -- and one request answers them all, so one choice is one entry in the access log. Nothing
|
|
31
|
+
* outlives the request: once it settles its entry is gone, and the next read, a reload or another member
|
|
32
|
+
* asks again.
|
|
33
|
+
*/
|
|
34
|
+
const customerFileReads = new Map();
|
|
35
|
+
function abortReason(signal) {
|
|
36
|
+
return signal.reason ?? new DOMException("The read was aborted.", "AbortError");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The route's answer for this caller. A caller that aborts leaves the request to the others; the request
|
|
40
|
+
* itself is aborted only when the last of them has gone, and is then no longer joined.
|
|
41
|
+
*/
|
|
42
|
+
export function readPhiCustomerFile(path, signal) {
|
|
43
|
+
if (signal?.aborted)
|
|
44
|
+
return Promise.reject(abortReason(signal));
|
|
45
|
+
let read = customerFileReads.get(path);
|
|
46
|
+
if (!read) {
|
|
47
|
+
const controller = new AbortController();
|
|
48
|
+
const entry = {
|
|
49
|
+
controller,
|
|
50
|
+
waiters: 0,
|
|
51
|
+
promise: (async () => {
|
|
52
|
+
const response = await fetch(path, createPhiTableProviderRequestInit(controller.signal));
|
|
53
|
+
if (response.status === 403) {
|
|
54
|
+
const refused = await readPhiJsonPayload(response);
|
|
55
|
+
throw new PhiCustomerFileOwnFileRefusal(readPhiJsonError(refused, "Nobody reaches their own file."));
|
|
56
|
+
}
|
|
57
|
+
return readPhiTableProviderResponse(response, RESPONSE_OPTIONS);
|
|
58
|
+
})().finally(() => {
|
|
59
|
+
if (customerFileReads.get(path) === entry)
|
|
60
|
+
customerFileReads.delete(path);
|
|
61
|
+
}),
|
|
62
|
+
};
|
|
63
|
+
// A request every caller left rejects with nobody listening.
|
|
64
|
+
entry.promise.catch(() => undefined);
|
|
65
|
+
customerFileReads.set(path, entry);
|
|
66
|
+
read = entry;
|
|
67
|
+
}
|
|
68
|
+
const shared = read;
|
|
69
|
+
shared.waiters += 1;
|
|
70
|
+
if (!signal)
|
|
71
|
+
return shared.promise;
|
|
72
|
+
return new Promise((resolve, reject) => {
|
|
73
|
+
const leave = () => {
|
|
74
|
+
shared.waiters -= 1;
|
|
75
|
+
reject(abortReason(signal));
|
|
76
|
+
if (shared.waiters > 0)
|
|
77
|
+
return;
|
|
78
|
+
if (customerFileReads.get(path) === shared)
|
|
79
|
+
customerFileReads.delete(path);
|
|
80
|
+
shared.controller.abort(abortReason(signal));
|
|
81
|
+
};
|
|
82
|
+
signal.addEventListener("abort", leave, { once: true });
|
|
83
|
+
shared.promise.then(resolve, reject).finally(() => signal.removeEventListener("abort", leave));
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The id of the member's file, from the same first-page read the Page's Tables make for the choice, or
|
|
88
|
+
* null where there is none to show: Core refused the reader's own file, or answered no file. Anything
|
|
89
|
+
* else that goes wrong is thrown, as the Tables are told.
|
|
90
|
+
*/
|
|
91
|
+
export async function readPhiCustomerFileThreadId(userId, signal) {
|
|
92
|
+
try {
|
|
93
|
+
const result = await readPhiCustomerFile(buildPhiCustomerFileFirstPagePath(userId), signal);
|
|
94
|
+
return isPhiRecord(result) ? readPhiPositiveInteger(result.fileThreadId) ?? null : null;
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
if (error instanceof PhiCustomerFileOwnFileRefusal)
|
|
98
|
+
return null;
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type PhiTableProviderQueryRequest } from "../../../../types/table-widget";
|
|
2
|
-
|
|
3
|
-
export declare function buildPhiCustomerFilePath(userId: number, page: URLSearchParams | null): string;
|
|
2
|
+
export { buildPhiCustomerFilePath } from "./customer-file-read";
|
|
4
3
|
/** The person as Core answered them, one row; a field the actor may not read stays empty. */
|
|
5
4
|
export declare function toPhiCustomerFilePersonRow(person: Record<string, unknown>): {
|
|
6
5
|
userId: unknown;
|
|
@@ -12,26 +11,17 @@ export declare function toPhiCustomerFilePersonRow(person: Record<string, unknow
|
|
|
12
11
|
mobile: string;
|
|
13
12
|
};
|
|
14
13
|
/**
|
|
15
|
-
* The
|
|
16
|
-
* its id beside the list,
|
|
17
|
-
*
|
|
14
|
+
* The person's conversations as the listing shows them, read as the inbox reads its rows. Their file is
|
|
15
|
+
* not one of them: Core answers its id beside the list, and the Page reads the file in a panel of its own
|
|
16
|
+
* (THREADS.md, section 10), so a row of it that the list carries is left out.
|
|
18
17
|
*/
|
|
19
|
-
export declare function toPhiCustomerFileThreadRows(result: Record<string, unknown
|
|
18
|
+
export declare function toPhiCustomerFileThreadRows(result: Record<string, unknown>): {
|
|
20
19
|
kind: string;
|
|
21
20
|
status: string;
|
|
22
21
|
archived: boolean;
|
|
23
22
|
locked: boolean;
|
|
24
23
|
state: string;
|
|
25
|
-
}
|
|
26
|
-
id: number;
|
|
27
|
-
subject: string;
|
|
28
|
-
kind: string;
|
|
29
|
-
status: string;
|
|
30
|
-
archived: boolean;
|
|
31
|
-
locked: boolean;
|
|
32
|
-
state: string;
|
|
33
|
-
latestMessageAt: null;
|
|
34
|
-
})[];
|
|
24
|
+
}[];
|
|
35
25
|
declare function queryCustomerFile({ resourceKey, query, params, signal }: PhiTableProviderQueryRequest): Promise<{
|
|
36
26
|
rows: {
|
|
37
27
|
userId: unknown;
|
|
@@ -43,40 +33,19 @@ declare function queryCustomerFile({ resourceKey, query, params, signal }: PhiTa
|
|
|
43
33
|
mobile: string;
|
|
44
34
|
}[];
|
|
45
35
|
total: number;
|
|
36
|
+
summary: {
|
|
37
|
+
userId: number | null;
|
|
38
|
+
};
|
|
46
39
|
} | {
|
|
47
40
|
rows: {
|
|
48
|
-
createdAt: {} | null;
|
|
49
|
-
flags: number;
|
|
50
|
-
billing: boolean;
|
|
51
|
-
shipping: boolean;
|
|
52
|
-
defaultBilling: boolean;
|
|
53
|
-
defaultShipping: boolean;
|
|
54
|
-
address: {
|
|
55
|
-
[k: string]: string | null;
|
|
56
|
-
};
|
|
57
|
-
lines: string;
|
|
58
|
-
purposes: ("billing" | "shipping" | "defaultBilling" | "defaultShipping")[];
|
|
59
|
-
id: unknown;
|
|
60
|
-
}[];
|
|
61
|
-
total: number;
|
|
62
|
-
} | {
|
|
63
|
-
rows: ({
|
|
64
41
|
kind: string;
|
|
65
42
|
status: string;
|
|
66
43
|
archived: boolean;
|
|
67
44
|
locked: boolean;
|
|
68
45
|
state: string;
|
|
69
|
-
}
|
|
70
|
-
id: number;
|
|
71
|
-
subject: string;
|
|
72
|
-
kind: string;
|
|
73
|
-
status: string;
|
|
74
|
-
archived: boolean;
|
|
75
|
-
locked: boolean;
|
|
76
|
-
state: string;
|
|
77
|
-
latestMessageAt: null;
|
|
78
|
-
})[];
|
|
46
|
+
}[];
|
|
79
47
|
total?: undefined;
|
|
48
|
+
summary?: undefined;
|
|
80
49
|
}>;
|
|
81
50
|
export declare const PHI_THREADS_CUSTOMER_FILE_TABLE_PROVIDER_REGISTRATION: {
|
|
82
51
|
key: `${string}/${string}`;
|
|
@@ -95,46 +64,11 @@ export declare const PHI_THREADS_CUSTOMER_FILE_TABLE_PROVIDER_REGISTRATION: {
|
|
|
95
64
|
type: "string";
|
|
96
65
|
required?: undefined;
|
|
97
66
|
})[];
|
|
98
|
-
|
|
99
|
-
search: false;
|
|
100
|
-
filterFields: string[];
|
|
101
|
-
sorting: "none";
|
|
102
|
-
pagination: "none";
|
|
103
|
-
total?: undefined;
|
|
104
|
-
};
|
|
105
|
-
rowActivation?: undefined;
|
|
106
|
-
} | {
|
|
107
|
-
resourceKey: "addresses";
|
|
108
|
-
title: string;
|
|
109
|
-
rowIdentityPath: string;
|
|
110
|
-
fields: ({
|
|
67
|
+
summaryFields: {
|
|
111
68
|
key: string;
|
|
112
69
|
title: string;
|
|
113
70
|
type: "number";
|
|
114
|
-
|
|
115
|
-
options?: undefined;
|
|
116
|
-
} | {
|
|
117
|
-
key: string;
|
|
118
|
-
title: string;
|
|
119
|
-
type: "string";
|
|
120
|
-
required?: undefined;
|
|
121
|
-
options?: undefined;
|
|
122
|
-
} | {
|
|
123
|
-
key: string;
|
|
124
|
-
title: string;
|
|
125
|
-
type: "enum[]";
|
|
126
|
-
options: {
|
|
127
|
-
value: string;
|
|
128
|
-
label: string;
|
|
129
|
-
}[];
|
|
130
|
-
required?: undefined;
|
|
131
|
-
} | {
|
|
132
|
-
key: string;
|
|
133
|
-
title: string;
|
|
134
|
-
type: "datetime";
|
|
135
|
-
required?: undefined;
|
|
136
|
-
options?: undefined;
|
|
137
|
-
})[];
|
|
71
|
+
}[];
|
|
138
72
|
query: {
|
|
139
73
|
search: false;
|
|
140
74
|
filterFields: string[];
|
|
@@ -183,10 +117,10 @@ export declare const PHI_THREADS_CUSTOMER_FILE_TABLE_PROVIDER_REGISTRATION: {
|
|
|
183
117
|
pagination: "offset";
|
|
184
118
|
total: false;
|
|
185
119
|
};
|
|
120
|
+
summaryFields?: undefined;
|
|
186
121
|
})[];
|
|
187
122
|
query: typeof queryCustomerFile;
|
|
188
123
|
};
|
|
189
124
|
export declare const PhiThreadsCustomerFileTableProviderClient: import("react").ComponentType<{
|
|
190
125
|
children: import("react").ReactNode;
|
|
191
126
|
}>;
|
|
192
|
-
export {};
|