@hcengineering/setting 0.7.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.
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var analytics_exports = {};
20
+ __export(analytics_exports, {
21
+ SettingsEvents: () => SettingsEvents
22
+ });
23
+ module.exports = __toCommonJS(analytics_exports);
24
+ var SettingsEvents = /* @__PURE__ */ ((SettingsEvents2) => {
25
+ SettingsEvents2["SelectWorkspace"] = "settings.SelectWorkspace";
26
+ SettingsEvents2["InviteToWorkspace"] = "settings.InviteToWorkspace";
27
+ SettingsEvents2["SignOut"] = "settings.SignOut";
28
+ return SettingsEvents2;
29
+ })(SettingsEvents || {});
30
+ //# sourceMappingURL=analytics.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/analytics.ts"],
4
+ "sourcesContent": ["export enum SettingsEvents {\n SelectWorkspace = 'settings.SelectWorkspace',\n InviteToWorkspace = 'settings.InviteToWorkspace',\n SignOut = 'settings.SignOut'\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAK,iBAAL,kBAAKA,oBAAL;AACL,EAAAA,gBAAA,qBAAkB;AAClB,EAAAA,gBAAA,uBAAoB;AACpB,EAAAA,gBAAA,aAAU;AAHA,SAAAA;AAAA,GAAA;",
6
+ "names": ["SettingsEvents"]
7
+ }
package/lib/index.js ADDED
@@ -0,0 +1,221 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
+ DOMAIN_SETTING: () => DOMAIN_SETTING,
23
+ IntegrationError: () => IntegrationError,
24
+ default: () => index_default,
25
+ settingId: () => settingId
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+ var import_platform = require("@hcengineering/platform");
29
+ __reExport(index_exports, require("./spaceTypeEditor"), module.exports);
30
+ __reExport(index_exports, require("./utils"), module.exports);
31
+ __reExport(index_exports, require("./analytics"), module.exports);
32
+ const DOMAIN_SETTING = "setting";
33
+ var IntegrationError = /* @__PURE__ */ ((IntegrationError2) => {
34
+ IntegrationError2["EMAIL_IS_ALREADY_USED"] = "EMAIL_IS_ALREADY_USED";
35
+ return IntegrationError2;
36
+ })(IntegrationError || {});
37
+ const settingId = "setting";
38
+ var index_default = (0, import_platform.plugin)(settingId, {
39
+ ids: {
40
+ SettingApp: "",
41
+ Profile: "",
42
+ Password: "",
43
+ Setting: "",
44
+ Integrations: "",
45
+ Relations: "",
46
+ Support: "",
47
+ Privacy: "",
48
+ Terms: "",
49
+ ClassSetting: "",
50
+ General: "",
51
+ Owners: "",
52
+ InviteSettings: "",
53
+ WorkspaceSetting: "",
54
+ ManageSpaces: "",
55
+ Spaces: "",
56
+ Backup: "",
57
+ Export: "",
58
+ DisablePermissionsConfiguration: "",
59
+ Mailboxes: ""
60
+ },
61
+ mixin: {
62
+ Editable: "",
63
+ UserMixin: "",
64
+ SpaceTypeEditor: "",
65
+ SpaceTypeCreator: ""
66
+ },
67
+ class: {
68
+ SettingsCategory: "",
69
+ WorkspaceSettingCategory: "",
70
+ Integration: "",
71
+ IntegrationType: "",
72
+ InviteSettings: "",
73
+ WorkspaceSetting: ""
74
+ },
75
+ component: {
76
+ Settings: "",
77
+ Profile: "",
78
+ Password: "",
79
+ WorkspaceSettings: "",
80
+ Integrations: "",
81
+ Support: "",
82
+ Privacy: "",
83
+ Terms: "",
84
+ ClassSetting: "",
85
+ PermissionPresenter: "",
86
+ SpaceTypeDescriptorPresenter: "",
87
+ SpaceTypeGeneralSectionEditor: "",
88
+ SpaceTypePropertiesSectionEditor: "",
89
+ SpaceTypeRolesSectionEditor: "",
90
+ RoleEditor: "",
91
+ RoleAssignmentEditor: "",
92
+ RelationSetting: "",
93
+ Backup: "",
94
+ CreateAttributePopup: "",
95
+ CreateRelation: "",
96
+ EditRelation: "",
97
+ Mailboxes: "",
98
+ AddEmailSocialId: ""
99
+ },
100
+ string: {
101
+ Settings: "",
102
+ Setting: "",
103
+ Spaces: "",
104
+ WorkspaceSettings: "",
105
+ Integrations: "",
106
+ Support: "",
107
+ Privacy: "",
108
+ Terms: "",
109
+ Categories: "",
110
+ Delete: "",
111
+ Disconnect: "",
112
+ DisconnectAll: "",
113
+ Add: "",
114
+ Proceed: "",
115
+ SendConfirmation: "",
116
+ NewEmail: "",
117
+ AccountSettings: "",
118
+ ChangePassword: "",
119
+ CurrentPassword: "",
120
+ NewPassword: "",
121
+ Saving: "",
122
+ Saved: "",
123
+ EnterCurrentPassword: "",
124
+ EnterNewPassword: "",
125
+ RepeatNewPassword: "",
126
+ Signout: "",
127
+ InviteWorkspace: "",
128
+ SelectWorkspace: "",
129
+ Reconnect: "",
130
+ ClassSetting: "",
131
+ Classes: "",
132
+ Owners: "",
133
+ Configure: "",
134
+ InviteSettings: "",
135
+ General: "",
136
+ Properties: "",
137
+ TaskTypes: "",
138
+ Automations: "",
139
+ Collections: "",
140
+ SpaceTypes: "",
141
+ Roles: "",
142
+ OwnerOrMaintainerRequired: "",
143
+ Backup: "",
144
+ BackupLast: "",
145
+ BackupTotalSnapshots: "",
146
+ BackupTotalFiles: "",
147
+ BackupSize: "",
148
+ BackupLinkInfo: "",
149
+ BackupBearerTokenInfo: "",
150
+ BackupSnapshots: "",
151
+ BackupFileDownload: "",
152
+ BackupFiles: "",
153
+ BackupNoBackup: "",
154
+ NonBackupedBlobs: "",
155
+ AddAttribute: "",
156
+ Mailboxes: "",
157
+ CreateMailbox: "",
158
+ CreateMailboxPlaceholder: "",
159
+ MailboxNoDomains: "",
160
+ MailboxLimitReached: "",
161
+ MailboxErrorInvalidName: "",
162
+ MailboxErrorDomainNotFound: "",
163
+ MailboxErrorNameRulesViolated: "",
164
+ MailboxErrorMailboxExists: "",
165
+ MailboxErrorMailboxCountLimit: "",
166
+ DeleteMailbox: "",
167
+ MailboxDeleteConfirmation: "",
168
+ IntegrationFailed: "",
169
+ IntegrationError: "",
170
+ EmailIsUsed: "",
171
+ Customize: "",
172
+ CodeSent: "",
173
+ SendAgain: "",
174
+ SendAgainIn: "",
175
+ AllIntegrations: "",
176
+ ConnectedIntegrations: "",
177
+ AvailableIntegrations: "",
178
+ Connect: "",
179
+ Integrate: "",
180
+ FailedToLoadIntegrations: "",
181
+ FailedToDisconnect: "",
182
+ ServiceIsUnavailable: "",
183
+ Integrated: "",
184
+ Connected: "",
185
+ Available: "",
186
+ NotConnectedIntegration: "",
187
+ IntegrationIsUnstable: ""
188
+ },
189
+ icon: {
190
+ AccountSettings: "",
191
+ Owners: "",
192
+ Password: "",
193
+ Setting: "",
194
+ Integrations: "",
195
+ Support: "",
196
+ Privacy: "",
197
+ Terms: "",
198
+ Signout: "",
199
+ SelectWorkspace: "",
200
+ Clazz: "",
201
+ Enums: "",
202
+ InviteSettings: "",
203
+ InviteWorkspace: "",
204
+ Views: "",
205
+ Relations: "",
206
+ Mailbox: ""
207
+ },
208
+ templateFieldCategory: {
209
+ Integration: ""
210
+ },
211
+ templateField: {
212
+ OwnerFirstName: "",
213
+ OwnerLastName: "",
214
+ OwnerPosition: "",
215
+ Value: ""
216
+ },
217
+ metadata: {
218
+ BackupUrl: ""
219
+ }
220
+ });
221
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright \u00A9 2020, 2021 Anticrm Platform Contributors.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport type {\n AccountRole,\n Blob,\n Class,\n Configuration,\n Doc,\n Mixin,\n Ref,\n AccountUuid,\n Domain,\n IntegrationKind\n} from '@hcengineering/core'\nimport type { Metadata, Plugin } from '@hcengineering/platform'\nimport { Asset, IntlString, Resource, plugin } from '@hcengineering/platform'\nimport { TemplateField, TemplateFieldCategory } from '@hcengineering/templates'\nimport { Action, AnyComponent } from '@hcengineering/ui'\nimport { type Integration as AccountIntegration } from '@hcengineering/account-client'\n\nimport { SpaceTypeCreator, SpaceTypeEditor } from './spaceTypeEditor'\n\nexport * from './spaceTypeEditor'\nexport * from './utils'\nexport * from './analytics'\n\nexport const DOMAIN_SETTING = 'setting' as Domain\n\n/**\n * @public\n */\nexport type Handler = Resource<(integration: AccountIntegration) => Promise<void>>\n\n/**\n * @public\n */\nexport interface IntegrationType extends Doc {\n label: IntlString\n description: IntlString\n descriptionComponent?: AnyComponent\n stateComponent?: AnyComponent\n icon: AnyComponent\n allowMultiple: boolean\n kind: IntegrationKind\n\n createComponent?: AnyComponent\n onDisconnect?: Handler\n onDisconnectAll?: Handler // Disconnect for all workspaces\n reconnectComponent?: AnyComponent\n configureComponent?: AnyComponent\n\n getActions?: Resource<(integration?: AccountIntegration) => Promise<Action[]>>\n}\n\n/**\n * @public\n */\nexport interface Integration extends Doc {\n type: Ref<IntegrationType>\n disabled: boolean\n value: string\n error?: IntlString | null\n shared?: AccountUuid[]\n}\n\n/**\n * @public\n */\nexport interface Editable extends Class<Doc> {\n value: boolean // true is editable, false is not\n}\n\n/**\n * @public\n *\n * Mixin to allow delete of Custom classes.\n */\nexport interface UserMixin extends Class<Doc> {}\n\n/**\n * @public\n */\nexport interface SettingsCategory extends Doc {\n name: string\n label: IntlString\n icon: Asset\n component: AnyComponent\n props?: Record<string, any>\n\n // If defined, will pass kind with key to component\n extraComponents?: Record<string, AnyComponent>\n\n group?: string\n\n // If defined, will sort using order.\n order?: number\n role: AccountRole\n\n expandable?: boolean\n adminOnly?: boolean\n}\n\n/**\n * @public\n */\nexport interface InviteSettings extends Configuration {\n expirationTime: number\n emailMask: string\n limit: number\n}\n\n/**\n * @public\n */\nexport interface WorkspaceSetting extends Doc {\n icon?: Ref<Blob> | null\n}\n\nexport enum IntegrationError {\n EMAIL_IS_ALREADY_USED = 'EMAIL_IS_ALREADY_USED'\n}\n\n/**\n * @public\n */\nexport const settingId = 'setting' as Plugin\n\nexport default plugin(settingId, {\n ids: {\n SettingApp: '' as Ref<Doc>,\n Profile: '' as Ref<Doc>,\n Password: '' as Ref<Doc>,\n Setting: '' as Ref<Doc>,\n Integrations: '' as Ref<Doc>,\n Relations: '' as Ref<Doc>,\n Support: '' as Ref<Doc>,\n Privacy: '' as Ref<Doc>,\n Terms: '' as Ref<Doc>,\n ClassSetting: '' as Ref<Doc>,\n General: '' as Ref<Doc>,\n Owners: '' as Ref<Doc>,\n InviteSettings: '' as Ref<Doc>,\n WorkspaceSetting: '' as Ref<Doc>,\n ManageSpaces: '' as Ref<Doc>,\n Spaces: '' as Ref<Doc>,\n Backup: '' as Ref<Doc>,\n Export: '' as Ref<Doc>,\n DisablePermissionsConfiguration: '' as Ref<Configuration>,\n Mailboxes: '' as Ref<Doc>\n },\n mixin: {\n Editable: '' as Ref<Mixin<Editable>>,\n UserMixin: '' as Ref<Mixin<UserMixin>>,\n SpaceTypeEditor: '' as Ref<Mixin<SpaceTypeEditor>>,\n SpaceTypeCreator: '' as Ref<Mixin<SpaceTypeCreator>>\n },\n class: {\n SettingsCategory: '' as Ref<Class<SettingsCategory>>,\n WorkspaceSettingCategory: '' as Ref<Class<SettingsCategory>>,\n Integration: '' as Ref<Class<Integration>>,\n IntegrationType: '' as Ref<Class<IntegrationType>>,\n InviteSettings: '' as Ref<Class<InviteSettings>>,\n WorkspaceSetting: '' as Ref<Class<WorkspaceSetting>>\n },\n component: {\n Settings: '' as AnyComponent,\n Profile: '' as AnyComponent,\n Password: '' as AnyComponent,\n WorkspaceSettings: '' as AnyComponent,\n Integrations: '' as AnyComponent,\n Support: '' as AnyComponent,\n Privacy: '' as AnyComponent,\n Terms: '' as AnyComponent,\n ClassSetting: '' as AnyComponent,\n PermissionPresenter: '' as AnyComponent,\n SpaceTypeDescriptorPresenter: '' as AnyComponent,\n SpaceTypeGeneralSectionEditor: '' as AnyComponent,\n SpaceTypePropertiesSectionEditor: '' as AnyComponent,\n SpaceTypeRolesSectionEditor: '' as AnyComponent,\n RoleEditor: '' as AnyComponent,\n RoleAssignmentEditor: '' as AnyComponent,\n RelationSetting: '' as AnyComponent,\n Backup: '' as AnyComponent,\n CreateAttributePopup: '' as AnyComponent,\n CreateRelation: '' as AnyComponent,\n EditRelation: '' as AnyComponent,\n Mailboxes: '' as AnyComponent,\n AddEmailSocialId: '' as AnyComponent\n },\n string: {\n Settings: '' as IntlString,\n Setting: '' as IntlString,\n Spaces: '' as IntlString,\n WorkspaceSettings: '' as IntlString,\n Integrations: '' as IntlString,\n Support: '' as IntlString,\n Privacy: '' as IntlString,\n Terms: '' as IntlString,\n Categories: '' as IntlString,\n Delete: '' as IntlString,\n Disconnect: '' as IntlString,\n DisconnectAll: '' as IntlString,\n Add: '' as IntlString,\n Proceed: '' as IntlString,\n SendConfirmation: '' as IntlString,\n NewEmail: '' as IntlString,\n AccountSettings: '' as IntlString,\n ChangePassword: '' as IntlString,\n CurrentPassword: '' as IntlString,\n NewPassword: '' as IntlString,\n Saving: '' as IntlString,\n Saved: '' as IntlString,\n EnterCurrentPassword: '' as IntlString,\n EnterNewPassword: '' as IntlString,\n RepeatNewPassword: '' as IntlString,\n Signout: '' as IntlString,\n InviteWorkspace: '' as IntlString,\n SelectWorkspace: '' as IntlString,\n Reconnect: '' as IntlString,\n ClassSetting: '' as IntlString,\n Classes: '' as IntlString,\n Owners: '' as IntlString,\n Configure: '' as IntlString,\n InviteSettings: '' as IntlString,\n General: '' as IntlString,\n Properties: '' as IntlString,\n TaskTypes: '' as IntlString,\n Automations: '' as IntlString,\n Collections: '' as IntlString,\n SpaceTypes: '' as IntlString,\n Roles: '' as IntlString,\n OwnerOrMaintainerRequired: '' as IntlString,\n Backup: '' as IntlString,\n BackupLast: '' as IntlString,\n BackupTotalSnapshots: '' as IntlString,\n BackupTotalFiles: '' as IntlString,\n BackupSize: '' as IntlString,\n BackupLinkInfo: '' as IntlString,\n BackupBearerTokenInfo: '' as IntlString,\n BackupSnapshots: '' as IntlString,\n BackupFileDownload: '' as IntlString,\n BackupFiles: '' as IntlString,\n BackupNoBackup: '' as IntlString,\n NonBackupedBlobs: '' as IntlString,\n AddAttribute: '' as IntlString,\n Mailboxes: '' as IntlString,\n CreateMailbox: '' as IntlString,\n CreateMailboxPlaceholder: '' as IntlString,\n MailboxNoDomains: '' as IntlString,\n MailboxLimitReached: '' as IntlString,\n MailboxErrorInvalidName: '' as IntlString,\n MailboxErrorDomainNotFound: '' as IntlString,\n MailboxErrorNameRulesViolated: '' as IntlString,\n MailboxErrorMailboxExists: '' as IntlString,\n MailboxErrorMailboxCountLimit: '' as IntlString,\n DeleteMailbox: '' as IntlString,\n MailboxDeleteConfirmation: '' as IntlString,\n IntegrationFailed: '' as IntlString,\n IntegrationError: '' as IntlString,\n EmailIsUsed: '' as IntlString,\n Customize: '' as IntlString,\n CodeSent: '' as IntlString,\n SendAgain: '' as IntlString,\n SendAgainIn: '' as IntlString,\n AllIntegrations: '' as IntlString,\n ConnectedIntegrations: '' as IntlString,\n AvailableIntegrations: '' as IntlString,\n Connect: '' as IntlString,\n Integrate: '' as IntlString,\n FailedToLoadIntegrations: '' as IntlString,\n FailedToDisconnect: '' as IntlString,\n ServiceIsUnavailable: '' as IntlString,\n Integrated: '' as IntlString,\n Connected: '' as IntlString,\n Available: '' as IntlString,\n NotConnectedIntegration: '' as IntlString,\n IntegrationIsUnstable: '' as IntlString\n },\n icon: {\n AccountSettings: '' as Asset,\n Owners: '' as Asset,\n Password: '' as Asset,\n Setting: '' as Asset,\n Integrations: '' as Asset,\n Support: '' as Asset,\n Privacy: '' as Asset,\n Terms: '' as Asset,\n Signout: '' as Asset,\n SelectWorkspace: '' as Asset,\n Clazz: '' as Asset,\n Enums: '' as Asset,\n InviteSettings: '' as Asset,\n InviteWorkspace: '' as Asset,\n Views: '' as Asset,\n Relations: '' as Asset,\n Mailbox: '' as Asset\n },\n templateFieldCategory: {\n Integration: '' as Ref<TemplateFieldCategory>\n },\n templateField: {\n OwnerFirstName: '' as Ref<TemplateField>,\n OwnerLastName: '' as Ref<TemplateField>,\n OwnerPosition: '' as Ref<TemplateField>,\n Value: '' as Ref<TemplateField>\n },\n metadata: {\n BackupUrl: '' as Metadata<string>\n }\n})\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4BA,sBAAoD;AAOpD,0BAAc,8BAnCd;AAoCA,0BAAc,oBApCd;AAqCA,0BAAc,wBArCd;AAuCO,MAAM,iBAAiB;AA4FvB,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,2BAAwB;AADd,SAAAA;AAAA,GAAA;AAOL,MAAM,YAAY;AAEzB,IAAO,oBAAQ,wBAAO,WAAW;AAAA,EAC/B,KAAK;AAAA,IACH,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,IACT,cAAc;AAAA,IACd,WAAW;AAAA,IACX,SAAS;AAAA,IACT,SAAS;AAAA,IACT,OAAO;AAAA,IACP,cAAc;AAAA,IACd,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,IAClB,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,iCAAiC;AAAA,IACjC,WAAW;AAAA,EACb;AAAA,EACA,OAAO;AAAA,IACL,UAAU;AAAA,IACV,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,EACpB;AAAA,EACA,OAAO;AAAA,IACL,kBAAkB;AAAA,IAClB,0BAA0B;AAAA,IAC1B,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EACpB;AAAA,EACA,WAAW;AAAA,IACT,UAAU;AAAA,IACV,SAAS;AAAA,IACT,UAAU;AAAA,IACV,mBAAmB;AAAA,IACnB,cAAc;AAAA,IACd,SAAS;AAAA,IACT,SAAS;AAAA,IACT,OAAO;AAAA,IACP,c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AAAA,EACb;AACF,CAAC;",
6
+ "names": ["IntegrationError"]
7
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var spaceTypeEditor_exports = {};
16
+ module.exports = __toCommonJS(spaceTypeEditor_exports);
17
+ //# sourceMappingURL=spaceTypeEditor.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/spaceTypeEditor.ts"],
4
+ "sourcesContent": ["//\n// Copyright \u00A9 2024 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport type { Class, SpaceType, SpaceTypeDescriptor } from '@hcengineering/core'\nimport type { IntlString } from '@hcengineering/platform'\nimport type { AnyComponent } from '@hcengineering/ui'\n\n/**\n * @public\n *\n * A mixin describing various configurations of a space type editor\n */\nexport interface SpaceTypeEditor extends Class<SpaceType> {\n sections: SpaceTypeEditorSection[]\n subEditors?: Record<string, AnyComponent>\n}\n\n/**\n * @public\n *\n * Describes one space type editor section\n */\nexport interface SpaceTypeEditorSection {\n id: string\n label: IntlString\n component: AnyComponent\n withoutContainer?: boolean\n}\n\n/**\n * @public\n *\n * A mixin for extensions during space type creation\n */\nexport interface SpaceTypeCreator extends Class<SpaceTypeDescriptor> {\n extraComponent: AnyComponent\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
6
+ "names": []
7
+ }
package/lib/utils.js ADDED
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
+ var __export = (target, all) => {
10
+ for (var name in all)
11
+ __defProp(target, name, { get: all[name], enumerable: true });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from))
16
+ if (!__hasOwnProp.call(to, key) && key !== except)
17
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
+ }
19
+ return to;
20
+ };
21
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
+ // If the importer is in node compatibility mode or this is not an ESM
23
+ // file that has been converted to a CommonJS file using a Babel-
24
+ // compatible transform (i.e. "__esModule" has not been set), then set
25
+ // "default" to the CommonJS "module.exports" for node compatibility.
26
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
+ mod
28
+ ));
29
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
+ var utils_exports = {};
31
+ __export(utils_exports, {
32
+ createSpaceType: () => createSpaceType,
33
+ createSpaceTypeRole: () => createSpaceTypeRole,
34
+ createSpaceTypeRoles: () => createSpaceTypeRoles,
35
+ deleteSpaceTypeRole: () => deleteSpaceTypeRole,
36
+ getRoleAttributeProps: () => getRoleAttributeProps
37
+ });
38
+ module.exports = __toCommonJS(utils_exports);
39
+ var import_core = __toESM(require("@hcengineering/core"));
40
+ var import_platform = require("@hcengineering/platform");
41
+ var import_index = __toESM(require("./index"));
42
+ async function createSpaceType(client, data, _id, _class = import_core.default.class.SpaceType) {
43
+ const descriptorObj = client.getModel().findObject(data.descriptor);
44
+ if (descriptorObj === void 0) {
45
+ throw new Error("Descriptor is not found in the model");
46
+ }
47
+ const baseClassClazz = client.getHierarchy().getClass(descriptorObj.baseClass);
48
+ const spaceTypeMixinId = `${_id}:type:mixin`;
49
+ await client.createDoc(
50
+ import_core.default.class.Mixin,
51
+ import_core.default.space.Model,
52
+ {
53
+ extends: descriptorObj.baseClass,
54
+ kind: import_core.ClassifierKind.MIXIN,
55
+ label: (0, import_platform.getEmbeddedLabel)(data.name),
56
+ icon: baseClassClazz.icon
57
+ },
58
+ spaceTypeMixinId
59
+ );
60
+ return await client.createDoc(
61
+ _class,
62
+ import_core.default.space.Model,
63
+ { ...data, targetClass: spaceTypeMixinId },
64
+ _id
65
+ );
66
+ }
67
+ __name(createSpaceType, "createSpaceType");
68
+ function TypeAny(presenter, label, editor) {
69
+ return { _class: import_core.default.class.TypeAny, label, presenter, editor };
70
+ }
71
+ __name(TypeAny, "TypeAny");
72
+ function getRoleAttributeProps(name) {
73
+ const label = (0, import_core.getRoleAttributeLabel)(name);
74
+ const roleType = TypeAny(import_index.default.component.RoleAssignmentEditor, label, import_index.default.component.RoleAssignmentEditor);
75
+ return { label, roleType };
76
+ }
77
+ __name(getRoleAttributeProps, "getRoleAttributeProps");
78
+ async function createSpaceTypeRole(client, type, data, _id) {
79
+ const roleId = await client.addCollection(
80
+ import_core.default.class.Role,
81
+ import_core.default.space.Model,
82
+ type._id,
83
+ type._class,
84
+ "roles",
85
+ data,
86
+ _id
87
+ );
88
+ const { label, roleType } = getRoleAttributeProps(data.name);
89
+ await client.createDoc(import_core.default.class.Attribute, import_core.default.space.Model, {
90
+ name: roleId,
91
+ attributeOf: type.targetClass,
92
+ type: roleType,
93
+ label
94
+ });
95
+ return roleId;
96
+ }
97
+ __name(createSpaceTypeRole, "createSpaceTypeRole");
98
+ async function createSpaceTypeRoles(tx, typeId, roles) {
99
+ const spaceType = await tx.findOne(import_core.default.class.SpaceType, { _id: typeId });
100
+ if (spaceType === void 0) return;
101
+ for (const { _id, name, permissions } of roles) {
102
+ await createSpaceTypeRole(tx, spaceType, { name, permissions }, _id);
103
+ }
104
+ }
105
+ __name(createSpaceTypeRoles, "createSpaceTypeRoles");
106
+ async function deleteSpaceTypeRole(client, role, targetClass) {
107
+ const attribute = await client.findOne(import_core.default.class.Attribute, { name: role._id, attributeOf: targetClass });
108
+ const ops = client.apply();
109
+ await ops.removeCollection(
110
+ import_core.default.class.Role,
111
+ import_core.default.space.Model,
112
+ role._id,
113
+ role.attachedTo,
114
+ role.attachedToClass,
115
+ "roles"
116
+ );
117
+ if (attribute !== void 0) {
118
+ const mixins = await client.findAll(targetClass, {});
119
+ for (const mixin of mixins) {
120
+ await ops.updateMixin(mixin._id, mixin._class, mixin.space, targetClass, {
121
+ [attribute.name]: void 0
122
+ });
123
+ }
124
+ await ops.remove(attribute);
125
+ }
126
+ await ops.commit();
127
+ }
128
+ __name(deleteSpaceTypeRole, "deleteSpaceTypeRole");
129
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/utils.ts"],
4
+ "sourcesContent": ["//\n// Copyright \u00A9 2024 Hardcore Engineering Inc.\n//\n// Licensed under the Eclipse Public License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License. You may\n// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n//\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\nimport core, {\n AttachedData,\n Class,\n ClassifierKind,\n Data,\n Ref,\n Role,\n Space,\n SpaceType,\n TxOperations,\n TypeAny as TypeAnyType,\n getRoleAttributeLabel\n} from '@hcengineering/core'\nimport { getEmbeddedLabel, IntlString } from '@hcengineering/platform'\n\nimport setting from './index'\n\nexport async function createSpaceType<T extends SpaceType> (\n client: TxOperations,\n data: Omit<Data<T>, 'targetClass'>,\n _id: Ref<T>,\n _class: Ref<Class<T>> = core.class.SpaceType\n): Promise<Ref<T>> {\n const descriptorObj = client.getModel().findObject(data.descriptor)\n if (descriptorObj === undefined) {\n throw new Error('Descriptor is not found in the model')\n }\n\n const baseClassClazz = client.getHierarchy().getClass(descriptorObj.baseClass)\n // NOTE: it is important for this id to be consistent when re-creating the same\n // space type with the same id as it will happen during every migration if type is created by the system\n const spaceTypeMixinId = `${_id}:type:mixin` as Ref<Class<Space>>\n await client.createDoc(\n core.class.Mixin,\n core.space.Model,\n {\n extends: descriptorObj.baseClass,\n kind: ClassifierKind.MIXIN,\n label: getEmbeddedLabel(data.name),\n icon: baseClassClazz.icon\n },\n spaceTypeMixinId\n )\n\n return await client.createDoc(\n _class,\n core.space.Model,\n { ...data, targetClass: spaceTypeMixinId } as unknown as Data<T>,\n _id\n )\n}\n\nexport interface RoleAttributeProps {\n label: IntlString\n roleType: TypeAnyType\n}\n\n/**\n * @public\n */\nfunction TypeAny<AnyComponent = any> (\n presenter: AnyComponent,\n label: IntlString,\n editor?: AnyComponent\n): TypeAnyType<AnyComponent> {\n return { _class: core.class.TypeAny, label, presenter, editor }\n}\nexport function getRoleAttributeProps (name: string): RoleAttributeProps {\n const label = getRoleAttributeLabel(name)\n const roleType = TypeAny(setting.component.RoleAssignmentEditor, label, setting.component.RoleAssignmentEditor)\n\n return { label, roleType }\n}\n\nexport async function createSpaceTypeRole (\n client: TxOperations,\n type: Pick<SpaceType, '_id' | '_class' | 'targetClass'>,\n data: AttachedData<Role>,\n _id?: Ref<Role> | undefined\n): Promise<Ref<Role>> {\n const roleId = await client.addCollection(\n core.class.Role,\n core.space.Model,\n type._id,\n type._class,\n 'roles',\n data,\n _id\n )\n\n const { label, roleType } = getRoleAttributeProps(data.name)\n\n await client.createDoc(core.class.Attribute, core.space.Model, {\n name: roleId,\n attributeOf: type.targetClass,\n type: roleType,\n label\n })\n\n return roleId\n}\n\nexport async function createSpaceTypeRoles (\n tx: TxOperations,\n typeId: Ref<SpaceType>,\n roles: Pick<Role, '_id' | 'name' | 'permissions'>[]\n): Promise<void> {\n const spaceType = await tx.findOne(core.class.SpaceType, { _id: typeId })\n if (spaceType === undefined) return\n\n for (const { _id, name, permissions } of roles) {\n await createSpaceTypeRole(tx, spaceType, { name, permissions }, _id)\n }\n}\n\nexport async function deleteSpaceTypeRole (\n client: TxOperations,\n role: Role,\n targetClass: Ref<Class<Space>>\n): Promise<void> {\n const attribute = await client.findOne(core.class.Attribute, { name: role._id, attributeOf: targetClass })\n const ops = client.apply()\n\n await ops.removeCollection(\n core.class.Role,\n core.space.Model,\n role._id,\n role.attachedTo,\n role.attachedToClass,\n 'roles'\n )\n if (attribute !== undefined) {\n const mixins = await client.findAll(targetClass, {})\n for (const mixin of mixins) {\n await ops.updateMixin(mixin._id, mixin._class, mixin.space, targetClass, {\n [attribute.name]: undefined\n })\n }\n\n await ops.remove(attribute)\n }\n\n // remove all the assignments\n await ops.commit()\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeA,kBAYO;AACP,sBAA6C;AAE7C,mBAAoB;AAEpB,eAAsB,gBACpB,QACA,MACA,KACA,SAAwB,YAAAA,QAAK,MAAM,WAClB;AACjB,QAAM,gBAAgB,OAAO,SAAS,EAAE,WAAW,KAAK,UAAU;AAClE,MA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AAAA,IAClB,MAAM;AAAA,IACN;AAAA,EACF,CAAC;AAED,SAAO;AACT;AA1BsB;AA4BtB,eAAsB,qBACpB,IACA,QACA,OACe;AACf,QAAM,YAAY,MAAM,GAAG,QAAQ,YAAAA,QAAK,MAAM,WAAW,EAAE,KAAK,OAAO,CAAC;AACxE,MAAI,cAAc,OAAW;AAE7B,aAAW,EAAE,KAAK,MAAM,YAAY,KAAK,OAAO;AAC9C,UAAM,oBAAoB,IAAI,WAAW,EAAE,MAAM,YAAY,GAAG,GAAG;AAAA,EACrE;AACF;AAXsB;AAatB,eAAsB,oBACpB,QACA,MACA,aACe;AACf,QAAM,YAAY,MAAM,OAAO,QAAQ,YAAAA,QAAK,MAAM,WAAW,EAAE,MAAM,KAAK,KAAK,aAAa,YAAY,CAAC;AACzG,QAAM,MAAM,OAAO,MAAM;AAEzB,QAAM,IAAI;AAAA,IACR,YAAAA,QAAK,MAAM;AAAA,IACX,YAAAA,QAAK,MAAM;AAAA,IACX,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL;AAAA,EACF;AACA,MAAI,cAAc,QAAW;AAC3B,UAAM,SAAS,MAAM,OAAO,QAAQ,aAAa,CAAC,CAAC;AACnD,eAAW,SAAS,QAAQ;AAC1B,YAAM,IAAI,YAAY,MAAM,KAAK,MAAM,QAAQ,MAAM,OAAO,aAAa;AAAA,QACvE,CAAC,UAAU,IAAI,GAAG;AAAA,MACpB,CAAC;AAAA,IACH;AAEA,UAAM,IAAI,OAAO,SAAS;AAAA,EAC5B;AAGA,QAAM,IAAI,OAAO;AACnB;AA7BsB;",
6
+ "names": ["core", "setting"]
7
+ }
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "@hcengineering/setting",
3
+ "version": "0.7.0",
4
+ "main": "lib/index.js",
5
+ "svelte": "src/index.ts",
6
+ "types": "types/index.d.ts",
7
+ "files": [
8
+ "lib/**/*",
9
+ "types/**/*",
10
+ "tsconfig.json"
11
+ ],
12
+ "author": "Anticrm Platform Contributors",
13
+ "license": "EPL-2.0",
14
+ "scripts": {
15
+ "build": "compile",
16
+ "build:watch": "compile",
17
+ "format": "format src",
18
+ "test": "jest --passWithNoTests --silent",
19
+ "_phase:build": "compile transpile src",
20
+ "_phase:test": "jest --passWithNoTests --silent",
21
+ "_phase:format": "format src",
22
+ "_phase:validate": "compile validate"
23
+ },
24
+ "devDependencies": {
25
+ "@hcengineering/platform-rig": "^0.7.10",
26
+ "@typescript-eslint/eslint-plugin": "^6.11.0",
27
+ "eslint-plugin-import": "^2.26.0",
28
+ "eslint-plugin-promise": "^6.1.1",
29
+ "eslint-plugin-n": "^15.4.0",
30
+ "eslint": "^8.54.0",
31
+ "@typescript-eslint/parser": "^6.11.0",
32
+ "eslint-config-standard-with-typescript": "^40.0.0",
33
+ "prettier": "^3.1.0",
34
+ "typescript": "^5.8.3",
35
+ "jest": "^29.7.0",
36
+ "ts-jest": "^29.1.1",
37
+ "@types/jest": "^29.5.5"
38
+ },
39
+ "dependencies": {
40
+ "@hcengineering/platform": "^0.7.3",
41
+ "@hcengineering/core": "^0.7.3",
42
+ "@hcengineering/templates": "^0.7.0",
43
+ "@hcengineering/ui": "^0.7.0",
44
+ "@hcengineering/account-client": "^0.7.3"
45
+ },
46
+ "repository": "https://github.com/hcengineering/platform",
47
+ "publishConfig": {
48
+ "access": "public"
49
+ }
50
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "extends": "./node_modules/@hcengineering/platform-rig/profiles/default/tsconfig.json",
3
+
4
+ "compilerOptions": {
5
+ "rootDir": "./src",
6
+ "outDir": "./lib",
7
+ "declarationDir": "./types",
8
+ "tsBuildInfoFile": ".build/build.tsbuildinfo"
9
+ },
10
+ "include": ["src/**/*"],
11
+ "exclude": ["node_modules", "lib", "dist", "types", "bundle"]
12
+ }
@@ -0,0 +1,6 @@
1
+ export declare enum SettingsEvents {
2
+ SelectWorkspace = "settings.SelectWorkspace",
3
+ InviteToWorkspace = "settings.InviteToWorkspace",
4
+ SignOut = "settings.SignOut"
5
+ }
6
+ //# sourceMappingURL=analytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,eAAe,6BAA6B;IAC5C,iBAAiB,+BAA+B;IAChD,OAAO,qBAAqB;CAC7B"}
@@ -0,0 +1,278 @@
1
+ import type { AccountRole, Blob, Class, Configuration, Doc, Mixin, Ref, AccountUuid, Domain, IntegrationKind } from '@hcengineering/core';
2
+ import type { Metadata, Plugin } from '@hcengineering/platform';
3
+ import { Asset, IntlString, Resource } from '@hcengineering/platform';
4
+ import { TemplateField, TemplateFieldCategory } from '@hcengineering/templates';
5
+ import { Action, AnyComponent } from '@hcengineering/ui';
6
+ import { type Integration as AccountIntegration } from '@hcengineering/account-client';
7
+ import { SpaceTypeCreator, SpaceTypeEditor } from './spaceTypeEditor';
8
+ export * from './spaceTypeEditor';
9
+ export * from './utils';
10
+ export * from './analytics';
11
+ export declare const DOMAIN_SETTING: Domain;
12
+ /**
13
+ * @public
14
+ */
15
+ export type Handler = Resource<(integration: AccountIntegration) => Promise<void>>;
16
+ /**
17
+ * @public
18
+ */
19
+ export interface IntegrationType extends Doc {
20
+ label: IntlString;
21
+ description: IntlString;
22
+ descriptionComponent?: AnyComponent;
23
+ stateComponent?: AnyComponent;
24
+ icon: AnyComponent;
25
+ allowMultiple: boolean;
26
+ kind: IntegrationKind;
27
+ createComponent?: AnyComponent;
28
+ onDisconnect?: Handler;
29
+ onDisconnectAll?: Handler;
30
+ reconnectComponent?: AnyComponent;
31
+ configureComponent?: AnyComponent;
32
+ getActions?: Resource<(integration?: AccountIntegration) => Promise<Action[]>>;
33
+ }
34
+ /**
35
+ * @public
36
+ */
37
+ export interface Integration extends Doc {
38
+ type: Ref<IntegrationType>;
39
+ disabled: boolean;
40
+ value: string;
41
+ error?: IntlString | null;
42
+ shared?: AccountUuid[];
43
+ }
44
+ /**
45
+ * @public
46
+ */
47
+ export interface Editable extends Class<Doc> {
48
+ value: boolean;
49
+ }
50
+ /**
51
+ * @public
52
+ *
53
+ * Mixin to allow delete of Custom classes.
54
+ */
55
+ export interface UserMixin extends Class<Doc> {
56
+ }
57
+ /**
58
+ * @public
59
+ */
60
+ export interface SettingsCategory extends Doc {
61
+ name: string;
62
+ label: IntlString;
63
+ icon: Asset;
64
+ component: AnyComponent;
65
+ props?: Record<string, any>;
66
+ extraComponents?: Record<string, AnyComponent>;
67
+ group?: string;
68
+ order?: number;
69
+ role: AccountRole;
70
+ expandable?: boolean;
71
+ adminOnly?: boolean;
72
+ }
73
+ /**
74
+ * @public
75
+ */
76
+ export interface InviteSettings extends Configuration {
77
+ expirationTime: number;
78
+ emailMask: string;
79
+ limit: number;
80
+ }
81
+ /**
82
+ * @public
83
+ */
84
+ export interface WorkspaceSetting extends Doc {
85
+ icon?: Ref<Blob> | null;
86
+ }
87
+ export declare enum IntegrationError {
88
+ EMAIL_IS_ALREADY_USED = "EMAIL_IS_ALREADY_USED"
89
+ }
90
+ /**
91
+ * @public
92
+ */
93
+ export declare const settingId: Plugin;
94
+ declare const _default: {
95
+ ids: {
96
+ SettingApp: Ref<Doc>;
97
+ Profile: Ref<Doc>;
98
+ Password: Ref<Doc>;
99
+ Setting: Ref<Doc>;
100
+ Integrations: Ref<Doc>;
101
+ Relations: Ref<Doc>;
102
+ Support: Ref<Doc>;
103
+ Privacy: Ref<Doc>;
104
+ Terms: Ref<Doc>;
105
+ ClassSetting: Ref<Doc>;
106
+ General: Ref<Doc>;
107
+ Owners: Ref<Doc>;
108
+ InviteSettings: Ref<Doc>;
109
+ WorkspaceSetting: Ref<Doc>;
110
+ ManageSpaces: Ref<Doc>;
111
+ Spaces: Ref<Doc>;
112
+ Backup: Ref<Doc>;
113
+ Export: Ref<Doc>;
114
+ DisablePermissionsConfiguration: Ref<Configuration>;
115
+ Mailboxes: Ref<Doc>;
116
+ };
117
+ mixin: {
118
+ Editable: Ref<Mixin<Editable>>;
119
+ UserMixin: Ref<Mixin<UserMixin>>;
120
+ SpaceTypeEditor: Ref<Mixin<SpaceTypeEditor>>;
121
+ SpaceTypeCreator: Ref<Mixin<SpaceTypeCreator>>;
122
+ };
123
+ class: {
124
+ SettingsCategory: Ref<Class<SettingsCategory>>;
125
+ WorkspaceSettingCategory: Ref<Class<SettingsCategory>>;
126
+ Integration: Ref<Class<Integration>>;
127
+ IntegrationType: Ref<Class<IntegrationType>>;
128
+ InviteSettings: Ref<Class<InviteSettings>>;
129
+ WorkspaceSetting: Ref<Class<WorkspaceSetting>>;
130
+ };
131
+ component: {
132
+ Settings: AnyComponent;
133
+ Profile: AnyComponent;
134
+ Password: AnyComponent;
135
+ WorkspaceSettings: AnyComponent;
136
+ Integrations: AnyComponent;
137
+ Support: AnyComponent;
138
+ Privacy: AnyComponent;
139
+ Terms: AnyComponent;
140
+ ClassSetting: AnyComponent;
141
+ PermissionPresenter: AnyComponent;
142
+ SpaceTypeDescriptorPresenter: AnyComponent;
143
+ SpaceTypeGeneralSectionEditor: AnyComponent;
144
+ SpaceTypePropertiesSectionEditor: AnyComponent;
145
+ SpaceTypeRolesSectionEditor: AnyComponent;
146
+ RoleEditor: AnyComponent;
147
+ RoleAssignmentEditor: AnyComponent;
148
+ RelationSetting: AnyComponent;
149
+ Backup: AnyComponent;
150
+ CreateAttributePopup: AnyComponent;
151
+ CreateRelation: AnyComponent;
152
+ EditRelation: AnyComponent;
153
+ Mailboxes: AnyComponent;
154
+ AddEmailSocialId: AnyComponent;
155
+ };
156
+ string: {
157
+ Settings: IntlString;
158
+ Setting: IntlString;
159
+ Spaces: IntlString;
160
+ WorkspaceSettings: IntlString;
161
+ Integrations: IntlString;
162
+ Support: IntlString;
163
+ Privacy: IntlString;
164
+ Terms: IntlString;
165
+ Categories: IntlString;
166
+ Delete: IntlString;
167
+ Disconnect: IntlString;
168
+ DisconnectAll: IntlString;
169
+ Add: IntlString;
170
+ Proceed: IntlString;
171
+ SendConfirmation: IntlString;
172
+ NewEmail: IntlString;
173
+ AccountSettings: IntlString;
174
+ ChangePassword: IntlString;
175
+ CurrentPassword: IntlString;
176
+ NewPassword: IntlString;
177
+ Saving: IntlString;
178
+ Saved: IntlString;
179
+ EnterCurrentPassword: IntlString;
180
+ EnterNewPassword: IntlString;
181
+ RepeatNewPassword: IntlString;
182
+ Signout: IntlString;
183
+ InviteWorkspace: IntlString;
184
+ SelectWorkspace: IntlString;
185
+ Reconnect: IntlString;
186
+ ClassSetting: IntlString;
187
+ Classes: IntlString;
188
+ Owners: IntlString;
189
+ Configure: IntlString;
190
+ InviteSettings: IntlString;
191
+ General: IntlString;
192
+ Properties: IntlString;
193
+ TaskTypes: IntlString;
194
+ Automations: IntlString;
195
+ Collections: IntlString;
196
+ SpaceTypes: IntlString;
197
+ Roles: IntlString;
198
+ OwnerOrMaintainerRequired: IntlString;
199
+ Backup: IntlString;
200
+ BackupLast: IntlString;
201
+ BackupTotalSnapshots: IntlString;
202
+ BackupTotalFiles: IntlString;
203
+ BackupSize: IntlString;
204
+ BackupLinkInfo: IntlString;
205
+ BackupBearerTokenInfo: IntlString;
206
+ BackupSnapshots: IntlString;
207
+ BackupFileDownload: IntlString;
208
+ BackupFiles: IntlString;
209
+ BackupNoBackup: IntlString;
210
+ NonBackupedBlobs: IntlString;
211
+ AddAttribute: IntlString;
212
+ Mailboxes: IntlString;
213
+ CreateMailbox: IntlString;
214
+ CreateMailboxPlaceholder: IntlString;
215
+ MailboxNoDomains: IntlString;
216
+ MailboxLimitReached: IntlString;
217
+ MailboxErrorInvalidName: IntlString;
218
+ MailboxErrorDomainNotFound: IntlString;
219
+ MailboxErrorNameRulesViolated: IntlString;
220
+ MailboxErrorMailboxExists: IntlString;
221
+ MailboxErrorMailboxCountLimit: IntlString;
222
+ DeleteMailbox: IntlString;
223
+ MailboxDeleteConfirmation: IntlString;
224
+ IntegrationFailed: IntlString;
225
+ IntegrationError: IntlString;
226
+ EmailIsUsed: IntlString;
227
+ Customize: IntlString;
228
+ CodeSent: IntlString;
229
+ SendAgain: IntlString;
230
+ SendAgainIn: IntlString;
231
+ AllIntegrations: IntlString;
232
+ ConnectedIntegrations: IntlString;
233
+ AvailableIntegrations: IntlString;
234
+ Connect: IntlString;
235
+ Integrate: IntlString;
236
+ FailedToLoadIntegrations: IntlString;
237
+ FailedToDisconnect: IntlString;
238
+ ServiceIsUnavailable: IntlString;
239
+ Integrated: IntlString;
240
+ Connected: IntlString;
241
+ Available: IntlString;
242
+ NotConnectedIntegration: IntlString;
243
+ IntegrationIsUnstable: IntlString;
244
+ };
245
+ icon: {
246
+ AccountSettings: Asset;
247
+ Owners: Asset;
248
+ Password: Asset;
249
+ Setting: Asset;
250
+ Integrations: Asset;
251
+ Support: Asset;
252
+ Privacy: Asset;
253
+ Terms: Asset;
254
+ Signout: Asset;
255
+ SelectWorkspace: Asset;
256
+ Clazz: Asset;
257
+ Enums: Asset;
258
+ InviteSettings: Asset;
259
+ InviteWorkspace: Asset;
260
+ Views: Asset;
261
+ Relations: Asset;
262
+ Mailbox: Asset;
263
+ };
264
+ templateFieldCategory: {
265
+ Integration: Ref<TemplateFieldCategory>;
266
+ };
267
+ templateField: {
268
+ OwnerFirstName: Ref<TemplateField>;
269
+ OwnerLastName: Ref<TemplateField>;
270
+ OwnerPosition: Ref<TemplateField>;
271
+ Value: Ref<TemplateField>;
272
+ };
273
+ metadata: {
274
+ BackupUrl: Metadata<string>;
275
+ };
276
+ };
277
+ export default _default;
278
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,WAAW,EACX,IAAI,EACJ,KAAK,EACL,aAAa,EACb,GAAG,EACH,KAAK,EACL,GAAG,EACH,WAAW,EACX,MAAM,EACN,eAAe,EAChB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EA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BACR,UAAU;oBACpB,UAAU;mBACX,UAAU;mBACV,UAAU;iCACI,UAAU;+BACZ,UAAU;;;yBAGhB,KAAK;gBACd,KAAK;kBACH,KAAK;iBACN,KAAK;sBACA,KAAK;iBACV,KAAK;iBACL,KAAK;eACP,KAAK;iBACH,KAAK;yBACG,KAAK;eACf,KAAK;eACL,KAAK;wBACI,KAAK;yBACJ,KAAK;eACf,KAAK;mBACD,KAAK;iBACP,KAAK;;;qBAGD,GAAG,CAAC,qBAAqB,CAAC;;;wBAGvB,GAAG,CAAC,aAAa,CAAC;uBACnB,GAAG,CAAC,aAAa,CAAC;uBAClB,GAAG,CAAC,aAAa,CAAC;eAC1B,GAAG,CAAC,aAAa,CAAC;;;mBAGd,QAAQ,CAAC,MAAM,CAAC;;;AApLrC,wBAsLE"}
@@ -0,0 +1,32 @@
1
+ import type { Class, SpaceType, SpaceTypeDescriptor } from '@hcengineering/core';
2
+ import type { IntlString } from '@hcengineering/platform';
3
+ import type { AnyComponent } from '@hcengineering/ui';
4
+ /**
5
+ * @public
6
+ *
7
+ * A mixin describing various configurations of a space type editor
8
+ */
9
+ export interface SpaceTypeEditor extends Class<SpaceType> {
10
+ sections: SpaceTypeEditorSection[];
11
+ subEditors?: Record<string, AnyComponent>;
12
+ }
13
+ /**
14
+ * @public
15
+ *
16
+ * Describes one space type editor section
17
+ */
18
+ export interface SpaceTypeEditorSection {
19
+ id: string;
20
+ label: IntlString;
21
+ component: AnyComponent;
22
+ withoutContainer?: boolean;
23
+ }
24
+ /**
25
+ * @public
26
+ *
27
+ * A mixin for extensions during space type creation
28
+ */
29
+ export interface SpaceTypeCreator extends Class<SpaceTypeDescriptor> {
30
+ extraComponent: AnyComponent;
31
+ }
32
+ //# sourceMappingURL=spaceTypeEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spaceTypeEditor.d.ts","sourceRoot":"","sources":["../src/spaceTypeEditor.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAChF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD;;;;GAIG;AACH,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,SAAS,CAAC;IACvD,QAAQ,EAAE,sBAAsB,EAAE,CAAA;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CAC1C;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,UAAU,CAAA;IACjB,SAAS,EAAE,YAAY,CAAA;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,mBAAmB,CAAC;IAClE,cAAc,EAAE,YAAY,CAAA;CAC7B"}
@@ -0,0 +1,12 @@
1
+ import { AttachedData, Class, Data, Ref, Role, Space, SpaceType, TxOperations, TypeAny as TypeAnyType } from '@hcengineering/core';
2
+ import { IntlString } from '@hcengineering/platform';
3
+ export declare function createSpaceType<T extends SpaceType>(client: TxOperations, data: Omit<Data<T>, 'targetClass'>, _id: Ref<T>, _class?: Ref<Class<T>>): Promise<Ref<T>>;
4
+ export interface RoleAttributeProps {
5
+ label: IntlString;
6
+ roleType: TypeAnyType;
7
+ }
8
+ export declare function getRoleAttributeProps(name: string): RoleAttributeProps;
9
+ export declare function createSpaceTypeRole(client: TxOperations, type: Pick<SpaceType, '_id' | '_class' | 'targetClass'>, data: AttachedData<Role>, _id?: Ref<Role> | undefined): Promise<Ref<Role>>;
10
+ export declare function createSpaceTypeRoles(tx: TxOperations, typeId: Ref<SpaceType>, roles: Pick<Role, '_id' | 'name' | 'permissions'>[]): Promise<void>;
11
+ export declare function deleteSpaceTypeRole(client: TxOperations, role: Role, targetClass: Ref<Class<Space>>): Promise<void>;
12
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAeA,OAAa,EACX,YAAY,EACZ,KAAK,EAEL,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,KAAK,EACL,SAAS,EACT,YAAY,EACZ,OAAO,IAAI,WAAW,EAEvB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAoB,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAItE,wBAAsB,eAAe,CAAC,CAAC,SAAS,SAAS,EACvD,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,EAClC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EACX,MAAM,GAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAwB,GAC3C,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CA4BjB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,UAAU,CAAA;IACjB,QAAQ,EAAE,WAAW,CAAA;CACtB;AAYD,wBAAgB,qBAAqB,CAAE,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAKvE;AAED,wBAAsB,mBAAmB,CACvC,MAAM,EAAE,YAAY,EACpB,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,GAAG,QAAQ,GAAG,aAAa,CAAC,EACvD,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,EACxB,GAAG,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,SAAS,GAC1B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAqBpB;AAED,wBAAsB,oBAAoB,CACxC,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,GAAG,CAAC,SAAS,CAAC,EACtB,KAAK,EAAE,IAAI,CAAC,IAAI,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