@owlmeans/viable-common 0.0.45 → 0.0.47

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 (180) hide show
  1. package/README.md +163 -13
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/agent-presentation/SKILL.md +1 -1
  4. package/agent-meta/skills/viable-common/SKILL.md +132 -23
  5. package/build/connect/account/types.d.ts +81 -0
  6. package/build/connect/account/types.d.ts.map +1 -0
  7. package/build/connect/account/types.js +2 -0
  8. package/build/connect/account/types.js.map +1 -0
  9. package/build/connect/branding/types.d.ts +26 -4
  10. package/build/connect/branding/types.d.ts.map +1 -1
  11. package/build/connect/call/types.d.ts +28 -0
  12. package/build/connect/call/types.d.ts.map +1 -0
  13. package/build/connect/call/types.js +2 -0
  14. package/build/connect/call/types.js.map +1 -0
  15. package/build/connect/config/types.d.ts +45 -0
  16. package/build/connect/config/types.d.ts.map +1 -0
  17. package/build/connect/config/types.js +2 -0
  18. package/build/connect/config/types.js.map +1 -0
  19. package/build/connect/consts.d.ts +383 -1
  20. package/build/connect/consts.d.ts.map +1 -1
  21. package/build/connect/consts.js +387 -1
  22. package/build/connect/consts.js.map +1 -1
  23. package/build/connect/conversion/types.d.ts +24 -0
  24. package/build/connect/conversion/types.d.ts.map +1 -1
  25. package/build/connect/entrypoints/types.d.ts +22 -13
  26. package/build/connect/entrypoints/types.d.ts.map +1 -1
  27. package/build/connect/entrypoints.d.ts +441 -8
  28. package/build/connect/entrypoints.d.ts.map +1 -1
  29. package/build/connect/entrypoints.js +292 -9
  30. package/build/connect/entrypoints.js.map +1 -1
  31. package/build/connect/errors.d.ts +12 -0
  32. package/build/connect/errors.d.ts.map +1 -1
  33. package/build/connect/errors.js +16 -0
  34. package/build/connect/errors.js.map +1 -1
  35. package/build/connect/feed/types.d.ts +71 -0
  36. package/build/connect/feed/types.d.ts.map +1 -0
  37. package/build/connect/feed/types.js +2 -0
  38. package/build/connect/feed/types.js.map +1 -0
  39. package/build/connect/files/types.d.ts +34 -0
  40. package/build/connect/files/types.d.ts.map +1 -0
  41. package/build/connect/files/types.js +2 -0
  42. package/build/connect/files/types.js.map +1 -0
  43. package/build/connect/git/types.d.ts +170 -0
  44. package/build/connect/git/types.d.ts.map +1 -0
  45. package/build/connect/git/types.js +14 -0
  46. package/build/connect/git/types.js.map +1 -0
  47. package/build/connect/iam/types.d.ts +25 -0
  48. package/build/connect/iam/types.d.ts.map +1 -0
  49. package/build/connect/iam/types.js +8 -0
  50. package/build/connect/iam/types.js.map +1 -0
  51. package/build/connect/index.d.ts +9 -0
  52. package/build/connect/index.d.ts.map +1 -1
  53. package/build/connect/ops.d.ts +189 -0
  54. package/build/connect/ops.d.ts.map +1 -0
  55. package/build/connect/ops.js +2 -0
  56. package/build/connect/ops.js.map +1 -0
  57. package/build/connect/production/types.d.ts +65 -0
  58. package/build/connect/production/types.d.ts.map +1 -0
  59. package/build/connect/production/types.js +2 -0
  60. package/build/connect/production/types.js.map +1 -0
  61. package/build/connect/project/types.d.ts +23 -16
  62. package/build/connect/project/types.d.ts.map +1 -1
  63. package/build/connect/references/types.d.ts +424 -2
  64. package/build/connect/references/types.d.ts.map +1 -1
  65. package/build/connect/references.d.ts.map +1 -1
  66. package/build/connect/references.js +122 -0
  67. package/build/connect/references.js.map +1 -1
  68. package/build/connect/schemas.d.ts +65 -2
  69. package/build/connect/schemas.d.ts.map +1 -1
  70. package/build/connect/schemas.js +306 -1
  71. package/build/connect/schemas.js.map +1 -1
  72. package/build/connect/settings/types.d.ts +0 -25
  73. package/build/connect/settings/types.d.ts.map +1 -1
  74. package/build/connect/slot/types.d.ts +24 -0
  75. package/build/connect/slot/types.d.ts.map +1 -0
  76. package/build/connect/slot/types.js +2 -0
  77. package/build/connect/slot/types.js.map +1 -0
  78. package/build/connect/types.d.ts +453 -0
  79. package/build/connect/types.d.ts.map +1 -0
  80. package/build/connect/types.js +2 -0
  81. package/build/connect/types.js.map +1 -0
  82. package/build/convert/record/types.d.ts +0 -9
  83. package/build/convert/record/types.d.ts.map +1 -1
  84. package/build/convert/schemas.d.ts +2 -5
  85. package/build/convert/schemas.d.ts.map +1 -1
  86. package/build/convert/schemas.js +2 -15
  87. package/build/convert/schemas.js.map +1 -1
  88. package/build/iam-console/consts.d.ts +13 -0
  89. package/build/iam-console/consts.d.ts.map +1 -0
  90. package/build/iam-console/consts.js +13 -0
  91. package/build/iam-console/consts.js.map +1 -0
  92. package/build/iam-console/consts.local.d.ts +123 -0
  93. package/build/iam-console/consts.local.d.ts.map +1 -0
  94. package/build/iam-console/consts.local.js +50 -0
  95. package/build/iam-console/consts.local.js.map +1 -0
  96. package/build/iam-console/index.d.ts +4 -0
  97. package/build/iam-console/index.d.ts.map +1 -0
  98. package/build/iam-console/index.js +3 -0
  99. package/build/iam-console/index.js.map +1 -0
  100. package/build/iam-console/schemas.d.ts +38 -0
  101. package/build/iam-console/schemas.d.ts.map +1 -0
  102. package/build/iam-console/schemas.js +217 -0
  103. package/build/iam-console/schemas.js.map +1 -0
  104. package/build/iam-console/types.d.ts +140 -0
  105. package/build/iam-console/types.d.ts.map +1 -0
  106. package/build/iam-console/types.js +2 -0
  107. package/build/iam-console/types.js.map +1 -0
  108. package/build/index.d.ts +2 -0
  109. package/build/index.d.ts.map +1 -1
  110. package/build/index.js +2 -0
  111. package/build/index.js.map +1 -1
  112. package/build/intent/flow.d.ts +17 -0
  113. package/build/intent/flow.d.ts.map +1 -0
  114. package/build/intent/flow.js +65 -0
  115. package/build/intent/flow.js.map +1 -0
  116. package/build/legal/consts.d.ts +67 -0
  117. package/build/legal/consts.d.ts.map +1 -0
  118. package/build/legal/consts.js +24 -0
  119. package/build/legal/consts.js.map +1 -0
  120. package/build/legal/index.d.ts +3 -0
  121. package/build/legal/index.d.ts.map +1 -0
  122. package/build/legal/index.js +2 -0
  123. package/build/legal/index.js.map +1 -0
  124. package/build/legal/types.d.ts +17 -0
  125. package/build/legal/types.d.ts.map +1 -0
  126. package/build/legal/types.js +2 -0
  127. package/build/legal/types.js.map +1 -0
  128. package/build/planning/flows.d.ts +34 -0
  129. package/build/planning/flows.d.ts.map +1 -0
  130. package/build/planning/flows.js +174 -0
  131. package/build/planning/flows.js.map +1 -0
  132. package/build/planning/schemas.d.ts.map +1 -1
  133. package/build/planning/schemas.js +0 -1
  134. package/build/planning/schemas.js.map +1 -1
  135. package/build/planning/types.d.ts +0 -2
  136. package/build/planning/types.d.ts.map +1 -1
  137. package/build/skills/roles.d.ts +43 -0
  138. package/build/skills/roles.d.ts.map +1 -0
  139. package/build/skills/roles.js +44 -0
  140. package/build/skills/roles.js.map +1 -0
  141. package/package.json +19 -3
  142. package/src/connect/account/types.ts +91 -0
  143. package/src/connect/branding/types.ts +28 -4
  144. package/src/connect/call/types.ts +31 -0
  145. package/src/connect/config/types.ts +51 -0
  146. package/src/connect/consts.ts +400 -1
  147. package/src/connect/conversion/types.ts +25 -0
  148. package/src/connect/entrypoints/types.ts +22 -7
  149. package/src/connect/entrypoints.ts +592 -15
  150. package/src/connect/errors.ts +18 -0
  151. package/src/connect/feed/types.ts +76 -0
  152. package/src/connect/files/types.ts +38 -0
  153. package/src/connect/git/types.ts +187 -0
  154. package/src/connect/iam/types.ts +28 -0
  155. package/src/connect/index.ts +9 -0
  156. package/src/connect/production/types.ts +71 -0
  157. package/src/connect/project/types.ts +25 -12
  158. package/src/connect/references/types.ts +166 -5
  159. package/src/connect/references.ts +210 -5
  160. package/src/connect/schemas.ts +366 -5
  161. package/src/connect/settings/types.ts +0 -25
  162. package/src/connect/slot/types.ts +24 -0
  163. package/src/convert/record/types.ts +0 -11
  164. package/src/convert/schemas.ts +3 -19
  165. package/src/iam-console/consts.local.ts +64 -0
  166. package/src/iam-console/consts.ts +15 -0
  167. package/src/iam-console/index.ts +3 -0
  168. package/src/iam-console/schemas.ts +251 -0
  169. package/src/iam-console/types.ts +165 -0
  170. package/src/index.ts +2 -0
  171. package/src/legal/consts.ts +25 -0
  172. package/src/legal/index.ts +2 -0
  173. package/src/legal/types.ts +22 -0
  174. package/src/planning/schemas.ts +0 -1
  175. package/src/planning/types.ts +0 -2
  176. package/tests/connect-convert.spec.ts +6 -2
  177. package/tests/connect-entrypoints.spec.ts +554 -16
  178. package/tests/error-status.spec.ts +2 -1
  179. package/tests/iam-console.spec.ts +89 -0
  180. package/tests/planning.spec.ts +8 -0
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The marker an IAM refusal of an owner-console change carries, stored or thrown — the platform's
3
+ * `IamRefused` (409) writes `iam-refused:<the IAM's own marker>`, and every reader (the browser, the
4
+ * connector's tools) phrases the refusal from it.
5
+ */
6
+ export declare const IAM_REFUSED = "iam-refused";
7
+ /**
8
+ * The IAM vocabulary a consumer of the owner console contract needs, re-exported: the contract is
9
+ * what every runtime imports, and a web app or a connector has no `@owlmeans/iam` dependency of its
10
+ * own — reaching the enums through hoisting works only by accident of the install layout.
11
+ */
12
+ export { IamDefaultClass, IamGrantMode, IamGrantOrigin, IamRemovalPolicy, IAM_AREAS, IAM_MEMBERS_GROUP, } from '@owlmeans/iam';
13
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/iam-console/consts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,WAAW,gBAAgB,CAAA;AAExC;;;;GAIG;AACH,OAAO,EACL,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,GAC9F,MAAM,eAAe,CAAA"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * The marker an IAM refusal of an owner-console change carries, stored or thrown — the platform's
3
+ * `IamRefused` (409) writes `iam-refused:<the IAM's own marker>`, and every reader (the browser, the
4
+ * connector's tools) phrases the refusal from it.
5
+ */
6
+ export const IAM_REFUSED = 'iam-refused';
7
+ /**
8
+ * The IAM vocabulary a consumer of the owner console contract needs, re-exported: the contract is
9
+ * what every runtime imports, and a web app or a connector has no `@owlmeans/iam` dependency of its
10
+ * own — reaching the enums through hoisting works only by accident of the install layout.
11
+ */
12
+ export { IamDefaultClass, IamGrantMode, IamGrantOrigin, IamRemovalPolicy, IAM_AREAS, IAM_MEMBERS_GROUP, } from '@owlmeans/iam';
13
+ //# sourceMappingURL=consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/iam-console/consts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAA;AAExC;;;;GAIG;AACH,OAAO,EACL,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,SAAS,EAAE,iBAAiB,GAC9F,MAAM,eAAe,CAAA"}
@@ -0,0 +1,123 @@
1
+ import { IamGrantMode } from '@owlmeans/iam';
2
+ import { WorkloadKind } from '../slot/consts.js';
3
+ export declare const PermissionNameSchema: {
4
+ readonly type: 'string';
5
+ readonly minLength: 1;
6
+ readonly maxLength: 128;
7
+ };
8
+ export declare const ResourceIdSchema: {
9
+ readonly type: 'string';
10
+ readonly minLength: 1;
11
+ readonly maxLength: 128;
12
+ };
13
+ export declare const ProfileIdSchema: {
14
+ readonly type: 'string';
15
+ readonly minLength: 1;
16
+ readonly maxLength: 256;
17
+ readonly pattern: '^[^/\\s]+$';
18
+ };
19
+ export declare const EntitySlugSchema: {
20
+ readonly type: 'string';
21
+ readonly minLength: 1;
22
+ readonly maxLength: 63;
23
+ readonly pattern: string;
24
+ };
25
+ export declare const EmailSchema: {
26
+ readonly type: 'string';
27
+ readonly minLength: 3;
28
+ readonly maxLength: 254;
29
+ };
30
+ export declare const RoleSchema: {
31
+ readonly type: 'string';
32
+ readonly minLength: 1;
33
+ readonly maxLength: 32;
34
+ };
35
+ export declare const NameSchema: {
36
+ readonly type: 'string';
37
+ readonly minLength: 1;
38
+ readonly maxLength: 128;
39
+ };
40
+ export declare const TitleSchema: {
41
+ readonly type: 'string';
42
+ readonly minLength: 1;
43
+ readonly maxLength: 256;
44
+ };
45
+ export declare const ProfileIdsSchema: {
46
+ readonly type: 'array';
47
+ readonly items: {
48
+ readonly type: 'string';
49
+ readonly minLength: 1;
50
+ readonly maxLength: 256;
51
+ readonly pattern: '^[^/\\s]+$';
52
+ };
53
+ readonly minItems: 1;
54
+ readonly maxItems: 256;
55
+ };
56
+ export declare const ScopeProp: {
57
+ readonly type: 'string';
58
+ readonly enum: readonly [...WorkloadKind[], null];
59
+ readonly nullable: true;
60
+ };
61
+ export declare const ModeProp: {
62
+ readonly type: 'string';
63
+ readonly enum: readonly [...IamGrantMode[], null];
64
+ readonly nullable: true;
65
+ };
66
+ export declare const ProjectIdProp: {
67
+ readonly projectId: import("ajv").JSONSchemaType<string>;
68
+ };
69
+ export declare const GroupKeySchema: {
70
+ type: 'string';
71
+ minLength: number;
72
+ maxLength: number;
73
+ pattern: string;
74
+ };
75
+ export declare const GroupBundleSchema: {
76
+ readonly type: 'object';
77
+ readonly properties: {
78
+ readonly filter: {
79
+ readonly type: 'object';
80
+ readonly properties: {
81
+ readonly areas: {
82
+ readonly type: 'array';
83
+ readonly items: {
84
+ readonly type: 'string';
85
+ readonly minLength: 1;
86
+ readonly maxLength: 64;
87
+ readonly nullable: true;
88
+ };
89
+ readonly maxItems: 16;
90
+ readonly nullable: true;
91
+ };
92
+ readonly managed: {
93
+ readonly type: 'boolean';
94
+ readonly nullable: true;
95
+ };
96
+ readonly resourceScoped: {
97
+ readonly type: 'boolean';
98
+ readonly nullable: true;
99
+ };
100
+ readonly entityScoped: {
101
+ readonly type: 'boolean';
102
+ readonly nullable: true;
103
+ };
104
+ };
105
+ readonly required: readonly [];
106
+ readonly additionalProperties: false;
107
+ readonly nullable: true;
108
+ };
109
+ readonly permissions: {
110
+ readonly type: 'array';
111
+ readonly items: {
112
+ readonly type: 'string';
113
+ readonly minLength: 1;
114
+ readonly maxLength: 128;
115
+ };
116
+ readonly maxItems: 256;
117
+ readonly nullable: true;
118
+ };
119
+ };
120
+ readonly required: readonly [];
121
+ readonly additionalProperties: false;
122
+ };
123
+ //# sourceMappingURL=consts.local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../../src/iam-console/consts.local.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAIhD,eAAO,MAAM,oBAAoB;aAAK,IAAI,EAAE,QAAQ;aAAE,SAAS,EAAE,CAAC;aAAE,SAAS,EAAE,GAAG;CAAW,CAAA;AAE7F,eAAO,MAAM,gBAAgB;aAAK,IAAI,EAAE,QAAQ;aAAE,SAAS,EAAE,CAAC;aAAE,SAAS,EAAE,GAAG;CAAW,CAAA;AAIzF,eAAO,MAAM,eAAe;aAAK,IAAI,EAAE,QAAQ;aAAE,SAAS,EAAE,CAAC;aAAE,SAAS,EAAE,GAAG;aAAE,OAAO,EAAE,YAAY;CAAW,CAAA;AAG/G,eAAO,MAAM,gBAAgB;aAAK,IAAI,EAAE,QAAQ;aAAE,SAAS,EAAE,CAAC;aAAE,SAAS,EAAE,EAAE;aAAE,OAAO;CAAuC,CAAA;AAE7H,eAAO,MAAM,WAAW;aAAK,IAAI,EAAE,QAAQ;aAAE,SAAS,EAAE,CAAC;aAAE,SAAS,EAAE,GAAG;CAAW,CAAA;AAEpF,eAAO,MAAM,UAAU;aAAK,IAAI,EAAE,QAAQ;aAAE,SAAS,EAAE,CAAC;aAAE,SAAS,EAAE,EAAE;CAAW,CAAA;AAElF,eAAO,MAAM,UAAU;aAAK,IAAI,EAAE,QAAQ;aAAE,SAAS,EAAE,CAAC;aAAE,SAAS,EAAE,GAAG;CAAW,CAAA;AAEnF,eAAO,MAAM,WAAW;aAAK,IAAI,EAAE,QAAQ;aAAE,SAAS,EAAE,CAAC;aAAE,SAAS,EAAE,GAAG;CAAW,CAAA;AAEpF,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,QAAQ;aACR,oBAAoB;CACZ,CAAA"}
@@ -0,0 +1,50 @@
1
+ import { IdValueSchema, GroupValueSchema } from '@owlmeans/auth';
2
+ import { ENTITY_SLUG_PATTERN } from '@owlmeans/auth-common';
3
+ import { IamGrantMode } from '@owlmeans/iam';
4
+ import { WorkloadKind } from '../slot/consts.js';
5
+ // Canonical permission name (e.g. "department--modify" or bare "department") — IAM-specific,
6
+ // deliberately not reusing the auth ScopeValueSchema (maxLength 32) / ResourceValueSchema (minLength 8).
7
+ export const PermissionNameSchema = { type: 'string', minLength: 1, maxLength: 128 };
8
+ export const ResourceIdSchema = { type: 'string', minLength: 1, maxLength: 128 };
9
+ // The pairwise subject `<clientId>:<digest>` — a client id is `{entity}-{alias}[-production]`, so
10
+ // relaxed and long, but never a path separator or whitespace: it rides in route params.
11
+ export const ProfileIdSchema = { type: 'string', minLength: 1, maxLength: 256, pattern: '^[^/\\s]+$' };
12
+ // The organization's renameable name, exactly as the identity store's registry admits one.
13
+ export const EntitySlugSchema = { type: 'string', minLength: 1, maxLength: 63, pattern: ENTITY_SLUG_PATTERN.source };
14
+ export const EmailSchema = { type: 'string', minLength: 3, maxLength: 254 };
15
+ export const RoleSchema = { type: 'string', minLength: 1, maxLength: 32 };
16
+ export const NameSchema = { type: 'string', minLength: 1, maxLength: 128 };
17
+ export const TitleSchema = { type: 'string', minLength: 1, maxLength: 256 };
18
+ export const ProfileIdsSchema = { type: 'array', items: ProfileIdSchema, minItems: 1, maxItems: 256 };
19
+ // A nullable enum carries `null` among its values: `nullable` and `enum` are checked apart, and a
20
+ // connector serialises an unset optional as `null` as readily as it drops the key.
21
+ export const ScopeProp = { type: 'string', enum: [...Object.values(WorkloadKind), null], nullable: true };
22
+ // Declared, or `removeAdditional: true` strips it before the handler and every grant silently
23
+ // falls back to the inferred form.
24
+ export const ModeProp = { type: 'string', enum: [...Object.values(IamGrantMode), null], nullable: true };
25
+ export const ProjectIdProp = { projectId: IdValueSchema };
26
+ // A group key is a route param as well: the auth vocabulary's group value, never a path separator.
27
+ export const GroupKeySchema = {
28
+ type: 'string', minLength: GroupValueSchema.minLength, maxLength: GroupValueSchema.maxLength, pattern: '^[^/\\s]+$',
29
+ };
30
+ export const GroupBundleSchema = {
31
+ type: 'object',
32
+ properties: {
33
+ filter: {
34
+ type: 'object',
35
+ properties: {
36
+ areas: { type: 'array', items: { type: 'string', minLength: 1, maxLength: 64, nullable: true }, maxItems: 16, nullable: true },
37
+ managed: { type: 'boolean', nullable: true },
38
+ resourceScoped: { type: 'boolean', nullable: true },
39
+ entityScoped: { type: 'boolean', nullable: true },
40
+ },
41
+ required: [],
42
+ additionalProperties: false,
43
+ nullable: true,
44
+ },
45
+ permissions: { type: 'array', items: PermissionNameSchema, maxItems: 256, nullable: true },
46
+ },
47
+ required: [],
48
+ additionalProperties: false,
49
+ };
50
+ //# sourceMappingURL=consts.local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../../src/iam-console/consts.local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,6FAA6F;AAC7F,yGAAyG;AACzG,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAW,CAAA;AAE7F,MAAM,CAAC,MAAM,gBAAgB,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,SAAS,EAAE,GAAG,EAAW,CAAA;AAEzF,kGAAkG;AAClG,wFAAwF;AACxF,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,IAAI,EAAE,QAAQ,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}
@@ -0,0 +1,4 @@
1
+ export type * from './types.js';
2
+ export * from './consts.js';
3
+ export * from './schemas.js';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/iam-console/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,YAAY,CAAA;AAC/B,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './consts.js';
2
+ export * from './schemas.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/iam-console/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA"}
@@ -0,0 +1,38 @@
1
+ import type { JSONSchemaType } from 'ajv';
2
+ import { type IamGroupRef } from '@owlmeans/iam';
3
+ import type { IamAssignGrant, IamDefinitionUpdate, IamGrantsQuery, IamGroupCreate, IamGroupEdit, IamGroupMembersChange, IamGroupParams, IamMemberParams, IamOrganizationEdit, IamOrganizationParams, IamProjectMemberInvite, IamProjectMemberUpdate, IamProjectParams, IamProjectUserInvite, IamProjectUserParams, IamProjectUserUpdate, IamRevokeGrant, IamScoped, IamStaffSync } from './types.js';
4
+ /**
5
+ * The owner console's IAM schemas — one set for both doors: the browser's `back.iam` routes and the
6
+ * connector's `connect.iam` twins validate the same bodies, so a field cannot be admitted on one and
7
+ * refused on the other. Every object is closed (`additionalProperties: false`): an organization's
8
+ * record id (`entityId`) is refused wherever it is offered.
9
+ */
10
+ export declare const IamProjectParamsSchema: JSONSchemaType<IamProjectParams>;
11
+ export declare const IamProjectUserParamsSchema: JSONSchemaType<IamProjectUserParams>;
12
+ export declare const IamOrganizationParamsSchema: JSONSchemaType<IamOrganizationParams>;
13
+ export declare const IamMemberParamsSchema: JSONSchemaType<IamMemberParams>;
14
+ export declare const IamGroupRefSchema: JSONSchemaType<IamGroupRef>;
15
+ export declare const IamGroupParamsSchema: JSONSchemaType<IamGroupParams>;
16
+ /** The client a body-less write addresses, carried in the body where a route has one (`scope`). */
17
+ export declare const IamScopedSchema: JSONSchemaType<IamScoped>;
18
+ /**
19
+ * A person or a group, never both; a group always with the organization it lives in.
20
+ *
21
+ * `dependencies` rather than a handler check, so a malformed listing is a validation refusal like
22
+ * every other — and the handler can rely on the shape it was handed.
23
+ */
24
+ export declare const IamGrantsQuerySchema: JSONSchemaType<IamGrantsQuery>;
25
+ export declare const IamAssignGrantSchema: JSONSchemaType<IamAssignGrant>;
26
+ export declare const IamRevokeGrantSchema: JSONSchemaType<IamRevokeGrant>;
27
+ /** At least one setting: an update that changes nothing is a client bug, not a request. */
28
+ export declare const IamDefinitionUpdateSchema: JSONSchemaType<IamDefinitionUpdate>;
29
+ export declare const IamStaffSyncSchema: JSONSchemaType<IamStaffSync>;
30
+ export declare const IamProjectUserInviteSchema: JSONSchemaType<IamProjectUserInvite>;
31
+ export declare const IamProjectUserUpdateSchema: JSONSchemaType<IamProjectUserUpdate>;
32
+ export declare const IamOrganizationEditSchema: JSONSchemaType<IamOrganizationEdit>;
33
+ export declare const IamProjectMemberInviteSchema: JSONSchemaType<IamProjectMemberInvite>;
34
+ export declare const IamProjectMemberUpdateSchema: JSONSchemaType<IamProjectMemberUpdate>;
35
+ export declare const IamGroupCreateSchema: JSONSchemaType<IamGroupCreate>;
36
+ export declare const IamGroupEditSchema: JSONSchemaType<IamGroupEdit>;
37
+ export declare const IamGroupMembersChangeSchema: JSONSchemaType<IamGroupMembersChange>;
38
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/iam-console/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AACzC,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAA;AAMjE,OAAO,KAAK,EACV,c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oB,CAUxB,CAAA;AAEpD,eAAO,MAAM,yBAAyB,EAAE,cAAc,CAAC,mBAAmB,CAQvB,CAAA;AAEnD,eAAO,MAAM,4BAA4B,EAAE,cAAc,CAAC,sBAAsB,CAU1B,CAAA;AAEtD,eAAO,MAAM,4BAA4B,EAAE,cAAc,CAAC,sBAAsB,CAS1B,CAAA;AAEtD,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,cAAc,CASlB,CAAA;AAE9C,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,YAAY,CAShB,CAAA;AAE5C,eAAO,MAAM,2BAA2B,EAAE,cAAc,CAAC,qBAAqB,CAQzB,CAAA"}
@@ -0,0 +1,217 @@
1
+ import { IamDefaultClass } from '@owlmeans/iam';
2
+ import { EmailSchema, EntitySlugSchema, GroupBundleSchema, GroupKeySchema, ModeProp, NameSchema, PermissionNameSchema, ProfileIdSchema, ProfileIdsSchema, ProjectIdProp, ResourceIdSchema, RoleSchema, ScopeProp, TitleSchema, } from './consts.local.js';
3
+ /**
4
+ * The owner console's IAM schemas — one set for both doors: the browser's `back.iam` routes and the
5
+ * connector's `connect.iam` twins validate the same bodies, so a field cannot be admitted on one and
6
+ * refused on the other. Every object is closed (`additionalProperties: false`): an organization's
7
+ * record id (`entityId`) is refused wherever it is offered.
8
+ */
9
+ export const IamProjectParamsSchema = {
10
+ type: 'object',
11
+ properties: { ...ProjectIdProp },
12
+ required: ['projectId'],
13
+ additionalProperties: false,
14
+ };
15
+ export const IamProjectUserParamsSchema = {
16
+ type: 'object',
17
+ properties: { ...ProjectIdProp, profileId: ProfileIdSchema },
18
+ required: ['projectId', 'profileId'],
19
+ additionalProperties: false,
20
+ };
21
+ export const IamOrganizationParamsSchema = {
22
+ type: 'object',
23
+ properties: { ...ProjectIdProp, entitySlug: EntitySlugSchema },
24
+ required: ['projectId', 'entitySlug'],
25
+ additionalProperties: false,
26
+ };
27
+ export const IamMemberParamsSchema = {
28
+ type: 'object',
29
+ properties: { ...ProjectIdProp, entitySlug: EntitySlugSchema, profileId: ProfileIdSchema },
30
+ required: ['projectId', 'entitySlug', 'profileId'],
31
+ additionalProperties: false,
32
+ };
33
+ export const IamGroupRefSchema = {
34
+ type: 'object',
35
+ properties: {
36
+ entitySlug: EntitySlugSchema,
37
+ key: GroupKeySchema,
38
+ },
39
+ required: ['entitySlug', 'key'],
40
+ additionalProperties: false,
41
+ };
42
+ export const IamGroupParamsSchema = {
43
+ type: 'object',
44
+ properties: { ...ProjectIdProp, entitySlug: EntitySlugSchema, group: GroupKeySchema },
45
+ required: ['projectId', 'entitySlug', 'group'],
46
+ additionalProperties: false,
47
+ };
48
+ /** The client a body-less write addresses, carried in the body where a route has one (`scope`). */
49
+ export const IamScopedSchema = {
50
+ type: 'object',
51
+ properties: { scope: ScopeProp },
52
+ required: [],
53
+ additionalProperties: false,
54
+ };
55
+ /**
56
+ * A person or a group, never both; a group always with the organization it lives in.
57
+ *
58
+ * `dependencies` rather than a handler check, so a malformed listing is a validation refusal like
59
+ * every other — and the handler can rely on the shape it was handed.
60
+ */
61
+ export const IamGrantsQuerySchema = {
62
+ type: 'object',
63
+ properties: {
64
+ profileId: { ...ProfileIdSchema, nullable: true },
65
+ group: { ...GroupKeySchema, nullable: true },
66
+ entitySlug: { ...EntitySlugSchema, nullable: true },
67
+ scope: ScopeProp,
68
+ },
69
+ required: [],
70
+ additionalProperties: false,
71
+ dependencies: { group: ['entitySlug'] },
72
+ not: { required: ['profileId', 'group'] },
73
+ };
74
+ /**
75
+ * Exactly one subject. Each branch excludes the other subject itself, so a body naming both
76
+ * matches neither; the group branch also refuses a binding — a group grant is bound to the group's
77
+ * own organization, and a second organization in the body could only disagree with it. Each branch
78
+ * declares the property it requires, so a reader of the branch alone (a model-schema check) sees it.
79
+ */
80
+ const OneSubject = [
81
+ { properties: { profileId: ProfileIdSchema }, required: ['profileId'], not: { required: ['group'] } },
82
+ {
83
+ properties: { group: IamGroupRefSchema },
84
+ required: ['group'],
85
+ not: { anyOf: [{ required: ['profileId'] }, { required: ['entitySlug'] }] },
86
+ },
87
+ ];
88
+ const grantSchemaProperties = {
89
+ profileId: { ...ProfileIdSchema, nullable: true },
90
+ group: { ...IamGroupRefSchema, nullable: true },
91
+ permission: PermissionNameSchema,
92
+ resources: { type: 'array', items: ResourceIdSchema, maxItems: 256, nullable: true },
93
+ mode: ModeProp,
94
+ entitySlug: { ...EntitySlugSchema, nullable: true },
95
+ scope: ScopeProp,
96
+ };
97
+ export const IamAssignGrantSchema = {
98
+ type: 'object',
99
+ properties: grantSchemaProperties,
100
+ required: ['permission'],
101
+ additionalProperties: false,
102
+ oneOf: OneSubject,
103
+ };
104
+ export const IamRevokeGrantSchema = {
105
+ type: 'object',
106
+ properties: grantSchemaProperties,
107
+ required: ['permission'],
108
+ additionalProperties: false,
109
+ oneOf: OneSubject,
110
+ };
111
+ const DefaultClassProp = { type: 'string', enum: [...Object.values(IamDefaultClass), null], nullable: true };
112
+ const EntityScopedProp = { type: 'boolean', nullable: true };
113
+ /** At least one setting: an update that changes nothing is a client bug, not a request. */
114
+ export const IamDefinitionUpdateSchema = {
115
+ type: 'object',
116
+ properties: {
117
+ permission: PermissionNameSchema,
118
+ defaultClass: DefaultClassProp,
119
+ entityScoped: EntityScopedProp,
120
+ scope: ScopeProp,
121
+ },
122
+ required: ['permission'],
123
+ additionalProperties: false,
124
+ // Each branch declares the property it requires, so a reader of the branch alone sees it.
125
+ anyOf: [
126
+ { properties: { defaultClass: DefaultClassProp }, required: ['defaultClass'] },
127
+ { properties: { entityScoped: EntityScopedProp }, required: ['entityScoped'] },
128
+ ],
129
+ };
130
+ export const IamStaffSyncSchema = {
131
+ type: 'object',
132
+ properties: { scope: ScopeProp },
133
+ required: [],
134
+ additionalProperties: false,
135
+ };
136
+ export const IamProjectUserInviteSchema = {
137
+ type: 'object',
138
+ properties: {
139
+ email: EmailSchema,
140
+ name: { ...NameSchema, nullable: true },
141
+ role: { ...RoleSchema, nullable: true },
142
+ scope: ScopeProp,
143
+ },
144
+ required: ['email'],
145
+ additionalProperties: false,
146
+ };
147
+ export const IamProjectUserUpdateSchema = {
148
+ type: 'object',
149
+ properties: {
150
+ name: { ...NameSchema, nullable: true },
151
+ role: { ...RoleSchema, nullable: true },
152
+ disabled: { type: 'boolean', nullable: true },
153
+ scope: ScopeProp,
154
+ },
155
+ required: [],
156
+ additionalProperties: false,
157
+ };
158
+ export const IamOrganizationEditSchema = {
159
+ type: 'object',
160
+ properties: {
161
+ title: TitleSchema,
162
+ scope: ScopeProp,
163
+ },
164
+ required: ['title'],
165
+ additionalProperties: false,
166
+ };
167
+ export const IamProjectMemberInviteSchema = {
168
+ type: 'object',
169
+ properties: {
170
+ email: EmailSchema,
171
+ name: { ...NameSchema, nullable: true },
172
+ owner: { type: 'boolean', nullable: true },
173
+ scope: ScopeProp,
174
+ },
175
+ required: ['email'],
176
+ additionalProperties: false,
177
+ };
178
+ export const IamProjectMemberUpdateSchema = {
179
+ type: 'object',
180
+ properties: {
181
+ owner: { type: 'boolean', nullable: true },
182
+ groups: { type: 'array', items: GroupKeySchema, maxItems: 64, nullable: true },
183
+ scope: ScopeProp,
184
+ },
185
+ required: [],
186
+ additionalProperties: false,
187
+ };
188
+ export const IamGroupCreateSchema = {
189
+ type: 'object',
190
+ properties: {
191
+ key: GroupKeySchema,
192
+ title: { ...TitleSchema, nullable: true },
193
+ scope: ScopeProp,
194
+ },
195
+ required: ['key'],
196
+ additionalProperties: false,
197
+ };
198
+ export const IamGroupEditSchema = {
199
+ type: 'object',
200
+ properties: {
201
+ title: { ...TitleSchema, nullable: true },
202
+ bundles: { type: 'array', items: GroupBundleSchema, maxItems: 32, nullable: true },
203
+ scope: ScopeProp,
204
+ },
205
+ required: [],
206
+ additionalProperties: false,
207
+ };
208
+ export const IamGroupMembersChangeSchema = {
209
+ type: 'object',
210
+ properties: {
211
+ profileIds: ProfileIdsSchema,
212
+ scope: ScopeProp,
213
+ },
214
+ required: ['profileIds'],
215
+ additionalProperties: false,
216
+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amOrganization, IamOrganizationUpdate, IamPermissionDefinition, IamUser, IamUserInvite, IamUserUpdate } from '@owlmeans/iam';
2
+ import type { WorkloadKind } from '../slot/consts.js';
3
+ /**
4
+ * The owner console's IAM, per project — the contract both doors share: the browser's
5
+ * `managerProtocols.back.iam` and the connector's `connect.iam`. Every route names its project, and
6
+ * `scope` picks the preview (ephemeral, default) or the production OIDC client — two apps with two
7
+ * sets of rows, definitions and groups. Organizations travel by `entitySlug` and groups by their key:
8
+ * an organization's record id never appears on this wire, and neither does the owner's.
9
+ */
10
+ /** The IAM vocabulary a consumer of this contract reads and writes, re-exported. */
11
+ export type { IamArea, IamGrant, IamGrantBundle, IamGroup, IamGroupBundle, IamGroupRef, IamMember, IamMemberInvite, IamMemberUpdate, IamOrganization, IamOrganizationUpdate, IamPermissionDefinition, IamPermissionFilter, IamUser, IamUserInvite, IamUserUpdate, } from '@owlmeans/iam';
12
+ /** Route params for the project-scoped IAM management endpoints. */
13
+ export interface IamProjectParams {
14
+ projectId: string;
15
+ }
16
+ /** One subject of the project's client, by its pairwise `profileId`. */
17
+ export interface IamProjectUserParams extends IamProjectParams {
18
+ profileId: string;
19
+ }
20
+ /** One organization the project's client has members in. */
21
+ export interface IamOrganizationParams extends IamProjectParams {
22
+ entitySlug: string;
23
+ }
24
+ /** One member of an organization, as the project's client sees them. */
25
+ export interface IamMemberParams extends IamOrganizationParams {
26
+ profileId: string;
27
+ }
28
+ /** One group of (organization, the project's client), by its key. */
29
+ export interface IamGroupParams extends IamOrganizationParams {
30
+ group: string;
31
+ }
32
+ /**
33
+ * Which of the project's two clients a write addresses. A route with a body carries it there; a
34
+ * body-less write (the browser's removes) and every read take it in the query.
35
+ */
36
+ export interface IamScoped {
37
+ scope?: WorkloadKind;
38
+ }
39
+ /**
40
+ * A listing. `external` answers a backend that keeps this in a console of its own (keycloak): the
41
+ * list is then empty on purpose, and a screen offers that console instead of reporting "none".
42
+ */
43
+ export interface IamListResponse<T> {
44
+ items: T[];
45
+ external?: boolean;
46
+ }
47
+ export interface IamUsersResponse extends IamListResponse<IamUser> {
48
+ }
49
+ export interface IamGrantsResponse extends IamListResponse<IamGrant> {
50
+ }
51
+ export interface IamOrganizationsResponse extends IamListResponse<IamOrganization> {
52
+ }
53
+ export interface IamMembersResponse extends IamListResponse<IamMember> {
54
+ }
55
+ export interface IamGroupsResponse extends IamListResponse<IamGroup> {
56
+ }
57
+ /** Which organizations the client's subjects act in — its registration's two tenancy flags. */
58
+ export interface IamTenancy {
59
+ operators: boolean;
60
+ users: boolean;
61
+ }
62
+ export interface IamPermissionsResponse extends IamListResponse<IamPermissionDefinition> {
63
+ tenancy: IamTenancy;
64
+ }
65
+ /**
66
+ * Query for listing grants: everything the client's subjects hold, one person's (`profileId`), or
67
+ * one group's (`group`, the key, with the `entitySlug` of its organization). With a person, an
68
+ * `entitySlug` alone narrows to the grants bound to that organization.
69
+ */
70
+ export interface IamGrantsQuery extends IamScoped {
71
+ profileId?: string;
72
+ group?: string;
73
+ entitySlug?: string;
74
+ }
75
+ /**
76
+ * Change a definition's settings: who holds it by default (`defaultClass`) and whether its grants
77
+ * are bound to one organization (`entityScoped`). An omitted field is kept.
78
+ */
79
+ export interface IamDefinitionUpdate extends IamScoped {
80
+ permission: string;
81
+ defaultClass?: IamDefaultClass;
82
+ entityScoped?: boolean;
83
+ }
84
+ /** Re-admit the owning organization's staff to the client `scope` names. */
85
+ export interface IamStaffSync extends IamScoped {
86
+ }
87
+ /** How many staff rows the synchronization added and removed. */
88
+ export interface IamStaffSyncResponse {
89
+ added: number;
90
+ removed: number;
91
+ }
92
+ /**
93
+ * Body to assign a permission grant — to exactly ONE subject: a person (`profileId`) or a group.
94
+ *
95
+ * A resource-scoped permission is grantable two ways under ONE name: with `resources`, bound to
96
+ * those ids; without them, covering every resource. `mode` names which, because the two are stored
97
+ * separately and a screen offering both controls has to be able to address each on its own.
98
+ *
99
+ * `entitySlug` binds a person's grant of an entity-scoped definition to that organization. A group
100
+ * grant is always bound to the group's own organization, so it takes none.
101
+ */
102
+ export interface IamAssignGrant extends IamScoped {
103
+ profileId?: string;
104
+ group?: IamGroupRef;
105
+ permission: string;
106
+ resources?: string[];
107
+ /** `blanket` (all resources) or `resources`. Inferred from `resources` when omitted. */
108
+ mode?: IamGrantMode;
109
+ entitySlug?: string;
110
+ }
111
+ /**
112
+ * Body to revoke a grant, the same shape. With `resources` only those ids are removed; an omitted
113
+ * `mode` means ALL forms, which is what a bare revoke has always meant — narrowing that default
114
+ * would leave a resource-scoped grant standing after a revoke reported success.
115
+ */
116
+ export interface IamRevokeGrant extends IamAssignGrant {
117
+ }
118
+ export interface IamProjectUserInvite extends IamUserInvite, IamScoped {
119
+ }
120
+ export interface IamProjectUserUpdate extends IamUserUpdate, IamScoped {
121
+ }
122
+ export interface IamOrganizationEdit extends IamOrganizationUpdate, IamScoped {
123
+ }
124
+ export interface IamProjectMemberInvite extends IamMemberInvite, IamScoped {
125
+ }
126
+ export interface IamProjectMemberUpdate extends IamMemberUpdate, IamScoped {
127
+ }
128
+ export interface IamGroupCreate extends IamScoped {
129
+ key: string;
130
+ title?: string;
131
+ }
132
+ /** A group's title and what it grants; an omitted field is kept. */
133
+ export interface IamGroupEdit extends IamScoped {
134
+ title?: string;
135
+ bundles?: IamGroupBundle[];
136
+ }
137
+ export interface IamGroupMembersChange extends IamScoped {
138
+ profileIds: string[];
139
+ }
140
+ //# sourceMappingURL=types.d.ts.map