Skip to content

Commit

Permalink
Merge pull request #508 from Esri/composition-and-defaults
Browse files Browse the repository at this point in the history
Draft: composition and defaults
  • Loading branch information
john gravois authored Apr 16, 2019
2 parents 18b3967 + a579715 commit a871246
Show file tree
Hide file tree
Showing 53 changed files with 573 additions and 297 deletions.
2 changes: 1 addition & 1 deletion packages/arcgis-rest-auth/test/UserSession.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
ArcGISRequestError,
ArcGISAuthError,
ErrorTypes
} from "@esri/arcgis-rest-request/src";
} from "@esri/arcgis-rest-request";
import * as fetchMock from "fetch-mock";
import { YESTERDAY, TOMORROW } from "./utils";

Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-feature-service-admin/test/addTo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

import * as fetchMock from "fetch-mock";

import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";
import {
encodeParam,
ErrorTypes,
ILayer,
ITable
} from "@esri/arcgis-rest-request/src";
} from "@esri/arcgis-rest-request";

import { addToServiceDefinition } from "../src/addTo";
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import { createFeatureService } from "../src/create";
import { FeatureServiceResponse } from "./mocks/service";
import { MoveToFolderResponse } from "./mocks/move";

import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";
import { encodeParam } from "@esri/arcgis-rest-request/src";
import { encodeParam } from "@esri/arcgis-rest-request";

