Skip to content

Commit

Permalink
Merge pull request #303 from gunjandatta/gdatta
Browse files Browse the repository at this point in the history
Major Updates for SPFx Support
  • Loading branch information
gunjandatta authored Oct 5, 2022
2 parents 951142c + f8bc555 commit a9bb6bf
Show file tree
Hide file tree
Showing 52 changed files with 1,843 additions and 2,394 deletions.
16 changes: 15 additions & 1 deletion @types/helper/listFormField.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IODataQuery } from "gd-sprest-def/base";
import { Field, FieldChoice, FieldCurrency, FieldDateTime, FieldLookup, FieldMultiChoice, FieldMultiLineText, FieldNumber, FieldOData, FieldText, FieldUrl, FieldUser, IListItemQuery } from "gd-sprest-def/lib/SP/entitytypes";
import { Field, FieldChoice, FieldCurrency, FieldDateTime, FieldLookup, FieldMultiChoice, FieldMultiLineText, FieldNumber, FieldOData, FieldText, FieldUrl, FieldUser, Folder, IListItemQuery } from "gd-sprest-def/lib/SP/entitytypes";
import { ITaxonomyField, TaxonomyField } from "gd-sprest-def/lib/SP/Taxonomy/entitytypes";
import { ITermInfo } from "./taxonomy";

Expand Down Expand Up @@ -68,6 +68,17 @@ export interface IListFormDateFieldInfo extends IListFormFieldInfo {
showTime?: boolean;
}

/**
* List Form Image Field Information
*/
export interface IListFormImageFieldInfo extends IListFormFieldInfo {
/** The list id field. */
listId?: string;

/** The web containing the list. */
webUrl?: string;
}

