@saasicat/ui-vue 0.26.0 → 0.27.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 (36) hide show
  1. package/LICENSE +90 -201
  2. package/README.md +23 -0
  3. package/dist/{catalog-Dch1Ryw0.d.cts → catalog-Dv2twuNi.d.cts} +205 -4
  4. package/dist/{catalog-Dch1Ryw0.d.ts → catalog-Dv2twuNi.d.ts} +205 -4
  5. package/dist/{chunk-BPF2BMCQ.js → chunk-4IZWT4UY.js} +414 -2
  6. package/dist/{chunk-O3J3ITF2.js → chunk-LK6YJDXC.js} +1 -1
  7. package/dist/{chunk-NEXTZZRQ.js → chunk-NRVF3JJJ.js} +2 -2
  8. package/dist/client/index.cjs +426 -5
  9. package/dist/client/index.d.cts +70 -4
  10. package/dist/client/index.d.ts +70 -4
  11. package/dist/client/index.js +22 -4
  12. package/dist/index.cjs +429 -8
  13. package/dist/index.d.cts +5 -5
  14. package/dist/index.d.ts +5 -5
  15. package/dist/index.js +23 -5
  16. package/dist/quasar/index.cjs +411 -2
  17. package/dist/quasar/index.d.cts +2 -2
  18. package/dist/quasar/index.d.ts +2 -2
  19. package/dist/quasar/index.js +2 -2
  20. package/dist/{resource-registry-D7Xjs-5f.d.cts → resource-registry-BxFpnzHY.d.cts} +1 -1
  21. package/dist/{resource-registry-TaR7rtq0.d.ts → resource-registry-Cn1Gy2LE.d.ts} +1 -1
  22. package/package.json +5 -4
  23. package/src/client/admin-error.ts +18 -1
  24. package/src/client/attach-cause.ts +21 -0
  25. package/src/client/nav-builder.ts +3 -1
  26. package/src/client/resources/bundles.resource.ts +145 -0
  27. package/src/client/resources/catalog.resource.ts +160 -0
  28. package/src/client/resources/discovery.resource.ts +108 -0
  29. package/src/client/resources/index.ts +52 -14
  30. package/src/client/resources/marketing.resource.ts +121 -0
  31. package/src/client/resources/promo-codes.resource.ts +63 -0
  32. package/src/client/resources/promotions.resource.ts +44 -0
  33. package/src/client/resources/subscriptions.resource.ts +19 -0
  34. package/src/client/resources/tenants.resource.ts +35 -9
  35. package/src/client/resources/users.resource.ts +31 -0
  36. package/src/pages-standard/SuperAdminSetupWizard.vue +7 -4
@@ -1,5 +1,5 @@
1
1
  import * as _saasicat_types from '@saasicat/types';
2
- import { AuditQuery, AuditEntry, TenantListFilter, TenantDto, PlanVersionRow, CreatePlanVersionDraftData, PlanVersionMutationResult, UpdatePlanVersionDraftData, PlanRow, CreatePlanData, UpdatePlanData, StandardPageKey, AdminManifest, TenantActionDef } from '@saasicat/types';
2
+ import { AuditQuery, AuditEntry, TenantListFilter, TenantDto, AdminTenantDetail, PromoCodeRecord, MarketingProjectionRow, CreateMarketingProjectionData, UpdateMarketingProjectionData, MarketingSettingsRow, DiscoverySnapshot, BundleVersionRow, CreateBundleVersionDraftData, BundleVersionMutationResult, UpdateBundleVersionDraftData, BundleRow, CreateBundleData, UpdateBundleData, PlanVersionRow, CreatePlanVersionDraftData, PlanVersionMutationResult, UpdatePlanVersionDraftData, PlanRow, CreatePlanData, UpdatePlanData, StandardPageKey, AdminManifest, TenantActionDef } from '@saasicat/types';
3
3
 
