@lssm/lib.identity-rbac 0.0.0-canary-20251217083314 → 0.0.0-canary-20251220002821

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 (182) hide show
  1. package/LICENSE +21 -0
  2. package/dist/contracts/dist/capabilities/openbanking.js +2 -1
  3. package/dist/contracts/dist/capabilities/openbanking.js.map +1 -0
  4. package/dist/contracts/dist/contract-registry/schemas.js +2 -1
  5. package/dist/contracts/dist/contract-registry/schemas.js.map +1 -0
  6. package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +2 -1
  7. package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +1 -0
  8. package/dist/contracts/dist/docs/index.js +2 -6
  9. package/dist/contracts/dist/docs/meta.docs.js +30 -0
  10. package/dist/contracts/dist/docs/meta.docs.js.map +1 -0
  11. package/dist/contracts/dist/docs/presentations.js +2 -1
  12. package/dist/contracts/dist/docs/presentations.js.map +1 -0
  13. package/dist/contracts/dist/docs/registry.js +2 -1
  14. package/dist/contracts/dist/docs/registry.js.map +1 -0
  15. package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +2 -1
  16. package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +1 -0
  17. package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +2 -1
  18. package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +1 -0
  19. package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +2 -1
  20. package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +1 -0
  21. package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js +2 -1
  22. package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -0
  23. package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js +2 -1
  24. package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +1 -0
  25. package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js +2 -1
  26. package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +1 -0
  27. package/dist/contracts/dist/docs/tech/schema/README.docblock.js +2 -1
  28. package/dist/contracts/dist/docs/tech/schema/README.docblock.js.map +1 -0
  29. package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js +2 -1
  30. package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +1 -0
  31. package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +2 -1
  32. package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +1 -0
  33. package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +2 -1
  34. package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +1 -0
  35. package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +2 -1
  36. package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +1 -0
  37. package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js +2 -1
  38. package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +1 -0
  39. package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +2 -1
  40. package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +1 -0
  41. package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js +2 -1
  42. package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +1 -0
  43. package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +2 -1
  44. package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +1 -0
  45. package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js +2 -1
  46. package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +1 -0
  47. package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js +2 -1
  48. package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +1 -0
  49. package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js +2 -1
  50. package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js.map +1 -0
  51. package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js +2 -1
  52. package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js.map +1 -0
  53. package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js +2 -1
  54. package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js.map +1 -0
  55. package/dist/contracts/dist/docs/tech-contracts.docs.js +97 -0
  56. package/dist/contracts/dist/docs/tech-contracts.docs.js.map +1 -0
  57. package/dist/contracts/dist/events.js +2 -1
  58. package/dist/contracts/dist/events.js.map +1 -0
  59. package/dist/contracts/dist/index.js +2 -1
  60. package/dist/contracts/dist/integrations/contracts.js +65 -66
  61. package/dist/contracts/dist/integrations/contracts.js.map +1 -0
  62. package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js +31 -32
  63. package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js.map +1 -0
  64. package/dist/contracts/dist/integrations/openbanking/contracts/balances.js +18 -19
  65. package/dist/contracts/dist/integrations/openbanking/contracts/balances.js.map +1 -0
  66. package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js +32 -33
  67. package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js.map +1 -0
  68. package/dist/contracts/dist/integrations/openbanking/models.js +60 -61
  69. package/dist/contracts/dist/integrations/openbanking/models.js.map +1 -0
  70. package/dist/contracts/dist/integrations/openbanking/telemetry.js +2 -1
  71. package/dist/contracts/dist/integrations/openbanking/telemetry.js.map +1 -0
  72. package/dist/contracts/dist/integrations/providers/elevenlabs.js +2 -1
  73. package/dist/contracts/dist/integrations/providers/elevenlabs.js.map +1 -0
  74. package/dist/contracts/dist/integrations/providers/gcs-storage.js +2 -1
  75. package/dist/contracts/dist/integrations/providers/gcs-storage.js.map +1 -0
  76. package/dist/contracts/dist/integrations/providers/gmail.js +2 -1
  77. package/dist/contracts/dist/integrations/providers/gmail.js.map +1 -0
  78. package/dist/contracts/dist/integrations/providers/google-calendar.js +2 -1
  79. package/dist/contracts/dist/integrations/providers/google-calendar.js.map +1 -0
  80. package/dist/contracts/dist/integrations/providers/mistral.js +2 -1
  81. package/dist/contracts/dist/integrations/providers/mistral.js.map +1 -0
  82. package/dist/contracts/dist/integrations/providers/postmark.js +2 -1
  83. package/dist/contracts/dist/integrations/providers/postmark.js.map +1 -0
  84. package/dist/contracts/dist/integrations/providers/powens.js +2 -1
  85. package/dist/contracts/dist/integrations/providers/powens.js.map +1 -0
  86. package/dist/contracts/dist/integrations/providers/qdrant.js +2 -1
  87. package/dist/contracts/dist/integrations/providers/qdrant.js.map +1 -0
  88. package/dist/contracts/dist/integrations/providers/stripe.js +2 -1
  89. package/dist/contracts/dist/integrations/providers/stripe.js.map +1 -0
  90. package/dist/contracts/dist/integrations/providers/twilio-sms.js +2 -1
  91. package/dist/contracts/dist/integrations/providers/twilio-sms.js.map +1 -0
  92. package/dist/contracts/dist/knowledge/contracts.js +44 -45
  93. package/dist/contracts/dist/knowledge/contracts.js.map +1 -0
  94. package/dist/contracts/dist/knowledge/spaces/email-threads.js +2 -1
  95. package/dist/contracts/dist/knowledge/spaces/email-threads.js.map +1 -0
  96. package/dist/contracts/dist/knowledge/spaces/financial-docs.js +2 -1
  97. package/dist/contracts/dist/knowledge/spaces/financial-docs.js.map +1 -0
  98. package/dist/contracts/dist/knowledge/spaces/financial-overview.js +2 -1
  99. package/dist/contracts/dist/knowledge/spaces/financial-overview.js.map +1 -0
  100. package/dist/contracts/dist/knowledge/spaces/product-canon.js +2 -1
  101. package/dist/contracts/dist/knowledge/spaces/product-canon.js.map +1 -0
  102. package/dist/contracts/dist/knowledge/spaces/support-faq.js +2 -1
  103. package/dist/contracts/dist/knowledge/spaces/support-faq.js.map +1 -0
  104. package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js +2 -1
  105. package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js.map +1 -0
  106. package/dist/contracts/dist/llm/exporters.js +2 -1
  107. package/dist/contracts/dist/llm/exporters.js.map +1 -0
  108. package/dist/contracts/dist/onboarding-base.js +22 -23
  109. package/dist/contracts/dist/onboarding-base.js.map +1 -0
  110. package/dist/contracts/dist/ownership.js +4 -2
  111. package/dist/contracts/dist/ownership.js.map +1 -0
  112. package/dist/contracts/dist/presentations.v2.js +2 -1
  113. package/dist/contracts/dist/presentations.v2.js.map +1 -0
  114. package/dist/contracts/dist/regenerator/service.js +2 -1
  115. package/dist/contracts/dist/regenerator/service.js.map +1 -0
  116. package/dist/contracts/dist/schema/dist/index.js +3873 -6
  117. package/dist/contracts/dist/schema/dist/index.js.map +1 -0
  118. package/dist/contracts/dist/spec.js +2 -1
  119. package/dist/contracts/dist/spec.js.map +1 -0
  120. package/dist/contracts/organization.d.ts +195 -194
  121. package/dist/contracts/organization.d.ts.map +1 -0
  122. package/dist/contracts/organization.js +72 -73
  123. package/dist/contracts/organization.js.map +1 -0
  124. package/dist/contracts/rbac.d.ts +120 -119
  125. package/dist/contracts/rbac.d.ts.map +1 -0
  126. package/dist/contracts/rbac.js +50 -51
  127. package/dist/contracts/rbac.js.map +1 -0
  128. package/dist/contracts/user.d.ts +141 -140
  129. package/dist/contracts/user.d.ts.map +1 -0
  130. package/dist/contracts/user.js +41 -42
  131. package/dist/contracts/user.js.map +1 -0
  132. package/dist/entities/index.d.ts +162 -161
  133. package/dist/entities/index.d.ts.map +1 -0
  134. package/dist/entities/index.js +2 -1
  135. package/dist/entities/index.js.map +1 -0
  136. package/dist/entities/organization.d.ts +61 -60
  137. package/dist/entities/organization.d.ts.map +1 -0
  138. package/dist/entities/organization.js +62 -62
  139. package/dist/entities/organization.js.map +1 -0
  140. package/dist/entities/rbac.d.ts +65 -64
  141. package/dist/entities/rbac.d.ts.map +1 -0
  142. package/dist/entities/rbac.js +66 -66
  143. package/dist/entities/rbac.js.map +1 -0
  144. package/dist/entities/user.d.ts +69 -68
  145. package/dist/entities/user.d.ts.map +1 -0
  146. package/dist/entities/user.js +70 -70
  147. package/dist/entities/user.js.map +1 -0
  148. package/dist/events.d.ts +145 -144
  149. package/dist/events.d.ts.map +1 -0
  150. package/dist/events.js +89 -90
  151. package/dist/events.js.map +1 -0
  152. package/dist/identity-rbac.feature.d.ts +2 -1
  153. package/dist/identity-rbac.feature.d.ts.map +1 -0
  154. package/dist/identity-rbac.feature.js +2 -1
  155. package/dist/identity-rbac.feature.js.map +1 -0
  156. package/dist/policies/engine.d.ts +2 -1
  157. package/dist/policies/engine.d.ts.map +1 -0
  158. package/dist/policies/engine.js +2 -1
  159. package/dist/policies/engine.js.map +1 -0
  160. package/dist/schema/dist/index.js +4888 -6
  161. package/dist/schema/dist/index.js.map +1 -0
  162. package/package.json +13 -6
  163. package/dist/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  164. package/dist/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  165. package/dist/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  166. package/dist/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  167. package/dist/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  168. package/dist/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  169. package/dist/contracts/dist/schema/dist/EnumType.js +0 -2
  170. package/dist/contracts/dist/schema/dist/FieldType.js +0 -49
  171. package/dist/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  172. package/dist/contracts/dist/schema/dist/SchemaModel.js +0 -34
  173. package/dist/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  174. package/dist/contracts/dist/schema/dist/entity/index.js +0 -2
  175. package/dist/contracts/dist/schema/dist/entity/types.js +0 -1
  176. package/dist/schema/dist/EnumType.js +0 -2
  177. package/dist/schema/dist/FieldType.js +0 -49
  178. package/dist/schema/dist/ScalarTypeEnum.js +0 -236
  179. package/dist/schema/dist/SchemaModel.js +0 -34
  180. package/dist/schema/dist/entity/defineEntity.js +0 -236
  181. package/dist/schema/dist/entity/index.js +0 -2
  182. package/dist/schema/dist/entity/types.js +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.d.ts","names":[],"sources":["../../src/contracts/organization.ts"],"sourcesContent":[],"mappings":";;;;;cAQa,mBAAiB;;UAa5B,mBAAA,CAAA;;EAbW,CAAA;EAaX,IAAA,EAAA;;;;;;;;;IAb4B,IAAA,+BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;EAejB,CAAA;EAQX,WAAA,EAAA;;;EAR0B,CAAA;EAAA,IAAA,EAAA;IAUf,IAAA,+BAcX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;;;;CAdsB,CAAA;AAAA,cAVX,eAUW,EAVI,WAUJ,CAAA;EAgBX,EAAA,EAAA;IAWX,IAAA,EA7BA,mBAAA,CAAA,SA6BA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;IAX0B,IAAA,+BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;EAaf,CAAA;CASX,CAAA;cAtCW,aAAW;;UActB,mBAAA,CAAA;IAe8B,UAAA,EAAA,KAAA;EAAA,CAAA;EAWnB,MAAA,EAAA;IAQA,IAAA,+BAUX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;EAV8B,CAAA;EAAA,IAAA,EAAA;IAYnB,IAAA,+BASX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;IATiC,UAAA,EAAA,KAAA;EAAA,CAAA;EAWtB,IAAA,EAAA;IAQA,IAAA,aAAA,CAAA;MAOX,EAAA,EAAA;;QAPiC,UAAA,EAAA,KAAA;MAAA,CAAA;MAStB,KAAA,EAAA;QAOX,IAAA,+BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;MAPo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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0CjB,sCAAc,aAAA;;UAkBzB,mBAAA,CAAA;;;;;UAlByB,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBd,yCAAiB,aAAA;;UA6B5B,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;UA7B4B,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCjB,4CAAoB,aAAA;;UA2C/B,mBAAA,CAAA;;;;;;;;;;;;;;;;;UA3C+B,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgDpB,4CAAoB,aAAA;;UA2C/B,mBAAA,CAAA;;;;;UA3C+B,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgDpB,4CAAoB,aAAA;;UAqC/B,mBAAA,CAAA;;;;;;;;;UArC+B,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;cA0CpB,2CAAmB,aAAA;;UAkB9B,mBAAA,CAAA;;;;;;;;;;;;;;;cAlB8B,mBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAuBnB,sBAAoB,qBAAA,CAAA,aAkB/B,mBAAA,CAlB+B,cAAA,EAAA;;;;cAAA,mBAAA,CAAA"}
