@wssto2/vue-core 0.5.3 → 0.6.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 (90) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +3 -1
  3. package/dist/{ActionRow.vue_vue_type_script_setup_true_lang-Bv-APkGf.js → ActionRow.vue_vue_type_script_setup_true_lang-D8NCXX4p.js} +1 -1
  4. package/dist/{Activity-DUjDaPfP.js → Activity-DGodh6BU.js} +4 -4
  5. package/dist/{Changes-B0tZO6BZ.js → Changes-38u4xY6e.js} +3 -3
  6. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-o_Pj-JcD.js → CollectionPage.vue_vue_type_script_setup_true_lang-DPcCnrjr.js} +3 -3
  7. package/dist/{DateField.vue_vue_type_script_setup_true_lang-CDg31ZU7.js → DateField.vue_vue_type_script_setup_true_lang-BxUuUypB.js} +1 -1
  8. package/dist/{DeadLetters-IgVHao84.js → DeadLetters-CeHfhFHP.js} +6 -5
  9. package/dist/{FormGroup.vue_vue_type_script_setup_true_lang-CSgT4ITL.js → FormGroup.vue_vue_type_script_setup_true_lang-CNb2CK01.js} +1 -1
  10. package/dist/{FormView.vue_vue_type_script_setup_true_lang-D31Hk3pJ.js → FormView.vue_vue_type_script_setup_true_lang-nyz8EkzM.js} +1 -1
  11. package/dist/{General-C40HxupS.js → General-BNTjPvat.js} +6 -6
  12. package/dist/{NewRolePage-Bhy8KJO1.js → NewRolePage-Btg7gzzH.js} +7 -6
  13. package/dist/{NumberField.vue_vue_type_script_setup_true_lang-BdS7BxuS.js → NumberField.vue_vue_type_script_setup_true_lang-C8um4ARi.js} +1 -1
  14. package/dist/PersonAccess.vue_vue_type_script_setup_true_lang-ClmawvYm.js +600 -0
  15. package/dist/{ProfilePage-Bf7dFzGd.js → ProfilePage-CoZyG11N.js} +9 -9
  16. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-C6oloGIh.js → RoleEditor.vue_vue_type_script_setup_true_lang-Bs9bo0Zb.js} +30 -29
  17. package/dist/{RolePage-BjbvciTg.js → RolePage-CPlwZA6X.js} +37 -35
  18. package/dist/{RolesPage-DzVOgF4z.js → RolesPage-CdYdIHR4.js} +29 -27
  19. package/dist/{SegmentedField.vue_vue_type_script_setup_true_lang-DXe_iOS8.js → SegmentedField.vue_vue_type_script_setup_true_lang-B_hBL5f4.js} +1 -1
  20. package/dist/{SelectField.vue_vue_type_script_setup_true_lang-BN4vzvV9.js → SelectField.vue_vue_type_script_setup_true_lang-CBZhGNpm.js} +4 -4
  21. package/dist/ServiceAccountDialog.vue_vue_type_script_setup_true_lang-DuvSSBbX.js +126 -0
  22. package/dist/ServiceAccountRecord-BtaUZuWU.js +511 -0
  23. package/dist/ServiceAccountsList-CcRJvNaf.js +137 -0
  24. package/dist/{SessionList.vue_vue_type_script_setup_true_lang-PuWIK-Wa.js → SessionList.vue_vue_type_script_setup_true_lang-VvBB2EZz.js} +2 -2
  25. package/dist/{Sessions-CRUObe5G.js → Sessions-DkGNO1FO.js} +2 -2
  26. package/dist/{SettingsPage-C0qEC0uI.js → SettingsPage-D4G1HGbG.js} +8 -8
  27. package/dist/{SignIn-Uy0Jujzz.js → SignIn-DS1YymqD.js} +4 -4
  28. package/dist/{SignInPage-CpVZfrLZ.js → SignInPage-BrmL0PUw.js} +3 -3
  29. package/dist/{SignIns-Cp5Gx2dk.js → SignIns-C7l7IPHQ.js} +1 -1
  30. package/dist/{SwitchField.vue_vue_type_script_setup_true_lang-Dj5Aq8QT.js → SwitchField.vue_vue_type_script_setup_true_lang-DXZK89A3.js} +1 -1
  31. package/dist/{TextField.vue_vue_type_script_setup_true_lang-BwfNNQEz.js → TextField.vue_vue_type_script_setup_true_lang-CX3LdZLK.js} +2 -2
  32. package/dist/{TextareaField.vue_vue_type_script_setup_true_lang-aT1P8Xqr.js → TextareaField.vue_vue_type_script_setup_true_lang-BOtn_1GT.js} +1 -1
  33. package/dist/{TimeField.vue_vue_type_script_setup_true_lang-jPKPE1hc.js → TimeField.vue_vue_type_script_setup_true_lang-CbflIrq6.js} +1 -1
  34. package/dist/{UserRecord-DbSMnTbj.js → UserRecord-Du8M_kuk.js} +25 -25
  35. package/dist/{UsersList-9MicE2pG.js → UsersList-D3ydQice.js} +13 -13
  36. package/dist/access/api.d.ts +7 -8
  37. package/dist/access/context.d.ts +2 -7
  38. package/dist/access/feature.d.ts +0 -8
  39. package/dist/access/index.js +47 -15
  40. package/dist/client/client.d.ts +2 -2
  41. package/dist/client/index.d.ts +1 -1
  42. package/dist/client/route.d.ts +22 -3
  43. package/dist/collection/http.d.ts +3 -2
  44. package/dist/collection/index.js +17 -16
  45. package/dist/form/index.js +586 -611
  46. package/dist/http-nz92KjdS.js +42 -0
  47. package/dist/i18n/index.js +32 -32
  48. package/dist/identity/index.d.ts +7 -0
  49. package/dist/identity/index.js +19 -15
  50. package/dist/identity/serviceaccounts/ApiKeysPanel.vue.d.ts +17 -0
  51. package/dist/identity/serviceaccounts/CreatedApiKeyDialog.vue.d.ts +53 -0
  52. package/dist/identity/serviceaccounts/NewApiKeyDialog.vue.d.ts +24 -0
  53. package/dist/identity/serviceaccounts/ServiceAccountDialog.vue.d.ts +22 -0
  54. package/dist/identity/serviceaccounts/ServiceAccountRecord.vue.d.ts +2 -0
  55. package/dist/identity/serviceaccounts/ServiceAccountsList.vue.d.ts +2 -0
  56. package/dist/identity/serviceaccounts/access.d.ts +4 -0
  57. package/dist/identity/serviceaccounts/api.d.ts +27 -0
  58. package/dist/identity/serviceaccounts/context.d.ts +14 -0
  59. package/dist/identity/serviceaccounts/feature.d.ts +23 -0
  60. package/dist/identity/serviceaccounts/form.d.ts +4 -0
  61. package/dist/identity/serviceaccounts/messages.d.ts +11 -0
  62. package/dist/identity/serviceaccounts/routes.d.ts +22 -0
  63. package/dist/{index-Ok29ucE3.js → index-Cmj9iZmT.js} +191 -168
  64. package/dist/{index-C-oM_Mnf.js → index-DH0MoFqg.js} +2 -2
  65. package/dist/index.d.ts +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/internal/copyText.d.ts +5 -0
  68. package/dist/modules/access/routes.d.ts +13 -13
  69. package/dist/modules/events/routes.d.ts +4 -4
  70. package/dist/modules/identity/routes.d.ts +31 -31
  71. package/dist/modules/notification/routes.d.ts +16 -16
  72. package/dist/modules/serviceaccount/entities.d.ts +127 -0
  73. package/dist/modules/serviceaccount/routes.d.ts +58 -0
  74. package/dist/modules/serviceaccount/schemas.d.ts +49 -0
  75. package/dist/{neighbors-Bv6vnWlW.js → neighbors-DNZuGlQH.js} +1 -1
  76. package/dist/notifications/index.js +1 -1
  77. package/dist/{options-Bu0XbEpN.js → options-e_CAfvDQ.js} +3 -3
  78. package/dist/phone/index.js +1 -1
  79. package/dist/refusals-COPr15XZ.js +135 -0
  80. package/dist/routes-CVckt7Pj.js +19 -0
  81. package/dist/state-BC1Fc6U2.js +154 -0
  82. package/dist/{status-C78NpXyB.js → status-C8XtnK6m.js} +7 -6
  83. package/dist/styles.css +1 -1
  84. package/dist/{suggestions-ClyLexMO.js → suggestions-cPjs5gQz.js} +1 -1
  85. package/dist/{useCommand-DyuPTosF.js → useCommand-CfG727e8.js} +1 -1
  86. package/dist/{useGroupSheet-C2NyqWRp.js → useGroupSheet-BVcNDWbP.js} +2 -2
  87. package/dist/useRecordDialog-D65FF85F.js +30 -0
  88. package/package.json +2 -2
  89. package/dist/http-CdQowFlW.js +0 -194
  90. package/dist/index-BdGnA1Jh.js +0 -765