describe("create feature service", () => {
afterEach(fetchMock.restore);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

import { ILayerDefinition, IExtent } from "@esri/arcgis-rest-request/src";
import { ILayerDefinition, IExtent } from "@esri/arcgis-rest-request";

const defaultExtent: IExtent = {
xmin: -180,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

import { IItemMoveResponse } from "@esri/arcgis-rest-portal/src";
import { IItemMoveResponse } from "@esri/arcgis-rest-portal";

export const MoveToFolderResponse: IItemMoveResponse = {
folder: "83216cba44bf4357bf06687ec88a847b",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Apache-2.0 */

import { IQueryFeaturesResponse } from "../../src/query";
import { IFeature, IGeometry } from "@esri/arcgis-rest-request/src";
import { IFeature, IGeometry } from "@esri/arcgis-rest-request";

export const cvdQueryResponse: IQueryFeaturesResponse = {
objectIdFieldName: "objectid",
Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-feature-service/test/mocks/fields.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

import { IField } from "@esri/arcgis-rest-request/src";
import { IField } from "@esri/arcgis-rest-request";

export const cvdServiceFields: IField[] = [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-feature-service/test/mocks/service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

import { ILayerDefinition } from "@esri/arcgis-rest-request/src";
import { ILayerDefinition } from "@esri/arcgis-rest-request";
import { cvdServiceFields } from "./fields";

export const getFeatureServiceResponse: ILayerDefinition = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IParamBuilder, warn } from "@esri/arcgis-rest-request";
import { IParamBuilder, warn } from "@esri/arcgis-rest-request/src";

export class SearchQueryBuilder implements IParamBuilder {
private termStack: any[] = [];
Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-portal/src/items/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
appendCustomParams,
IPagingParams,
IItem
} from "@esri/arcgis-rest-request";
} from "@esri/arcgis-rest-request/src";

import { getPortalUrl } from "../util/get-portal-url";
import { SearchQueryBuilder } from "./SearchQueryBuilder";
Expand Down
1 change: 1 addition & 0 deletions packages/arcgis-rest-portal/src/util/get-portal-url.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Copyright (c) 2017 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

import { IRequestOptions, cleanUrl } from "@esri/arcgis-rest-request";

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/groups/crud.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { removeGroup } from "../../src/groups/remove";

import { GroupEditResponse } from "../mocks/groups/responses";

import { encodeParam, IGroupAdd } from "@esri/arcgis-rest-request/src";
import { UserSession } from "@esri/arcgis-rest-auth/src";
import { encodeParam, IGroupAdd } from "@esri/arcgis-rest-request";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";
import * as fetchMock from "fetch-mock";

Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/groups/join.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { joinGroup, leaveGroup } from "../../src/groups/join";

import { GroupEditResponse } from "../mocks/groups/responses";

import { encodeParam } from "@esri/arcgis-rest-request/src";
import { UserSession } from "@esri/arcgis-rest-auth/src";
import { encodeParam } from "@esri/arcgis-rest-request";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";

import * as fetchMock from "fetch-mock";
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/groups/notification.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { encodeParam } from "@esri/arcgis-rest-request/src";
import { UserSession } from "@esri/arcgis-rest-auth/src";
import { encodeParam } from "@esri/arcgis-rest-request";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";

import * as fetchMock from "fetch-mock";
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/groups/protect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { protectGroup, unprotectGroup } from "../../src/groups/protect";

import { GroupEditResponse } from "../mocks/groups/responses";

import { encodeParam } from "@esri/arcgis-rest-request/src";
import { UserSession } from "@esri/arcgis-rest-auth/src";
import { encodeParam } from "@esri/arcgis-rest-request";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";

import * as fetchMock from "fetch-mock";
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/items/add.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {

import { ItemSuccessResponse } from "../mocks/items/item";

import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";
import { encodeParam } from "@esri/arcgis-rest-request/src";
import { encodeParam } from "@esri/arcgis-rest-request";

describe("search", () => {
afterEach(fetchMock.restore);
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/items/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import {

import { ItemSuccessResponse } from "../mocks/items/item";

import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";
import { encodeParam } from "@esri/arcgis-rest-request/src";
import { encodeParam } from "@esri/arcgis-rest-request";

describe("search", () => {
afterEach(fetchMock.restore);
Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-portal/test/items/get.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {

import { GetItemResourcesResponse } from "../mocks/items/resources";

import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";

describe("get", () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/items/protect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { protectItem, unprotectItem } from "../../src/items/protect";

import { ItemSuccessResponse } from "../mocks/items/item";

import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";
import { encodeParam } from "@esri/arcgis-rest-request/src";
import { encodeParam } from "@esri/arcgis-rest-request";

describe("search", () => {
afterEach(fetchMock.restore);
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/items/remove.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import { ItemSuccessResponse } from "../mocks/items/item";

import { RemoveItemResourceResponse } from "../mocks/items/resources";

import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";
import { encodeParam } from "@esri/arcgis-rest-request/src";
import { encodeParam } from "@esri/arcgis-rest-request";

describe("search", () => {
afterEach(fetchMock.restore);
Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-portal/test/items/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as fetchMock from "fetch-mock";
import { searchItems } from "../../src/items/search";

import { SearchResponse, BigSearchResponse } from "../mocks/items/search";
import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";
import { SearchQueryBuilder } from "../../src/items/SearchQueryBuilder";

Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/items/update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import { ItemSuccessResponse } from "../mocks/items/item";

import { UpdateItemResourceResponse } from "../mocks/items/resources";

import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";
import { encodeParam } from "@esri/arcgis-rest-request/src";
import { encodeParam } from "@esri/arcgis-rest-request";

describe("search", () => {
afterEach(fetchMock.restore);
Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-portal/test/mocks/groups/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
IGroupUsersResult
} from "../../../src/groups/get";

import { IGroup } from "@esri/arcgis-rest-request/src";
import { IGroup } from "@esri/arcgis-rest-request";

export const GroupSearchResponse: IGroupSearchResult = {
query: "* AND owner:dcadmin",
Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-portal/test/mocks/items/item.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

import { IItem } from "@esri/arcgis-rest-request/src";
import { IItem } from "@esri/arcgis-rest-request";
import {
IGetRelatedItemsResponse,
IItemGroupResponse
Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-portal/test/mocks/sharing/sharing.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";
import { TOMORROW } from "@esri/arcgis-rest-auth/test/utils";

export const MOCK_USER_SESSION = new UserSession({
Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-portal/test/mocks/users/user.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

import { IUser } from "@esri/arcgis-rest-request/src";
import { IUser } from "@esri/arcgis-rest-request";

export const AnonUserResponse: IUser = {
username: "jsmith",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* Copyright (c) 2018 Environmental Systems Research Institute, Inc.
* Apache-2.0 */

import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";

import { getUserUrl } from "../../src/users/get-user-url";

Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-portal/test/users/get-user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
GroupAdminUserResponse
} from "../mocks/users/user";

import { UserSession } from "@esri/arcgis-rest-auth/src";
import { UserSession } from "@esri/arcgis-rest-auth";
import * as fetchMock from "fetch-mock";

const TOMORROW = (function() {
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/users/invitation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
UserInvitationResponse
} from "../mocks/users/invitation";

import { encodeParam } from "@esri/arcgis-rest-request/src";
import { UserSession } from "@esri/arcgis-rest-auth/src";
import { encodeParam } from "@esri/arcgis-rest-request";
import { UserSession } from "@esri/arcgis-rest-auth";
import * as fetchMock from "fetch-mock";

const TOMORROW = (function() {
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/users/notification.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
IDeleteSuccessResponse
} from "../mocks/users/notification";

import { encodeParam } from "@esri/arcgis-rest-request/src";
import { UserSession } from "@esri/arcgis-rest-auth/src";
import { encodeParam } from "@esri/arcgis-rest-request";
import { UserSession } from "@esri/arcgis-rest-auth";
import * as fetchMock from "fetch-mock";

const TOMORROW = (function() {
Expand Down
4 changes: 2 additions & 2 deletions packages/arcgis-rest-portal/test/users/update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
* Apache-2.0 */

import { updateUser, IUpdateUserResponse } from "../../src/users/update";
import { encodeParam } from "@esri/arcgis-rest-request/src";
import { UserSession } from "@esri/arcgis-rest-auth/src";
import { encodeParam } from "@esri/arcgis-rest-request";
import { UserSession } from "@esri/arcgis-rest-auth";
import * as fetchMock from "fetch-mock";

const TOMORROW = (function() {
Expand Down
23 changes: 16 additions & 7 deletions packages/arcgis-rest-request/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,28 @@
* Apache-2.0 */

export * from "./request";

export * from "./utils/append-custom-params";
export * from "./utils/ArcGISRequestError";
export * from "./utils/ArcGISAuthError";
export * from "./utils/check-for-errors";
export * from "./utils/clean-url";
export * from "./utils/encode-form-data";
export * from "./utils/encode-query-string";
export * from "./utils/warn";
export * from "./utils/ArcGISRequestError";
export * from "./utils/retryAuthError";
export * from "./utils/ErrorTypes";
export * from "./utils/params";
export * from "./utils/GrantTypes";
export * from "./utils/HTTPMethods";
export * from "./utils/IAuthenticationManager";
export * from "./utils/IFetchTokenParams";
export * from "./utils/IGenerateTokenParams";
export * from "./utils/IParams";
export * from "./utils/IParamBuilder";
export * from "./utils/IParamsBuilder";
export * from "./utils/IRequestOptions";
export * from "./utils/ITokenRequestOptions";
export * from "./utils/process-params";
export * from "./utils/clean-url";
export * from "./utils/append-custom-params";
export * from "./utils/ResponseFormats";
export * from "./utils/retryAuthError";
export * from "./utils/warn";

export * from "./types/feature";
export * from "./types/geometry";
Expand Down
Loading

0 comments on commit a871246

Please sign in to comment.