@@ -1,90 +1,88 @@
1
- import { ScalarTypeEnum } from "../schema/dist/ScalarTypeEnum.js";
2
- import { SchemaModel } from "../schema/dist/SchemaModel.js";
3
- import "../schema/dist/index.js";
1
+ import { E5, x8 } from "../schema/dist/index.js";
4
2
  import { defineCommand, defineQuery } from "./dist/spec.js";
5
3
  import "./dist/index.js";
6
4
  import { SuccessResultModel } from "./user.js";
7
5
 
8
6
  //#region src/contracts/organization.ts
9
7
  const OWNERS = ["platform.identity-rbac"];
10
- const OrganizationModel = new SchemaModel({
8
+ const OrganizationModel = new x8({
11
9
  name: "Organization",
12
10
  description: "Organization details",
13
11
  fields: {
14
12
  id: {
15
- type: ScalarTypeEnum.String_unsecure(),
13
+ type: E5.String_unsecure(),
16
14
  isOptional: false
17
15
  },
18
16
  name: {
19
- type: ScalarTypeEnum.String_unsecure(),
17
+ type: E5.String_unsecure(),
20
18
  isOptional: false
21
19
  },
22
20
  slug: {
23
- type: ScalarTypeEnum.String_unsecure(),
21
+ type: E5.String_unsecure(),
24
22
  isOptional: true
25
23
  },
26
24
  logo: {
27
- type: ScalarTypeEnum.URL(),
25
+ type: E5.URL(),
28
26
  isOptional: true
29
27
  },
30
28
  description: {
31
- type: ScalarTypeEnum.String_unsecure(),
29
+ type: E5.String_unsecure(),
32
30
  isOptional: true
33
31
  },
34
32
  type: {
35
- type: ScalarTypeEnum.String_unsecure(),
33
+ type: E5.String_unsecure(),
36
34
  isOptional: false
37
35
  },
38
36
  onboardingCompleted: {
39
- type: ScalarTypeEnum.Boolean(),
37
+ type: E5.Boolean(),
40
38
  isOptional: false
41
39
  },
42
40
  createdAt: {
43
- type: ScalarTypeEnum.DateTime(),
41
+ type: E5.DateTime(),
44
42
  isOptional: false
45
43
  }
46
44
  }
47
45
  });
48
- const MemberUserModel = new SchemaModel({
46
+ const MemberUserModel = new x8({
49
47
  name: "MemberUser",
50
48
  description: "Basic user info within a member",
51
49
  fields: {
52
50
  id: {
53
- type: ScalarTypeEnum.String_unsecure(),
51
+ type: E5.String_unsecure(),
54
52
  isOptional: false
55
53
  },
56
54
  email: {
57
- type: ScalarTypeEnum.EmailAddress(),
55
+ type: E5.EmailAddress(),
58
56
  isOptional: false
59
57
  },
60
58
  name: {
61
- type: ScalarTypeEnum.String_unsecure(),
59
+ type: E5.String_unsecure(),
62
60
  isOptional: true
63
61
  }
64
62
  }
65
63
  });
66
- const MemberModel = new SchemaModel({
64
+ const MemberModel = new x8({
67
65
  name: "Member",
68
66
  description: "Organization member",
69
67
  fields: {
70
68
  id: {
71
- type: ScalarTypeEnum.String_unsecure(),
69
+ type: E5.String_unsecure(),
72
70
  isOptional: false
73
71
  },
74
72
  userId: {
75
- type: ScalarTypeEnum.String_unsecure(),
73
+ type: E5.String_unsecure(),
76
74
  isOptional: false
77
75
  },
78
76
  organizationId: {
79
- type: ScalarTypeEnum.String_unsecure(),
77
+ type: E5.String_unsecure(),
80
78
  isOptional: false
81
79
  },
82
80
  role: {
83
- type: ScalarTypeEnum.String_unsecure(),
81
+ type: E5.String_unsecure(),
84
82
  isOptional: false
85
83
  },
86
84
  createdAt: {
87
- type: ScalarTypeEnum.DateTime(),
85
+ type: E5.DateTime(),
88
86
  isOptional: false
89
87
  },
90
88
  user: {
@@ -93,169 +91,169 @@ const MemberModel = new SchemaModel({
93
91
  }
94
92
  }
95
93
  });
96
- const InvitationModel = new SchemaModel({
94
+ const InvitationModel = new x8({
97
95
  name: "Invitation",
98
96
  description: "Organization invitation",
99
97
  fields: {
100
98
  id: {
101
- type: ScalarTypeEnum.String_unsecure(),
99
+ type: E5.String_unsecure(),
102
100
  isOptional: false
103
101
  },
104
102
  email: {
105
- type: ScalarTypeEnum.EmailAddress(),
103
+ type: E5.EmailAddress(),
106
104
  isOptional: false
107
105
  },
108
106
  role: {
109
- type: ScalarTypeEnum.String_unsecure(),
107
+ type: E5.String_unsecure(),
110
108
  isOptional: true
111
109
  },
112
110
  status: {
113
- type: ScalarTypeEnum.String_unsecure(),
111
+ type: E5.String_unsecure(),
114
112
  isOptional: false
115
113
  },
116
114
  expiresAt: {
117
- type: ScalarTypeEnum.DateTime(),
115
+ type: E5.DateTime(),
118
116
  isOptional: true
119
117
  },
120
118
  createdAt: {
121
- type: ScalarTypeEnum.DateTime(),
119
+ type: E5.DateTime(),
122
120
  isOptional: false
123
121
  }
124
122
  }
125
123
  });
126
- const CreateOrgInputModel = new SchemaModel({
124
+ const CreateOrgInputModel = new x8({
127
125
  name: "CreateOrgInput",
128
126
  description: "Input for creating an organization",
129
127
  fields: {
130
128
  name: {
131
- type: ScalarTypeEnum.NonEmptyString(),
129
+ type: E5.NonEmptyString(),
132
130
  isOptional: false
133
131
  },
134
132
  slug: {
135
- type: ScalarTypeEnum.String_unsecure(),
133
+ type: E5.String_unsecure(),
136
134
  isOptional: true
137
135
  },
138
136
  description: {
139
- type: ScalarTypeEnum.String_unsecure(),
137
+ type: E5.String_unsecure(),
140
138
  isOptional: true
141
139
  },
142
140
  type: {
143
- type: ScalarTypeEnum.String_unsecure(),
141
+ type: E5.String_unsecure(),
144
142
  isOptional: true
145
143
  }
146
144
  }
147
145
  });
148
- const GetOrgInputModel = new SchemaModel({
146
+ const GetOrgInputModel = new x8({
149
147
  name: "GetOrgInput",
150
148
  description: "Input for getting an organization",
151
149
  fields: { orgId: {
152
- type: ScalarTypeEnum.String_unsecure(),
150
+ type: E5.String_unsecure(),
153
151
  isOptional: false
154
152
  } }
155
153
  });
156
- const UpdateOrgInputModel = new SchemaModel({
154
+ const UpdateOrgInputModel = new x8({
157
155
  name: "UpdateOrgInput",
158
156
  description: "Input for updating an organization",
159
157
  fields: {
160
158
  orgId: {
161
- type: ScalarTypeEnum.String_unsecure(),
159
+ type: E5.String_unsecure(),
162
160
  isOptional: false
163
161
  },
164
162
  name: {
165
- type: ScalarTypeEnum.String_unsecure(),
163
+ type: E5.String_unsecure(),
166
164
  isOptional: true
167
165
  },
168
166
  slug: {
169
- type: ScalarTypeEnum.String_unsecure(),
167
+ type: E5.String_unsecure(),
170
168
  isOptional: true
171
169
  },
172
170
  logo: {
173
- type: ScalarTypeEnum.URL(),
171
+ type: E5.URL(),
174
172
  isOptional: true
175
173
  },
176
174
  description: {
177
- type: ScalarTypeEnum.String_unsecure(),
175
+ type: E5.String_unsecure(),
178
176
  isOptional: true
179
177
  }
180
178
  }
181
179
  });
182
- const InviteMemberInputModel = new SchemaModel({
180
+ const InviteMemberInputModel = new x8({
183
181
  name: "InviteMemberInput",
184
182
  description: "Input for inviting a member",
185
183
  fields: {
186
184
  orgId: {
187
- type: ScalarTypeEnum.String_unsecure(),
185
+ type: E5.String_unsecure(),
188
186
  isOptional: false
189
187
  },
190
188
  email: {
191
- type: ScalarTypeEnum.EmailAddress(),
189
+ type: E5.EmailAddress(),
192
190
  isOptional: false
193
191
  },
194
192
  role: {
195
- type: ScalarTypeEnum.String_unsecure(),
193
+ type: E5.String_unsecure(),
196
194
  isOptional: false
197
195
  },
198
196
  teamId: {
199
- type: ScalarTypeEnum.String_unsecure(),
197
+ type: E5.String_unsecure(),
200
198
  isOptional: true
201
199
  }
202
200
  }
203
201
  });
204
- const AcceptInviteInputModel = new SchemaModel({
202
+ const AcceptInviteInputModel = new x8({
205
203
  name: "AcceptInviteInput",
206
204
  description: "Input for accepting an invitation",
207
205
  fields: { invitationId: {
208
- type: ScalarTypeEnum.String_unsecure(),
206
+ type: E5.String_unsecure(),
209
207
  isOptional: false
210
208
  } }
211
209
  });
212
- const RemoveMemberInputModel = new SchemaModel({
210
+ const RemoveMemberInputModel = new x8({
213
211
  name: "RemoveMemberInput",
214
212
  description: "Input for removing a member",
215
213
  fields: {
216
214
  orgId: {
217
- type: ScalarTypeEnum.String_unsecure(),
215
+ type: E5.String_unsecure(),
218
216
  isOptional: false
219
217
  },
220
218
  userId: {
221
- type: ScalarTypeEnum.String_unsecure(),
219
+ type: E5.String_unsecure(),
222
220
  isOptional: false
223
221
  }
224
222
  }
225
223
  });
226
- const MemberRemovedPayloadModel = new SchemaModel({
224
+ const MemberRemovedPayloadModel = new x8({
227
225
  name: "MemberRemovedPayload",
228
226
  description: "Payload for member removed event",
229
227
  fields: {
230
228
  orgId: {
231
- type: ScalarTypeEnum.String_unsecure(),
229
+ type: E5.String_unsecure(),
232
230
  isOptional: false
233
231
  },
234
232
  userId: {
235
- type: ScalarTypeEnum.String_unsecure(),
233
+ type: E5.String_unsecure(),
236
234
  isOptional: false
237
235
  }
238
236
  }
239
237
  });
240
- const ListMembersInputModel = new SchemaModel({
238
+ const ListMembersInputModel = new x8({
241
239
  name: "ListMembersInput",
242
240
  description: "Input for listing members",
243
241
  fields: {
244
242
  orgId: {
245
- type: ScalarTypeEnum.String_unsecure(),
243
+ type: E5.String_unsecure(),
246
244
  isOptional: false
247
245
  },
248
246
  limit: {
249
- type: ScalarTypeEnum.Int_unsecure(),
247
+ type: E5.Int_unsecure(),
250
248
  isOptional: true
251
249
  },
252
250
  offset: {
253
- type: ScalarTypeEnum.Int_unsecure(),
251
+ type: E5.Int_unsecure(),
254
252
  isOptional: true
255
253
  }
256
254
  }
257
255
  });
258
- const ListMembersOutputModel = new SchemaModel({
256
+ const ListMembersOutputModel = new x8({
259
257
  name: "ListMembersOutput",
260
258
  description: "Output for listing members",
261
259
  fields: {
@@ -265,54 +263,54 @@ const ListMembersOutputModel = new SchemaModel({
265
263
  isArray: true
266
264
  },
267
265
  total: {
268
- type: ScalarTypeEnum.Int_unsecure(),
266
+ type: E5.Int_unsecure(),
269
267
  isOptional: false
270
268
  }
271
269
  }
272
270
  });
273
- const OrganizationWithRoleModel = new SchemaModel({
271
+ const OrganizationWithRoleModel = new x8({
274
272
  name: "OrganizationWithRole",
275
273
  description: "Organization with user role",
276
274
  fields: {
277
275
  id: {
278
- type: ScalarTypeEnum.String_unsecure(),
276
+ type: E5.String_unsecure(),
279
277
  isOptional: false
280
278
  },
281
279
  name: {
282
- type: ScalarTypeEnum.String_unsecure(),
280
+ type: E5.String_unsecure(),
283
281
  isOptional: false
284
282
  },
285
283
  slug: {
286
- type: ScalarTypeEnum.String_unsecure(),
284
+ type: E5.String_unsecure(),
287
285
  isOptional: true
288
286
  },
289
287
  logo: {
290
- type: ScalarTypeEnum.URL(),
288
+ type: E5.URL(),
291
289
  isOptional: true
292
290
  },
293
291
  description: {
294
- type: ScalarTypeEnum.String_unsecure(),
292
+ type: E5.String_unsecure(),
295
293
  isOptional: true
296
294
  },
297
295
  type: {
298
- type: ScalarTypeEnum.String_unsecure(),
296
+ type: E5.String_unsecure(),
299
297
  isOptional: false
300
298
  },
301
299
  onboardingCompleted: {
302
- type: ScalarTypeEnum.Boolean(),
300
+ type: E5.Boolean(),
303
301
  isOptional: false
304
302
  },
305
303
  createdAt: {
306
- type: ScalarTypeEnum.DateTime(),
304
+ type: E5.DateTime(),
307
305
  isOptional: false
308
306
  },
309
307
  role: {
310
- type: ScalarTypeEnum.String_unsecure(),
308
+ type: E5.String_unsecure(),
311
309
  isOptional: false
312
310
  }
313
311
  }
314
312
  });
315
- const ListUserOrgsOutputModel = new SchemaModel({
313
+ const ListUserOrgsOutputModel = new x8({
316
314
  name: "ListUserOrgsOutput",
317
315
  description: "Output for listing user organizations",
318
316
  fields: { organizations: {
@@ -604,4 +602,5 @@ const ListUserOrgsContract = defineQuery({
604
602
  });
605
603
 
606
604
  //#endregion
607
- export { AcceptInviteContract, AcceptInviteInputModel, CreateOrgContract, CreateOrgInputModel, GetOrgContract, GetOrgInputModel, InvitationModel, InviteMemberContract, InviteMemberInputModel, ListMembersContract, ListMembersInputModel, ListMembersOutputModel, ListUserOrgsContract, ListUserOrgsOutputModel, MemberModel, MemberRemovedPayloadModel, MemberUserModel, OrganizationModel, OrganizationWithRoleModel, RemoveMemberContract, RemoveMemberInputModel, UpdateOrgContract, UpdateOrgInputModel };
605
+ export { AcceptInviteContract, AcceptInviteInputModel, CreateOrgContract, CreateOrgInputModel, GetOrgContract, GetOrgInputModel, InvitationModel, InviteMemberContract, InviteMemberInputModel, ListMembersContract, ListMembersInputModel, ListMembersOutputModel, ListUserOrgsContract, ListUserOrgsOutputModel, MemberModel, MemberRemovedPayloadModel, MemberUserModel, OrganizationModel, OrganizationWithRoleModel, RemoveMemberContract, RemoveMemberInputModel, UpdateOrgContract, UpdateOrgInputModel };
606
+ //# sourceMappingURL=organization.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.js","names":["SchemaModel","ScalarTypeEnum"],"sources":["../../src/contracts/organization.ts"],"sourcesContent":["import { ScalarTypeEnum, SchemaModel } from '@lssm/lib.schema';\nimport { defineCommand, defineQuery } from '@lssm/lib.contracts';\nimport { SuccessResultModel } from './user';\n\nconst OWNERS = ['platform.identity-rbac'] as const;\n\n// ============ SchemaModels ============\n\nexport const OrganizationModel = new SchemaModel({\n name: 'Organization',\n description: 'Organization details',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n logo: { type: ScalarTypeEnum.URL(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // PLATFORM_ADMIN | CONTRACT_SPEC_CUSTOMER\n onboardingCompleted: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const MemberUserModel = new SchemaModel({\n name: 'MemberUser',\n description: 'Basic user info within a member',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const MemberModel = new SchemaModel({\n name: 'Member',\n description: 'Organization member',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n organizationId: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n user: { type: MemberUserModel, isOptional: false },\n },\n});\n\nexport const InvitationModel = new SchemaModel({\n name: 'Invitation',\n description: 'Organization invitation',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // pending | accepted | declined | expired\n expiresAt: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const CreateOrgInputModel = new SchemaModel({\n name: 'CreateOrgInput',\n description: 'Input for creating an organization',\n fields: {\n name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n type: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const GetOrgInputModel = new SchemaModel({\n name: 'GetOrgInput',\n description: 'Input for getting an organization',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const UpdateOrgInputModel = new SchemaModel({\n name: 'UpdateOrgInput',\n description: 'Input for updating an organization',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n logo: { type: ScalarTypeEnum.URL(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const InviteMemberInputModel = new SchemaModel({\n name: 'InviteMemberInput',\n description: 'Input for inviting a member',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n email: { type: ScalarTypeEnum.EmailAddress(), isOptional: false },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }, // owner | admin | member\n teamId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nexport const AcceptInviteInputModel = new SchemaModel({\n name: 'AcceptInviteInput',\n description: 'Input for accepting an invitation',\n fields: {\n invitationId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const RemoveMemberInputModel = new SchemaModel({\n name: 'RemoveMemberInput',\n description: 'Input for removing a member',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const MemberRemovedPayloadModel = new SchemaModel({\n name: 'MemberRemovedPayload',\n description: 'Payload for member removed event',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n userId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const ListMembersInputModel = new SchemaModel({\n name: 'ListMembersInput',\n description: 'Input for listing members',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n offset: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nexport const ListMembersOutputModel = new SchemaModel({\n name: 'ListMembersOutput',\n description: 'Output for listing members',\n fields: {\n members: { type: MemberModel, isOptional: false, isArray: true },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nexport const OrganizationWithRoleModel = new SchemaModel({\n name: 'OrganizationWithRole',\n description: 'Organization with user role',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n slug: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n logo: { type: ScalarTypeEnum.URL(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n onboardingCompleted: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n role: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nexport const ListUserOrgsOutputModel = new SchemaModel({\n name: 'ListUserOrgsOutput',\n description: 'Output for listing user organizations',\n fields: {\n organizations: {\n type: OrganizationWithRoleModel,\n isOptional: false,\n isArray: true,\n },\n },\n});\n\n// ============ Contracts ============\n\n/**\n * Create a new organization.\n */\nexport const CreateOrgContract = defineCommand({\n meta: {\n name: 'identity.org.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'create'],\n description: 'Create a new organization.',\n goal: 'Allow users to create new organizations/workspaces.',\n context: 'Called during onboarding or when creating additional workspaces.',\n },\n io: {\n input: CreateOrgInputModel,\n output: OrganizationModel,\n errors: {\n SLUG_EXISTS: {\n description: 'An organization with this slug already exists',\n http: 409,\n gqlCode: 'SLUG_EXISTS',\n when: 'Slug is already taken',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n name: 'org.created',\n version: 1,\n when: 'Organization is created',\n payload: OrganizationModel,\n },\n ],\n audit: ['org.created'],\n },\n});\n\n/**\n * Get organization details.\n */\nexport const GetOrgContract = defineQuery({\n meta: {\n name: 'identity.org.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'get'],\n description: 'Get organization details.',\n goal: 'Retrieve organization information.',\n context: 'Called when viewing organization settings or dashboard.',\n },\n io: {\n input: GetOrgInputModel,\n output: OrganizationModel,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Update organization.\n */\nexport const UpdateOrgContract = defineCommand({\n meta: {\n name: 'identity.org.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'update'],\n description: 'Update organization details.',\n goal: 'Allow org admins to update organization settings.',\n context: 'Organization settings page.',\n },\n io: {\n input: UpdateOrgInputModel,\n output: OrganizationModel,\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n name: 'org.updated',\n version: 1,\n when: 'Organization is updated',\n payload: OrganizationModel,\n },\n ],\n audit: ['org.updated'],\n },\n});\n\n/**\n * Invite a member to the organization.\n */\nexport const InviteMemberContract = defineCommand({\n meta: {\n name: 'identity.org.invite',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'invite', 'member'],\n description: 'Invite a user to join the organization.',\n goal: 'Allow org admins to invite new members.',\n context: 'Team management. Sends invitation email.',\n },\n io: {\n input: InviteMemberInputModel,\n output: InvitationModel,\n errors: {\n ALREADY_MEMBER: {\n description: 'User is already a member of this organization',\n http: 409,\n gqlCode: 'ALREADY_MEMBER',\n when: 'Invitee is already a member',\n },\n INVITE_PENDING: {\n description: 'An invitation for this email is already pending',\n http: 409,\n gqlCode: 'INVITE_PENDING',\n when: 'Active invitation exists',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n name: 'org.invite.sent',\n version: 1,\n when: 'Invitation is sent',\n payload: InvitationModel,\n },\n ],\n audit: ['org.invite.sent'],\n },\n});\n\n/**\n * Accept an invitation.\n */\nexport const AcceptInviteContract = defineCommand({\n meta: {\n name: 'identity.org.invite.accept',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'invite', 'accept'],\n description: 'Accept an organization invitation.',\n goal: 'Allow users to join organizations via invitation.',\n context: 'Called from invitation email link.',\n },\n io: {\n input: AcceptInviteInputModel,\n output: MemberModel,\n errors: {\n INVITE_EXPIRED: {\n description: 'The invitation has expired',\n http: 410,\n gqlCode: 'INVITE_EXPIRED',\n when: 'Invitation is past expiry date',\n },\n INVITE_USED: {\n description: 'The invitation has already been used',\n http: 409,\n gqlCode: 'INVITE_USED',\n when: 'Invitation was already accepted',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n name: 'org.member.added',\n version: 1,\n when: 'Member joins org',\n payload: MemberModel,\n },\n ],\n audit: ['org.member.added'],\n },\n});\n\n/**\n * Remove a member from the organization.\n */\nexport const RemoveMemberContract = defineCommand({\n meta: {\n name: 'identity.org.member.remove',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'member', 'remove'],\n description: 'Remove a member from the organization.',\n goal: 'Allow org admins to remove members.',\n context: 'Team management.',\n },\n io: {\n input: RemoveMemberInputModel,\n output: SuccessResultModel,\n errors: {\n CANNOT_REMOVE_OWNER: {\n description: 'Cannot remove the organization owner',\n http: 403,\n gqlCode: 'CANNOT_REMOVE_OWNER',\n when: 'Target is the org owner',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n sideEffects: {\n emits: [\n {\n name: 'org.member.removed',\n version: 1,\n when: 'Member is removed',\n payload: MemberRemovedPayloadModel,\n },\n ],\n audit: ['org.member.removed'],\n },\n});\n\n/**\n * List organization members.\n */\nexport const ListMembersContract = defineQuery({\n meta: {\n name: 'identity.org.members.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'member', 'list'],\n description: 'List organization members.',\n goal: 'View all members of an organization.',\n context: 'Team management page.',\n },\n io: {\n input: ListMembersInputModel,\n output: ListMembersOutputModel,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * List user's organizations.\n */\nexport const ListUserOrgsContract = defineQuery({\n meta: {\n name: 'identity.org.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['identity', 'org', 'list'],\n description: 'List organizations the current user belongs to.',\n goal: 'Show user their organizations for workspace switching.',\n context: 'Workspace switcher, org selection.',\n },\n io: {\n input: null,\n output: ListUserOrgsOutputModel,\n },\n policy: {\n auth: 'user',\n },\n});\n"],"mappings":";;;;;;AAIA,MAAM,SAAS,CAAC,yBAAyB;AAIzC,MAAa,oBAAoB,IAAIA,GAAY;CAC/C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAMC,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,MAAM;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,MAAM;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EAClE,MAAM;GAAE,MAAMA,GAAe,KAAK;GAAE,YAAY;GAAM;EACtD,aAAa;GAAE,MA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