@umbraco-cms/backoffice 1.0.0-next.bf0e5e95 → 1.0.0-next.c727665d

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.
package/element.d.ts CHANGED
@@ -13,6 +13,6 @@ declare class UmbElementMixinInterface extends UmbControllerHostElement {
13
13
  consumeContext<R = unknown>(alias: string | UmbContextToken<R>, callback: UmbContextCallback<R>): UmbContextConsumerController<R>;
14
14
  consumeAllContexts(contextAliases: string[], callback: (_instances: ResolvedContexts) => void): void;
15
15
  }
16
- declare const UmbElementMixin: <T extends HTMLElementConstructor<HTMLElement>>(superClass: T) => HTMLElementConstructor<UmbElementMixinInterface> & T;
16
+ declare const UmbElementMixin: <T extends HTMLElementConstructor>(superClass: T) => HTMLElementConstructor<UmbElementMixinInterface> & T;
17
17
 
18
18
  export { UmbElementMixin, UmbElementMixinInterface };
@@ -1,5 +1,6 @@
1
1
  import { UmbControllerHostElement } from './controller';
2
2
  import { UmbEntityActionBase as UmbEntityActionBase$1 } from './entity-action';
3
+ import { UmbFolderRepository } from './repository';
3
4
 
4
5
  interface UmbAction<RepositoryType = unknown> {
5
6
  host: UmbControllerHostElement;
@@ -17,6 +18,7 @@ interface UmbEntityAction<RepositoryType> extends UmbAction<RepositoryType> {
17
18
  }
18
19
  declare class UmbEntityActionBase<RepositoryType> extends UmbActionBase<RepositoryType> {
19
20
  unique: string;
21
+ repositoryAlias: string;
20
22
  constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
21
23
  }
22
24
 
@@ -39,13 +41,28 @@ declare class UmbCopyEntityAction<T extends {
39
41
 
40
42
  declare class UmbDeleteEntityAction<T extends {
41
43
  delete(unique: string): Promise<void>;
42
- requestItems(uniques: Array<string>): any;
44
+ requestTreeItems(uniques: Array<string>): any;
43
45
  }> extends UmbEntityActionBase$1<T> {
44
46
  #private;
45
47
  constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
46
48
  execute(): Promise<void>;
47
49
  }
48
50
 
51
+ declare class UmbDeleteFolderEntityAction<T extends {
52
+ deleteFolder(unique: string): Promise<void>;
53
+ requestTreeItems(uniques: Array<string>): any;
54
+ }> extends UmbEntityActionBase$1<T> {
55
+ #private;
56
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
57
+ execute(): Promise<void>;
58
+ }
59
+
60
+ declare class UmbFolderUpdateEntityAction<T extends UmbFolderRepository = UmbFolderRepository> extends UmbEntityActionBase$1<T> {
61
+ #private;
62
+ constructor(host: UmbControllerHostElement, repositoryAlias: string, unique: string);
63
+ execute(): Promise<void>;
64
+ }
65
+
49
66
  declare class UmbMoveEntityAction<T extends {
50
67
  move(): Promise<void>;
51
68
  }> extends UmbEntityActionBase$1<T> {
@@ -69,4 +86,4 @@ declare class UmbTrashEntityAction<T extends {
69
86
  execute(): Promise<void>;
70
87
  }
71
88
 
72
- export { UmbAction, UmbActionBase, UmbCopyEntityAction, UmbDeleteEntityAction, UmbEntityAction, UmbEntityActionBase, UmbEntityBulkAction, UmbEntityBulkActionBase, UmbMoveEntityAction, UmbSortChildrenOfEntityAction, UmbTrashEntityAction };
89
+ export { UmbAction, UmbActionBase, UmbCopyEntityAction, UmbDeleteEntityAction, UmbDeleteFolderEntityAction, UmbEntityAction, UmbEntityActionBase, UmbEntityBulkAction, UmbEntityBulkActionBase, UmbFolderUpdateEntityAction, UmbMoveEntityAction, UmbSortChildrenOfEntityAction, UmbTrashEntityAction };
package/modal.d.ts CHANGED
@@ -7,7 +7,7 @@ import { UUIModalDialogElement, UUIModalSidebarElement, UUIModalSidebarSize } fr
7
7
  import { UmbControllerHostElement, UmbControllerInterface } from './controller';
8
8
  import { UmbContextToken } from './context-api';
9
9
  import { UmbModalToken as UmbModalToken$1, UmbModalConfig as UmbModalConfig$1, UmbPickerModalData as UmbPickerModalData$1 } from './modal';
10
- import { LanguageResponseModel } from './backend-api';
10
+ import { LanguageResponseModel, FolderReponseModel } from './backend-api';
11
11
  import { UserDetails } from './models';
12
12
 
13
13
  declare class UmbSearchModalElement extends LitElement {
@@ -104,7 +104,7 @@ interface UmbModalConfig {
104
104
  declare class UmbModalContext {
105
105
  #private;
106
106
  host: UmbControllerHostElement;
107
- readonly modals: rxjs.Observable<UmbModalHandler<object, any>[]>;
107
+ readonly modals: rxjs.Observable<UmbModalHandler[]>;
108
108
  constructor(host: UmbControllerHostElement);
109
109
  search(): UmbModalHandler<any, any>;
110
110
  /**
@@ -478,7 +478,7 @@ declare class UmbModalRouteRegistrationController<D extends object = object, R =
478
478
  }
479
479
 
480
480
  interface UmbAllowedDocumentTypesModalData {
481
- key: string | null;
481
+ id: string | null;
482
482
  }
483
483
  interface UmbAllowedDocumentTypesModalResult {
484
484
  documentTypeKey: string;
@@ -526,6 +526,15 @@ interface UmbDocumentPickerModalResult {
526
526
  }
527
527
  declare const UMB_DOCUMENT_PICKER_MODAL: UmbModalToken$1<UmbDocumentPickerModalData, UmbDocumentPickerModalResult>;
528
528
 
529
+ interface UmbDocumentTypePickerModalData {
530
+ multiple?: boolean;
531
+ selection?: Array<string>;
532
+ }
533
+ interface UmbDocumentTypePickerModalResult {
534
+ selection: Array<string>;
535
+ }
536
+ declare const UMB_DOCUMENT_TYPE_PICKER_MODAL: UmbModalToken$1<UmbDocumentTypePickerModalData, UmbDocumentTypePickerModalResult>;
537
+
529
538
  declare enum OEmbedStatus {
530
539
  NotSupported = 0,
531
540
  Error = 1,
@@ -580,8 +589,8 @@ interface UmbImportDictionaryModalData {
580
589
  unique: string | null;
581
590
  }
582
591
  interface UmbImportDictionaryModalResult {
583
- fileName?: string;
584
- parentKey?: string;
592
+ temporaryFileId?: string;
593
+ parentId?: string;
585
594
  }
586
595
  declare const UMB_IMPORT_DICTIONARY_MODAL: UmbModalToken$1<UmbImportDictionaryModalData, UmbImportDictionaryModalResult>;
587
596
 
@@ -664,10 +673,37 @@ interface UmbSectionPickerModalData {
664
673
  }
665
674
  declare const UMB_SECTION_PICKER_MODAL: UmbModalToken$1<UmbSectionPickerModalData, unknown>;
666
675
 
676
+ interface UmbTemplateModalData {
677
+ id: string;
678
+ language?: 'razor' | 'typescript' | 'javascript' | 'css' | 'markdown' | 'json' | 'html';
679
+ }
680
+ interface UmbTemplateModalResult {
681
+ id: string;
682
+ }
683
+ declare const UMB_TEMPLATE_MODAL: UmbModalToken$1<UmbTemplateModalData, UmbTemplateModalResult>;
684
+
685
+ interface UmbTemplatePickerModalData {
686
+ multiple: boolean;
687
+ selection: string[];
688
+ }
689
+ interface UmbTemplatePickerModalResult {
690
+ selection: string[] | undefined;
691
+ }
692
+ declare const UMB_TEMPLATE_PICKER_MODAL: UmbModalToken$1<UmbTemplatePickerModalData, UmbTemplatePickerModalResult>;
693
+
667
694
  declare const UMB_USER_GROUP_PICKER_MODAL: UmbModalToken$1<UmbPickerModalData$1<UserDetails>, unknown>;
668
695
 
669
696
  declare const UMB_USER_PICKER_MODAL: UmbModalToken$1<UmbPickerModalData$1<UserDetails>, unknown>;
670
697
 
698
+ interface UmbFolderModalData {
699
+ repositoryAlias: string;
700
+ unique?: string;
701
+ }
702
+ interface UmbFolderModalResult {
703
+ folder: FolderReponseModel;
704
+ }
705
+ declare const UMB_FOLDER_MODAL: UmbModalToken$1<UmbFolderModalData, UmbFolderModalResult>;
706
+
671
707
  interface UmbPickerModalData<T> {
672
708
  multiple: boolean;
673
709
  selection: Array<string>;
@@ -677,4 +713,4 @@ interface UmbPickerModalResult<T> {
677
713
  selection: Array<string>;
678
714
  }
679
715
 
680
- export { OEmbedResult, OEmbedStatus, UMB_ALLOWED_DOCUMENT_TYPES_MODAL, UMB_CHANGE_PASSWORD_MODAL, UMB_CONFIRM_MODAL, UMB_CONTEXT_DEBUGGER_MODAL, UMB_CREATE_DICTIONARY_MODAL, UMB_CREATE_USER_MODAL, UMB_CURRENT_USER_MODAL, UMB_DOCUMENT_PICKER_MODAL, UMB_EMBEDDED_MEDIA_MODAL, UMB_EXAMINE_FIELDS_SETTINGS_MODAL, UMB_EXPORT_DICTIONARY_MODAL, UMB_ICON_PICKER_MODAL, UMB_IMPORT_DICTIONARY_MODAL, UMB_INVITE_USER_MODAL, UMB_LANGUAGE_PICKER_MODAL, UMB_LINK_PICKER_MODAL, UMB_MEDIA_PICKER_MODAL, UMB_MODAL_CONTEXT_TOKEN, UMB_PROPERTY_EDITOR_UI_PICKER_MODAL, UMB_PROPERTY_SETTINGS_MODAL, UMB_SEARCH_MODAL, UMB_SECTION_PICKER_MODAL, UMB_USER_GROUP_PICKER_MODAL, UMB_USER_PICKER_MODAL, UmbAllowedDocumentTypesModalData, UmbAllowedDocumentTypesModalResult, UmbChangePasswordModalData, UmbConfirmModalData, UmbConfirmModalResult, UmbContextDebuggerModalData, UmbCreateDictionaryModalData, UmbCreateDictionaryModalResult, UmbCreateDocumentModalResultData, UmbDocumentPickerModalData, UmbDocumentPickerModalResult, UmbEmbeddedMediaModalData, UmbEmbeddedMediaModalResult, UmbExamineFieldsSettingsModalData, UmbExportDictionaryModalData, UmbExportDictionaryModalResult, UmbIconPickerModalData, UmbIconPickerModalResult, UmbImportDictionaryModalData, UmbImportDictionaryModalResult, UmbLanguagePickerModalData, UmbLanguagePickerModalResult, UmbLinkPickerConfig, UmbLinkPickerLink, UmbLinkPickerModalData, UmbLinkPickerModalResult, UmbMediaPickerModalData, UmbMediaPickerModalResult, UmbModalConfig, UmbModalContext, UmbModalHandler, UmbModalHandlerClass, UmbModalRouteBuilder, UmbModalRouteRegistration, UmbModalRouteRegistrationController, UmbModalToken, UmbModalType, UmbPickerModalData, UmbPickerModalResult, UmbPropertyEditorUIPickerModalData, UmbPropertyEditorUIPickerModalResult, UmbPropertySettingsModalResult, UmbSectionPickerModalData };
716
+ export { OEmbedResult, OEmbedStatus, UMB_ALLOWED_DOCUMENT_TYPES_MODAL, UMB_CHANGE_PASSWORD_MODAL, UMB_CONFIRM_MODAL, UMB_CONTEXT_DEBUGGER_MODAL, UMB_CREATE_DICTIONARY_MODAL, UMB_CREATE_USER_MODAL, UMB_CURRENT_USER_MODAL, UMB_DOCUMENT_PICKER_MODAL, UMB_DOCUMENT_TYPE_PICKER_MODAL, UMB_EMBEDDED_MEDIA_MODAL, UMB_EXAMINE_FIELDS_SETTINGS_MODAL, UMB_EXPORT_DICTIONARY_MODAL, UMB_FOLDER_MODAL, UMB_ICON_PICKER_MODAL, UMB_IMPORT_DICTIONARY_MODAL, UMB_INVITE_USER_MODAL, UMB_LANGUAGE_PICKER_MODAL, UMB_LINK_PICKER_MODAL, UMB_MEDIA_PICKER_MODAL, UMB_MODAL_CONTEXT_TOKEN, UMB_PROPERTY_EDITOR_UI_PICKER_MODAL, UMB_PROPERTY_SETTINGS_MODAL, UMB_SEARCH_MODAL, UMB_SECTION_PICKER_MODAL, UMB_TEMPLATE_MODAL, UMB_TEMPLATE_PICKER_MODAL, UMB_USER_GROUP_PICKER_MODAL, UMB_USER_PICKER_MODAL, UmbAllowedDocumentTypesModalData, UmbAllowedDocumentTypesModalResult, UmbChangePasswordModalData, UmbConfirmModalData, UmbConfirmModalResult, UmbContextDebuggerModalData, UmbCreateDictionaryModalData, UmbCreateDictionaryModalResult, UmbCreateDocumentModalResultData, UmbDocumentPickerModalData, UmbDocumentPickerModalResult, UmbDocumentTypePickerModalData, UmbDocumentTypePickerModalResult, UmbEmbeddedMediaModalData, UmbEmbeddedMediaModalResult, UmbExamineFieldsSettingsModalData, UmbExportDictionaryModalData, UmbExportDictionaryModalResult, UmbFolderModalData, UmbFolderModalResult, UmbIconPickerModalData, UmbIconPickerModalResult, UmbImportDictionaryModalData, UmbImportDictionaryModalResult, UmbLanguagePickerModalData, UmbLanguagePickerModalResult, UmbLinkPickerConfig, UmbLinkPickerLink, UmbLinkPickerModalData, UmbLinkPickerModalResult, UmbMediaPickerModalData, UmbMediaPickerModalResult, UmbModalConfig, UmbModalContext, UmbModalHandler, UmbModalHandlerClass, UmbModalRouteBuilder, UmbModalRouteRegistration, UmbModalRouteRegistrationController, UmbModalToken, UmbModalType, UmbPickerModalData, UmbPickerModalResult, UmbPropertyEditorUIPickerModalData, UmbPropertyEditorUIPickerModalResult, UmbPropertySettingsModalResult, UmbSectionPickerModalData, UmbTemplateModalData, UmbTemplateModalResult, UmbTemplatePickerModalData, UmbTemplatePickerModalResult };
package/models.d.ts CHANGED
@@ -3,13 +3,18 @@ import { EntityTreeItemResponseModel, FolderTreeItemResponseModel, PackageManife
3
3
  type HTMLElementConstructor<T = HTMLElement> = new (...args: any[]) => T;
4
4
  type ClassConstructor<T> = new (...args: any[]) => T;
5
5
  interface Entity {
6
- key: string;
6
+ id: string;
7
7
  name: string;
8
8
  icon: string;
9
9
  type: string;
10
10
  hasChildren: boolean;
11
- parentKey: string | null;
11
+ parentId: string | null;
12
12
  }
13
+ /** Tried to find a common base of our entities — used by Entity Workspace Context */
14
+ type BaseEntity = {
15
+ id?: string;
16
+ name?: string;
17
+ };
13
18
  interface UserEntity extends Entity {
14
19
  type: 'user';
15
20
  }
@@ -38,23 +43,23 @@ interface UserGroupDetails extends UserGroupEntity {
38
43
  permissions: Array<string>;
39
44
  }
40
45
  interface MemberTypeDetails extends EntityTreeItemResponseModel {
41
- key: string;
46
+ id: string;
42
47
  alias: string;
43
48
  properties: [];
44
49
  }
45
50
  interface MediaTypeDetails extends FolderTreeItemResponseModel {
46
- key: string;
51
+ id: string;
47
52
  alias: string;
48
53
  properties: [];
49
54
  }
50
55
  interface MemberGroupDetails extends EntityTreeItemResponseModel {
51
- key: string;
56
+ id: string;
52
57
  }
53
58
  interface MemberDetails extends EntityTreeItemResponseModel {
54
- key: string;
59
+ id: string;
55
60
  }
56
61
  interface DocumentBlueprintDetails {
57
- key: string;
62
+ id: string;
58
63
  name: string;
59
64
  type: 'document-blueprint';
60
65
  properties: Array<any>;
@@ -72,4 +77,4 @@ type UmbPackageWithMigrationStatus = UmbPackage & {
72
77
  hasPendingMigrations: boolean;
73
78
  };
74
79
 
75
- export { ClassConstructor, DocumentBlueprintDetails, Entity, HTMLElementConstructor, MediaTypeDetails, MemberDetails, MemberGroupDetails, MemberTypeDetails, PackageManifestResponse, SwatchDetails, UmbPackage, UmbPackageWithMigrationStatus, UserDetails, UserEntity, UserGroupDetails, UserGroupEntity, UserStatus };
80
+ export { BaseEntity, ClassConstructor, DocumentBlueprintDetails, Entity, HTMLElementConstructor, MediaTypeDetails, MemberDetails, MemberGroupDetails, MemberTypeDetails, PackageManifestResponse, SwatchDetails, UmbPackage, UmbPackageWithMigrationStatus, UserDetails, UserEntity, UserGroupDetails, UserGroupEntity, UserStatus };
@@ -98,19 +98,33 @@ declare class DeepState<T> extends BehaviorSubject<T> {
98
98
  * The ArrayState provides methods to append data when the data is an Object.
99
99
  */
100
100
  declare class ArrayState<T> extends DeepState<T[]> {
101
- private _getUnique?;
102
- constructor(initialData: T[], _getUnique?: ((entry: T) => unknown) | undefined);
101
+ #private;
102
+ constructor(initialData: T[], getUniqueMethod?: (entry: T) => unknown);
103
+ /**
104
+ * @method sortBy
105
+ * @param {(a: T, b: T) => number} sortMethod - A method to be used for sorting everytime data is set.
106
+ * @description - A sort method to this Subject.
107
+ * @example <caption>Example add sort method</caption>
108
+ * const data = [
109
+ * { key: 1, value: 'foo'},
110
+ * { key: 2, value: 'bar'}
111
+ * ];
112
+ * const myState = new ArrayState(data, (x) => x.key);
113
+ * myState.sortBy((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0));
114
+ */
115
+ sortBy(sortMethod?: (a: T, b: T) => number): this;
116
+ next(value: T[]): void;
103
117
  /**
104
118
  * @method remove
105
119
  * @param {unknown[]} uniques - The unique values to remove.
106
120
  * @return {ArrayState<T>} Reference to it self.
107
121
  * @description - Remove some new data of this Subject.
108
- * @example <caption>Example remove entry with key '1' and '2'</caption>
122
+ * @example <caption>Example remove entry with id '1' and '2'</caption>
109
123
  * const data = [
110
- * { key: 1, value: 'foo'},
111
- * { key: 2, value: 'bar'}
124
+ * { id: 1, value: 'foo'},
125
+ * { id: 2, value: 'bar'}
112
126
  * ];
113
- * const myState = new ArrayState(data, (x) => x.key);
127
+ * const myState = new ArrayState(data, (x) => x.id);
114
128
  * myState.remove([1, 2]);
115
129
  */
116
130
  remove(uniques: unknown[]): this;
@@ -119,12 +133,12 @@ declare class ArrayState<T> extends DeepState<T[]> {
119
133
  * @param {unknown} unique - The unique value to remove.
120
134
  * @return {ArrayState<T>} Reference to it self.
121
135
  * @description - Remove some new data of this Subject.
122
- * @example <caption>Example remove entry with key '1'</caption>
136
+ * @example <caption>Example remove entry with id '1'</caption>
123
137
  * const data = [
124
- * { key: 1, value: 'foo'},
125
- * { key: 2, value: 'bar'}
138
+ * { id: 1, value: 'foo'},
139
+ * { id: 2, value: 'bar'}
126
140
  * ];
127
- * const myState = new ArrayState(data, (x) => x.key);
141
+ * const myState = new ArrayState(data, (x) => x.id);
128
142
  * myState.removeOne(1);
129
143
  */
130
144
  removeOne(unique: unknown): this;
@@ -181,6 +195,21 @@ declare class ArrayState<T> extends DeepState<T[]> {
181
195
  * ]);
182
196
  */
183
197
  append(entries: T[]): this;
198
+ /**
199
+ * @method updateOne
200
+ * @param {unknown} unique - Unique value to find entry to update.
201
+ * @param {Partial<T>} entry - new data to be added in this Subject.
202
+ * @return {ArrayState<T>} Reference to it self.
203
+ * @description - Update a item with some new data, requires the ArrayState to be constructed with a getUnique method.
204
+ * @example <caption>Example append some data.</caption>
205
+ * const data = [
206
+ * { key: 1, value: 'foo'},
207
+ * { key: 2, value: 'bar'}
208
+ * ];
209
+ * const myState = new ArrayState(data, (x) => x.key);
210
+ * myState.updateOne(2, {value: 'updated-bar'});
211
+ */
212
+ updateOne(unique: unknown, entry: Partial<T>): this;
184
213
  }
185
214
 
186
215
  /**
@@ -226,8 +255,8 @@ declare function createObservablePart<R, T>(source$: Observable<T>, mappingFunct
226
255
  * @param {(previousResult: R, currentResult: R) => boolean} [memoizationFunction] - Method to Compare if the data has changed. Should return true when data is different.
227
256
  * @description - Creates a RxJS Observable from RxJS Subject.
228
257
  * @example <caption>Example append new entry for a ArrayState or a part of DeepState/ObjectState it which is an array. Where the key is unique and the item will be updated if matched with existing.</caption>
229
- * const entry = {key: 'myKey', value: 'myValue'};
230
- * const newDataSet = appendToFrozenArray(mySubject.getValue(), entry, x => x.key === key);
258
+ * const entry = {id: 'myKey', value: 'myValue'};
259
+ * const newDataSet = appendToFrozenArray(mySubject.getValue(), entry, x => x.id === id);
231
260
  * mySubject.next(newDataSet);
232
261
  */
233
262
  declare function appendToFrozenArray<T>(data: T[], entry: T, getUniqueMethod?: (entry: T) => unknown): T[];
@@ -246,4 +275,4 @@ declare function appendToFrozenArray<T>(data: T[], entry: T, getUniqueMethod?: (
246
275
  */
247
276
  declare function partialUpdateFrozenArray<T>(data: T[], partialEntry: Partial<T>, findMethod: (entry: T) => boolean): T[];
248
277
 
249
- export { ArrayState, BasicState, BooleanState, ClassState, DeepState, NumberState, ObjectState, StringState, UmbObserver, UmbObserverController, appendToFrozenArray, createObservablePart, partialUpdateFrozenArray };
278
+ export { ArrayState, BasicState, BooleanState, ClassState, DeepState, MappingFunction, NumberState, ObjectState, StringState, UmbObserver, UmbObserverController, appendToFrozenArray, createObservablePart, partialUpdateFrozenArray };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umbraco-cms/backoffice",
3
- "version": "1.0.0-next.bf0e5e95",
3
+ "version": "1.0.0-next.c727665d",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "umbraco",
package/repository.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ProblemDetailsModel } from './backend-api';
1
+ import { ProblemDetailsModel, FolderReponseModel, CreateFolderRequestModel, UpdateFolderReponseModel, FolderModelBaseModel } from './backend-api';
2
2
  import { DataSourceResponse as DataSourceResponse$1 } from './repository';
3
3
  import { Observable } from 'rxjs';
4
4
 
@@ -7,12 +7,20 @@ interface DataSourceResponse<T = undefined> {
7
7
  error?: ProblemDetailsModel;
8
8
  }
9
9
 
10
- interface UmbDataSource<T> {
11
- createScaffold(parentKey: string | null): Promise<DataSourceResponse$1<T>>;
12
- get(key: string): Promise<DataSourceResponse$1<T>>;
13
- insert(data: T): Promise<DataSourceResponse$1<T>>;
14
- update(data: T): Promise<DataSourceResponse$1<T>>;
15
- delete(key: string): Promise<DataSourceResponse$1<T>>;
10
+ interface UmbDataSource<CreateRequestType, UpdateRequestType, ResponseType> {
11
+ createScaffold(parentId: string | null): Promise<DataSourceResponse$1<ResponseType>>;
12
+ get(unique: string): Promise<DataSourceResponse$1<ResponseType>>;
13
+ insert(data: CreateRequestType): Promise<any>;
14
+ update(unique: string, data: UpdateRequestType): Promise<DataSourceResponse$1<ResponseType>>;
15
+ delete(unique: string): Promise<DataSourceResponse$1>;
16
+ }
17
+
18
+ interface UmbFolderDataSource {
19
+ createScaffold(parentId: string | null): Promise<DataSourceResponse<FolderReponseModel>>;
20
+ get(unique: string): Promise<DataSourceResponse<FolderReponseModel>>;
21
+ insert(data: CreateFolderRequestModel): Promise<DataSourceResponse<string>>;
22
+ update(unique: string, data: CreateFolderRequestModel): Promise<DataSourceResponse<UpdateFolderReponseModel>>;
23
+ delete(unique: string): Promise<DataSourceResponse>;
16
24
  }
17
25
 
18
26
  interface UmbTreeDataSource<PagedItemsType = any, ItemsType = any> {
@@ -22,11 +30,11 @@ interface UmbTreeDataSource<PagedItemsType = any, ItemsType = any> {
22
30
  }
23
31
 
24
32
  interface UmbDetailRepository<DetailType> {
25
- createScaffold(parentKey: string | null): Promise<{
33
+ createScaffold(parentId: string | null): Promise<{
26
34
  data?: DetailType;
27
35
  error?: ProblemDetailsModel;
28
36
  }>;
29
- requestByKey(key: string): Promise<{
37
+ requestById(id: string): Promise<{
30
38
  data?: DetailType;
31
39
  error?: ProblemDetailsModel;
32
40
  }>;
@@ -66,4 +74,26 @@ interface UmbTreeRepository<ItemType = any, PagedItemType = UmbPagedData<ItemTyp
66
74
  treeItems: (uniques: string[]) => Promise<Observable<ItemType[]>>;
67
75
  }
68
76
 
69
- export { DataSourceResponse, UmbDataSource, UmbDetailRepository, UmbPagedData, UmbTreeDataSource, UmbTreeRepository };
77
+ interface UmbFolderRepository {
78
+ createFolderScaffold(parentId: string | null): Promise<{
79
+ data?: FolderReponseModel;
80
+ error?: ProblemDetailsModel;
81
+ }>;
82
+ createFolder(folderRequest: CreateFolderRequestModel): Promise<{
83
+ data?: string;
84
+ error?: ProblemDetailsModel;
85
+ }>;
86
+ requestFolder(unique: string): Promise<{
87
+ data?: FolderReponseModel;
88
+ error?: ProblemDetailsModel;
89
+ }>;
90
+ updateFolder(unique: string, folder: FolderModelBaseModel): Promise<{
91
+ data?: UpdateFolderReponseModel;
92
+ error?: ProblemDetailsModel;
93
+ }>;
94
+ deleteFolder(key: string): Promise<{
95
+ error?: ProblemDetailsModel;
96
+ }>;
97
+ }
98
+
99
+ export { DataSourceResponse, UmbDataSource, UmbDetailRepository, UmbFolderDataSource, UmbFolderRepository, UmbPagedData, UmbTreeDataSource, UmbTreeRepository };
package/store.d.ts CHANGED
@@ -18,7 +18,7 @@ interface UmbEntityDetailStore<T> extends UmbDataStore {
18
18
  * @return {*} {T}
19
19
  * @memberof UmbEntityDetailStore
20
20
  */
21
- getScaffold: (entityType: string, parentKey: string | null) => T;
21
+ getScaffold: (entityType: string, parentId: string | null) => T;
22
22
  /**
23
23
  * @description - Request data by key. The data is added to the store and is returned as an Observable.
24
24
  * @param {string} key
@@ -60,17 +60,17 @@ declare class UmbEntityTreeStore extends UmbStoreBase$1 implements UmbTreeStore$
60
60
  appendItems(items: Array<EntityTreeItemResponseModel>): void;
61
61
  /**
62
62
  * Updates an item in the store
63
- * @param {string} key
63
+ * @param {string} id
64
64
  * @param {Partial<EntityTreeItemResponseModel>} data
65
65
  * @memberof UmbEntityTreeStore
66
66
  */
67
- updateItem(key: string, data: Partial<EntityTreeItemResponseModel>): void;
67
+ updateItem(id: string, data: Partial<EntityTreeItemResponseModel>): void;
68
68
  /**
69
69
  * Removes an item from the store
70
- * @param {string} key
70
+ * @param {string} id
71
71
  * @memberof UmbEntityTreeStore
72
72
  */
73
- removeItem(key: string): void;
73
+ removeItem(id: string): void;
74
74
  /**
75
75
  * An observable to observe the root items
76
76
  * @memberof UmbEntityTreeStore
@@ -78,18 +78,18 @@ declare class UmbEntityTreeStore extends UmbStoreBase$1 implements UmbTreeStore$
78
78
  rootItems: rxjs.Observable<EntityTreeItemResponseModel[]>;
79
79
  /**
80
80
  * Returns an observable to observe the children of a given parent
81
- * @param {(string | null)} parentKey
81
+ * @param {(string | null)} parentId
82
82
  * @return {*}
83
83
  * @memberof UmbEntityTreeStore
84
84
  */
85
- childrenOf(parentKey: string | null): rxjs.Observable<EntityTreeItemResponseModel[]>;
85
+ childrenOf(parentId: string | null): rxjs.Observable<EntityTreeItemResponseModel[]>;
86
86
  /**
87
- * Returns an observable to observe the items with the given keys
88
- * @param {Array<string>} keys
87
+ * Returns an observable to observe the items with the given ids
88
+ * @param {Array<string>} ids
89
89
  * @return {*}
90
90
  * @memberof UmbEntityTreeStore
91
91
  */
92
- items(keys: Array<string>): rxjs.Observable<EntityTreeItemResponseModel[]>;
92
+ items(ids: Array<string>): rxjs.Observable<EntityTreeItemResponseModel[]>;
93
93
  }
94
94
 
95
95
  /**
package/utils.d.ts CHANGED
@@ -11,4 +11,6 @@ declare function umbracoPath(path: string): string;
11
11
  declare function buildUdi(entityType: string, guid: string): string;
12
12
  declare function getKeyFromUdi(udi: string): string;
13
13
 
14
- export { buildUdi, getKeyFromUdi, getLookAndColorFromUserStatus, umbracoPath };
14
+ declare function generateGuid(): string;
15
+
16
+ export { buildUdi, generateGuid, getKeyFromUdi, getLookAndColorFromUserStatus, umbracoPath };