@saasicat/ui-vue 0.7.0 → 0.9.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 (41) hide show
  1. package/dist/{chunk-A3W2N26K.js → chunk-66BUSVC5.js} +68 -217
  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 +180 -463
  5. package/dist/client/index.d.cts +32 -57
  6. package/dist/client/index.d.ts +32 -57
  7. package/dist/client/index.js +4 -6
  8. package/dist/index.cjs +273 -580
  9. package/dist/index.d.cts +10 -55
  10. package/dist/index.d.ts +10 -55
  11. package/dist/index.js +76 -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 +5 -5
  21. package/src/client/admin-resource-client.ts +112 -0
  22. package/src/client/i18n/messages/nav.ts +0 -2
  23. package/src/client/i18n/messages/plan-versions.ts +0 -143
  24. package/src/client/index.ts +1 -2
  25. package/src/client/nav-builder.ts +9 -4
  26. package/src/index.ts +0 -1
  27. package/src/pages-standard/AdminLayout.vue +1 -1
  28. package/src/pages-standard/plan-versions/PlanVersionsDiff.vue +1 -1
  29. package/src/pages-standard/plan-versions/PlanVersionsTimeline.vue +1 -1
  30. package/src/pages-standard/plan-versions/catalog-history.types.ts +37 -0
  31. package/src/pages-standard/plan-versions/format.ts +2 -38
  32. package/src/client/plan-versions-catalog.ts +0 -380
  33. package/src/pages-standard/PlanVersionsPage.vue +0 -220
  34. package/src/pages-standard/plan-versions/PlanVersionHeader.vue +0 -309
  35. package/src/pages-standard/plan-versions/PlanVersionStatusBadge.vue +0 -48
  36. package/src/pages-standard/plan-versions/PlanVersionsAudit.vue +0 -326
  37. package/src/pages-standard/plan-versions/PlanVersionsKpi.vue +0 -65
  38. package/src/pages-standard/plan-versions/PlanVersionsList.vue +0 -315
  39. package/src/pages-standard/plan-versions/PlanVersionsMatrix.vue +0 -261
  40. package/src/pages-standard/plan-versions/types.ts +0 -33
  41. package/src/vue/use-plan-versions.ts +0 -83
@@ -1,6 +1,6 @@
1
- import { H as HttpClient, K as KvStore, S as SaLocale } from '../messages-7b0P8W75.cjs';
2
- export { d as ActionDefNotInManifestError, A as ActionHandler, c as ActionRegistry, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, j as defaultHttpClient, k as defaultKvStore, l as defineMessages, m as mergeMessages, r as resolveMessages } from '../messages-7b0P8W75.cjs';
3
- import { PublicBootResponse, AdminManifest, StandardPageKey, TenantColumnDef, PlanVersionRow } from '@saasicat/types';
1
+ import { H as HttpClient, K as KvStore, S as SaLocale } from '../messages-BIYw32u1.cjs';
2
+ export { d as ActionDefNotInManifestError, A as ActionHandler, c as ActionRegistry, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, j as defaultHttpClient, k as defaultKvStore, l as defineMessages, m as mergeMessages, r as resolveMessages } from '../messages-BIYw32u1.cjs';
3
+ import { PublicBootResponse, AdminManifest, StandardPageKey, TenantColumnDef, PromoCodeRecord, AdminTenantDetail, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow } from '@saasicat/types';
4
4
 
5
5
  declare const ADMIN_UI_VERSION = "1.2.0";
6
6
 
@@ -247,62 +247,37 @@ declare class BatchColumnFetcher {
247
247
  private buildUrl;
248
248
  }
249
249
 