@@ -1,17 +1,49 @@
1
- import { _ as a, j as c, k as r, c as o, b as u, l as i, m as n, p as l, n as t, q as m, t as p, u as R, i as b, f as d } from "../index-BdGnA1Jh.js";
1
+ import { _ as f, a as R, b } from "../PersonAccess.vue_vue_type_script_setup_true_lang-ClmawvYm.js";
2
+ import { d as o, p as c } from "../feature-DdUAfyi4.js";
3
+ import { a as s, b as t } from "../refusals-COPr15XZ.js";
4
+ import { d as g, p as x, r as h, c as v, u as y, e as C, f as K } from "../refusals-COPr15XZ.js";
5
+ import { d as r } from "../defineRoutes-BGAdiIrt.js";
6
+ const a = r({
7
+ roles: { name: "access.roles", path: "/iam/roles", component: () => import("../RolesPage-CdYdIHR4.js"), meta: { access: s.viewRoles, titleKey: "core.access.title" } },
8
+ newRole: { name: "access.roles.new", path: "/iam/roles/new", component: () => import("../NewRolePage-Btg7gzzH.js"), meta: { access: s.manageRoles, titleKey: "core.access.new_title" } },
9
+ role: {
10
+ name: "access.role",
11
+ path: "/iam/roles/:ref",
12
+ component: () => import("../RolePage-CPlwZA6X.js"),
13
+ // A role's ref (its key, or the id of a custom one) swaps in place when a link leads to another role.
14
+ meta: { access: s.viewRoles, titleKey: "core.access.title", remountOnParam: "ref" }
15
+ }
16
+ }), m = {
17
+ access: s.viewAccess,
18
+ section: { labelKey: "core.access.person_roles", icon: "shieldStarFill" }
19
+ };
20
+ function u(e) {
21
+ return o({
22
+ id: "access",
23
+ routes: a.records,
24
+ context: c(t, {
25
+ catalogue: e.catalogue,
26
+ subjectRoute: e.subjectRoute ?? (() => null),
27
+ constraints: e.roleConstraints ?? [],
28
+ problems: e.problems ?? {},
29
+ scopes: e.scopes ?? null
30
+ }),
31
+ navigation: e.destination ? [{ destination: e.destination, to: a.roles, within: ["access.role", "access.roles.new"] }] : []
32
+ });
33
+ }
2
34
  export {
3
- a as BindingRow,
4
- c as PersonAccess,
5
- r as accessFeature,
6
- o as accessPages,
7
- u as accessPermissions,
8
- i as accessRoutes,
9
- n as dependantsClosure,
10
- l as permissionTree,
11
- t as personRolesSection,
12
- m as requiredClosure,
13
- p as roleProblems,
14
- R as useAccessLabels,
15
- b as useDescribeRefusal,
16
- d as useRefusalMessage
35
+ f as BindingRow,
36
+ R as PersonAccess,
37
+ u as accessFeature,
38
+ a as accessPages,
39
+ s as accessPermissions,
40
+ b as accessRoutes,
41
+ g as dependantsClosure,
42
+ x as permissionTree,
43
+ m as personRolesSection,
44
+ h as requiredClosure,
45
+ v as roleProblems,
46
+ y as useAccessLabels,
47
+ C as useDescribeRefusal,
48
+ K as useRefusalMessage
17
49
  };
