-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(:family:): reorganize IItem and IGroup interfaces
extending interfaces between categories proved to be more complicated than helpful there is already way too much complexity between what items and groups need to look like when they are created, updated and retrieved. AFFECTS PACKAGES: @esri/arcgis-rest-common-types @esri/arcgis-rest-groups @esri/arcgis-rest-items @esri/arcgis-rest-users
- Loading branch information
Showing
9 changed files
with
174 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
|
||
/** | ||
* A [Group](https://developers.arcgis.com/rest/users-groups-and-items/common-parameters.htm) that has not been created yet. | ||
*/ | ||
export interface IGroupAdd { | ||
title: string; | ||
owner?: string; | ||
tags?: string[]; | ||
description?: string; | ||
access?: "private" | "org" | "public"; | ||
phone?: string; | ||
sortField?: | ||
| "title" | ||
| "owner" | ||
| "avgrating" | ||
| "numviews" | ||
| "created" | ||
| "modified"; | ||
sortOrder?: "asc" | "desc"; | ||
isViewOnly?: boolean; | ||
isInvitationOnly?: boolean; | ||
thumbnail?: string; | ||
autoJoin?: boolean; | ||
snippet?: string; | ||
[key: string]: any; | ||
} | ||
|
||
/** | ||
* Existing Portal [Group](https://developers.arcgis.com/rest/users-groups-and-items/group.htm). | ||
*/ | ||
export interface IGroup extends IGroupAdd { | ||
id: string; | ||
owner: string; | ||
tags: string[]; | ||
created: number; | ||
modified: number; | ||
protected: boolean; | ||
isInvitationOnly: boolean; | ||
isViewOnly: boolean; | ||
isOpenData: boolean; | ||
isFav: boolean; | ||
autoJoin: boolean; | ||
userMembership?: { | ||
username?: string; | ||
memberType?: string; | ||
applications?: number; | ||
}; | ||
hasCategorySchema?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc. | ||
* Apache-2.0 */ | ||
|
||
import { ISpatialReference } from "./index"; | ||
|
||
/** | ||
* A Portal [Item](https://developers.arcgis.com/rest/users-groups-and-items/common-parameters.htm) that has not been created yet. | ||
*/ | ||
export interface IItemAdd { | ||
title: string; | ||
type: string; | ||
owner?: string; | ||
typeKeywords?: string[]; | ||
description?: string; | ||
snippet?: string; | ||
documentation?: string; | ||
extent?: number[][]; | ||
categories?: string[]; | ||
spatialReference?: ISpatialReference; | ||
culture?: string; | ||
properties?: any; | ||
url?: string; | ||
tags?: string[]; | ||
[key: string]: any; | ||
} | ||
|
||
/** | ||
* A Portal [Item](https://developers.arcgis.com/rest/users-groups-and-items/common-parameters.htm) to be updated. | ||
*/ | ||
export interface IItemUpdate { | ||
id: string; | ||
[key: string]: any; | ||
} | ||
|
||
/** | ||
* Existing Portal [Item](https://developers.arcgis.com/rest/users-groups-and-items/item.htm). | ||
*/ | ||
export interface IItem extends IItemAdd { | ||
id: string; | ||
owner: string; | ||
tags: string[]; | ||
created: number; | ||
modified: number; | ||
protected: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.