250
- type SnapshotKind = 'drafts' | 'active' | 'historical';
251
- interface CatalogSnapshot<P extends PlanVersionRow = PlanVersionRow> {
252
- id: string;
253
- kind: SnapshotKind;
254
- status: 'DRAFT' | 'ACTIVE' | 'ARCHIVED';
255
- label: string;
256
- title: string;
257
- description: string;
258
- asOf: string | null;
259
- createdAt: string | null;
260
- publishedAt: string | null;
261
- authorEmail: string | null;
262
- plans: ResolvedPlan<P>[];
263
- /** Number of open drafts for the `drafts` snapshot, otherwise 0. */
264
- draftCount: number;
265
- /** Number of entities in this snapshot whose publication flagged at least
266
- * one regression (`nonRegressive === false`). */
267
- regressionCount: number;
250
+ interface AdminResourceClientOptions {
251
+ http: HttpClient;
252
+ /** Default `/api/v1/admin`. */
253
+ adminBase?: string;
268
254
  }
269
- interface ResolvedPlan<P extends PlanVersionRow = PlanVersionRow> {
270
- /** Which PlanVersionRow was selected to represent this slot. */
271
- source: P;
272
- /** Live predecessor (only set when `source` is a DRAFT; otherwise null). */
273
- liveBase: P | null;
274
- isDraft: boolean;
275
- planId: string;
276
- features: string[];
277
- /** Quota map (from `source.quotas` or legacy fields; empty if none). */
278
- quotas: Record<string, number>;
279
- monthlyNet: number;
280
- yearlyNet: number;
281
- marketed: boolean;
282
- version: number;
283
- /** @deprecated Read from `quotas['users']`. */
284
- maxUsers?: number;
285
- /** @deprecated Legacy field; read from `quotas['vehicles']`. */
286
- maxVehicles?: number;
287
- /** @deprecated Read from `quotas['storageGb']`. */
288
- maxStorageGb?: number;
255
+ /** Filters accepted by the standard PromoCodesPage, including its "all" state. */
256
+ interface AdminPromoListFilter {
257
+ search?: string;
258
+ status?: string | null;
289
259
  }
290
- interface RawCatalogData<P extends PlanVersionRow = PlanVersionRow> {
291
- planVersions: P[];
292
- }
293
- interface BuildSnapshotsOptions {
294
- /**
295
- * App-specific plan order, e.g. `['BASIC', 'STANDARD',
296
- * 'PROFESSIONAL', 'BUSINESS', 'ENTERPRISE']`. Plan IDs outside the list
297
- * end up sorted alphabetically at the back.
298
- */
299
- planSortOrder?: readonly string[];
300
- /** UI locale for the generated snapshot labels/titles/descriptions. */
301
- locale?: SaLocale;
260
+ /** Promo row shape used by the extensible standard Admin table. */
261
+ interface AdminPromoListRow extends PromoCodeRecord {
262
+ [extra: string]: unknown;
302
263
  }
303
- declare function buildSnapshots<P extends PlanVersionRow>(data: RawCatalogData<P>, options?: BuildSnapshotsOptions): CatalogSnapshot<P>[];
304
- declare function listOpenDrafts<P extends PlanVersionRow>(data: RawCatalogData<P>): {
305
- plans: P[];
264
+ /**
265
+ * Ready-to-use client for the standard SaaSiCat AdminResources and promo
266
+ * controllers. App wrappers pass these functions straight to the standard
267
+ * pages; no repeated fetch/error/query-string plumbing is needed.
268
+ */
269
+ declare function createAdminResourceClient(options: AdminResourceClientOptions): {
270
+ tenantsEndpoint: string;
271
+ loadTenantDetail: (slug: string) => Promise<AdminTenantDetail>;
272
+ loadUsers: (filter: AdminUserListFilter) => Promise<AdminUserListRow[]>;
273
+ loadAudit: (filter: AdminAuditListFilter) => Promise<AuditEntry[]>;
274
+ loadSubscriptions: () => Promise<AdminSubscriptionListRow[]>;
275
+ loadPromos: (filter: AdminPromoListFilter) => Promise<AdminPromoListRow[]>;
276
+ createPromo: (payload: unknown) => Promise<void>;
277
+ updatePromo: (id: string, payload: unknown) => Promise<void>;
278
+ deletePromo: (id: string) => Promise<void>;
279
+ suspendTenant: (slug: string, reason: string) => Promise<unknown>;
280
+ reactivateTenant: (slug: string) => Promise<unknown>;
306
281
  };
307
282
 
308
283
  type MessageParams = Record<string, string | number>;
@@ -318,4 +293,4 @@ declare function formatMessage(template: string, params: MessageParams): string;
318
293
  */
319
294
  declare function formatCurrency(amount: number | string | null | undefined, locale?: SaLocale, currency?: string): string;
320
295
 
321
- export { ADMIN_UI_VERSION, type BatchColumnData, BatchColumnDriftError, BatchColumnFetcher, type BatchColumnFetcherOptions, type BatchColumnRow, type BatchColumnValue, BootLoadError, BootLoader, type BootLoaderOptions, type BuildRouteEntry, type BuildSnapshotsOptions, type CachedManifestEntry, type CatalogSnapshot, DEFAULT_STANDARD_PAGE_ROUTES, HttpClient, HttpJsonError, KvStore, ManifestLoadError, ManifestLoader, type ManifestLoaderOptions, type MessageParams, type NavBuilderOptions, type ParamStyle, type RawCatalogData, type ResolvedPlan, SaLocale, type SidebarItem, type SidebarSection, type SnapshotKind, buildRoutes, buildSidebar, buildSnapshots, defaultSectionOrder, formatCurrency, formatMessage, getJson, listOpenDrafts, postJson, resolveExtension, trimTrailingSlashes };
296
+ export { ADMIN_UI_VERSION, type AdminPromoListFilter, type AdminPromoListRow, type AdminResourceClientOptions, type BatchColumnData, BatchColumnDriftError, BatchColumnFetcher, type BatchColumnFetcherOptions, type BatchColumnRow, type BatchColumnValue, BootLoadError, BootLoader, type BootLoaderOptions, type BuildRouteEntry, type CachedManifestEntry, DEFAULT_STANDARD_PAGE_ROUTES, HttpClient, HttpJsonError, KvStore, ManifestLoadError, ManifestLoader, type ManifestLoaderOptions, type MessageParams, type NavBuilderOptions, type ParamStyle, SaLocale, type SidebarItem, type SidebarSection, buildRoutes, buildSidebar, createAdminResourceClient, defaultSectionOrder, formatCurrency, formatMessage, getJson, postJson, resolveExtension, trimTrailingSlashes };
@@ -1,6 +1,6 @@
1
- import { H as HttpClient, K as KvStore, S as SaLocale } from '../messages-7b0P8W75.js';
2
- export { d as ActionDefNotInManifestError, A as ActionHandler, c as ActionRegistry, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, j as defaultHttpClient, k as defaultKvStore, l as defineMessages, m as mergeMessages, r as resolveMessages } from '../messages-7b0P8W75.js';
3
- import { PublicBootResponse, AdminManifest, StandardPageKey, TenantColumnDef, PlanVersionRow } from '@saasicat/types';
1
+ import { H as HttpClient, K as KvStore, S as SaLocale } from '../messages-BIYw32u1.js';
2
+ export { d as ActionDefNotInManifestError, A as ActionHandler, c as ActionRegistry, D as DEFAULT_SA_LOCALE, e as HttpResponse, M as MessageTree, f as MissingHandlerError, P as PartialMessages, R as ResolvedAction, g as SA_INTL_LOCALES, h as SA_LOCALES, i as SA_MESSAGES, a as SaMessages, b as SaMessagesOverrides, T as TranslationOf, j as defaultHttpClient, k as defaultKvStore, l as defineMessages, m as mergeMessages, r as resolveMessages } from '../messages-BIYw32u1.js';
3
+ import { PublicBootResponse, AdminManifest, StandardPageKey, TenantColumnDef, PromoCodeRecord, AdminTenantDetail, AdminUserListFilter, AdminUserListRow, AdminAuditListFilter, AuditEntry, AdminSubscriptionListRow } from '@saasicat/types';
4
4
 
5
5
  declare const ADMIN_UI_VERSION = "1.2.0";
6
6
 
@@ -247,62 +247,37 @@ declare class BatchColumnFetcher {
247
247
  private buildUrl;
248
248
  }
249
249
 
250
- type SnapshotKind = 'drafts' | 'active' | 'historical';
251
- interface CatalogSnapshot<P extends PlanVersionRow = PlanVersionRow> {
252
- id: string;
253
- kind: SnapshotKind;
254
- status: 'DRAFT' | 'ACTIVE' | 'ARCHIVED';
255
- label: string;
256
- title: string;
257
- description: string;
258
- asOf: string | null;
259
- createdAt: string | null;
260
- publishedAt: string | null;
261
- authorEmail: string | null;
262
- plans: ResolvedPlan<P>[];
263
- /** Number of open drafts for the `drafts` snapshot, otherwise 0. */
264
- draftCount: number;
265
- /** Number of entities in this snapshot whose publication flagged at least
266
- * one regression (`nonRegressive === false`). */
267
- regressionCount: number;
250
+ interface AdminResourceClientOptions {
251
+ http: HttpClient;
252
+ /** Default `/api/v1/admin`. */
253
+ adminBase?: string;
268
254
  }
269
- interface ResolvedPlan<P extends PlanVersionRow = PlanVersionRow> {
270
- /** Which PlanVersionRow was selected to represent this slot. */
271
- source: P;
272
- /** Live predecessor (only set when `source` is a DRAFT; otherwise null). */
273
- liveBase: P | null;
274
- isDraft: boolean;
275
- planId: string;
276
- features: string[];
277
- /** Quota map (from `source.quotas` or legacy fields; empty if none). */
278
- quotas: Record<string, number>;
279
- monthlyNet: number;
280
- yearlyNet: number;
281
- marketed: boolean;
282
- version: number;
283
- /** @deprecated Read from `quotas['users']`. */
284
- maxUsers?: number;
285
- /** @deprecated Legacy field; read from `quotas['vehicles']`. */
286
- maxVehicles?: number;
287
- /** @deprecated Read from `quotas['storageGb']`. */
288
- maxStorageGb?: number;
255
+ /** Filters accepted by the standard PromoCodesPage, including its "all" state. */
256
+ interface AdminPromoListFilter {
257
+ search?: string;
258
+ status?: string | null;
289
259
  }
290
- interface RawCatalogData<P extends PlanVersionRow = PlanVersionRow> {
291
- planVersions: P[];
292
- }
293
- interface BuildSnapshotsOptions {
294
- /**
295
- * App-specific plan order, e.g. `['BASIC', 'STANDARD',
296
- * 'PROFESSIONAL', 'BUSINESS', 'ENTERPRISE']`. Plan IDs outside the list
297
- * end up sorted alphabetically at the back.
298
- */
299
- planSortOrder?: readonly string[];
300
- /** UI locale for the generated snapshot labels/titles/descriptions. */
301
- locale?: SaLocale;
260
+ /** Promo row shape used by the extensible standard Admin table. */
261
+ interface AdminPromoListRow extends PromoCodeRecord {
262
+ [extra: string]: unknown;
302
263
  }
303
- declare function buildSnapshots<P extends PlanVersionRow>(data: RawCatalogData<P>, options?: BuildSnapshotsOptions): CatalogSnapshot<P>[];
304
- declare function listOpenDrafts<P extends PlanVersionRow>(data: RawCatalogData<P>): {
305
- plans: P[];
264
+ /**
265
+ * Ready-to-use client for the standard SaaSiCat AdminResources and promo
266
+ * controllers. App wrappers pass these functions straight to the standard
267
+ * pages; no repeated fetch/error/query-string plumbing is needed.
268
+ */
269
+ declare function createAdminResourceClient(options: AdminResourceClientOptions): {
270
+ tenantsEndpoint: string;
271
+ loadTenantDetail: (slug: string) => Promise<AdminTenantDetail>;
272
+ loadUsers: (filter: AdminUserListFilter) => Promise<AdminUserListRow[]>;
273
+ loadAudit: (filter: AdminAuditListFilter) => Promise<AuditEntry[]>;
274
+ loadSubscriptions: () => Promise<AdminSubscriptionListRow[]>;
275
+ loadPromos: (filter: AdminPromoListFilter) => Promise<AdminPromoListRow[]>;
276
+ createPromo: (payload: unknown) => Promise<void>;
277
+ updatePromo: (id: string, payload: unknown) => Promise<void>;
278
+ deletePromo: (id: string) => Promise<void>;
279
+ suspendTenant: (slug: string, reason: string) => Promise<unknown>;
280
+ reactivateTenant: (slug: string) => Promise<unknown>;
306
281
  };
307
282
 
308
283
  type MessageParams = Record<string, string | number>;
@@ -318,4 +293,4 @@ declare function formatMessage(template: string, params: MessageParams): string;
318
293
  */
319
294
  declare function formatCurrency(amount: number | string | null | undefined, locale?: SaLocale, currency?: string): string;
320
295
 
321
- export { ADMIN_UI_VERSION, type BatchColumnData, BatchColumnDriftError, BatchColumnFetcher, type BatchColumnFetcherOptions, type BatchColumnRow, type BatchColumnValue, BootLoadError, BootLoader, type BootLoaderOptions, type BuildRouteEntry, type BuildSnapshotsOptions, type CachedManifestEntry, type CatalogSnapshot, DEFAULT_STANDARD_PAGE_ROUTES, HttpClient, HttpJsonError, KvStore, ManifestLoadError, ManifestLoader, type ManifestLoaderOptions, type MessageParams, type NavBuilderOptions, type ParamStyle, type RawCatalogData, type ResolvedPlan, SaLocale, type SidebarItem, type SidebarSection, type SnapshotKind, buildRoutes, buildSidebar, buildSnapshots, defaultSectionOrder, formatCurrency, formatMessage, getJson, listOpenDrafts, postJson, resolveExtension, trimTrailingSlashes };
296
+ export { ADMIN_UI_VERSION, type AdminPromoListFilter, type AdminPromoListRow, type AdminResourceClientOptions, type BatchColumnData, BatchColumnDriftError, BatchColumnFetcher, type BatchColumnFetcherOptions, type BatchColumnRow, type BatchColumnValue, BootLoadError, BootLoader, type BootLoaderOptions, type BuildRouteEntry, type CachedManifestEntry, DEFAULT_STANDARD_PAGE_ROUTES, HttpClient, HttpJsonError, KvStore, ManifestLoadError, ManifestLoader, type ManifestLoaderOptions, type MessageParams, type NavBuilderOptions, type ParamStyle, SaLocale, type SidebarItem, type SidebarSection, buildRoutes, buildSidebar, createAdminResourceClient, defaultSectionOrder, formatCurrency, formatMessage, getJson, postJson, resolveExtension, trimTrailingSlashes };
@@ -13,14 +13,13 @@ import {
13
13
  MissingHandlerError,
14
14
  buildRoutes,
15
15
  buildSidebar,
16
- buildSnapshots,
16
+ createAdminResourceClient,
17
17
  defaultSectionOrder,
18
18
  getJson,
19
- listOpenDrafts,
20
19
  postJson,
21
20
  resolveExtension,
22
21
  trimTrailingSlashes
23
- } from "../chunk-A3W2N26K.js";
22
+ } from "../chunk-66BUSVC5.js";
24
23
  import {
25
24
  DEFAULT_SA_LOCALE,
26
25
  SA_INTL_LOCALES,
@@ -33,7 +32,7 @@ import {
33
32
  formatMessage,
34
33
  mergeMessages,
35
34
  resolveMessages
36
- } from "../chunk-X5SQ5HMB.js";
35
+ } from "../chunk-TBLXKSTR.js";
37
36
  export {
38
37
  ADMIN_UI_VERSION,
39
38
  ActionDefNotInManifestError,
@@ -53,7 +52,7 @@ export {
53
52
  SA_MESSAGES,
54
53
  buildRoutes,
55
54
  buildSidebar,
56
- buildSnapshots,
55
+ createAdminResourceClient,
57
56
  defaultHttpClient,
58
57
  defaultKvStore,
59
58
  defaultSectionOrder,
@@ -61,7 +60,6 @@ export {
61
60
  formatCurrency,
62
61
  formatMessage,
63
62
  getJson,
64
- listOpenDrafts,
65
63
  mergeMessages,
66
64
  postJson,
67
65
  resolveExtension,