@wssto2/vue-core 0.5.4 → 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 (82) hide show
  1. package/CHANGELOG.md +23 -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/collection/index.js +17 -16
  41. package/dist/form/index.js +586 -611
  42. package/dist/http-nz92KjdS.js +42 -0
  43. package/dist/i18n/index.js +32 -32
  44. package/dist/identity/index.d.ts +7 -0
  45. package/dist/identity/index.js +19 -15
  46. package/dist/identity/serviceaccounts/ApiKeysPanel.vue.d.ts +17 -0
  47. package/dist/identity/serviceaccounts/CreatedApiKeyDialog.vue.d.ts +53 -0
  48. package/dist/identity/serviceaccounts/NewApiKeyDialog.vue.d.ts +24 -0
  49. package/dist/identity/serviceaccounts/ServiceAccountDialog.vue.d.ts +22 -0
  50. package/dist/identity/serviceaccounts/ServiceAccountRecord.vue.d.ts +2 -0
  51. package/dist/identity/serviceaccounts/ServiceAccountsList.vue.d.ts +2 -0
  52. package/dist/identity/serviceaccounts/access.d.ts +4 -0
  53. package/dist/identity/serviceaccounts/api.d.ts +27 -0
  54. package/dist/identity/serviceaccounts/context.d.ts +14 -0
  55. package/dist/identity/serviceaccounts/feature.d.ts +23 -0
  56. package/dist/identity/serviceaccounts/form.d.ts +4 -0
  57. package/dist/identity/serviceaccounts/messages.d.ts +11 -0
  58. package/dist/identity/serviceaccounts/routes.d.ts +22 -0
  59. package/dist/{index-Ok29ucE3.js → index-Cmj9iZmT.js} +191 -168
  60. package/dist/{index-C-oM_Mnf.js → index-DH0MoFqg.js} +2 -2
  61. package/dist/index.d.ts +1 -1
  62. package/dist/index.js +1 -1
  63. package/dist/internal/copyText.d.ts +5 -0
  64. package/dist/modules/serviceaccount/entities.d.ts +127 -0
  65. package/dist/modules/serviceaccount/routes.d.ts +58 -0
  66. package/dist/modules/serviceaccount/schemas.d.ts +49 -0
  67. package/dist/{neighbors-Bv6vnWlW.js → neighbors-DNZuGlQH.js} +1 -1
  68. package/dist/notifications/index.js +1 -1
  69. package/dist/{options-Bu0XbEpN.js → options-e_CAfvDQ.js} +3 -3
  70. package/dist/phone/index.js +1 -1
  71. package/dist/refusals-COPr15XZ.js +135 -0
  72. package/dist/routes-CVckt7Pj.js +19 -0
  73. package/dist/state-BC1Fc6U2.js +154 -0
  74. package/dist/{status-C78NpXyB.js → status-C8XtnK6m.js} +7 -6
  75. package/dist/styles.css +1 -1
  76. package/dist/{suggestions-ClyLexMO.js → suggestions-cPjs5gQz.js} +1 -1
  77. package/dist/{useCommand-DyuPTosF.js → useCommand-CfG727e8.js} +1 -1
  78. package/dist/{useGroupSheet-C2NyqWRp.js → useGroupSheet-BVcNDWbP.js} +2 -2
  79. package/dist/useRecordDialog-D65FF85F.js +30 -0
  80. package/package.json +2 -2
  81. package/dist/http-CdQowFlW.js +0 -194
  82. package/dist/index-BdGnA1Jh.js +0 -765
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** The version of @wssto2/vue-core (kept equal to package.json by index.test.ts). */
2
- export declare const version = "0.5.4";
2
+ export declare const version = "0.6.0";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const o = "0.5.4";
1
+ const o = "0.6.0";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Puts `text` on the clipboard and says whether it got there. The async clipboard needs a secure page; on any other (a local
3
+ * address over plain HTTP) the old selection-and-copy still works, so a secret that cannot be shown again is not lost for want of a button.
4
+ */
5
+ export declare function copyText(text: string): Promise<boolean>;
@@ -0,0 +1,127 @@
1
+ export type AccountTenant = {
2
+ id: number;
3
+ name: string;
4
+ };
5
+ export type ApiKey = {
6
+ id: number;
7
+ name: string;
8
+ prefix: string;
9
+ created_by: PersonRef;
10
+ created_at: string;
11
+ last_used_at: string | null;
12
+ expires_at: string | null;
13
+ revoked_at: string | null;
14
+ };
15
+ export type ApiKeyList = {
16
+ keys: ApiKey[];
17
+ };
18
+ export type BindableRoles = {
19
+ roles: Role[];
20
+ };
21
+ export type Binding = {
22
+ id: number;
23
+ role: RoleSummary;
24
+ scope: Scope;
25
+ created_by: BindingPersonRef | null;
26
+ created_at: string;
27
+ };
28
+ export type BindingPersonRef = {
29
+ id: number;
30
+ name: string;
31
+ };
32
+ export type Constraint = {
33
+ attribute: string;
34
+ values: string[];
35
+ };
36
+ export type CreatedApiKey = {
37
+ key: ApiKey;
38
+ secret: string;
39
+ };
40
+ export type EffectiveGrant = {
41
+ qualifier: string;
42
+ scope: Scope;
43
+ attrs: Constraint[];
44
+ binding_id: number;
45
+ role_key: string;
46
+ role_name: string;
47
+ };
48
+ export type EffectivePermission = {
49
+ permission: string;
50
+ grants: EffectiveGrant[];
51
+ unavailable: boolean;
52
+ };
53
+ export type Grant = {
54
+ permission: string;
55
+ qualifier: string;
56
+ };
57
+ export type PersonRef = {
58
+ id: number;
59
+ name: string;
60
+ };
61
+ export type Role = {
62
+ ref: string;
63
+ id: number | null;
64
+ key: string | null;
65
+ name: string;
66
+ description: string;
67
+ predefined: boolean;
68
+ computed: boolean;
69
+ attrs: Constraint[];
70
+ holders: number;
71
+ permission_count: number;
72
+ grants: Grant[];
73
+ };
74
+ export type RoleSummary = {
75
+ ref: string;
76
+ id: number | null;
77
+ key: string | null;
78
+ name: string;
79
+ description: string;
80
+ predefined: boolean;
81
+ computed: boolean;
82
+ attrs: Constraint[];
83
+ holders: number;
84
+ permission_count: number;
85
+ };
86
+ export type Scope = {
87
+ level: string;
88
+ id: number | null;
89
+ name: string | null;
90
+ };
91
+ export type ScopeOption = {
92
+ level: string;
93
+ id: number;
94
+ name: string;
95
+ parent_level: string;
96
+ parent_id: number | null;
97
+ };
98
+ export type ScopeOptions = {
99
+ root_level: string;
100
+ root: boolean;
101
+ places: ScopeOption[];
102
+ };
103
+ export type ServiceAccount = {
104
+ id: number;
105
+ name: string;
106
+ description: string;
107
+ tenant: AccountTenant | null;
108
+ owner: PersonRef;
109
+ created_by: PersonRef;
110
+ created_at: string;
111
+ active_keys: number;
112
+ last_used_at: string | null;
113
+ deactivated_at: string | null;
114
+ };
115
+ export type ServiceAccountList = {
116
+ service_accounts: ServiceAccount[];
117
+ };
118
+ export type SubjectAccess = {
119
+ subject: SubjectRef;
120
+ bindings: Binding[];
121
+ effective: EffectivePermission[];
122
+ can_manage: boolean;
123
+ };
124
+ export type SubjectRef = {
125
+ kind: string;
126
+ id: number;
127
+ };
@@ -0,0 +1,58 @@
1
+ import type { ApiKeyList, BindableRoles, Binding, CreatedApiKey, ScopeOptions, ServiceAccount, ServiceAccountList, SubjectAccess } from "./entities";
2
+ export declare const serviceaccountRoutes: {
3
+ readonly index: import("../../client").ApiRoute<void, ServiceAccountList, unknown>;
4
+ readonly show: import("../../client").ApiRoute<{
5
+ id: number;
6
+ }, ServiceAccount, unknown>;
7
+ readonly create: import("../../client").ApiRoute<{
8
+ name: string;
9
+ description: string;
10
+ owner_id: number;
11
+ tenant_id?: number | null | undefined;
12
+ }, ServiceAccount, unknown>;
13
+ readonly update: import("../../client").ApiRoute<{
14
+ name: string;
15
+ description: string;
16
+ owner_id: number;
17
+ tenant_id?: number | null | undefined;
18
+ } & {
19
+ id: number;
20
+ }, ServiceAccount, unknown>;
21
+ readonly deactivate: import("../../client").ApiRoute<{
22
+ id: number;
23
+ }, ServiceAccount, unknown>;
24
+ readonly keys: import("../../client").ApiRoute<{
25
+ id: number;
26
+ }, ApiKeyList, unknown>;
27
+ readonly createkey: import("../../client").ApiRoute<{
28
+ name: string;
29
+ expires_at?: string | null | undefined;
30
+ } & {
31
+ id: number;
32
+ }, CreatedApiKey, unknown>;
33
+ readonly revokekey: import("../../client").ApiRoute<{
34
+ keyID: number;
35
+ } & {
36
+ id: number;
37
+ }, void, unknown>;
38
+ readonly bindableroles: import("../../client").ApiRoute<{
39
+ level: string;
40
+ scope_id: number;
41
+ }, BindableRoles, unknown>;
42
+ readonly access: import("../../client").ApiRoute<{
43
+ id: number;
44
+ }, SubjectAccess, unknown>;
45
+ readonly scopes: import("../../client").ApiRoute<{
46
+ id: number;
47
+ }, ScopeOptions, unknown>;
48
+ readonly bind: import("../../client").ApiRoute<{
49
+ id: number;
50
+ role_ref: string;
51
+ level: string;
52
+ scope_id?: number | null | undefined;
53
+ }, Binding, unknown>;
54
+ readonly unbind: import("../../client").ApiRoute<{
55
+ id: number;
56
+ binding_id: number;
57
+ }, void, unknown>;
58
+ };
@@ -0,0 +1,49 @@
1
+ import { z } from 'zod';
2
+ export declare const AccountPathSchema: z.ZodObject<{
3
+ id: z.ZodNumber;
4
+ }, z.core.$strip>;
5
+ export type AccountPath = z.infer<typeof AccountPathSchema>;
6
+ export declare const BindInputSchema: z.ZodObject<{
7
+ id: z.ZodNumber;
8
+ role_ref: z.ZodString;
9
+ level: z.ZodString;
10
+ scope_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
11
+ }, z.core.$strip>;
12
+ export type BindInput = z.infer<typeof BindInputSchema>;
13
+ export declare const BindableInputSchema: z.ZodObject<{
14
+ level: z.ZodString;
15
+ scope_id: z.ZodNumber;
16
+ }, z.core.$strip>;
17
+ export type BindableInput = z.infer<typeof BindableInputSchema>;
18
+ export declare const KeyRequestSchema: z.ZodObject<{
19
+ name: z.ZodString;
20
+ expires_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
21
+ }, z.core.$strip>;
22
+ export type KeyRequest = z.infer<typeof KeyRequestSchema>;
23
+ export declare const RevokeRequestSchema: z.ZodObject<{
24
+ keyID: z.ZodNumber;
25
+ }, z.core.$strip>;
26
+ export type RevokeRequest = z.infer<typeof RevokeRequestSchema>;
27
+ export declare const SaveInputSchema: z.ZodObject<{
28
+ name: z.ZodString;
29
+ description: z.ZodString;
30
+ tenant_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
31
+ owner_id: z.ZodNumber;
32
+ }, z.core.$strip>;
33
+ export type SaveInput = z.infer<typeof SaveInputSchema>;
34
+ export declare const SubjectInputSchema: z.ZodObject<{
35
+ id: z.ZodNumber;
36
+ }, z.core.$strip>;
37
+ export type SubjectInput = z.infer<typeof SubjectInputSchema>;
38
+ export declare const UnbindInputSchema: z.ZodObject<{
39
+ id: z.ZodNumber;
40
+ binding_id: z.ZodNumber;
41
+ }, z.core.$strip>;
42
+ export type UnbindInput = z.infer<typeof UnbindInputSchema>;
43
+ export declare const UpdateRequestSchema: z.ZodObject<{
44
+ name: z.ZodString;
45
+ description: z.ZodString;
46
+ tenant_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
47
+ owner_id: z.ZodNumber;
48
+ }, z.core.$strip>;
49
+ export type UpdateRequest = z.infer<typeof UpdateRequestSchema>;
@@ -1,7 +1,7 @@
1
1
  import { computed as j, ref as z, shallowRef as I, watch as F, getCurrentScope as J, onScopeDispose as Q } from "vue";