@@ -38,7 +38,7 @@ export interface HttpClientOptions {
38
38
  /** A route that takes no input (`void`, or an empty object) needs no second argument. */
39
39
  type RequestArguments<In> = [In] extends [void] ? [input?: undefined, options?: RequestOptions] : [In] extends [Record<string, never>] ? [input?: In, options?: RequestOptions] : [input: In, options?: RequestOptions];
40
40
  /** A route declared `void` has no body: its data is `null`. */
41
- export type RouteResult<Out> = ApiResult<[Out] extends [void] ? null : Out>;
41
+ export type RouteResult<Out, Meta = unknown> = ApiResult<[Out] extends [void] ? null : Out, Meta>;
42
42
  export interface HttpClient {
43
43
  /**
44
44
  * Calls a declared route: `:name` segments of the path are filled from `input` (encoded), the rest of
@@ -46,7 +46,7 @@ export interface HttpClient {
46
46
  * parameter rejects with a plain `Error` (a bug in the caller, not an answer from the server) before
47
47
  * anything is sent. Abort, request ids and 401 handling are those of `get` and `post`.
48
48
  */
49
- request<In, Out>(route: ApiRoute<In, Out>, ...args: RequestArguments<In>): Promise<RouteResult<Out>>;
49
+ request<In, Out, Meta>(route: ApiRoute<In, Out, Meta>, ...args: RequestArguments<In>): Promise<RouteResult<Out, Meta>>;
50
50
  get<TData = unknown, TMeta = unknown>(path: string, options?: RequestOptions): Promise<ApiResult<TData, TMeta>>;
51
51
  post<TData = unknown, TMeta = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<ApiResult<TData, TMeta>>;
52
52
  put<TData = unknown, TMeta = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<ApiResult<TData, TMeta>>;
@@ -8,4 +8,4 @@ export type { ApiErrorInit, ApiErrorKind, FieldErrors } from "./error";
8
8
  export { fetchTransport } from "./transport";
9
9
  export type { Transport } from "./transport";
10
10
  export { route } from "./route";
11
- export type { HttpMethod, ListResult, RawRoute, ApiRoute, RouteOptions, ViewCount } from "./route";
11
+ export type { HttpMethod, ListResult, PageMeta, RawRoute, ApiRoute, RouteOptions, ViewCount } from "./route";
@@ -13,13 +13,18 @@ interface RouteBase {
13
13
  readonly permission?: string;
14
14
  readonly public: boolean;
15
15
  }
16
- /** A typed call: `In` is what `client.request` takes, `Out` what it resolves to (`void`: no body). */
17
- export interface ApiRoute<In, Out> extends RouteBase {
16
+ /**
17
+ * A typed call: `In` is what `client.request` takes, `Out` what it resolves to (`void`: no body), `Meta` the
18
+ * envelope's top-level `meta` (go-core `route.WithMeta` / `route.Page`). `Meta` defaults to `unknown`, not
19
+ * `never`: a route that declares none may still be answered with a meta, and `unknown` makes the caller narrow it.
20
+ */
21
+ export interface ApiRoute<In, Out, Meta = unknown> extends RouteBase {
18
22
  readonly raw: false;
19
23
  /** Type-only; never set. */
20
24
  readonly [types]?: {
21
25
  readonly in: In;
22
26
  readonly out: Out;
27
+ readonly meta: Meta;
23
28
  };
24
29
  }
25
30
  /** A route without a JSON answer (an event stream, a file): it keeps method and path for links, `client.request` refuses it. */
@@ -30,8 +35,9 @@ export interface RawRoute extends RouteBase {
30
35
  * Declares one endpoint. go-core's generator writes these; the types come from the Go input and response.
31
36
  *
32
37
  * route<ShowInput, Ticket>("GET", "/v1/tickets/:id", { permission: "tickets.ticket:view" })
38
+ * route<ListInput, Ticket[], PageMeta>("GET", "/v1/tickets") // a page: `result.meta` is a PageMeta
33
39
  */
34
- export declare function route<In, Out>(method: HttpMethod, path: string, options?: RouteOptions): ApiRoute<In, Out>;
40
+ export declare function route<In, Out, Meta = unknown>(method: HttpMethod, path: string, options?: RouteOptions): ApiRoute<In, Out, Meta>;
35
41
  export declare namespace route {
36
42
  var raw: (method: HttpMethod, path: string, options?: RouteOptions) => RawRoute;
37
43
  }
@@ -40,6 +46,19 @@ export interface ViewCount {
40
46
  readonly key: string;
41
47
  readonly count: number;
42
48
  }
49
+ /**
50
+ * The `meta` go-core's `web.PageMeta` writes next to a page of rows (`route.Page[T]`); other keys
51
+ * (lookups, totals) may sit beside these. `readListPage` reads an `ApiResult<Row[], PageMeta>` with no cast.
52
+ */
53
+ export type PageMeta = Readonly<Record<string, unknown>> & {
54
+ readonly total: number;
55
+ readonly page: number;
56
+ readonly per_page: number;
57
+ readonly last_page: number;
58
+ readonly from: number;
59
+ readonly to: number;
60
+ readonly views?: readonly ViewCount[];
61
+ };
43
62
  /**
44
63
  * The wire shape of go-core's `datatable.DatatableResult[T]`: a page of rows with its numbers.
45
64
  * `readListPage` (`/collection`) reads it into a `ListPage` with no glue.
@@ -1,4 +1,4 @@
1
- import type { ApiResult, HttpClient, ListResult, QueryValue } from "../client";
1
+ import type { ApiResult, HttpClient, ListResult, PageMeta, QueryValue } from "../client";
2
2
  import type { CollectionLoader, ListPage, CollectionQuery } from "./types";
3
3
  /**
4
4
  * The query parameters go-core's datatable reads: `page`, `per_page`, `order_col`, `order_dir`,
@@ -8,10 +8,11 @@ export declare function listParams(query: CollectionQuery): Record<string, Query
8
8
  /**
9
9
  * Reads a list answer into a `ListPage`. Understands go-core's envelope (`data` is the rows,
10
10
  * `meta` has `total`, `page`, `per_page`, `last_page`, `from`, `to`, and may carry `views` and lookups)
11
- * and the shape with the numbers next to `data` (`current_page`), which is `ListResult<Row>`: pass a typed
11
+ * and the shape with the numbers next to `data` (`current_page`), which is `ListResult<Row>`; a `route.Page` route answers `Row[]` with a `PageMeta`. Pass a typed
12
12
  * route's result (`client.request(route, input)`) and `Row` is inferred. Missing numbers are derived
13
13
  * from what is there rather than becoming 0; `query` supplies the page and size that were asked for.
14
14
  */
15
+ export declare function readListPage<Row>(result: ApiResult<readonly Row[], PageMeta>, query: Pick<CollectionQuery, "page" | "pageSize">): ListPage<Row>;
15
16
  export declare function readListPage<Row>(result: ApiResult<ListResult<Row>, unknown>, query: Pick<CollectionQuery, "page" | "pageSize">): ListPage<Row>;
16
17
  export declare function readListPage<Row>(result: ApiResult<unknown, unknown>, query: Pick<CollectionQuery, "page" | "pageSize">): ListPage<Row>;
17
18
  /**
@@ -1,8 +1,9 @@
1
- import { D as O, L as j, a as U, h as G, l as X, r as Z } from "../http-CdQowFlW.js";
2
- import { _ as H, a as J, u as K } from "../CollectionPage.vue_vue_type_script_setup_true_lang-o_Pj-JcD.js";
3
- import { u as W, a as Y } from "../neighbors-Bv6vnWlW.js";
4
- import { a as te, b as se } from "../rowLayout-BBFyLbOl.js";
5
- import { _ as ae } from "../DataTable.vue_vue_type_script_setup_true_lang-BEvz5zqo.js";
1
+ import { D as O, L as j, a as U } from "../state-BC1Fc6U2.js";
2
+ import { _ as X, a as Z, u as q } from "../CollectionPage.vue_vue_type_script_setup_true_lang-DPcCnrjr.js";
3
+ import { h as J, l as K, r as Q } from "../http-nz92KjdS.js";
4
+ import { u as Y, a as ee } from "../neighbors-DNZuGlQH.js";
5
+ import { a as se, b as oe } from "../rowLayout-BBFyLbOl.js";
6
+ import { _ as ne } from "../DataTable.vue_vue_type_script_setup_true_lang-BEvz5zqo.js";
6
7
  import { defineComponent as y, openBlock as c, createElementBlock as d, Fragment as h, renderList as v, createBlock as k, unref as f, withCtx as C, normalizeClass as m, createVNode as p, createCommentVNode as g, computed as w, toValue as E } from "vue";
7
8
  import { _ } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
8
9
  import { _ as S } from "../Tooltip.vue_vue_type_script_setup_true_lang-mErNPt8e.js";
@@ -91,22 +92,22 @@ function V(r, s) {
91
92
  }));
92
93
  }
93
94
  export {
94
- te as CollectionCell,
95
- H as CollectionPage,
96
- J as CollectionTable,
95
+ se as CollectionCell,
96
+ X as CollectionPage,
97
+ Z as CollectionTable,
97
98
  B as DATE_PRESETS,
98
99
  O as DEFAULT_PAGE_SIZES,
99
- ae as DataTable,
100
+ ne as DataTable,
100
101
  j as LIST_CONTEXT_PARAM,
101
- se as RecordIdentity,
102
+ oe as RecordIdentity,
102
103
  N as RowActions,
103
104
  $ as createMemorySavedViews,
104
105
  U as defineCollection,
105
- G as httpList,
106
- X as listParams,
107
- Z as readListPage,
108
- K as useCollection,
109
- W as useCollectionBack,
110
- Y as useCollectionNeighbors,
106
+ J as httpList,
107
+ K as listParams,
108
+ Q as readListPage,
109
+ q as useCollection,
110
+ Y as useCollectionBack,
111
+ ee as useCollectionNeighbors,
111
112
  V as useDatePresetFilter
112
113
  };