4
4
  /**
5
5
  * Minimal abstraction over `fetch`. Consumers may pass their own
@@ -224,6 +224,145 @@ declare const auditResource: ResourceDef<{
224
224
  type TenantsListFilter = ListFilterOf<TenantListFilter>;
225
225
  declare const tenantsResource: ResourceDef<{
226
226
  readonly list: ListOp<TenantDto, TenantsListFilter>;
227
+ readonly detail: (http: HttpClient, ctx: ResourceContext, slug: string) => Promise<AdminTenantDetail | null>;
228
+ /**
229
+ * Suspends a tenant. The reason is recorded on the audit trail, so it is a
230
+ * required argument rather than an option with a default.
231
+ */
232
+ readonly suspend: (http: HttpClient, ctx: ResourceContext, slug: string, reason: string) => Promise<void>;
233
+ readonly reactivate: (http: HttpClient, ctx: ResourceContext, slug: string) => Promise<void>;
234
+ }>;
235
+
236
+ /** What the promo list can be narrowed by, including its "all" state. */
237
+ interface PromoCodesFilter {
238
+ search?: string;
239
+ status?: string | null;
240
+ }
241
+ declare const promoCodesResource: ResourceDef<{
242
+ readonly list: (http: HttpClient, ctx: ResourceContext, filter?: PromoCodesFilter) => Promise<PromoCodeRecord[]>;
243
+ /**
244
+ * Returns nothing, matching `createAdminResourceClient.createPromo`.
245
+ *
246
+ * The endpoint does answer with the created record, but the page it feeds
247
+ * reloads the list rather than reading it, and promising a body a caller
248
+ * would then have to trust is a wider contract than anything holds today.
249
+ */
250
+ readonly create: (http: HttpClient, ctx: ResourceContext, payload: unknown) => Promise<void>;
251
+ readonly update: (http: HttpClient, ctx: ResourceContext, id: string, payload: unknown) => Promise<void>;
252
+ readonly remove: (http: HttpClient, ctx: ResourceContext, id: string) => Promise<void>;
253
+ }>;
254
+
255
+ /**
256
+ * What the projection list can be narrowed by, beyond the bound project.
257
+ *
258
+ * `projectKey` is deliberately absent: it comes from the context, so a page
259
+ * cannot list one project's projections while creating in another.
260
+ */
261
+ interface MarketingProjectionsFilter {
262
+ targetType?: string;
263
+ targetVersionId?: string;
264
+ locale?: string;
265
+ }
266
+ declare const marketingResource: ResourceDef<{
267
+ readonly listProjections: (http: HttpClient, ctx: ResourceContext, filter?: MarketingProjectionsFilter) => Promise<MarketingProjectionRow[]>;
268
+ /**
269
+ * The request only. `useMarketingProjections.create` reloads the list
270
+ * afterwards because a unique-tuple insert can change what the filter
271
+ * matches — that is the composable keeping its refs true, not part of
272
+ * the call.
273
+ */
274
+ readonly createProjection: (http: HttpClient, ctx: ResourceContext, data: CreateMarketingProjectionData) => Promise<MarketingProjectionRow>;
275
+ readonly updateProjection: (http: HttpClient, ctx: ResourceContext, id: string, data: UpdateMarketingProjectionData) => Promise<MarketingProjectionRow>;
276
+ readonly deleteProjection: (http: HttpClient, ctx: ResourceContext, id: string) => Promise<void>;
277
+ /**
278
+ * The activated locale subset, or `null` when none was ever stored.
279
+ *
280
+ * `null` means the full pool is active — the server's answer for "no
281
+ * row", and the state the page falls back to.
282
+ */
283
+ readonly settings: (http: HttpClient, ctx: ResourceContext) => Promise<MarketingSettingsRow | null>;
284
+ /** `PUT`, not `PATCH`: the endpoint replaces the set it is given. */
285
+ readonly saveSettings: (http: HttpClient, ctx: ResourceContext, activeLocales: readonly string[]) => Promise<void>;
286
+ }>;
287
+
288
+ /**
289
+ * The answer to a conditional read.
290
+ *
291
+ * `unchanged` carries no snapshot on purpose: the server said the caller's copy
292
+ * is current, and returning a re-fetched one would defeat the request.
293
+ */
294
+ type DiscoveryRead = {
295
+ readonly status: 'unchanged';
296
+ } | {
297
+ readonly status: 'loaded';
298
+ readonly snapshot: DiscoverySnapshot;
299
+ /** `null` when the server sent none — revalidation is then a full read. */
300
+ readonly etag: string | null;
301
+ };
302
+ declare const discoveryResource: ResourceDef<{
303
+ /**
304
+ * Reads the snapshot, revalidating against `etag` when one is passed.
305
+ *
306
+ * Pass `null` (or nothing) to force a full read — that is what
307
+ * `useDiscovery.reload()` does when the operator asks for fresh data.
308
+ */
309
+ readonly read: (http: HttpClient, ctx: ResourceContext, etag?: string | null) => Promise<DiscoveryRead>;
310
+ /**
311
+ * Re-runs the scan and returns what it found.
312
+ *
313
+ * Unconditional by construction: a rescan asks the server to look again,
314
+ * so revalidating against a tag the previous scan produced would answer
315
+ * with the snapshot the rescan was meant to replace.
316
+ */
317
+ readonly rescan: (http: HttpClient, ctx: ResourceContext) => Promise<{
318
+ snapshot: DiscoverySnapshot;
319
+ etag: string | null;
320
+ }>;
321
+ }>;
322
+
323
+ /** What `publish` may override at the moment a bundle version goes live. */
324
+ interface PublishBundleVersionOptions {
325
+ forceRegressive?: boolean;
326
+ allowZeroPrice?: boolean;
327
+ validFrom?: string | null;
328
+ validUntil?: string | null;
329
+ }
330
+ /**
331
+ * The bundle catalogue — read per project, like the plan catalogue.
332
+ *
333
+ * `create` takes the project from the context rather than from the caller, for
334
+ * the reason spelled out on `plansResource.create`: the composable this
335
+ * replaces made it the caller's job, so `list()` and `create()` read two
336
+ * different sources for one value and a stale one creates a bundle outside the
337
+ * project the list is showing.
338
+ */
339
+ declare const bundlesResource: ResourceDef<{
340
+ readonly list: (http: HttpClient, ctx: ResourceContext) => Promise<BundleRow[]>;
341
+ readonly create: (http: HttpClient, ctx: ResourceContext, data: Omit<CreateBundleData, "projectKey">) => Promise<BundleRow>;
342
+ readonly update: (http: HttpClient, ctx: ResourceContext, bundleId: string, data: UpdateBundleData) => Promise<BundleRow>;
343
+ /** Marks the bundle deleted. */
344
+ readonly softDelete: (http: HttpClient, ctx: ResourceContext, bundleId: string) => Promise<void>;
345
+ }>;
346
+ /**
347
+ * Bundle version lifecycle.
348
+ *
349
+ * `publish` is the request only. `useBundleVersions.publish` reloads the list
350
+ * afterwards, because publishing may supersede another version — but that is
351
+ * the composable keeping its own refs consistent, not part of the call. A
352
+ * descriptor operation that issued a second request would make every override
353
+ * inherit a reload it cannot see, and a page holding no list would pay for one
354
+ * it does not read.
355
+ */
356
+ declare const bundleVersionsResource: ResourceDef<{
357
+ readonly listForBundle: (http: HttpClient, ctx: ResourceContext, bundleId: string) => Promise<BundleVersionRow[]>;
358
+ readonly createDraft: (http: HttpClient, ctx: ResourceContext, bundleId: string, data: Omit<CreateBundleVersionDraftData, "bundleId">) => Promise<BundleVersionMutationResult>;
359
+ readonly updateDraft: (http: HttpClient, ctx: ResourceContext, versionId: string, data: UpdateBundleVersionDraftData) => Promise<BundleVersionMutationResult>;
360
+ readonly publish: (http: HttpClient, ctx: ResourceContext, versionId: string, options?: PublishBundleVersionOptions) => Promise<BundleVersionMutationResult>;
361
+ /**
362
+ * Discards a draft. A published version cannot be discarded — the API
363
+ * answers 422 `BUNDLE_VERSION_ALREADY_PUBLISHED`.
364
+ */
365
+ readonly discardDraft: (http: HttpClient, ctx: ResourceContext, versionId: string) => Promise<void>;
227
366
  }>;