2
2
  import { useRoute as O } from "vue-router";
3
3
  import { a as N } from "./error-Bb_dr_Ay.js";
4
- import { L as k, d as B, e as D, o as U, q as V } from "./http-CdQowFlW.js";
4
+ import { L as k, d as B, e as D, o as U, q as V } from "./state-BC1Fc6U2.js";
5
5
  function K(l, t, n, g) {
6
6
  return typeof t == "string" ? t : { ...t, query: { ...t.query, [n]: D(l, g) } };
7
7
  }
@@ -1,4 +1,4 @@
1
- import { d as s, e as a, n as o, b as i, c as n, f as u } from "../index-C-oM_Mnf.js";
1
+ import { d as s, e as a, n as o, b as i, c as n, f as u } from "../index-DH0MoFqg.js";
2
2
  export {
3
3
  s as deadLettersRoutes,
4
4
  a as eventsRoutes,
@@ -354,9 +354,9 @@ export {
354
354
  Te as _,
355
355
  N as a,
356
356
  X as b,
357
- je as c,
358
- I as d,
359
- te as e,
357
+ I as c,
358
+ te as d,
359
+ je as e,
360
360
  He as f,
361
361
  fe as g,
362
362
  Z as h,
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as fe, useModel as me, useTemplateRef as F, ref as E, computed as g, watch as ne, nextTick as A, openBlock as w, createElementBlock as $, createElementVNode as f, normalizeClass as P, unref as s, createVNode as M, toDisplayString as T, normalizeStyle as xe, Fragment as ee, renderList as le, createCommentVNode as J, withModifiers as we, withDirectives as _e, vModelText as ke, mergeModels as ae, inject as Ce, shallowRef as $e, onBeforeUnmount as De, createBlock as Me, mergeProps as Te, createSlots as Se, withCtx as ie, createTextVNode as Ne, renderSlot as Ie, mergeDefaults as Pe } from "vue";
2
2
  import { useI18n as pe } from "vue-i18n";
3
3
  import { b as Ve } from "../controlSurface-t7OEFESJ.js";
4
- import { d as se, a as Oe, c as Re, _ as Be, f as Ee, b as ze } from "../options-Bu0XbEpN.js";
4
+ import { c as se, a as Oe, e as Re, _ as Be, f as Ee, b as ze } from "../options-e_CAfvDQ.js";
5
5
  import { _ as q } from "../Icon.vue_vue_type_script_lang-D7oC-d-S.js";
6
6
  import { _ as ue } from "../CountryFlag.vue_vue_type_script_setup_true_lang-Kry_vPPZ.js";
7
7
  import { u as Fe } from "../anchored-DpuUwf-9.js";
@@ -0,0 +1,135 @@
1
+ import { hasInjectionContext as k, inject as $ } from "vue";
2
+ import { useI18n as v } from "vue-i18n";
3
+ import { i as w } from "./error-Bb_dr_Ay.js";
4
+ import { u as g } from "./describeError-BqGAUZgX.js";
5
+ import { d as h } from "./context-Ch1r4fdN.js";
6
+ const [j, O] = h("vue-core.access"), B = {
7
+ viewRoles: "iam.role:view",
8
+ manageRoles: "iam.role:manage",
9
+ deleteRoles: "iam.role:delete",
10
+ viewAccess: "iam.user:view",
11
+ manageBindings: "iam.user:manage",
12
+ /** The same for the roles of a service account (`kind: "service"`). */
13
+ manageServiceBindings: "iam.serviceaccount:manage"
14
+ }, u = "system", d = ["view", "create", "update", "manage", "delete"], p = (s) => {
15
+ const t = d.indexOf(s);
16
+ return t === -1 ? d.length : t;
17
+ }, b = (s) => s.system ? u : s.module, q = (s) => s.resource === "" ? s.module : `${s.module}_${s.resource.replace(/\./g, "_")}`;
18
+ function P(s) {
19
+ const t = /* @__PURE__ */ new Map();
20
+ for (const [r, o] of Object.entries(s)) {
21
+ const i = t.get(b(o)) ?? /* @__PURE__ */ new Map(), e = q(o);
22
+ i.set(e, [...i.get(e) ?? [], { ...o, id: r }]), t.set(b(o), i);
23
+ }
24
+ return [...t.keys()].sort((r, o) => +(r === u) - +(o === u) || r.localeCompare(o)).map((r) => ({
25
+ key: r,
26
+ screens: [...t.get(r) ?? []].map(([o, i]) => ({ key: o, permissions: i.sort((e, a) => p(e.verb) - p(a.verb) || e.verb.localeCompare(a.verb)) })).sort((o, i) => o.key.localeCompare(i.key))
27
+ }));
28
+ }
29
+ function R(s, t) {
30
+ const n = /* @__PURE__ */ new Set(), r = (o) => {
31
+ for (const i of s[o]?.requires ?? [])
32
+ n.has(i) || (n.add(i), r(i));
33
+ };
34
+ return r(t), [...n];
35
+ }
36
+ function L(s, t) {
37
+ const n = /* @__PURE__ */ new Set(), r = (o) => {
38
+ for (const [i, e] of Object.entries(s))
39
+ n.has(i) || !e.requires.includes(o) || (n.add(i), r(i));
40
+ };
41
+ return r(t), [...n];
42
+ }
43
+ function _(s, t, n) {
44
+ const r = Object.entries(s).filter(([i, e]) => e.ownable === n && i in t), o = r.find(([, i]) => i.verb === "view") ?? r[0];
45
+ return o ? t[o[0]] ?? null : null;
46
+ }
47
+ function C(s, t, n) {
48
+ for (const r of [n, ...R(s, n)]) {
49
+ if (r in t || !(r in s)) continue;
50
+ const o = s[r]?.ownable;
51
+ t[r] = o ? _(s, t, o) ?? "own" : "all";
52
+ }
53
+ }
54
+ function z(s, t, n) {
55
+ for (const r of [n, ...L(s, n)]) delete t[r];
56
+ }
57
+ function I(s, t, n, r) {
58
+ for (const [o, i] of Object.entries(s)) i.ownable === n && o in t && (t[o] = r);
59
+ }
60
+ function Q(s, t) {
61
+ const n = new Set(Object.keys(t));
62
+ for (const r of n) C(s, t, r);
63
+ return Object.keys(t).filter((r) => !n.has(r));
64
+ }
65
+ function K() {
66
+ const { t: s, te: t } = v(), { catalogue: n, constraints: r } = O(), o = (e, a) => {
67
+ const l = e.find((c) => t(c));
68
+ return l ? s(l) : a;
69
+ }, i = (e) => o([`access.levels.${e}`, `core.access.levels.${e}`], e);
70
+ return {
71
+ roleName: (e) => e.key ? o([`access.roles.${e.key}`], e.name) : e.name,
72
+ permissionLabel: (e) => o(n[e]?.labelKey ? [n[e].labelKey] : [], e),
73
+ permissionDescription: (e) => o(n[e]?.descriptionKey ? [n[e].descriptionKey] : [], ""),
74
+ groupLabel: (e) => o([`access.modules.${e}`, ...e === u ? ["core.access.system_group"] : []], e),
75
+ screenLabel: (e) => o([`access.resources.${e}`], e),
76
+ ownableLabel: (e) => o([`access.ownable.${e.replace(/\./g, "_")}`], e),
77
+ qualifierLabel: (e) => s(`core.access.qualifier.${e}`),
78
+ qualifierHint: (e) => s(`core.access.qualifier_hint.${e}`),
79
+ qualifierNoun: (e) => s(`core.access.qualifier_noun.${e}`),
80
+ levelLabel: i,
81
+ /** A place: the level and its name (`Dealer · Auto Zagreb`); the root, which has no name, by its level. */
82
+ scopeLabel: (e) => e.name ? `${i(e.level)} · ${e.name}` : i(e.level),
83
+ /** A role's constraint as the application worded it (`Used only`); an attribute or value it gave no text for stays as `attribute: value`. */
84
+ constraintLabel: (e) => {
85
+ const a = r.find((c) => c.attribute === e.attribute)?.options ?? [], l = e.values.map((c) => a.find((f) => f.value === c)?.labelKey);
86
+ return l.every((c) => c !== void 0 && t(c)) ? l.map((c) => s(c)).join(", ") : `${e.attribute}: ${e.values.join(", ")}`;
87
+ },
88
+ roleKind: (e) => s(`core.access.role_kind.${e.computed ? "computed" : e.predefined ? "predefined" : "custom"}`)
89
+ };
90
+ }
91
+ function S(s) {
92
+ if (!w(s) || s.code !== "authz.invalid") return [];
93
+ const t = s.params?.problems;
94
+ return Array.isArray(t) ? t.flatMap((n) => {
95
+ if (typeof n != "object" || n === null || typeof n.code != "string") return [];
96
+ const { code: r, permission: o, detail: i } = n;
97
+ return [{ code: r, ...typeof o == "string" ? { permission: o } : {}, ...typeof i == "string" ? { detail: i } : {} }];
98
+ }) : [];
99
+ }
100
+ function x() {
101
+ const { t: s, te: t } = v(), n = g(), r = k() ? $(j, null) : null, o = r ? K() : null;
102
+ return (i, e) => {
103
+ const a = S(i);
104
+ if (a.length === 0) return n(i, e);
105
+ const l = a.map((c) => {
106
+ const f = [r?.problems[c.code], `core.access.problems.${c.code}`].find((m) => m && t(m)), y = { code: c.code, permission: c.permission ? o?.permissionLabel(c.permission) ?? c.permission : "", detail: c.detail ?? "" };
107
+ return s(f ?? "core.access.problems.unknown", y);
108
+ });
109
+ return [...new Set(l)].join(" ");
110
+ };
111
+ }
112
+ function T() {
113
+ const s = x();
114
+ return (t, n) => w(n) && n.code?.startsWith("authz.") ? s(n) : void 0;
115
+ }
116
+ export {
117
+ u as S,
118
+ B as a,
119
+ j as b,
120
+ S as c,
121
+ L as d,
122
+ x as e,
123
+ T as f,
124
+ O as g,
125
+ z as h,
126
+ C as i,
127
+ b as j,
128
+ Q as k,
129
+ q as l,
130
+ _ as o,
131
+ P as p,
132
+ R as r,
133
+ I as s,
134
+ K as u
135
+ };
@@ -0,0 +1,19 @@
1
+ import { route as e } from "./client/index.js";
2
+ const c = {
3
+ index: e("GET", "/v1/iam/service-accounts", { permission: "iam.serviceaccount:view" }),
4
+ show: e("GET", "/v1/iam/service-accounts/:id", { permission: "iam.serviceaccount:view" }),
5
+ create: e("POST", "/v1/iam/service-accounts", { permission: "iam.serviceaccount:manage" }),
6
+ update: e("PUT", "/v1/iam/service-accounts/:id", { permission: "iam.serviceaccount:manage" }),
7
+ deactivate: e("POST", "/v1/iam/service-accounts/:id/deactivate", { permission: "iam.serviceaccount:manage" }),
8
+ keys: e("GET", "/v1/iam/service-accounts/:id/keys", { permission: "iam.serviceaccount:view" }),
9
+ createkey: e("POST", "/v1/iam/service-accounts/:id/keys", { permission: "iam.serviceaccount:manage" }),
10
+ revokekey: e("POST", "/v1/iam/service-accounts/:id/keys/:keyID/revoke", { permission: "iam.serviceaccount:revoke" }),
11
+ bindableroles: e("GET", "/v1/iam/service-accounts/bindable-roles", { permission: "iam.serviceaccount:manage" }),
12
+ access: e("GET", "/v1/iam/service-accounts/:id/access", { permission: "iam.serviceaccount:view" }),
13
+ scopes: e("GET", "/v1/iam/service-accounts/:id/scopes", { permission: "iam.serviceaccount:manage" }),
14
+ bind: e("POST", "/v1/iam/service-accounts/:id/bindings", { permission: "iam.serviceaccount:manage" }),
15
+ unbind: e("DELETE", "/v1/iam/service-accounts/:id/bindings/:binding_id", { permission: "iam.serviceaccount:manage" })
16
+ };
17
+ export {
18
+ c as s
19
+ };
@@ -0,0 +1,154 @@
1
+ import { hasInjectionContext as $, inject as z, watch as O } from "vue";
2
+ import { g as j } from "./platform-Dx6STiwY.js";
3
+ const A = [5, 8, 10, 15, 25, 50, 100], v = 25;
4
+ function M(e) {
5
+ const t = `defineCollection("${e.id}")`;
6
+ if (typeof e.id != "string" || e.id.trim() === "") throw new Error("defineCollection: `id` must be a non-empty string.");
7
+ if (!Number.isInteger(e.stateVersion) || e.stateVersion < 1) throw new Error(`${t}: \`stateVersion\` must be a positive integer.`);
8
+ if (typeof e.load != "function") throw new Error(`${t}: \`load\` must be a function.`);
9
+ if (typeof e.key != "function") throw new Error(`${t}: \`key\` must be a function.`);
10
+ const s = {
11
+ sorts: e.query?.sorts ? [...e.query.sorts] : null,
12
+ filters: e.query?.filters ? [...e.query.filters] : null,
13
+ views: e.query?.views ? [...e.query.views] : null,
14
+ sensitive: [...e.query?.sensitive ?? []],
15
+ pageSizes: [...e.query?.pageSizes ?? A],
16
+ search: e.query?.search ?? !0
17
+ };
18
+ if (s.pageSizes.length === 0 || s.pageSizes.some((n) => !Number.isInteger(n) || n < 1))
19
+ throw new Error(`${t}: \`query.pageSizes\` must list positive integers.`);
20
+ for (const n of s.sensitive)
21
+ if (s.filters && !s.filters.includes(n)) throw new Error(`${t}: sensitive filter "${n}" is not in \`query.filters\`.`);
22
+ const r = e.defaults ?? {}, o = r.pageSize ?? (s.pageSizes.includes(v) ? v : s.pageSizes[0]);
23
+ if (!s.pageSizes.includes(o)) throw new Error(`${t}: default page size ${o} is not one of ${s.pageSizes.join(", ")}.`);
24
+ const c = r.sort ?? null;
25
+ if (c !== null && s.sorts && !s.sorts.includes(c)) throw new Error(`${t}: default sort "${c}" is not in \`query.sorts\`.`);
26
+ const i = r.view ?? null;
27
+ if (i !== null && s.views && !s.views.includes(i)) throw new Error(`${t}: default view "${i}" is not in \`query.views\`.`);
28
+ const f = Object.fromEntries(Object.entries(r.filters ?? {}).filter(([, n]) => n !== void 0 && n !== ""));
29
+ for (const n of Object.keys(f))
30
+ if (s.filters && !s.filters.includes(n)) throw new Error(`${t}: default filter "${n}" is not in \`query.filters\`.`);
31
+ const l = r.page ?? 1;
32
+ if (!Number.isInteger(l) || l < 1) throw new Error(`${t}: default page must be a positive integer.`);
33
+ const a = r.direction ?? "asc";
34
+ if (a !== "asc" && a !== "desc") throw new Error(`${t}: default direction must be "asc" or "desc".`);
35
+ return Object.freeze({
36
+ id: e.id,
37
+ stateVersion: e.stateVersion,
38
+ load: e.load,
39
+ key: e.key,
40
+ defaults: Object.freeze({
41
+ page: l,
42
+ pageSize: o,
43
+ sort: c,
44
+ direction: a,
45
+ search: r.search ?? "",
46
+ view: i,
47
+ filters: Object.freeze(f)
48
+ }),
49
+ contract: Object.freeze(s),
50
+ migrate: e.migrate
51
+ });
52
+ }
53
+ const U = "from";
54
+ function X(e, t) {
55
+ if (typeof e == "string") {
56
+ const s = new URLSearchParams(t).toString(), r = e.indexOf("#"), o = r === -1 ? e : e.slice(0, r);
57
+ return `${o}${o.includes("?") ? "&" : "?"}${s}${r === -1 ? "" : e.slice(r)}`;
58
+ }
59
+ return { ...e, query: { ...e.query, ...t } };
60
+ }
61
+ function P(e) {
62
+ if (!$()) return;
63
+ const t = z(j, null);
64
+ t && O(
65
+ () => {
66
+ const s = t.session.state.value;
67
+ return s.status === "authenticated" ? s.user.id : null;
68
+ },
69
+ e,
70
+ { flush: "sync" }
71
+ );
72
+ }
73
+ const I = 4096, T = 200, _ = 32, k = 1e6, b = /^[A-Za-z0-9_.-]{1,64}$/;
74
+ function C(e) {
75
+ let t = "";
76
+ for (const s of new TextEncoder().encode(e)) t += String.fromCharCode(s);
77
+ return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
78
+ }
79
+ function N(e) {
80
+ const t = e.replace(/-/g, "+").replace(/_/g, "/"), s = atob(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
81
+ return new TextDecoder("utf-8", { fatal: !0 }).decode(Uint8Array.from(s, (r) => r.charCodeAt(0)));
82
+ }
83
+ const m = (e) => typeof e == "object" && e !== null && !Array.isArray(e);
84
+ function h(e, t = T) {
85
+ return typeof e == "string" && e.length <= t ? e : null;
86
+ }
87
+ function d(e, t, s) {
88
+ const { contract: r } = e, o = s ?? e.defaults, c = typeof t.p == "number" && Number.isInteger(t.p) && t.p >= 1 && t.p <= k ? t.p : o.page, i = typeof t.l == "number" && r.pageSizes.includes(t.l) ? t.l : o.pageSize;
89
+ let f = o.sort;
90
+ const l = h(t.c, 64);
91
+ l !== null && (r.sorts ? r.sorts.includes(l) : b.test(l)) && (f = l);
92
+ const a = t.d === "asc" || t.d === "desc" ? t.d : o.direction, n = h(t.s) ?? o.search;
93
+ let p = o.view;
94
+ const u = h(t.w, 64);
95
+ t.w === "" ? p = null : u !== null && (r.views ? r.views.includes(u) : b.test(u)) && (p = u);
96
+ const S = m(t.f) ? {} : { ...o.filters };
97
+ if (m(t.f)) {
98
+ let E = 0;
99
+ for (const [g, w] of Object.entries(t.f)) {
100
+ if (++E > _) break;
101
+ if (!(r.filters ? r.filters.includes(g) : b.test(g)) || r.sensitive.includes(g)) continue;
102
+ const y = typeof w == "number" || typeof w == "boolean" ? String(w) : h(w);
103
+ y !== null && y !== "" && (S[g] = y);
104
+ }
105
+ }
106
+ return { page: c, pageSize: i, sort: f, direction: a, search: n, view: p, filters: S };
107
+ }
108
+ function R(e, t, s) {
109
+ const r = { v: e.stateVersion, p: t.page, l: t.pageSize };
110
+ t.sort && (r.c = t.sort), r.d = t.direction, (t.search || s && e.defaults.search !== s.search) && (r.s = t.search), (t.view || s && e.defaults.view !== s.view) && (r.w = t.view ?? "");
111
+ const o = Object.fromEntries(
112
+ Object.entries(t.filters).filter(([c, i]) => i !== void 0 && i !== "" && !e.contract.sensitive.includes(c))
113
+ );
114
+ return (Object.keys(o).length > 0 || Object.keys(e.defaults.filters).length > 0 || Object.keys(s?.filters ?? {}).length > 0) && (r.f = o), C(JSON.stringify(r));
115
+ }
116
+ function V(e, t, s) {
117
+ const r = t.v === void 0 ? e.stateVersion : t.v;
118
+ if (typeof r != "number" || !Number.isInteger(r)) return null;
119
+ if (r === e.stateVersion) return d(e, t, s);
120
+ const o = e.migrate?.(t, r);
121
+ return o ? d(e, o, s) : null;
122
+ }
123
+ function q(e, t, s) {
124
+ if (typeof t != "string" || t === "" || t.length > I) return null;
125
+ let r;
126
+ try {
127
+ r = JSON.parse(N(t));
128
+ } catch {
129
+ return null;
130
+ }
131
+ return m(r) ? V(e, r, s) : null;
132
+ }
133
+ function F(e) {
134
+ return JSON.stringify([
135
+ e.page,
136
+ e.pageSize,
137
+ e.sort,
138
+ e.direction,
139
+ e.search,
140
+ e.view,
141
+ Object.entries(e.filters).sort(([t], [s]) => t.localeCompare(s))
142
+ ]);
143
+ }
144
+ export {
145
+ A as D,
146
+ U as L,
147
+ M as a,
148
+ q as d,
149
+ R as e,
150
+ P as o,
151
+ F as q,
152
+ V as r,
153
+ X as w
154
+ };
@@ -1,7 +1,8 @@
1
- import { a, r as o } from "./http-CdQowFlW.js";
2
- import { i as r } from "./index-Ok29ucE3.js";
1
+ import { a } from "./state-BC1Fc6U2.js";
2
+ import { r as o } from "./http-nz92KjdS.js";
3
+ import { i as r } from "./index-Cmj9iZmT.js";
3
4
  const n = ["active", "locked", "inactive", "all"];
4
- function l(i) {
5
+ function v(i) {
5
6
  return a({
6
7
  id: "identity.users",
7
8
  stateVersion: 1,
@@ -25,9 +26,9 @@ function l(i) {
25
26
  defaults: { sort: "name", direction: "asc", view: "active" }
26
27
  });
27
28
  }
28
- const v = (i) => i === "locked" ? "critical" : i === "inactive" ? "neutral" : "positive";
29
+ const p = (i) => i === "locked" ? "critical" : i === "inactive" ? "neutral" : "positive";
29
30
  export {
30
31
  n as U,
31
- v as s,
32
- l as u
32
+ p as s,
33
+ v as u
33
34
  };