/**
* List Form Lookup Field Information
*/
Expand Down Expand Up @@ -183,6 +194,9 @@ export interface IListFormField {
*/
create(props: IListFormFieldInfo): PromiseLike<IListFormFieldInfo>;

/** Method to get or create the associated folder for a list's image field. */
getOrCreateImageFolder(info: IListFormResult): PromiseLike<Folder>;

/** Method to load the lookup data */
loadLookupData(info: IListFormLookupFieldInfo, queryTop?: number): PromiseLike<Array<IListItemQuery>>;

Expand Down
35 changes: 35 additions & 0 deletions @types/helper/sp.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ export interface ISPComponents {
*/
Notify: INotify,

/**
* Ribbon
*/
Ribbon: IRibbon,

/**
* ### How to wait for a library to be loaded
* ```ts
Expand Down Expand Up @@ -535,6 +540,36 @@ export interface INotify {
removeNotification(id: string);
}

/**
* Ribbon
*/
export interface IRibbon {
exists: boolean;
PageState: {
Handlers: {
isApproveEnabled: boolean;
isCancelApprovalEnabled: boolean;
isCheckinEnabled: boolean;
isCheckoutEnabled: boolean;
isDeleteEnabled: boolean;
isDiscardcheckoutEnabled: boolean;
isDontSaveAndStopEnabled: boolean;
isEditEnabled: boolean;
isInEditMode: boolean;
isOverrideCheckoutEnabled: boolean;
isPublishEnabled: boolean;
isRejectEnabled: boolean;
isSaveAndStopEditEnabled: boolean;
isSaveEnabled: boolean;
isSubmitForApprovalEnabled: boolean;
isUnpublishEnabled: boolean;
onCancelButton: (...args) => void;
onOkButton: (...args) => void;
showStateChangeDialog: boolean;
}
}
}

/**
* Script on Demand (SOD)
*/
Expand Down
22 changes: 21 additions & 1 deletion @types/helper/spCfg.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,23 +358,40 @@ export interface ISPCfgListInfo {
/** The list creation information. */
ListInformation: ListProps;

/** The list url name. */
ListUrlName?: string;

/** The title default value. */
TitleFieldDefaultValue?: string;

/** The title display name. */
TitleFieldDisplayName?: string;

/** Flag to index the title field. */
TitleFieldIndexed?: boolean;

/** Flag to enfore a value. */
TitleFieldRequired?: boolean;

/** Flag to enforce unique values. */
TitleFieldUniqueValues?: boolean;

/** The user custom actions. */
UserCustomActions?: Array<UserCustomActionProps>;

/** The view information. */
ViewInformation?: Array<ISPCfgViewInfo>;

/**
* Event triggered after the list is created or updated.
* Event triggered after the list is created and configured.
*/
onCreated?: (list: List) => void;

/**
* Event triggered after the list is created.
*/
onCreating?: (list: List) => void;

/**
* Event triggered after the list is updated.
*/
Expand All @@ -385,6 +402,9 @@ export interface ISPCfgListInfo {
* SharePoint Configuration - View Information
*/
export interface ISPCfgViewInfo {
/** Flag to set the view as the default view. */
Default?: boolean;

/** The JSLink property. */
JSLink?: string;

Expand Down
1 change: 1 addition & 0 deletions @types/helper/spCfgTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export type ISPCfgFieldType = {
Date: number;
Geolocation: number;
Guid: number;
Image: number;
Lookup: number;
MMS: number;
Note: number;
Expand Down
8 changes: 4 additions & 4 deletions @types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Library
*/
import { Apps, ContextInfo, GroupService, GroupSiteManager, HubSites, HubSitesUtility, List, Navigation, PeopleManager, PeoplePicker, ProfileLoader, Search, Site, SiteManager, SitePages, SocialFeed, UserProfile, Utility, Web, ThemeManager, WorkflowInstanceService, WorkflowSubscriptionService } from "./lib";
import { Apps, ContextInfo, Graph, GroupService, GroupSiteManager, HubSites, HubSitesUtility, List, Navigation, PeopleManager, PeoplePicker, ProfileLoader, Search, Site, SiteIconManager, SiteManager, SitePages, SocialFeed, UserProfile, Utility, Web, ThemeManager, WorkflowInstanceService, WorkflowSubscriptionService } from "./lib";
export {
Apps, ContextInfo, GroupService, GroupSiteManager, HubSites, HubSitesUtility,
List, Navigation, PeopleManager, PeoplePicker, ProfileLoader, Search, Site, SiteManager, SitePages,
SocialFeed, ThemeManager, UserProfile, Utility, Web, WorkflowInstanceService, WorkflowSubscriptionService
Apps, ContextInfo, Graph, GroupService, GroupSiteManager, HubSites, HubSitesUtility,
List, Navigation, PeopleManager, PeoplePicker, ProfileLoader, Search, Site, SiteIconManager, SiteManager,
SitePages, SocialFeed, ThemeManager, UserProfile, Utility, Web, WorkflowInstanceService, WorkflowSubscriptionService
}

/**
Expand Down
3 changes: 3 additions & 0 deletions @types/lib/contextInfo.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ export interface IContextInformation {
/** Page Personalization Scope */
pagePersonalizationScope: number;

/** Portal URL */
portalUrl: string;

/** Prefer User Time Zone */
preferUserTimeZone: boolean;

Expand Down
61 changes: 54 additions & 7 deletions @types/lib/graph.d.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,73 @@
import * as SP from "../intellisense/graph";
import { IBaseExecution } from "gd-sprest-def/lib/base";
import { Graph as GraphCore } from "gd-sprest-def/lib/microsoft";
import { IGraph as IGraphCore, IGraphToken } from "../intellisense/graph";
import { ITargetInfo } from "../utils";

/**
* Graph
* @hidden
*/
export const Graph: IGraph;

/**
* Graph Properties
*/
export interface IGraphProperties {
/** The access token. Defaults to the Graph.Token value if not set. */
accessToken?: string;

/** The cloud environment. Defaults to the Graph.Cloud or commercial environment if not set. */
cloud?: string;

/** The data to be sent in the body of the request. */
data?: string;

/** The request type GET or POST. */
requestType?: string;

/** The url of the graph api request. */
url: string;

/** The version of the graph api to use. */
version?: string;
}

/**
* Graph EndPoints
*/
export interface IGraphCustom extends IGraphCore {
me(): IBaseExecution<GraphCore.user>;
group(id: string): IBaseExecution<GraphCore.group>;
groups(): IBaseExecution<GraphCore.groupCollections>;
list(siteId: string, id: string): IBaseExecution<GraphCore.list>;
lists(siteId: string): IBaseExecution<GraphCore.listCollections>;
site(id: string): IBaseExecution<GraphCore.site>;
sites(): IBaseExecution<GraphCore.siteCollections>;
user(id: string): IBaseExecution<GraphCore.user>;
users(): IBaseExecution<GraphCore.userCollections>;
}

/**
* Graph
* @hidden
*/
export interface IGraph {
/**
* Creates an instance of the graph library.
* @param accessToken - The access token for the graph api request.
* @param version - The version of the graph to target.
* @param props - The graph request information.
*/
(accessToken: string, version?: string): SP.IGraph;
(props?: IGraphProperties): IGraphCustom;

/** The default cloud environment to use for the requests. */
Cloud: string;

/** The default token to use for the requests. */
Token: string;

/** The default version to use for the requests. */
Version: string;

/**
* Method to get the access token from a classic page.
* @param resource - The graph api endpoint.
*/
getAccessToken(): Promise<SP.IGraphToken>;
getAccessToken(resource?: string): IBaseExecution<IGraphToken>;
}
4 changes: 2 additions & 2 deletions @types/lib/groupService.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as SP from "gd-sprest-def/lib/Microsoft/SharePoint/Portal/entitytypes";
import { IGroupService as IGroupServiceCore } from "gd-sprest-def/lib/Microsoft/SharePoint/Portal/entitytypes";
import { ITargetInfoProps } from "../utils";

/**
Expand All @@ -16,5 +16,5 @@ export interface IGroupService {
* Creates an instance of the user profile library.
* @param targetInfo - (Optional) The target information.
*/
(targetInfo?: ITargetInfoProps): SP.IGroupService;
(targetInfo?: ITargetInfoProps): IGroupServiceCore;
}
4 changes: 2 additions & 2 deletions @types/lib/groupSiteManager.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as SP from "gd-sprest-def/lib/Microsoft/SharePoint/Portal/entitytypes";
import { IGroupSiteManager as IGroupSiteManagerCore } from "gd-sprest-def/lib/Microsoft/SharePoint/Portal/entitytypes";
import { ITargetInfoProps } from "../utils";

/**
Expand All @@ -16,5 +16,5 @@ export interface IGroupSiteManager {
* Creates an instance of the user profile library.
* @param targetInfo - (Optional) The target information.
*/
(targetInfo?: ITargetInfoProps): SP.IGroupSiteManager;
(targetInfo?: ITargetInfoProps): IGroupSiteManagerCore;
}
4 changes: 2 additions & 2 deletions @types/lib/hubSitesUtility.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as SP from "gd-sprest-def/lib/Microsoft/SharePoint/Portal/entitytypes";
import { ISPHubSitesUtility as ISPHubSitesUtilityCore } from "gd-sprest-def/lib/Microsoft/SharePoint/Portal/entitytypes";
import { ITargetInfoProps } from "../utils";

/**
Expand All @@ -16,5 +16,5 @@ export interface IHubSitesUtility {
* Creates an instance of the user profile library.
* @param targetInfo - (Optional) The target information.
*/
(targetInfo?: ITargetInfoProps): SP.ISPHubSitesUtility;
(targetInfo?: ITargetInfoProps): ISPHubSitesUtilityCore;
}
1 change: 1 addition & 0 deletions @types/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export * from "./peoplePicker";
export * from "./profileLoader";
export * from "./search";
export * from "./site";
export * from "./siteIconManager";
export * from "./siteManager";
export * from "./sitePages";
export * from "./socialFeed";
Expand Down
10 changes: 5 additions & 5 deletions @types/lib/list.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IBaseExecution } from "gd-sprest-def/lib/base";
import { RenderListDataParameters } from "gd-sprest-def/lib/SP/complextypes";
import * as SP from "gd-sprest-def/lib/SP/entitytypes";
import { IList as IListCore, ListItem } from "gd-sprest-def/lib/SP/entitytypes";
import { ITargetInfoProps } from "../utils";

/**
Expand Down Expand Up @@ -41,14 +41,14 @@ export interface IList {
* @param listName - The name of the list.
* @param targetInfo - (Optional) The target information.
*/
(listName: string, targetInfo?: ITargetInfoProps): SP.IList;
(listName: string, targetInfo?: ITargetInfoProps): IListCore;

/**
* @category List
* A static method to get the list by the entity name.
* @param props - The list entity request properties.
*/
getByEntityName(props: IListEntityProps): SP.IList;
getByEntityName(props: IListEntityProps): IListCore;

/**
* A static method to get the list data from the SP.List.GetListAsDataStream endpoint.
Expand All @@ -63,7 +63,7 @@ export interface IList {
* List Data Stream
* @category List
*/
export interface IListDataStream<RowProps = SP.ListItem> {
export interface IListDataStream<RowProps = ListItem> {
FilterFields?: string;
FilterLink: string;
FirstRow: number;
Expand All @@ -81,7 +81,7 @@ export interface IListDataStream<RowProps = SP.ListItem> {
*/
export interface IListEntityProps {
/** The callback method. */
callback?: (list: SP.IList) => void;
callback?: (list: IListCore) => void;

/** The list entity name. */
name: string;
Expand Down
4 changes: 2 additions & 2 deletions @types/lib/peopleManager.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as SP from "gd-sprest-def/lib/SP/UserProfiles/entitytypes";
import { IPeopleManager as IPeopleManagerCore } from "gd-sprest-def/lib/SP/UserProfiles/entitytypes";
import { ITargetInfoProps } from "../utils";

/**
Expand All @@ -16,5 +16,5 @@ export interface IPeopleManager {
* Creates an instance of the people manager library.
* @param targetInfo - (Optional) The target information.
*/
(targetInfo?: ITargetInfoProps): SP.IPeopleManager;
(targetInfo?: ITargetInfoProps): IPeopleManagerCore;
}
4 changes: 2 additions & 2 deletions @types/lib/peoplePicker.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as SP from "../intellisense/peoplePicker";
import { IPeoplePicker as IPeoplePickerCore } from "../intellisense/peoplePicker";
import { ITargetInfoProps } from "../utils";

/**
Expand All @@ -16,5 +16,5 @@ export interface IPeoplePicker {
* Creates an instance of the people picker library.
* @param targetInfo - (Optional) The target information.
*/
(targetInfo?: ITargetInfoProps): SP.IPeoplePicker;
(targetInfo?: ITargetInfoProps): IPeoplePickerCore;
}
4 changes: 2 additions & 2 deletions @types/lib/profileLoader.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as SP from "gd-sprest-def/lib/SP/UserProfiles/entitytypes";
import { IProfileLoader as IProfileLoaderCore } from "gd-sprest-def/lib/SP/UserProfiles/entitytypes";
import { ITargetInfoProps } from "../utils";

/**
Expand All @@ -16,5 +16,5 @@ export interface IProfileLoader {
* Creates an instance of the profile loader library.
* @param targetInfo - (Optional) The target information.
*/
(targetInfo?: ITargetInfoProps): SP.IProfileLoader;
(targetInfo?: ITargetInfoProps): IProfileLoaderCore;
}
Loading

0 comments on commit a9bb6bf

Please sign in to comment.