228
367
 
229
368
  /** What `publish` may override at the moment a version goes live. */
@@ -279,8 +418,9 @@ declare const planVersionsResource: ResourceDef<{
279
418
  /**
280
419
  * Every resource the shell offers by default.
281
420
  *
282
- * The registry binds these; an app overrides by key. Partial while the roster
283
- * growsa page whose resource is not here yet keeps its props.
421
+ * The registry binds these; an app overrides by key. A page whose data is
422
+ * app-ownedpilots, platform e-mail keeps its props, because there is no
423
+ * platform default to override.
284
424
  */
285
425
  declare const platformResources: {
286
426
  plans: ResourceDef<{
@@ -299,8 +439,69 @@ declare const platformResources: {
299
439
  readonly discardDraft: (http: HttpClient, ctx: ResourceContext, versionId: string) => Promise<void>;
300
440
  readonly terminate: (http: HttpClient, ctx: ResourceContext, versionId: string, endsAt: string) => Promise<_saasicat_types.PlanVersionRow>;
301
441
  }>;
442
+ bundles: ResourceDef<{
443
+ readonly list: (http: HttpClient, ctx: ResourceContext) => Promise<_saasicat_types.BundleRow[]>;
444
+ readonly create: (http: HttpClient, ctx: ResourceContext, data: Omit<_saasicat_types.CreateBundleData, "projectKey">) => Promise<_saasicat_types.BundleRow>;
445
+ readonly update: (http: HttpClient, ctx: ResourceContext, bundleId: string, data: _saasicat_types.UpdateBundleData) => Promise<_saasicat_types.BundleRow>;
446
+ readonly softDelete: (http: HttpClient, ctx: ResourceContext, bundleId: string) => Promise<void>;
447
+ }>;
448
+ bundleVersions: ResourceDef<{
449
+ readonly listForBundle: (http: HttpClient, ctx: ResourceContext, bundleId: string) => Promise<_saasicat_types.BundleVersionRow[]>;
450
+ readonly createDraft: (http: HttpClient, ctx: ResourceContext, bundleId: string, data: Omit<_saasicat_types.CreateBundleVersionDraftData, "bundleId">) => Promise<_saasicat_types.BundleVersionMutationResult>;
451
+ readonly updateDraft: (http: HttpClient, ctx: ResourceContext, versionId: string, data: _saasicat_types.UpdateBundleVersionDraftData) => Promise<_saasicat_types.BundleVersionMutationResult>;
452
+ readonly publish: (http: HttpClient, ctx: ResourceContext, versionId: string, options?: PublishBundleVersionOptions) => Promise<_saasicat_types.BundleVersionMutationResult>;
453
+ readonly discardDraft: (http: HttpClient, ctx: ResourceContext, versionId: string) => Promise<void>;
454
+ }>;
455
+ catalog: ResourceDef<{
456
+ readonly capabilities: (http: HttpClient, ctx: ResourceContext) => Promise<_saasicat_types.CapabilityCatalogEntryRow[]>;
457
+ readonly features: (http: HttpClient, ctx: ResourceContext) => Promise<_saasicat_types.FeatureCatalogEntryRow[]>;
458
+ readonly quotas: (http: HttpClient, ctx: ResourceContext) => Promise<_saasicat_types.QuotaCatalogEntryRow[]>;
459
+ readonly reviewFeature: (http: HttpClient, ctx: ResourceContext, featureKey: string, data: _saasicat_types.ReviewCatalogEntryData) => Promise<_saasicat_types.FeatureCatalogEntryRow>;
460
+ readonly reviewQuota: (http: HttpClient, ctx: ResourceContext, quotaKey: string, data: _saasicat_types.ReviewCatalogEntryData) => Promise<_saasicat_types.QuotaCatalogEntryRow>;
461
+ readonly setFeatureI18n: (http: HttpClient, ctx: ResourceContext, featureKey: string, i18n: _saasicat_types.CatalogEntryI18n) => Promise<_saasicat_types.FeatureCatalogEntryRow>;
462
+ readonly setQuotaI18n: (http: HttpClient, ctx: ResourceContext, quotaKey: string, i18n: _saasicat_types.CatalogEntryI18n) => Promise<_saasicat_types.QuotaCatalogEntryRow>;
463
+ readonly setFeatureBase: (http: HttpClient, ctx: ResourceContext, featureKey: string, data: _saasicat_types.UpdateCatalogEntryBaseData) => Promise<_saasicat_types.FeatureCatalogEntryRow>;
464
+ readonly setQuotaBase: (http: HttpClient, ctx: ResourceContext, quotaKey: string, data: _saasicat_types.UpdateCatalogEntryBaseData) => Promise<_saasicat_types.QuotaCatalogEntryRow>;
465
+ readonly syncDiscovery: (http: HttpClient, ctx: ResourceContext, snapshot: _saasicat_types.DiscoverySnapshot) => Promise<_saasicat_types.SyncDiscoveryResult>;
466
+ }>;
467
+ discovery: ResourceDef<{
468
+ readonly read: (http: HttpClient, ctx: ResourceContext, etag?: string | null) => Promise<DiscoveryRead>;
469
+ readonly rescan: (http: HttpClient, ctx: ResourceContext) => Promise<{
470
+ snapshot: _saasicat_types.DiscoverySnapshot;
471
+ etag: string | null;
472
+ }>;
473
+ }>;
474
+ marketing: ResourceDef<{
475
+ readonly listProjections: (http: HttpClient, ctx: ResourceContext, filter?: MarketingProjectionsFilter) => Promise<_saasicat_types.MarketingProjectionRow[]>;
476
+ readonly createProjection: (http: HttpClient, ctx: ResourceContext, data: _saasicat_types.CreateMarketingProjectionData) => Promise<_saasicat_types.MarketingProjectionRow>;
477
+ readonly updateProjection: (http: HttpClient, ctx: ResourceContext, id: string, data: _saasicat_types.UpdateMarketingProjectionData) => Promise<_saasicat_types.MarketingProjectionRow>;
478
+ readonly deleteProjection: (http: HttpClient, ctx: ResourceContext, id: string) => Promise<void>;
479
+ readonly settings: (http: HttpClient, ctx: ResourceContext) => Promise<_saasicat_types.MarketingSettingsRow | null>;
480
+ readonly saveSettings: (http: HttpClient, ctx: ResourceContext, activeLocales: readonly string[]) => Promise<void>;
481
+ }>;
482
+ promoCodes: ResourceDef<{
483
+ readonly list: (http: HttpClient, ctx: ResourceContext, filter?: PromoCodesFilter) => Promise<_saasicat_types.PromoCodeRecord[]>;
484
+ readonly create: (http: HttpClient, ctx: ResourceContext, payload: unknown) => Promise<void>;
485
+ readonly update: (http: HttpClient, ctx: ResourceContext, id: string, payload: unknown) => Promise<void>;
486
+ readonly remove: (http: HttpClient, ctx: ResourceContext, id: string) => Promise<void>;
487
+ }>;
488
+ promotions: ResourceDef<{
489
+ readonly list: (http: HttpClient, ctx: ResourceContext) => Promise<_saasicat_types.PromotionRow[]>;
490
+ readonly create: (http: HttpClient, ctx: ResourceContext, data: _saasicat_types.CreatePromotionData) => Promise<_saasicat_types.PromotionRow>;
491
+ readonly update: (http: HttpClient, ctx: ResourceContext, id: string, data: _saasicat_types.UpdatePromotionData) => Promise<_saasicat_types.PromotionRow>;
492
+ readonly remove: (http: HttpClient, ctx: ResourceContext, id: string) => Promise<void>;
493
+ }>;
302
494
  tenants: ResourceDef<{
303
495
  readonly list: ListOp<_saasicat_types.TenantDto, TenantsListFilter>;
496
+ readonly detail: (http: HttpClient, ctx: ResourceContext, slug: string) => Promise<_saasicat_types.AdminTenantDetail | null>;
497
+ readonly suspend: (http: HttpClient, ctx: ResourceContext, slug: string, reason: string) => Promise<void>;
498
+ readonly reactivate: (http: HttpClient, ctx: ResourceContext, slug: string) => Promise<void>;
499
+ }>;
500
+ users: ResourceDef<{
501
+ readonly list: (http: HttpClient, ctx: ResourceContext, filter?: _saasicat_types.AdminUserListFilter) => Promise<_saasicat_types.AdminUserListRow[]>;
502
+ }>;
503
+ subscriptions: ResourceDef<{
504
+ readonly list: (http: HttpClient, ctx: ResourceContext) => Promise<_saasicat_types.AdminSubscriptionListRow[]>;
304
505
  }>;
305
506
  audit: ResourceDef<{
306
507
  readonly list: ListOp<_saasicat_types.AuditEntry, AuditListFilter>;
@@ -1956,4 +2157,4 @@ interface SaCatalog {
1956
2157
  */
1957
2158
  declare function createSaCatalog(options?: SaCatalogOptions): SaCatalog;
1958
2159
 
1959
- export { filterQueryString as $, type ActionHandler as A, type Bound as B, SA_LOCALE_LABELS as C, DEFAULT_SA_LOCALE as D, SA_MESSAGES as E, type SaBuiltinLocale as F, type SaCatalog as G, type HttpClient as H, type SaCatalogOptions as I, type TranslationOf as J, type KvStore as K, LIST_FIRST_PAGE as L, type MessageTree as M, auditResource as N, bindResource as O, type PlatformResources as P, clampListPage as Q, type ResourceDef as R, type SaLocale as S, type TenantsListFilter as T, clampListPageSize as U, createSaCatalog as V, defaultHttpClient as W, defaultKvStore as X, defineListOp as Y, defineMessages as Z, defineResource as _, type SaMessages as a, isSaBuiltinLocale as a0, isSentInQuery as a1, listUrl as a2, mergeMessages as a3, planVersionsResource as a4, plansResource as a5, readListPage as a6, resolveMessages as a7, tenantsResource as a8, type SaNavMessages as a9, type SaLocaleOption as b, type SaLocaleDefinition as c, type SaMessagesOverrides as d, type ResourceOps as e, type ResourceContext as f, type ResourceListPage as g, ActionRegistry as h, ActionDefNotInManifestError as i, type AuditListFilter as j, type DefineResourceOptions as k, type HttpResponse as l, LIST_PAGE_SIZE_DEFAULT as m, LIST_PAGE_SIZE_MAX as n, LIST_PAGINATION_PARAMS as o, platformResources as p, type ListFilterOf as q, type ListOp as r, type ListQuery as s, MissingHandlerError as t, type PartialMessages as u, type PublishPlanVersionOptions as v, type ResolvedAction as w, type ResourceOp as x, SA_INTL_LOCALES as y, SA_LOCALES as z };
2160
+ export { createSaCatalog as $, type ActionHandler as A, type Bound as B, type ResolvedAction as C, DEFAULT_SA_LOCALE as D, type ResourceOp as E, SA_INTL_LOCALES as F, SA_LOCALES as G, type HttpClient as H, SA_LOCALE_LABELS as I, SA_MESSAGES as J, type KvStore as K, LIST_FIRST_PAGE as L, type MarketingProjectionsFilter as M, type SaBuiltinLocale as N, type SaCatalog as O, type PlatformResources as P, type SaCatalogOptions as Q, type ResourceDef as R, type SaLocale as S, type TenantsListFilter as T, type TranslationOf as U, auditResource as V, bindResource as W, bundleVersionsResource as X, bundlesResource as Y, clampListPage as Z, clampListPageSize as _, type SaMessages as a, defaultHttpClient as a0, defaultKvStore as a1, defineListOp as a2, defineMessages as a3, defineResource as a4, discoveryResource as a5, filterQueryString as a6, isSaBuiltinLocale as a7, isSentInQuery as a8, listUrl as a9, marketingResource as aa, mergeMessages as ab, planVersionsResource as ac, plansResource as ad, promoCodesResource as ae, readListPage as af, resolveMessages as ag, tenantsResource as ah, type SaNavMessages as ai, type SaLocaleOption as b, type SaLocaleDefinition as c, type SaMessagesOverrides as d, type ResourceOps as e, type ResourceContext as f, type ResourceListPage as g, ActionRegistry as h, ActionDefNotInManifestError as i, type AuditListFilter as j, type DefineResourceOptions as k, type DiscoveryRead as l, type HttpResponse as m, LIST_PAGE_SIZE_DEFAULT as n, LIST_PAGE_SIZE_MAX as o, platformResources as p, LIST_PAGINATION_PARAMS as q, type ListFilterOf as r, type ListOp as s, type ListQuery as t, type MessageTree as u, MissingHandlerError as v, type PartialMessages as w, type PromoCodesFilter as x, type PublishBundleVersionOptions as y, type PublishPlanVersionOptions as z };