@saasicat/ui-vue 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/{chunk-A3W2N26K.js → chunk-7N3CJTOA.js} +7 -227
  2. package/dist/{chunk-X5SQ5HMB.js → chunk-TBLXKSTR.js} +0 -137
  3. package/dist/{chunk-QZOSDCNP.js → chunk-TY2WYKME.js} +1 -1
  4. package/dist/client/index.cjs +112 -467
  5. package/dist/client/index.d.cts +4 -62
  6. package/dist/client/index.d.ts +4 -62
  7. package/dist/client/index.js +2 -6
  8. package/dist/index.cjs +204 -583
  9. package/dist/index.d.cts +10 -55
  10. package/dist/index.d.ts +10 -55
  11. package/dist/index.js +74 -101
  12. package/dist/{messages-7b0P8W75.d.ts → messages-BIYw32u1.d.cts} +0 -67
  13. package/dist/{messages-7b0P8W75.d.cts → messages-BIYw32u1.d.ts} +0 -67
  14. package/dist/quasar/index.cjs +0 -136
  15. package/dist/quasar/index.d.cts +2 -2
  16. package/dist/quasar/index.d.ts +2 -2
  17. package/dist/quasar/index.js +2 -2
  18. package/dist/{use-super-admin-i18n-B3v3-SWZ.d.ts → use-super-admin-i18n-CWNu_W3u.d.ts} +1 -1
  19. package/dist/{use-super-admin-i18n-DMktRVEt.d.cts → use-super-admin-i18n-DL_qI1BY.d.cts} +1 -1
  20. package/package.json +2 -2
  21. package/src/client/i18n/messages/nav.ts +0 -2
  22. package/src/client/i18n/messages/plan-versions.ts +0 -143
  23. package/src/client/index.ts +0 -2
  24. package/src/client/nav-builder.ts +9 -4
  25. package/src/index.ts +0 -1
  26. package/src/pages-standard/AdminLayout.vue +1 -1
  27. package/src/pages-standard/plan-versions/PlanVersionsDiff.vue +1 -1
  28. package/src/pages-standard/plan-versions/PlanVersionsTimeline.vue +1 -1
  29. package/src/pages-standard/plan-versions/catalog-history.types.ts +37 -0
  30. package/src/pages-standard/plan-versions/format.ts +2 -38
  31. package/src/client/plan-versions-catalog.ts +0 -380
  32. package/src/pages-standard/PlanVersionsPage.vue +0 -220
  33. package/src/pages-standard/plan-versions/PlanVersionHeader.vue +0 -309
  34. package/src/pages-standard/plan-versions/PlanVersionStatusBadge.vue +0 -48
  35. package/src/pages-standard/plan-versions/PlanVersionsAudit.vue +0 -326
  36. package/src/pages-standard/plan-versions/PlanVersionsKpi.vue +0 -65
  37. package/src/pages-standard/plan-versions/PlanVersionsList.vue +0 -315
  38. package/src/pages-standard/plan-versions/PlanVersionsMatrix.vue +0 -261
  39. package/src/pages-standard/plan-versions/types.ts +0 -33
  40. package/src/vue/use-plan-versions.ts +0 -83
@@ -1,83 +0,0 @@
1
- // usePlanVersionsCatalog — composable for the plan-versions page
2
- // (`<app> /admin/plans`).
3
- //
4
- // **Endpoint is mandatory** and is supplied by the app consumer, because
5
- // apps have different `globalPrefix` conventions
6
- // (e.g. `/api/admin/...` or `/api/v1/admin/...`).
7
- //
8
- // Platform pure functions (`assertDraftPublishable` etc. from
9
- // `@saasicat/nest/billing`) validate the drafts before the
10
- // publish POST.
11
-
12
- import { ref, type Ref } from 'vue';
13
- import { useApiList, type UseApiListOptions, type UseApiListResult } from './use-api-list.js';
14
-
15
- /**
16
- * Generic filter shape for versions lists.
17
- * `state`: 'draft' (publishedAt null), 'live' (publishedAt set, supersededAt null),
18
- * 'superseded' (supersededAt set), 'all' (default).
19
- */
20
- export interface PlanVersionListFilter {
21
- state?: 'draft' | 'live' | 'superseded' | 'all';
22
- /** PlanId (`'BASIC'`, `'STANDARD'`, …). */
23
- planId?: string;
24
- }
25
-
26
- /**
27
- * Generic versions row shape. Depending on the endpoint, the consumer backend
28
- * returns slightly different fields; the platform composable takes the universal ones.
29
- */
30
- export interface PlanVersionRow {
31
- id: string;
32
- version: number;
33
- publishedAt: string | null;
34
- supersededAt: string | null;
35
- nonRegressive: boolean;
36
- changeNote?: string;
37
- [extra: string]: unknown;
38
- }
39
-
40
- export interface VersionsOptions {
41
- /**
42
- * Fully qualified versions-list endpoint including the app globalPrefix
43
- * (`/api/admin/plan-versions`, `/api/v1/admin/plan-versions`, …). Mandatory.
44
- */
45
- endpoint: string;
46
- filter?: Ref<PlanVersionListFilter>;
47
- http?: UseApiListOptions<Record<string, unknown>>['http'];
48
- getAuthToken?: () => string | null;
49
- autoLoad?: boolean;
50
- }
51
-
52
- export interface VersionsResult extends UseApiListResult<PlanVersionRow> {
53
- filter: Ref<PlanVersionListFilter>;
54
- }
55
-
56
- function buildVersionsComposable(label: string) {
57
- return function (options: VersionsOptions): VersionsResult {
58
- if (!options?.endpoint) {
59
- throw new Error(
60
- `${label}: \`endpoint\` is required (e.g. "/api/admin/${label}" ` +
61
- `or "/api/v1/admin/${label}"). The platform has no default ` +
62
- `because apps use different globalPrefix conventions.`,
63
- );
64
- }
65
- const filter = options.filter ?? ref<PlanVersionListFilter>({});
66
- const list = useApiList<PlanVersionRow>({
67
- endpoint: options.endpoint,
68
- filter: filter as unknown as Ref<Record<string, unknown>>,
69
- http: options.http,
70
- getAuthToken: options.getAuthToken,
71
- autoLoad: options.autoLoad,
72
- });
73
- return { ...list, filter };
74
- };
75
- }
76
-
77
- /**
78
- * Read-only catalog view for PlanVersions (lift-and-shift from a
79
- * consumer admin).
80
- * Called `usePlanVersionsCatalog` since M6 Pack 2a, because `usePlanVersions`
81
- * from `use-plans.ts` is now the lifecycle editor (createDraft/publish).
82
- */
83
- export const usePlanVersionsCatalog = buildVersionsComposable('plan-versions');