diff --git a/.gitignore b/.gitignore
index fd24998..dba7f54 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,5 @@ coverage
documentation
npm-debug.log
debug.log
-.vscode
\ No newline at end of file
+dist
+.nyc_output
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..d6a3d68
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,27 @@
+{
+ // Use IntelliSense to learn about possible Node.js debug attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "type": "node",
+ "request": "launch",
+ "name": "Debug tests",
+ "runtimeExecutable": "mocha",
+ "windows": {
+ "runtimeExecutable": "mocha.cmd"
+ },
+ "preLaunchTask": "build",
+ "runtimeArgs": [
+ "--debug-brk",
+ "./dist/test/index.js"
+ ],
+ "program": "${workspaceRoot}\\test\\index.ts",
+ "outFiles": [
+ "${workspaceRoot}\\dist\\**\\*.js"
+ ],
+ "port": 5858
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 0000000..31effad
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,18 @@
+{
+ // See https://go.microsoft.com/fwlink/?LinkId=733558
+ // for the documentation about the tasks.json format
+ "version": "0.1.0",
+ "command": "npm",
+ "isShellCommand": true,
+ "showOutput": "always",
+ "suppressTaskName": true,
+ "tasks": [
+ {
+ "taskName": "build",
+ "args": [
+ "run",
+ "build"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index 4f8c331..454ae32 100644
--- a/README.md
+++ b/README.md
@@ -51,24 +51,35 @@ To install the latest stable version
npm install --save sn-redux
```
-Set your Sense/Net portal's url with SetSiteUrl method
+Create your sense NET portal Repository to use. You can configure your Store to use this repository, when calling Store.ConfigureStore
-```
-import { SetSiteUrl } from 'sn-client-js';
+```ts
+import { Repository } from 'sn-client-js';
-SetSiteUrl('https://daily.demo.sensenet.com');
-```
+let repository = new Repository.SnRepository({
+ RepositoryUrl: 'http://path-to-your-portal.com',
+});
-So that you can set the url of your Sense/Net portal that you want to communicate with. To enable your external app to send request against your Sense/Net portal change
-your ```Portal.settings```. For further information about cross-origin resource sharing in Sense/Net check [this](http://wiki.sensenet.com/Cross-origin_resource_sharing#Origin_check)
-article.
+const store = Store.configureStore(
+ myRootReducer,
+ myRootEpic, // If not set, the default will be 'Epics.rootEpic'
+ [middleware1, middleware2], // If not set, only the epicMiddleware will be used
+ persistedState, // Optional
+ repository // Optional. If not provided, a Repository with default values will be used
+ );
-Check your Sense/Net portal's web.config and if the ```ODataServiceToken``` is set, use the ```SetServiceToken()``` method to set the same service token on client side.
```
-import { SetServiceToken } from 'sn-client-js';
-SetServiceToken('myservicetoken');
+To enable your external app to send request against your Sense/Net portal change your ```Portal.settings```. For further information about cross-origin resource sharing in Sense/Net check [this](http://wiki.sensenet.com/Cross-origin_resource_sharing#Origin_check) article.
+
+Check your Sense/Net portal's web.config and if the ```ODataServiceToken``` is set, you can pass to your Repository as a config value on client side.
+
+```ts
+let repository = new Repository.SnRepository({
+ RepositoryUrl: 'http://path-to-your-portal.com',
+ ODataToken: 'MyODataServiceToken'
+});
```
## Import
@@ -94,22 +105,17 @@ store.dispatch(Actions.Delete(123, false));
Building the project, running all the unit tests and the ts linter and get the code coverage report, use:
```
-gulp
+npm run build
```
## Running tests
-To execute all unit tests, use:
+To execute all unit tests and generate coverage reports, use:
```
-gulp test
+npm t
```
-## Generatings code coverage report
-
-```
-gulp test:coverage
-```
## Examples
diff --git a/dist/src/Actions.js b/dist/src/Actions.js
deleted file mode 100644
index cf451b8..0000000
--- a/dist/src/Actions.js
+++ /dev/null
@@ -1,189 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const normalizr_1 = require("normalizr");
-const Schema_1 = require("./Schema");
-const SN = require("sn-client-js");
-var Actions;
-(function (Actions) {
- Actions.RequestContent = (path, options = {}) => ({
- type: 'FETCH_CONTENT_REQUEST',
- path,
- filter: SN.ODataHelper.buildUrlParamString(options)
- });
- Actions.ReceiveContent = (response, filter) => ({
- type: 'FETCH_CONTENT_SUCCESS',
- response: normalizr_1.normalize(response.d.results, Schema_1.Schemas.arrayOfContent),
- filter
- });
- Actions.ReceiveContentFailure = (filter, error) => ({
- type: 'FETCH_CONTENT_FAILURE',
- filter,
- message: error.message
- });
- Actions.CreateContent = (path, content) => ({ type: 'CREATE_CONTENT_REQUEST', content, path });
- Actions.CreateContentSuccess = (response) => ({
- type: 'CREATE_CONTENT_SUCCESS',
- response: normalizr_1.normalize(response.response.d, Schema_1.Schemas.content)
- });
- Actions.CreateContentFailure = (error) => ({
- type: 'CREATE_CONTENT_FAILURE',
- message: error.message
- });
- Actions.UpdateContent = (id, fields) => ({ type: 'UPDATE_CONTENT_REQUEST', id, fields });
- Actions.UpdateContentSuccess = (response) => ({
- type: 'UPDATE_CONTENT_SUCCESS',
- response: normalizr_1.normalize(response.response.d, Schema_1.Schemas.content)
- });
- Actions.UpdateContentFailure = (error) => ({
- type: 'UPDATE_CONTENT_FAILURE',
- message: error.message
- });
- Actions.Delete = (id, permanently = false) => ({ type: 'DELETE_CONTENT_REQUEST', id, permanently });
- Actions.DeleteSuccess = (index, id) => ({
- type: 'DELETE_CONTENT_SUCCESS',
- index,
- id
- });
- Actions.DeleteFailure = (error) => ({
- type: 'DELETE_CONTENT_FAILURE',
- message: error.message
- });
- Actions.DeleteBatch = (path, ids, permanently = false) => ({
- type: 'DELETE_BATCH_REQUEST',
- path,
- ids,
- permanently
- });
- Actions.DeleteBatchSuccess = (indexes) => ({
- type: 'DELETE_BATCH_SUCCESS',
- indexes
- });
- Actions.DeleteBatchFailure = (error) => ({
- type: 'DELETE_BATCH_FAILURE',
- message: error.message
- });
- Actions.CheckOut = (id) => ({
- type: 'CHECKOUT_CONTENT_REQUEST',
- id
- });
- Actions.CheckOutSuccess = (response) => ({
- type: 'CHECKOUT_CONTENT_SUCCESS',
- response: normalizr_1.normalize(response.response.d, Schema_1.Schemas.content)
- });
- Actions.CheckOutFailure = (error) => ({
- type: 'CHECKOUT_CONTENT_FAILURE',
- message: error.message
- });
- Actions.CheckIn = (id, checkInComment = '') => ({
- type: 'CHECKIN_CONTENT_REQUEST',
- id,
- checkInComment
- });
- Actions.CheckInSuccess = (response) => ({
- type: 'CHECKIN_CONTENT_SUCCESS',
- response: normalizr_1.normalize(response.response.d, Schema_1.Schemas.content)
- });
- Actions.CheckInFailure = (error) => ({
- type: 'CHECKIN_CONTENT_FAILURE',
- message: error.message
- });
- Actions.Publish = (id) => ({
- type: 'PUBLISH_CONTENT_REQUEST',
- id
- });
- Actions.PublishSuccess = (response) => ({
- type: 'PUBLISH_CONTENT_SUCCESS',
- response: normalizr_1.normalize(response.response.d, Schema_1.Schemas.content)
- });
- Actions.PublishFailure = (error) => ({
- type: 'PUBLISH_CONTENT_FAILURE',
- message: error.message
- });
- Actions.Approve = (id) => ({
- type: 'APPROVE_CONTENT_REQUEST',
- id
- });
- Actions.ApproveSuccess = (response) => ({
- type: 'APPROVE_CONTENT_SUCCESS',
- response: normalizr_1.normalize(response.response.d, Schema_1.Schemas.content)
- });
- Actions.ApproveFailure = (error) => ({
- type: 'APPROVE_CONTENT_FAILURE',
- message: error.message
- });
- Actions.Reject = (id, rejectReason = '') => ({
- type: 'REJECT_CONTENT_REQUEST',
- id,
- rejectReason
- });
- Actions.RejectSuccess = (response) => ({
- type: 'REJECT_CONTENT_SUCCESS',
- response: normalizr_1.normalize(response.response.d, Schema_1.Schemas.content)
- });
- Actions.RejectFailure = (error) => ({
- type: 'REJECT_CONTENT_FAILURE',
- message: error.message
- });
- Actions.UndoCheckout = (id) => ({
- type: 'UNDOCHECKOUT_CONTENT_REQUEST',
- id
- });
- Actions.UndoCheckoutSuccess = (response) => ({
- type: 'UNDOCHECKOUT_CONTENT_SUCCESS',
- response: normalizr_1.normalize(response.response.d, Schema_1.Schemas.content)
- });
- Actions.UndoCheckoutFailure = (error) => ({
- type: 'UNDOCHECKOUT_CONTENT_FAILURE',
- message: error.message
- });
- Actions.ForceUndoCheckout = (id) => ({
- type: 'FORCEUNDOCHECKOUT_CONTENT_REQUEST',
- id
- });
- Actions.ForceUndoCheckoutSuccess = (response) => ({
- type: 'FORCEUNDOCHECKOUT_CONTENT_SUCCESS',
- response: normalizr_1.normalize(response.response.d, Schema_1.Schemas.content)
- });
- Actions.ForceUndoCheckoutFailure = (error) => ({
- type: 'FORCEUNDOCHECKOUT_CONTENT_FAILURE',
- message: error.message
- });
- Actions.RestoreVersion = (id, version) => ({
- type: 'RESTOREVERSION_CONTENT_REQUEST',
- id,
- version
- });
- Actions.RestoreVersionSuccess = (response) => ({
- type: 'RESTOREVERSION_CONTENT_SUCCESS',
- response: normalizr_1.normalize(response.response.d, Schema_1.Schemas.content)
- });
- Actions.RestoreVersionFailure = (error) => ({
- type: 'RESTOREVERSION_CONTENT_FAILURE',
- message: error.message
- });
- Actions.UserLogin = (userName, password) => ({
- type: 'USER_LOGIN_REQUEST',
- userName,
- password
- });
- Actions.UserLoginSuccess = (response) => ({
- type: 'USER_LOGIN_SUCCESS',
- response: response.response.d
- });
- Actions.UserLoginFailure = (error) => ({
- type: 'USER_LOGIN_FAILURE',
- message: (error.status === 403) ? 'The username or the password is not valid!' : error.message
- });
- Actions.UserLogout = () => ({
- type: 'USER_LOGOUT_REQUEST'
- });
- Actions.UserLogoutSuccess = (response) => ({
- type: 'USER_LOGOUT_SUCCESS'
- });
- Actions.UserLogoutFailure = (error) => ({
- type: 'USER_LOGOUT_FAILURE',
- message: error.message
- });
-})(Actions = exports.Actions || (exports.Actions = {}));
-
-//# sourceMappingURL=Actions.js.map
diff --git a/dist/src/Actions.js.map b/dist/src/Actions.js.map
deleted file mode 100644
index 9e68112..0000000
--- a/dist/src/Actions.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["src/Actions.ts"],"names":[],"m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QAC7B,IAAI,EAAE,qBAAqB;KAC9B,CAAC,CAAA;IAMW,yBAAiB,GAAG,CAAC,QAAa,KAAK,CAAC;QACjD,IAAI,EAAE,qBAAqB;KAC9B,CAAC,CAAA;IAMW,yBAAiB,GAAG,CAAC,KAAU,KAAK,CAAC;QAC9C,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,KAAK,CAAC,OAAO;KACzB,CAAC,CAAA;AACN,CAAC,EApaa,OAAO,GAAP,eAAO,KAAP,eAAO,QAoapB","file":"Actions.js","sourcesContent":["import { normalize } from 'normalizr';\r\nimport { Schemas } from './Schema';\r\nimport * as SN from 'sn-client-js';\r\n\r\n/**\r\n * Module that contains the action creators. \r\n * \r\n * _Redux actions are payloads of information that send data from your application to your store. They are the only source of information for the store. You send them to the store using \r\n * ```store.dispatch()```. Actions are plain JavaScript objects. Actions must have a type property that indicates the type of action being performed._\r\n * \r\n * Learn more about Redux actions [here](http://redux.js.org/docs/basics/Actions.html)\r\n * \r\n * Following are Redux actions but they're all related with a Sense/Net built-in action. Since this Sense/Net built-in actions are OData actions and functions and they get and set \r\n * data throught ajax request we have to handle the main steps of their process separately. So there're three separate redux action for every Sense/Net action:\r\n * one for the request itself and two for the two possible end of an ajax request, success and fail.\r\n * \r\n * All of the JSON responses with content or collection are normalized so you shouldn't care about how to handle nested data structure, normalizr takes JSON and a schema and replaces \r\n * nested entities with their IDs, gathering all entities in dictionaries.\r\n * For further information about normalizr check this [link](https://github.com/paularmstrong/normalizr).\r\n * \r\n * ```\r\n * [{\r\n * Id: 5145,\r\n * DisplayName: 'Some Article',\r\n * Status: ['Active']\r\n * }, {\r\n * Id: 5146,\r\n * Displayname: 'Other Article',\r\n * Status: ['Completed']\r\n * }]\r\n * \r\n * ```\r\n * \r\n * is normalized to\r\n * \r\n * ```\r\n * result: [5145, 5146],\r\n * entities: {\r\n * collection: {\r\n * 5145: {\r\n * Id: 5145,\r\n * DisplayName: 'Some Article',\r\n * Status: ['Active']\r\n * },\r\n * 5146: {\r\n * Id: 5146,\r\n * Displayname: 'Other Article',\r\n * Status: ['Completed']\r\n * }\r\n * }\r\n * }\r\n * ```\r\n * \r\n * Following module now cover the CRUD operations, so it contains Actions which are related to fetching, creating, deleting and updating Content. Other built-in SenseNet OData\r\n * Actions and Functions will be the parts of this module too and you are be able to add your custom Actions too by combining your reducers with the built-in ones.\r\n * \r\n * ### Using built-in redux actions in your views\r\n * \r\n * ```\r\n * import * as React from 'react'\r\n * import { connect } from 'react-redux'\r\n * import { TextField } from 'material-ui/TextField';\r\n * import RaisedButton from 'material-ui/RaisedButton';\r\n * import { Actions } from 'sn-redux';\r\n * import { Content } from './SenseNet/Content';\r\n * \r\n * let AddTodo = ({ dispatch }) => {\r\n * let input\r\n * \r\n * return (\r\n *
\r\n * \r\n *
\r\n * )\r\n * }\r\n * AddTodo = connect()(AddTodo)\r\n * ```\r\n * \r\n * ### Combining your custom redux reducers with sn-redux's root reducer.\r\n * \r\n * ```\r\n * import { combineReducers } from 'redux';\r\n * import { Store, Reducers } from 'sn-redux';\r\n * import { Root } from './components/Root'\r\n * import { listByFilter } from './reducers/filtering'\r\n * \r\n * const collection = Reducers.collection;\r\n * const myReducer = combineReducers({\r\n * collection,\r\n * listByFilter\r\n * });\r\n * \r\n * const store = Store.configureStore(myReducer);\r\n * ```\r\n */\r\nexport module Actions {\r\n /**\r\n * Action creator for requesting a content from Sense/Net Content Repository to get its children content.\r\n * @param path {string} Path of the requested parent item.\r\n * @param options {OData.IODataParams} Represents an ODataOptions object based on the IODataOptions interface. Holds the possible url parameters as properties.\r\n * @returns {Object} Returns a redux action with the properties type, path and filter. \r\n */\r\n export const RequestContent = (path: string, options: SN.ODataApi.IODataParams = {}) => ({\r\n type: 'FETCH_CONTENT_REQUEST',\r\n path,\r\n filter: SN.ODataHelper.buildUrlParamString(options)\r\n });\r\n /**\r\n * Action creator for the step when a fetching request ends successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @param filter {string} String with the url params.\r\n * @returns {Object} Returns a redux action with the properties type, normalized response and filter. \r\n */\r\n export const ReceiveContent = (response: any, filter: string) =>\r\n ({\r\n type: 'FETCH_CONTENT_SUCCESS',\r\n response: normalize(response.d.results, Schemas.arrayOfContent),\r\n filter\r\n })\r\n /**\r\n * Action creator for the step when a fetching request failed.\r\n * @param filter {string} String with the url params.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type, filter and errormessage. \r\n */\r\n export const ReceiveContentFailure = (filter: string, error: any) => ({\r\n type: 'FETCH_CONTENT_FAILURE',\r\n filter,\r\n message: error.message\r\n });\r\n /**\r\n * Action creator for creating a Content in the Content Repository.\r\n * @param path {string} Path of the parent item.\r\n * @param content {Content} Content that have to be created in the Content Respository.\r\n * @returns {Object} Returns a redux action with the properties type, path of the parent and content. \r\n */\r\n export const CreateContent = (path: string, content: SN.Content) => ({ type: 'CREATE_CONTENT_REQUEST', content, path });\r\n /**\r\n * Action creator for the step when Content creation on the server ends successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with the properties type and the normalized response. \r\n */\r\n export const CreateContentSuccess = (response: any) =>\r\n ({\r\n type: 'CREATE_CONTENT_SUCCESS',\r\n response: normalize(response.response.d, Schemas.content)\r\n });\r\n /**\r\n * Action creator for the step when Content creation failed on the server.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const CreateContentFailure = (error: any) => ({\r\n type: 'CREATE_CONTENT_FAILURE',\r\n message: error.message\r\n });\r\n /**\r\n * Action creator for updating a Content in the Content Repository.\r\n * @param id {number} Id of the Content that has to be updated.\r\n * @param fields {Object} Object with the field value pairs that have to be modified.\r\n * @returns {Object} Returns a redux action with the properties type, id and fields. \r\n */\r\n export const UpdateContent = (id: number, fields: Object) => ({ type: 'UPDATE_CONTENT_REQUEST', id, fields });\r\n /**\r\n * Action creator for the step when Content modification on the server ends successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with the properties type and the response. \r\n */\r\n export const UpdateContentSuccess = (response: any) =>\r\n ({\r\n type: 'UPDATE_CONTENT_SUCCESS',\r\n response: normalize(response.response.d, Schemas.content)\r\n });\r\n /**\r\n * Action creator for the step when Content modification failed on the server.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const UpdateContentFailure = (error: any) => ({\r\n type: 'UPDATE_CONTENT_FAILURE',\r\n message: error.message\r\n })\r\n /**\r\n * Action creator for deleting a Content from the Content Repository.\r\n * @param id {number} Id of the Content that has to be deleted.\r\n * @param permanently {boolean} Defines whether the a Content must be moved to the Trash or deleted permanently.\r\n * @returns {Object} Returns a redux action with the properties type, id and permanently. \r\n */\r\n export const Delete = (id: number, permanently: boolean = false) => ({ type: 'DELETE_CONTENT_REQUEST', id, permanently });\r\n /**\r\n * Action creator for the step when Content deleted successfully.\r\n * @param index {number} Index of the item in the state collection.\r\n * @returns {Object} Returns a redux action with the properties type and index. \r\n */\r\n export const DeleteSuccess = (index: number, id: number) => ({\r\n type: 'DELETE_CONTENT_SUCCESS',\r\n index,\r\n id\r\n })\r\n /**\r\n * Action creator for the step when deleting a Content is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const DeleteFailure = (error: any) => ({\r\n type: 'DELETE_CONTENT_FAILURE',\r\n message: error.message\r\n })\r\n /**\r\n * Action creator for deleting multiple Content from the Content Repository.\r\n * @param path {string} Path of the parent Content.\r\n * @param ids {string[]} Array of ids of the Content that should be deleted.\r\n * @param permanently {boolean} Defines whether Content must be moved to the Trash or deleted permanently.\r\n * @returns {Object} Returns a redux action with the properties type, id and permanently. \r\n */\r\n export const DeleteBatch = (path: string, ids: string[], permanently: boolean = false) => ({\r\n type: 'DELETE_BATCH_REQUEST',\r\n path,\r\n ids,\r\n permanently\r\n })\r\n /**\r\n * Action creator for the step when multiple Content deleted successfully.\r\n * @param indexes {number[]} Array of indexes of the items in the state collection that should be removed.\r\n * @returns {Object} Returns a redux action with the properties type and index. \r\n */\r\n export const DeleteBatchSuccess = (indexes: number[]) => ({\r\n type: 'DELETE_BATCH_SUCCESS',\r\n indexes\r\n })\r\n /**\r\n * Action creator for the step when deleting multiple Content is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const DeleteBatchFailure = (error: any) => ({\r\n type: 'DELETE_BATCH_FAILURE',\r\n message: error.message\r\n })\r\n /**\r\n * Action creator for checking out a Content in the Content Repository.\r\n * @param id {number} Id of the content that should be checked out.\r\n * @returns {Object} Returns a redux action with the properties type and id . \r\n */\r\n export const CheckOut = (id: number) => ({\r\n type: 'CHECKOUT_CONTENT_REQUEST',\r\n id\r\n })\r\n /**\r\n * Action creator for the step when a Content is checked out successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with the properties type and the normalized JSON response. \r\n */\r\n export const CheckOutSuccess = (response: any) => ({\r\n type: 'CHECKOUT_CONTENT_SUCCESS',\r\n response: normalize(response.response.d, Schemas.content)\r\n })\r\n /**\r\n * Action creator for the step when checking out a Content is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const CheckOutFailure = (error: any) => ({\r\n type: 'CHECKOUT_CONTENT_FAILURE',\r\n message: error.message\r\n })\r\n /**\r\n * Action creator for checking in a Content in the Content Repository.\r\n * @param id {number} Id of the content that should be checked in.\r\n * @returns {Object} Returns a redux action with the properties type, id and checkinComment. \r\n */\r\n export const CheckIn = (id: number, checkInComment: string = '') => ({\r\n type: 'CHECKIN_CONTENT_REQUEST',\r\n id,\r\n checkInComment\r\n })\r\n /**\r\n * Action creator for the step when a Content is checked in successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with the properties type and the normalized JSON response. \r\n */\r\n export const CheckInSuccess = (response: any) => ({\r\n type: 'CHECKIN_CONTENT_SUCCESS',\r\n response: normalize(response.response.d, Schemas.content)\r\n })\r\n /**\r\n * Action creator for the step when checking out a Content is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const CheckInFailure = (error: any) => ({\r\n type: 'CHECKIN_CONTENT_FAILURE',\r\n message: error.message\r\n })\r\n /**\r\n * Action creator for publishing a Content in the Content Repository.\r\n * @param id {number} Id of the content that should be published.\r\n * @returns {Object} Returns a redux action with the properties type and id. \r\n */\r\n export const Publish = (id: number) => ({\r\n type: 'PUBLISH_CONTENT_REQUEST',\r\n id\r\n })\r\n /**\r\n * Action creator for the step when a Content is published successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with the properties type and the normalized JSON response. \r\n */\r\n export const PublishSuccess = (response: any) => ({\r\n type: 'PUBLISH_CONTENT_SUCCESS',\r\n response: normalize(response.response.d, Schemas.content)\r\n })\r\n /**\r\n * Action creator for the step when publishing a Content is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const PublishFailure = (error: any) => ({\r\n type: 'PUBLISH_CONTENT_FAILURE',\r\n message: error.message\r\n })\r\n /**\r\n * Action creator for approving a Content in the Content Repository.\r\n * @param id {number} Id of the content that should be approved.\r\n * @returns {Object} Returns a redux action with the properties type and id. \r\n */\r\n export const Approve = (id: number) => ({\r\n type: 'APPROVE_CONTENT_REQUEST',\r\n id\r\n })\r\n /**\r\n * Action creator for the step when a Content is approved successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with the properties type and the normalized JSON response. \r\n */\r\n export const ApproveSuccess = (response: any) => ({\r\n type: 'APPROVE_CONTENT_SUCCESS',\r\n response: normalize(response.response.d, Schemas.content)\r\n })\r\n /**\r\n * Action creator for the step when approving a Content is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const ApproveFailure = (error: any) => ({\r\n type: 'APPROVE_CONTENT_FAILURE',\r\n message: error.message\r\n })\r\n /**\r\n * Action creator for rejecting a Content in the Content Repository.\r\n * @param id {number} Id of the content that should be rejected.\r\n * @param rejectReason {string} Reason of rejecting.\r\n * @returns {Object} Returns a redux action with the properties type, rejectReason and id. \r\n */\r\n export const Reject = (id: number, rejectReason: string = '') => ({\r\n type: 'REJECT_CONTENT_REQUEST',\r\n id,\r\n rejectReason\r\n })\r\n /**\r\n * Action creator for the step when a Content is rejected successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with the properties type and the normalized JSON response. \r\n */\r\n export const RejectSuccess = (response: any) => ({\r\n type: 'REJECT_CONTENT_SUCCESS',\r\n response: normalize(response.response.d, Schemas.content)\r\n })\r\n /**\r\n * Action creator for the step when rejecting a Content is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const RejectFailure = (error: any) => ({\r\n type: 'REJECT_CONTENT_FAILURE',\r\n message: error.message\r\n })\r\n /**\r\n * Action creator for undoing checkout on a Content in the Content Repository.\r\n * @param id {number} Id of the content that should be checked in.\r\n * @returns {Object} Returns a redux action with the properties type and id. \r\n */\r\n export const UndoCheckout = (id: number) => ({\r\n type: 'UNDOCHECKOUT_CONTENT_REQUEST',\r\n id\r\n })\r\n /**\r\n * Action creator for the step when a Content is checked-in successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with the properties type and the normalized JSON response. \r\n */\r\n export const UndoCheckoutSuccess = (response: any) => ({\r\n type: 'UNDOCHECKOUT_CONTENT_SUCCESS',\r\n response: normalize(response.response.d, Schemas.content)\r\n })\r\n /**\r\n * Action creator for the step when undoing checkout on a Content is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const UndoCheckoutFailure = (error: any) => ({\r\n type: 'UNDOCHECKOUT_CONTENT_FAILURE',\r\n message: error.message\r\n })\r\n /**\r\n * Action creator for undoing checkout on a Content in the Content Repository.\r\n * @param id {number} Id of the content that should be checked in.\r\n * @returns {Object} Returns a redux action with the properties type and id. \r\n */\r\n export const ForceUndoCheckout = (id: number) => ({\r\n type: 'FORCEUNDOCHECKOUT_CONTENT_REQUEST',\r\n id\r\n })\r\n /**\r\n * Action creator for the step when a Content is checked-in successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with the properties type and the normalized JSON response. \r\n */\r\n export const ForceUndoCheckoutSuccess = (response: any) => ({\r\n type: 'FORCEUNDOCHECKOUT_CONTENT_SUCCESS',\r\n response: normalize(response.response.d, Schemas.content)\r\n })\r\n /**\r\n * Action creator for the step when undoing checkout on a Content is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const ForceUndoCheckoutFailure = (error: any) => ({\r\n type: 'FORCEUNDOCHECKOUT_CONTENT_FAILURE',\r\n message: error.message\r\n })\r\n /**\r\n * Action creator for restoring the version of a Content in the Content Repository.\r\n * @param id {number} Id of the content that should be checked in.\r\n * @param version {string} Specify which old version to restore\r\n * @returns {Object} Returns a redux action with the properties type and id. \r\n */\r\n export const RestoreVersion = (id: number, version: string) => ({\r\n type: 'RESTOREVERSION_CONTENT_REQUEST',\r\n id,\r\n version\r\n })\r\n /**\r\n * Action creator for the step when a Content is restored to a previous version successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with the properties type and the normalized JSON response. \r\n */\r\n export const RestoreVersionSuccess = (response: any) => ({\r\n type: 'RESTOREVERSION_CONTENT_SUCCESS',\r\n response: normalize(response.response.d, Schemas.content)\r\n })\r\n /**\r\n * Action creator for the step when restoring a previous version of a Content is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const RestoreVersionFailure = (error: any) => ({\r\n type: 'RESTOREVERSION_CONTENT_FAILURE',\r\n message: error.message\r\n })\r\n\r\n /**\r\n * Action creator for login a user to a Sense/Net portal.\r\n * @param userName {string} Login name of the user.\r\n * @param password {string} Password of the user.\r\n * @returns {Object} Returns a redux action with the properties userName and password.\r\n */\r\n export const UserLogin = (userName: string, password: string) => ({\r\n type: 'USER_LOGIN_REQUEST',\r\n userName,\r\n password\r\n })\r\n /**\r\n * Action creator for the step when a User is logged in successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with the user as a response.\r\n */\r\n export const UserLoginSuccess = (response: any) => ({\r\n type: 'USER_LOGIN_SUCCESS',\r\n response: response.response.d\r\n })\r\n /**\r\n * Action creator for the step when login of a user is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const UserLoginFailure = (error: any) => ({\r\n type: 'USER_LOGIN_FAILURE',\r\n message: (error.status === 403) ? 'The username or the password is not valid!' : error.message\r\n })\r\n\r\n /**\r\n * Action creator for logout a user from a Sense/Net portal.\r\n * @returns {Object} Returns a redux action.\r\n */\r\n export const UserLogout = () => ({\r\n type: 'USER_LOGOUT_REQUEST'\r\n })\r\n /**\r\n * Action creator for the step when a user is logged out successfully.\r\n * @param response {any} JSON response of the ajax request.\r\n * @returns {Object} Returns a redux action with a response.\r\n */\r\n export const UserLogoutSuccess = (response: any) => ({\r\n type: 'USER_LOGOUT_SUCCESS'\r\n })\r\n /**\r\n * Action creator for the step when logging out of a user is failed.\r\n * @param error {any} The catched error object.\r\n * @returns {Object} Returns a redux action with the properties type and the error message. \r\n */\r\n export const UserLogoutFailure = (error: any) => ({\r\n type: 'USER_LOGOUT_FAILURE',\r\n message: error.message\r\n })\r\n}"]}
\ No newline at end of file
diff --git a/dist/src/Epics.js b/dist/src/Epics.js
deleted file mode 100644
index c6156c0..0000000
--- a/dist/src/Epics.js
+++ /dev/null
@@ -1,162 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const redux_observable_1 = require("redux-observable");
-const Rx = require("@reactivex/rxjs");
-const SN = require("sn-client-js");
-const Actions_1 = require("./Actions");
-const Reducers_1 = require("./Reducers");
-const { ajax } = Rx.Observable;
-var Epics;
-(function (Epics) {
- Epics.fetchContentEpic = action$ => {
- return action$.ofType('FETCH_CONTENT_REQUEST')
- .mergeMap(action => {
- let params = `${action.filter}`;
- return SN.ODataApiActionObservables.FetchContent(action.path, params)
- .map((response) => Actions_1.Actions.ReceiveContent(response.response, params))
- .catch(error => Rx.Observable.of(Actions_1.Actions.ReceiveContentFailure(params, error)));
- });
- };
- Epics.createContentEpic = action$ => {
- return action$.ofType('CREATE_CONTENT_REQUEST')
- .mergeMap(action => {
- let content = action.content;
- content['__ContentType'] = content.Type;
- return SN.ODataApiActionObservables.CreateContent(action.path, content)
- .map(Actions_1.Actions.CreateContentSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.CreateContentFailure(error)));
- });
- };
- Epics.updateContentEpic = (action$, store) => {
- return action$.ofType('UPDATE_CONTENT_REQUEST')
- .mergeMap(action => {
- return SN.ODataApiActionObservables.PatchContent(action.id, action.fields)
- .map(Actions_1.Actions.UpdateContentSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.UpdateContentFailure(error)));
- });
- };
- Epics.deleteContentEpic = (action$, store) => {
- return action$.ofType('DELETE_CONTENT_REQUEST')
- .mergeMap(action => {
- return SN.ODataApiActionObservables.DeleteContent(action.id, action.permanently)
- .map((response) => {
- const state = store.getState();
- const ids = Reducers_1.Reducers.getIds(state.collection);
- return Actions_1.Actions.DeleteSuccess(ids.indexOf(action.id), action.id);
- })
- .catch(error => Rx.Observable.of(Actions_1.Actions.DeleteFailure(error)));
- });
- };
- Epics.deleteBatchEpic = (action$, store) => {
- return action$.ofType('DELETE_BATCH_REQUEST')
- .mergeMap(action => {
- const Action = new SN.ODataApi.CustomAction({ name: 'DeleteBatch', path: action.path, isAction: true, requiredParams: ['paths'] });
- return SN.ODataApiActionObservables.CreateCustomAction(Action, { data: { 'paths': action.ids, 'permanently': action.permanently } })
- .map((response) => {
- const state = store.getState();
- const ids = Reducers_1.Reducers.getIds(state.collection);
- let indexes = [];
- for (let i = 0; i < ids.length; i++) {
- if (action.ids.indexOf(ids[i]) > -1) {
- indexes.push(i);
- }
- }
- return Actions_1.Actions.DeleteBatchSuccess(indexes);
- })
- .catch(error => Rx.Observable.of(Actions_1.Actions.DeleteBatchFailure(error)));
- });
- };
- Epics.checkoutContentEpic = (action$, store) => {
- return action$.ofType('CHECKOUT_CONTENT_REQUEST')
- .mergeMap(action => {
- const Action = new SN.ODataApi.CustomAction({ name: 'CheckOut', id: action.id, isAction: true });
- return SN.ODataApiActionObservables.CreateCustomAction(Action)
- .map(Actions_1.Actions.CheckOutSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.CheckOutFailure(error)));
- });
- };
- Epics.checkinContentEpic = (action$, store) => {
- return action$.ofType('CHECKIN_CONTENT_REQUEST')
- .mergeMap(action => {
- const Action = new SN.ODataApi.CustomAction({ name: 'CheckIn', id: action.id, isAction: true, params: ['checkInComment'] });
- return SN.ODataApiActionObservables.CreateCustomAction(Action, { data: { 'checkInComments': action.checkInComment } })
- .map(Actions_1.Actions.CheckInSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.CheckInFailure(error)));
- });
- };
- Epics.publishContentEpic = (action$, store) => {
- return action$.ofType('PUBLISH_CONTENT_REQUEST')
- .mergeMap(action => {
- const Action = new SN.ODataApi.CustomAction({ name: 'Publish', id: action.id, isAction: true });
- return SN.ODataApiActionObservables.CreateCustomAction(Action)
- .map(Actions_1.Actions.PublishSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.PublishFailure(error)));
- });
- };
- Epics.approveContentEpic = (action$, store) => {
- return action$.ofType('APPROVE_CONTENT_REQUEST')
- .mergeMap(action => {
- const Action = new SN.ODataApi.CustomAction({ name: 'Approve', id: action.id, isAction: true });
- return SN.ODataApiActionObservables.CreateCustomAction(Action)
- .map(Actions_1.Actions.ApproveSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.ApproveFailure(error)));
- });
- };
- Epics.rejectContentEpic = (action$, store) => {
- return action$.ofType('REJECT_CONTENT_REQUEST')
- .mergeMap(action => {
- const Action = new SN.ODataApi.CustomAction({ name: 'Reject', id: action.id, isAction: true, params: ['rejectReason'] });
- return SN.ODataApiActionObservables.CreateCustomAction(Action, { data: { 'rejectReason': action.rejectReason ? action.rejectReason : '' } })
- .map(Actions_1.Actions.RejectSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.RejectFailure(error)));
- });
- };
- Epics.undocheckoutContentEpic = (action$, store) => {
- return action$.ofType('UNDOCHECKOUT_CONTENT_REQUEST')
- .mergeMap(action => {
- const Action = new SN.ODataApi.CustomAction({ name: 'UndoCheckout', id: action.id, isAction: true });
- return SN.ODataApiActionObservables.CreateCustomAction(Action)
- .map(Actions_1.Actions.UndoCheckoutSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.UndoCheckoutFailure(error)));
- });
- };
- Epics.forceundocheckoutContentEpic = (action$, store) => {
- return action$.ofType('FORCEUNDOCHECKOUT_CONTENT_REQUEST')
- .mergeMap(action => {
- const Action = new SN.ODataApi.CustomAction({ name: 'ForceUndoCheckout', id: action.id, isAction: true });
- return SN.ODataApiActionObservables.CreateCustomAction(Action)
- .map(Actions_1.Actions.ForceUndoCheckoutSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.ForceUndoCheckoutFailure(error)));
- });
- };
- Epics.restoreversionContentEpic = (action$, store) => {
- return action$.ofType('RESTOREVERSION_CONTENT_REQUEST')
- .mergeMap(action => {
- const Action = new SN.ODataApi.CustomAction({ name: 'RestoreVersion', id: action.id, isAction: true, params: ['version'] });
- return SN.ODataApiActionObservables.CreateCustomAction(Action, { data: { 'version': action.version } })
- .map(Actions_1.Actions.RestoreVersionSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.RestoreVersionFailure(error)));
- });
- };
- Epics.userLoginEpic = (action$, store) => {
- return action$.ofType('USER_LOGIN_REQUEST')
- .mergeMap(action => {
- const Action = new SN.ODataApi.CustomAction({ name: 'Login', path: '/Root', isAction: true, requiredParams: ['username', 'password'], noCache: true });
- return SN.ODataApiActionObservables.Login(Action, { data: { 'username': action.userName, 'password': action.password } })
- .map(Actions_1.Actions.UserLoginSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.UserLoginFailure(error)));
- });
- };
- Epics.userLogoutEpic = (action$, store) => {
- return action$.ofType('USER_LOGOUT_REQUEST')
- .mergeMap(action => {
- const Action = new SN.ODataApi.CustomAction({ name: 'Logout', path: '/Root', isAction: true, noCache: true });
- return SN.ODataApiActionObservables.Logout(Action, {})
- .map(Actions_1.Actions.UserLogoutSuccess)
- .catch(error => Rx.Observable.of(Actions_1.Actions.UserLogoutFailure(error)));
- });
- };
- Epics.rootEpic = redux_observable_1.combineEpics(Epics.fetchContentEpic, Epics.createContentEpic, Epics.updateContentEpic, Epics.deleteContentEpic, Epics.deleteBatchEpic, Epics.checkoutContentEpic, Epics.checkinContentEpic, Epics.publishContentEpic, Epics.approveContentEpic, Epics.rejectContentEpic, Epics.undocheckoutContentEpic, Epics.forceundocheckoutContentEpic, Epics.restoreversionContentEpic, Epics.userLoginEpic, Epics.userLogoutEpic);
-})(Epics = exports.Epics || (exports.Epics = {}));
-
-//# sourceMappingURL=Epics.js.map
diff --git a/dist/src/Epics.js.map b/dist/src/Epics.js.map
deleted file mode 100644
index 25326ca..0000000
--- a/dist/src/Epics.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["src/Epics.ts"],"names":[],"mappings":";;AAAA,uDAAmE;AACnE,sCAAsC;AACtC,mCAAmC;AACnC,uCAAoC;AACpC,yCAAsC;AAEtC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC;AA+B/B,IAAc,KAAK,CAwOlB;AAxOD,WAAc,KAAK;IAKF,sBAAgB,GAAG,OAAO;QACnC,MAAM,CAAC,OAA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IAKY,cAAQ,GAAG,+BAAY,CAChC,MAAA,gBAAgB,EAChB,MAAA,iBAAiB,EACjB,MAAA,iBAAiB,EACjB,MAAA,iBAAiB,EACjB,MAAA,eAAe,EACf,MAAA,mBAAmB,EACnB,MAAA,kBAAkB,EAClB,MAAA,kBAAkB,EAClB,MAAA,kBAAkB,EAClB,MAAA,iBAAiB,EACjB,MAAA,uBAAuB,EACvB,MAAA,4BAA4B,EAC5B,MAAA,yBAAyB,EACzB,MAAA,aAAa,EACb,MAAA,cAAc,CACjB,CAAC;AACN,CAAC,EAxOa,KAAK,GAAL,aAAK,KAAL,aAAK,QAwOlB","file":"Epics.js","sourcesContent":["import { ActionsObservable, combineEpics } from 'redux-observable';\r\nimport * as Rx from '@reactivex/rxjs';\r\nimport * as SN from 'sn-client-js';\r\nimport { Actions } from './Actions';\r\nimport { Reducers } from './Reducers';\r\n\r\nconst { ajax } = Rx.Observable;\r\n\r\n/**\r\n * Module for redux-observable Epics of the Sense/Net built-in OData actions.\r\n * \r\n * _An Epic is the core primitive of [redux-observable](https://redux-observable.js.org). It is a function which takes a stream of actions and returns a stream of actions._\r\n * \r\n * Learn more about redux-observable Epics [here](https://redux-observable.js.org/docs/basics/Epics.html);\r\n * \r\n * In Sense/Net's case it means that the action steps (for exmaple request, success, fail) or multiple actions can be combined into Epics. It's extremely useful if you have\r\n * to work with async action or you have a complex process with multiple steps that have to wait for each other like validation, multiple step saving, etc.\r\n * \r\n * Following epics cover the CRUD operations and all the other built-in Sense/Net OData Actions. All of these Epics are combined into one root Epic. If you want to use them in\r\n * your application without any customization you don't have to do anything special, because it is set as default at the store creation, but if you want add you custom Epics to it\r\n * use combineEpics on Sense/Nets root Epic and yours.\r\n * \r\n * ```\r\n * import { combineEpics } from 'redux-observable';\r\n * import { myCombinedEpics } from '../myApp/Epics';\r\n * import { myRootReducer } from '../myApp/Reducers';\r\n * import { rootEpic } from '../sn-redux/Epics';\r\n * \r\n * const myRootEpic = combinedEpics(\r\n * rootEpic,\r\n * myCombinedEpics\r\n * );\r\n * \r\n * const store = Store.configureStore(myRootReducer, myRootEpic, [Authentication]);\r\n * ``` \r\n */\r\n\r\nexport module Epics {\r\n /**\r\n * Epic for fetching content from the Content Repository. It is related to three redux actions, returns the ```RequestContent``` action and sends the JSON response to the\r\n * ```ReceiveContent``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```ReceiveContentFailure``` action.\r\n */\r\n export const fetchContentEpic = action$ => {\r\n return action$.ofType('FETCH_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n let params = `${action.filter}`;\r\n return SN.ODataApiActionObservables.FetchContent(action.path, params)\r\n .map((response) => Actions.ReceiveContent(response.response, params))\r\n .catch(error => Rx.Observable.of(Actions.ReceiveContentFailure(params, error)))\r\n }\r\n );\r\n }\r\n /**\r\n * Epic for creating a Content in the Content Repository. It is related to three redux actions, returns ```CreateContent``` action and sends the JSON response to the\r\n * ```CreateContentSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```CreateContentFailure``` action.\r\n */\r\n export const createContentEpic = action$ => {\r\n return action$.ofType('CREATE_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n let content = action.content;\r\n content['__ContentType'] = content.Type;\r\n return SN.ODataApiActionObservables.CreateContent(action.path, content)\r\n .map(Actions.CreateContentSuccess)\r\n .catch(error => Rx.Observable.of(Actions.CreateContentFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic for updating metadata of a Content in the Content Repository. It is related to three redux actions, returns ```UpdateContent``` action and sends the JSON response to the\r\n * ```UpdateContentSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```UpdateContentFailure``` action.\r\n */\r\n export const updateContentEpic = (action$, store) => {\r\n return action$.ofType('UPDATE_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n return SN.ODataApiActionObservables.PatchContent(action.id, action.fields)\r\n .map(Actions.UpdateContentSuccess)\r\n .catch(error => Rx.Observable.of(Actions.UpdateContentFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic to delete a Content from the Content Repository. It is related to three redux actions, returns ```Delete``` action and sends the response to the\r\n * ```DeleteSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```DeleteFailure``` action.\r\n */\r\n export const deleteContentEpic = (action$, store) => {\r\n return action$.ofType('DELETE_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n return SN.ODataApiActionObservables.DeleteContent(action.id, action.permanently)\r\n .map((response) => {\r\n const state = store.getState();\r\n const ids = Reducers.getIds(state.collection);\r\n return Actions.DeleteSuccess(ids.indexOf(action.id), action.id);\r\n })\r\n .catch(error => Rx.Observable.of(Actions.DeleteFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic to delete multiple Content from the Content Repository. It is related to three redux actions, returns ```DeleteBatch``` action and sends the response to the\r\n * ```DeleteBatchSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```DeleteBatchFailure``` action.\r\n */\r\n export const deleteBatchEpic = (action$, store) => {\r\n return action$.ofType('DELETE_BATCH_REQUEST')\r\n .mergeMap(action => {\r\n const Action = new SN.ODataApi.CustomAction({ name: 'DeleteBatch', path: action.path, isAction: true, requiredParams: ['paths'] });\r\n return SN.ODataApiActionObservables.CreateCustomAction(Action, { data: { 'paths': action.ids, 'permanently': action.permanently } })\r\n .map((response) => {\r\n const state = store.getState();\r\n const ids = Reducers.getIds(state.collection);\r\n let indexes = [];\r\n for (let i = 0; i < ids.length; i++) {\r\n if (action.ids.indexOf(ids[i]) > -1) {\r\n indexes.push(i);\r\n }\r\n }\r\n return Actions.DeleteBatchSuccess(indexes);\r\n })\r\n .catch(error => Rx.Observable.of(Actions.DeleteBatchFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic to checkout a Content in the Content Repository. It is related to three redux actions, returns ```CheckOut``` action and sends the response to the\r\n * ```CheckOutSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```CheckOutFailure``` action.\r\n */\r\n export const checkoutContentEpic = (action$, store) => {\r\n return action$.ofType('CHECKOUT_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n const Action = new SN.ODataApi.CustomAction({ name: 'CheckOut', id: action.id, isAction: true });\r\n return SN.ODataApiActionObservables.CreateCustomAction(Action)\r\n .map(Actions.CheckOutSuccess)\r\n .catch(error => Rx.Observable.of(Actions.CheckOutFailure(error)))\r\n })\r\n }\r\n\r\n /**\r\n * Epic to checkin a Content in the Content Repository. It is related to three redux actions, returns ```CheckIn``` action and sends the response to the\r\n * ```CheckInSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```CheckInFailure``` action.\r\n */\r\n export const checkinContentEpic = (action$, store) => {\r\n return action$.ofType('CHECKIN_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n const Action = new SN.ODataApi.CustomAction({ name: 'CheckIn', id: action.id, isAction: true, params: ['checkInComment'] });\r\n return SN.ODataApiActionObservables.CreateCustomAction(Action, { data: { 'checkInComments': action.checkInComment } })\r\n .map(Actions.CheckInSuccess)\r\n .catch(error => Rx.Observable.of(Actions.CheckInFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic to publish a Content in the Content Repository. It is related to three redux actions, returns ```Publish``` action and sends the response to the\r\n * ```PublishSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```PublishFailure``` action.\r\n */\r\n export const publishContentEpic = (action$, store) => {\r\n return action$.ofType('PUBLISH_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n const Action = new SN.ODataApi.CustomAction({ name: 'Publish', id: action.id, isAction: true });\r\n return SN.ODataApiActionObservables.CreateCustomAction(Action)\r\n .map(Actions.PublishSuccess)\r\n .catch(error => Rx.Observable.of(Actions.PublishFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic to approve a Content in the Content Repository. It is related to three redux actions, returns ```Approve``` action and sends the response to the\r\n * ```ApproveSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```ApproveFailure``` action.\r\n */\r\n export const approveContentEpic = (action$, store) => {\r\n return action$.ofType('APPROVE_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n const Action = new SN.ODataApi.CustomAction({ name: 'Approve', id: action.id, isAction: true });\r\n return SN.ODataApiActionObservables.CreateCustomAction(Action)\r\n .map(Actions.ApproveSuccess)\r\n .catch(error => Rx.Observable.of(Actions.ApproveFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic to reject a Content in the Content Repository. It is related to three redux actions, returns ```Reject``` action and sends the response to the\r\n * ```RejectSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```RejectFailure``` action.\r\n */\r\n export const rejectContentEpic = (action$, store) => {\r\n return action$.ofType('REJECT_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n const Action = new SN.ODataApi.CustomAction({ name: 'Reject', id: action.id, isAction: true, params: ['rejectReason'] });\r\n return SN.ODataApiActionObservables.CreateCustomAction(Action, { data: { 'rejectReason': action.rejectReason ? action.rejectReason : '' } })\r\n .map(Actions.RejectSuccess)\r\n .catch(error => Rx.Observable.of(Actions.RejectFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic to undo checkout a Content in the Content Repository. It is related to three redux actions, returns ```UndoCheckout``` action and sends the response to the\r\n * ```UndoCheckoutSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```UndoCheckoutFailure``` action.\r\n */\r\n export const undocheckoutContentEpic = (action$, store) => {\r\n return action$.ofType('UNDOCHECKOUT_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n const Action = new SN.ODataApi.CustomAction({ name: 'UndoCheckout', id: action.id, isAction: true });\r\n return SN.ODataApiActionObservables.CreateCustomAction(Action)\r\n .map(Actions.UndoCheckoutSuccess)\r\n .catch(error => Rx.Observable.of(Actions.UndoCheckoutFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic to force undo checkout a Content in the Content Repository. It is related to three redux actions, returns ```ForceUndoCheckout``` action and sends the response to the\r\n * ```ForceUndoCheckoutSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```ForceUndoCheckoutFailure``` action.\r\n */\r\n export const forceundocheckoutContentEpic = (action$, store) => {\r\n return action$.ofType('FORCEUNDOCHECKOUT_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n const Action = new SN.ODataApi.CustomAction({ name: 'ForceUndoCheckout', id: action.id, isAction: true });\r\n return SN.ODataApiActionObservables.CreateCustomAction(Action)\r\n .map(Actions.ForceUndoCheckoutSuccess)\r\n .catch(error => Rx.Observable.of(Actions.ForceUndoCheckoutFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic to restore a version of a Content in the Content Repository. It is related to three redux actions, returns ```RestoreVersion``` action and sends the response to the\r\n * ```RestoreVersionSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```RestoreVersionFailure``` action.\r\n */\r\n export const restoreversionContentEpic = (action$, store) => {\r\n return action$.ofType('RESTOREVERSION_CONTENT_REQUEST')\r\n .mergeMap(action => {\r\n const Action = new SN.ODataApi.CustomAction({ name: 'RestoreVersion', id: action.id, isAction: true, params: ['version'] });\r\n return SN.ODataApiActionObservables.CreateCustomAction(Action, { data: { 'version': action.version } })\r\n .map(Actions.RestoreVersionSuccess)\r\n .catch(error => Rx.Observable.of(Actions.RestoreVersionFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic to login a user to a Sense/Net portal. It is related to three redux actions, returns ```LoginUser``` action and sends the response to the\r\n * ```LoginUserSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```LoginUserFailure``` action.\r\n */\r\n export const userLoginEpic = (action$, store) => {\r\n return action$.ofType('USER_LOGIN_REQUEST')\r\n .mergeMap(action => {\r\n const Action = new SN.ODataApi.CustomAction({ name: 'Login', path: '/Root', isAction: true, requiredParams: ['username', 'password'], noCache: true });\r\n return SN.ODataApiActionObservables.Login(Action, { data: { 'username': action.userName, 'password': action.password } })\r\n .map(Actions.UserLoginSuccess)\r\n .catch(error => Rx.Observable.of(Actions.UserLoginFailure(error)))\r\n })\r\n }\r\n /**\r\n * Epic to logout a user from a Sense/Net portal. It is related to three redux actions, returns ```LogoutUser``` action and sends the response to the\r\n * ```LogoutUserSuccess``` action if the ajax request ended successfully or catches the error if the request failed and sends the error message to the ```LogoutUserFailure``` action.\r\n */\r\n export const userLogoutEpic = (action$, store) => {\r\n return action$.ofType('USER_LOGOUT_REQUEST')\r\n .mergeMap(action => {\r\n const Action = new SN.ODataApi.CustomAction({ name: 'Logout', path: '/Root', isAction: true, noCache: true });\r\n return SN.ODataApiActionObservables.Logout(Action, {})\r\n .map(Actions.UserLogoutSuccess)\r\n .catch(error => Rx.Observable.of(Actions.UserLogoutFailure(error)))\r\n })\r\n }\r\n /**\r\n * sn-redux root Epic, the main Epic combination that is used on a default Sense/Net application. Contains Epics related to CRUD operations and thr other built-in Sense/Net\r\n * [OData Actions and Function](http://wiki.sensenet.com/Built-in_OData_actions_and_functions).\r\n */\r\n export const rootEpic = combineEpics(\r\n fetchContentEpic,\r\n createContentEpic,\r\n updateContentEpic,\r\n deleteContentEpic,\r\n deleteBatchEpic,\r\n checkoutContentEpic,\r\n checkinContentEpic,\r\n publishContentEpic,\r\n approveContentEpic,\r\n rejectContentEpic,\r\n undocheckoutContentEpic,\r\n forceundocheckoutContentEpic,\r\n restoreversionContentEpic,\r\n userLoginEpic,\r\n userLogoutEpic\r\n );\r\n}"]}
\ No newline at end of file
diff --git a/dist/src/Reducers.js b/dist/src/Reducers.js
deleted file mode 100644
index 7eba8bc..0000000
--- a/dist/src/Reducers.js
+++ /dev/null
@@ -1,142 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const redux_1 = require("redux");
-var Reducers;
-(function (Reducers) {
- Reducers.byId = (state = {}, action) => {
- if (action.response && action.type !== 'USER_LOGIN_SUCCESS') {
- return Object.assign({}, state, action.response.entities.collection);
- }
- switch (action.type) {
- case 'DELETE_CONTENT_SUCCESS':
- let res = Object.assign({}, state);
- delete res[action.id];
- return res;
- default:
- return state;
- }
- };
- Reducers.ids = (state = [], action) => {
- switch (action.type) {
- case 'FETCH_CONTENT_SUCCESS':
- return action.response.result;
- case 'CREATE_CONTENT_SUCCESS':
- return [...state, action.response.result];
- case 'DELETE_CONTENT_SUCCESS':
- return [...state.slice(0, action.index), ...state.slice(action.index + 1)];
- default:
- return state;
- }
- };
- Reducers.isFetching = (state = false, action) => {
- switch (action.type) {
- case 'FETCH_CONTENT_REQUEST':
- return true;
- case 'FETCH_CONTENT_SUCCESS':
- case 'FETCH_CONTENT_FAILURE':
- return false;
- default:
- return state;
- }
- };
- Reducers.errorMessage = (state = null, action) => {
- switch (action.type) {
- case 'FETCH_CONTENT_FAILURE':
- case 'CREATE_CONTENT_FAILURE':
- case 'UPDATE_CONTENT_FAILURE':
- case 'DELETE_CONTENT_FAILURE':
- case 'CHECKIN_CONTENT_FAILURE':
- case 'CHECKOUT_CONTENT_FAILURE':
- case 'PUBLISH_CONTENT_FAILURE':
- case 'APPROVE_CONTENT_FAILURE':
- case 'REJECT_CONTENT_FAILURE':
- case 'UNDOCHECKOUT_CONTENT_FAILURE':
- case 'FORCEUNDOCHECKOUT_CONTENT_FAILURE':
- case 'RESTOREVERSION_CONTENT_FAILURE':
- return action.message;
- case 'FETCH_CONTENT_REQUEST':
- case 'FETCH_CONTENT_SUCCESS':
- case 'CREATE_CONTENT_REQUEST':
- case 'CREATE_CONTENT_SUCCESS':
- case 'UPDATE_CONTENT_REQUEST':
- case 'UPDATE_CONTENT_SUCCESS':
- case 'DELETE_CONTENT_REQUEST':
- case 'DELETE_CONTENT_SUCCESS':
- case 'CHECKIN_CONTENT_REQUEST':
- case 'CHECKIN_CONTENT_SUCCESS':
- case 'CHECKOUT_CONTENT_REQUEST':
- case 'CHECKOUT_CONTENT_SUCCESS':
- case 'APPROVE_CONTENT_REQUEST':
- case 'APPROVE_CONTENT_SUCCESS':
- case 'PUBLISH_CONTENT_REQUEST':
- case 'PUBLISH_CONTENT_SUCCESS':
- case 'REJECT_CONTENT_REQUEST':
- case 'REJECT_CONTENT_SUCCESS':
- case 'UNDOCHECKOUT_CONTENT_REQUEST':
- case 'UNDOCHECKOUT_CONTENT_SUCCESS':
- case 'FORCEUNDOCHECKOUT_CONTENT_REQUEST':
- case 'FORCEUNDOCHECKOUT_CONTENT_SUCCESS':
- case 'RESTOREVERSION_CONTENT_REQUEST':
- case 'RESTOREVERSION_CONTENT_SUCCESS':
- return null;
- default:
- return state;
- }
- };
- const userInitialState = {
- data: null,
- isLoading: false,
- isAuthenticated: false,
- errorMessage: ''
- };
- Reducers.user = (state = userInitialState, action) => {
- switch (action.type) {
- case 'USER_LOGIN_REQUEST':
- case 'USER_LOGOUT_REQUEST':
- return Object.assign({}, userInitialState, { isLoading: true, isAuthenticated: false });
- case 'USER_LOGIN_SUCCESS':
- return {
- data: {
- userName: action.response.LoginName,
- fullName: action.response.FullName
- },
- isLoading: false,
- isAuthenticated: true
- };
- case 'USER_LOGOUT_SUCCESS':
- return userInitialState;
- case 'USER_LOGIN_FAILURE':
- return Object.assign({}, userInitialState, { isLoading: false, errorMessage: action.message, isAuthenticated: false });
- case 'USER_LOGOUT_FAILURE':
- return Object.assign({}, userInitialState, { isLoading: false, errorMessage: action.message, isAuthenticated: true });
- default:
- return state;
- }
- };
- Reducers.collection = redux_1.combineReducers({
- byId: Reducers.byId,
- ids: Reducers.ids,
- isFetching: Reducers.isFetching,
- errorMessage: Reducers.errorMessage,
- user: Reducers.user
- });
- Reducers.snApp = redux_1.combineReducers({
- collection: Reducers.collection
- });
- Reducers.getContent = (state, Id) => state[Id];
- Reducers.getIds = (state) => state.ids;
- Reducers.getFetching = (state) => state.isFetching;
- Reducers.getError = (state) => {
- return state.errorMessage;
- };
- Reducers.getAuthenticationStatus = (state) => {
- const user = state.user;
- return user.isAuthenticated;
- };
- Reducers.getAuthenticationError = (state) => {
- const user = state.user;
- return user.errorMessage;
- };
-})(Reducers = exports.Reducers || (exports.Reducers = {}));
-
-//# sourceMappingURL=Reducers.js.map
diff --git a/dist/src/Reducers.js.map b/dist/src/Reducers.js.map
deleted file mode 100644
index 47675f7..0000000
--- a/dist/src/Reducers.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["src/Reducers.ts"],"names":[],"mappings":";;AACA,iCAAwC;AAUxC,IAAc,QAAQ,CAkNrB;AAlND,WAAc,QAAQ;IAUP,aAAI,GAAG,CAAC,KAAK,GAAG,EAAE,EAAE,MAAM;QACrC,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC,IAAI,KAAK,oBAAoB,CAAC,CAAC,CAAC;YAC5D,MAAM,CAAO,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC9E,CAAC;QACD,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;YACpB,KAAK,wBAAwB;gBAC3B,IAAI,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;gBACnC,OAAO,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACtB,MAAM,CAAC,GAAG,CAAC;YACb;gBACE,MAAM,CAAC,KAAK,CAAC;QACjB,CAAC;IACH,CAAC,CAAA;IASY,YAAG,GAAG,CAAC,KAAK,GAAG,EAAE,EAAE,MAAM;QACpC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;YACpB,KAAK,uBAAuB;gBAC1B,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YAChC,KAAK,wBAAwB;gBAC3B,MAAM,CAAC,CAAC,GAAG,KAAK,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC5C,KAAK,wBAAwB;gBAC3B,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC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Module for defining Redux reducers.\r\n * \r\n * _Actions describe the fact that something happened, but don't specify how the application's state changes in response. This is the job of a reducer._\r\n * \r\n * Following module contains the reducers of sn-redux, some 'reducer groups' and the root reducer which could be passed to the store creator function. Using a root reduces means\r\n * that you define which combination of reducers will be used and eventually defines which type of actions can be called on the store.\r\n */\r\nexport module Reducers {\r\n\r\n /**\r\n * Reducer to handle Actions on the byId Object in the state, which is a dictionary with normalized nested JSON response. It becomes the current state and an action as arguments,\r\n * creates a new state based on the previous state and the action and returns it as the next state. If the Action doesn't affect the state the returned state will\r\n * be the current state itself.\r\n * @param {Object} [state={}] Represents the current state.\r\n * @param {Object} action Represents an action that is called.\r\n * @returns {Object} state. Returns the next state based on the action.\r\n */\r\n export const byId = (state = {}, action) => {\r\n if (action.response && action.type !== 'USER_LOGIN_SUCCESS') {\r\n return (Object).assign({}, state, action.response.entities.collection);\r\n }\r\n switch (action.type) {\r\n case 'DELETE_CONTENT_SUCCESS':\r\n let res = Object.assign({}, state);\r\n delete res[action.id];\r\n return res;\r\n default:\r\n return state;\r\n }\r\n }\r\n /**\r\n * Reducers to handle Actions on the ids Array in the state, which is the list Ids of the Content in the byId Object. It becomes the current state of the ids array and an action\r\n * creates a new array based on the current one and the action and returns it as the next state of the ids array. If the Action doesn't affect the state the returned state will\r\n * be the current state itself.\r\n * @param {number[]} state Represents the current state.\r\n * @param {Object} action Represents the action that is called.\r\n * @returns {number[]} state. Returns the next state based on the action.\r\n */\r\n export const ids = (state = [], action) => {\r\n switch (action.type) {\r\n case 'FETCH_CONTENT_SUCCESS':\r\n return action.response.result;\r\n case 'CREATE_CONTENT_SUCCESS':\r\n return [...state, action.response.result];\r\n case 'DELETE_CONTENT_SUCCESS':\r\n return [...state.slice(0, action.index), ...state.slice(action.index + 1)]\r\n default:\r\n return state;\r\n }\r\n }\r\n /**\r\n * Reducers to set in the state if the data is fetching or not. If the Action doesn't affect the state the returned state will be the current state itself.\r\n * @param {boolean} [state=false] Represents the current state.\r\n * @param {Object} action Represents the action that is called.\r\n * @returns {boolean} state. Returns the next state based on the action.\r\n */\r\n export const isFetching = (state = false, action) => {\r\n switch (action.type) {\r\n case 'FETCH_CONTENT_REQUEST':\r\n return true;\r\n case 'FETCH_CONTENT_SUCCESS':\r\n case 'FETCH_CONTENT_FAILURE':\r\n return false;\r\n default:\r\n return state;\r\n }\r\n }\r\n /**\r\n * Reducers to set the errormessage in the state if a process is failed. If the Action doesn't affect the state the returned state will be the current state itself.\r\n * @param {any} [state=null] Represents the current state.\r\n * @param {any} action Represents the action that is called.\r\n * @returns {string} state. Returns the next state based on the action.\r\n */\r\n export const errorMessage = (state: any = null, action: any) => {\r\n switch (action.type) {\r\n case 'FETCH_CONTENT_FAILURE':\r\n case 'CREATE_CONTENT_FAILURE':\r\n case 'UPDATE_CONTENT_FAILURE':\r\n case 'DELETE_CONTENT_FAILURE':\r\n case 'CHECKIN_CONTENT_FAILURE':\r\n case 'CHECKOUT_CONTENT_FAILURE':\r\n case 'PUBLISH_CONTENT_FAILURE':\r\n case 'APPROVE_CONTENT_FAILURE':\r\n case 'REJECT_CONTENT_FAILURE':\r\n case 'UNDOCHECKOUT_CONTENT_FAILURE':\r\n case 'FORCEUNDOCHECKOUT_CONTENT_FAILURE':\r\n case 'RESTOREVERSION_CONTENT_FAILURE':\r\n return action.message;\r\n case 'FETCH_CONTENT_REQUEST':\r\n case 'FETCH_CONTENT_SUCCESS':\r\n case 'CREATE_CONTENT_REQUEST':\r\n case 'CREATE_CONTENT_SUCCESS':\r\n case 'UPDATE_CONTENT_REQUEST':\r\n case 'UPDATE_CONTENT_SUCCESS':\r\n case 'DELETE_CONTENT_REQUEST':\r\n case 'DELETE_CONTENT_SUCCESS':\r\n case 'CHECKIN_CONTENT_REQUEST':\r\n case 'CHECKIN_CONTENT_SUCCESS':\r\n case 'CHECKOUT_CONTENT_REQUEST':\r\n case 'CHECKOUT_CONTENT_SUCCESS':\r\n case 'APPROVE_CONTENT_REQUEST':\r\n case 'APPROVE_CONTENT_SUCCESS':\r\n case 'PUBLISH_CONTENT_REQUEST':\r\n case 'PUBLISH_CONTENT_SUCCESS':\r\n case 'REJECT_CONTENT_REQUEST':\r\n case 'REJECT_CONTENT_SUCCESS':\r\n case 'UNDOCHECKOUT_CONTENT_REQUEST':\r\n case 'UNDOCHECKOUT_CONTENT_SUCCESS':\r\n case 'FORCEUNDOCHECKOUT_CONTENT_REQUEST':\r\n case 'FORCEUNDOCHECKOUT_CONTENT_SUCCESS':\r\n case 'RESTOREVERSION_CONTENT_REQUEST':\r\n case 'RESTOREVERSION_CONTENT_SUCCESS':\r\n return null;\r\n default:\r\n return state;\r\n }\r\n }\r\n\r\n const userInitialState = {\r\n data: null,\r\n isLoading: false,\r\n isAuthenticated: false,\r\n errorMessage: ''\r\n }\r\n /**\r\n * Reducer to handle Actions on the user Object in the state. It becomes the current state and an action as arguments,\r\n * creates a new state based on the previous state and the action and returns it as the next state. If the Action doesn't affect the state the returned state will\r\n * be the current state itself.\r\n * @param {Object} [state={}] Represents the current state.\r\n * @param {Object} action Represents an action that is called.\r\n * @returns {Object} state. Returns the next state based on the action.\r\n */\r\n export const user = (state = userInitialState, action) => {\r\n switch (action.type) {\r\n case 'USER_LOGIN_REQUEST':\r\n case 'USER_LOGOUT_REQUEST':\r\n return { ...userInitialState, isLoading: true, isAuthenticated: false }\r\n case 'USER_LOGIN_SUCCESS':\r\n return {\r\n data: {\r\n userName: action.response.LoginName,\r\n fullName: action.response.FullName\r\n },\r\n isLoading: false,\r\n isAuthenticated: true\r\n }\r\n case 'USER_LOGOUT_SUCCESS':\r\n return userInitialState\r\n case 'USER_LOGIN_FAILURE':\r\n return {\r\n ...userInitialState, isLoading: false, errorMessage: action.message, isAuthenticated: false\r\n }\r\n case 'USER_LOGOUT_FAILURE':\r\n return {\r\n ...userInitialState, isLoading: false, errorMessage: action.message, isAuthenticated: true\r\n }\r\n default:\r\n return state\r\n }\r\n }\r\n\r\n /**\r\n * Reducer combining ```byId``` object, ```ids``` array, isFetching and errorMessage into a single object which means ```collection``` will be a top object in the state.\r\n */\r\n export const collection = combineReducers({\r\n byId,\r\n ids,\r\n isFetching,\r\n errorMessage,\r\n user\r\n })\r\n /**\r\n * Reducer to hold the collection object and represent a root reducer of a SenseNet Redux application store. If you want to add your custom Reducers to the store, create your own\r\n * root Reducer combining ```collection``` and your top Reducer.\r\n */\r\n export const snApp = combineReducers({\r\n collection\r\n })\r\n /**\r\n * Method to get a Content item from a state object by its Id.\r\n * @param {Object} state Current state object.\r\n * @param {number} Id Id of the Content.\r\n * @returns {Object} content. Returns the Content from a state object with the given Id.\r\n */\r\n export const getContent = (state: Object, Id: number) => state[Id];\r\n /**\r\n * Method to get the ```ids``` array from a state object.\r\n * @param {Object} state Current state object.\r\n * @returns {number[]} content. Returns the ```ids``` array from the given state.\r\n */\r\n export const getIds = (state: any) => state.ids;\r\n /**\r\n * Method to get if the fetching of data is in progress.\r\n * @param {Object} state Current state object.\r\n * @returns {boolean} Returns true or false whether data fetching is in progress or not.\r\n */\r\n export const getFetching = (state: any) => state.isFetching;\r\n /**\r\n * Method to get the error message.\r\n * @param {Object} state Current state object.\r\n * @returns {string} Returns the error message.\r\n */\r\n export const getError = (state: any) => {\r\n\r\n return state.errorMessage\r\n };\r\n\r\n export const getAuthenticationStatus = (state) => {\r\n const user = state.user;\r\n return user.isAuthenticated;\r\n }\r\n\r\n export const getAuthenticationError = (state) => {\r\n const user = state.user;\r\n return user.errorMessage;\r\n }\r\n\r\n}"]}
\ No newline at end of file
diff --git a/dist/src/Schema.js b/dist/src/Schema.js
deleted file mode 100644
index dc7ef27..0000000
--- a/dist/src/Schema.js
+++ /dev/null
@@ -1,10 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const normalizr_1 = require("normalizr");
-var Schemas;
-(function (Schemas) {
- Schemas.content = new normalizr_1.schema.Entity('collection', {}, { idAttribute: 'Id' });
- Schemas.arrayOfContent = new normalizr_1.schema.Array(Schemas.content);
-})(Schemas = exports.Schemas || (exports.Schemas = {}));
-
-//# sourceMappingURL=Schema.js.map
diff --git a/dist/src/Schema.js.map b/dist/src/Schema.js.map
deleted file mode 100644
index 08b9950..0000000
--- a/dist/src/Schema.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["src/Schema.ts"],"names":[],"mappings":";;AAAA,yCAAmC;AAwCnC,IAAc,OAAO,CAapB;AAbD,WAAc,OAAO;IAMJ,eAAO,GAAG,IAAI,kBAAM,CAAC,MAAM,CAAC,YAAY,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;IAMrE,sBAAc,GAAG,IAAI,kBAAM,CAAC,KAAK,CAAC,QAAA,OAAO,CAAC,CAAC;AAC5D,CAAC,EAba,OAAO,GAAP,eAAO,KAAP,eAAO,QAapB","file":"Schema.js","sourcesContent":["import { schema } from 'normalizr';\r\n\r\n/** \r\n * This module is for defining Content and Collection schemas to normalize nested JSON response data in redux state store.\r\n * \r\n * Normalizr takes JSON and a schema and replaces nested entities with their IDs, gathering all entities in dictionaries.\r\n ** Entities can be nested inside other entities, objects and arrays;\r\n ** Combine entity schemas to express any kind of API response;\r\n ** Entities with same IDs are automatically merged (with a warning if they differ);\r\n ** Allows using a custom ID attribute (e.g. slug).\r\n *\r\n * Read more about normalizr [here](https://github.com/paularmstrong/normalizr)\r\n * \r\n * Since everything is a Content in SenseNet we're working with Content and collection of Content in most of the cases. So the sn-redux Schemas module defines the two\r\n * neccessarry main schema, content and arrayofContent to work with. This two schemas help you to normalize your JSON responses so that you can create a pure and flexible \r\n * client-side datasource.\r\n * \r\n * Example of normalizing the JSON response of a SenseNet OData Action for fetching Content as arrayOfContent schema which will create a collection object.\r\n * ```ts\r\n * export const receiveContent = (response: any, filter: string) =>\r\n * ({\r\n * type: 'FETCH_CONTENT_SUCCESS',\r\n * response: normalize(response.d.results, Schemas.arrayOfContent),\r\n * filter\r\n * })\r\n * ```\r\n * \r\n * ![Normalized collection](http://download.sensenet.com/aniko/sn7/jsapidocs/img/normalized-collection.png)\r\n * \r\n * Example of normalizing the JSON response of a SenseNet OData Action for creating Content as content schema.\r\n * ```ts\r\n * export const createContentSuccess = (response: any) =>\r\n * ({\r\n * type: 'CREATE_CONTENT_SUCCESS',\r\n * response: normalize(response.response.d, Schemas.content)\r\n * });\r\n * ```\r\n * \r\n * ![Normalized content](http://download.sensenet.com/aniko/sn7/jsapidocs/img/normalized-content.png)\r\n*/\r\nexport module Schemas{\r\n /**\r\n * Schema of a Content. \r\n * \r\n * It represents an item in the collection Object of the sn-redux store. The items are identified by the attribute 'Id'.\r\n */\r\n export const content = new schema.Entity('collection', {}, { idAttribute: 'Id' });\r\n /**\r\n * Schema of a Collection.\r\n * \r\n * It represents the top object of the sn-redux store. It's a parent element of the Content items so it is defined as array of items with the schema content.\r\n */\r\n export const arrayOfContent = new schema.Array(content);\r\n}"]}
\ No newline at end of file
diff --git a/dist/src/Store.js b/dist/src/Store.js
deleted file mode 100644
index b706fe6..0000000
--- a/dist/src/Store.js
+++ /dev/null
@@ -1,36 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const redux_1 = require("redux");
-const createLogger = require("redux-logger");
-const redux_observable_1 = require("redux-observable");
-const Epics_1 = require("./Epics");
-const Reducers_1 = require("./Reducers");
-var Store;
-(function (Store) {
- Store.configureStore = (rootReducer = Reducers_1.Reducers.snApp, rootEpic, middlewares, persistedState) => {
- let epicMiddleware;
- if (typeof rootEpic === 'undefined' || rootEpic === null) {
- epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.rootEpic);
- }
- else {
- epicMiddleware = redux_observable_1.createEpicMiddleware(rootEpic);
- }
- let middlewareArray = [];
- if (typeof middlewares === 'undefined' || middlewares === null) {
- middlewareArray.push(epicMiddleware);
- }
- else {
- middlewareArray = [...middlewares, epicMiddleware];
- }
- const loggerMiddleware = createLogger();
- middlewareArray.push(loggerMiddleware);
- if (typeof persistedState !== 'undefined') {
- return redux_1.createStore(rootReducer, persistedState, redux_1.applyMiddleware(...middlewareArray));
- }
- else {
- return redux_1.createStore(rootReducer, redux_1.applyMiddleware(...middlewareArray));
- }
- };
-})(Store = exports.Store || (exports.Store = {}));
-
-//# sourceMappingURL=Store.js.map
diff --git a/dist/src/Store.js.map b/dist/src/Store.js.map
deleted file mode 100644
index 879d6dc..0000000
--- a/dist/src/Store.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["src/Store.ts"],"names":[],"mappings":";;AAAA,iCAAqD;AACrD,6CAA4C;AAC5C,uDAAwD;AACxD,mCAAgC;AAChC,yCAAsC;AA6BtC,IAAc,KAAK,CAsDlB;AAtDD,WAAc,KAAK;IAuBF,oBAAc,GAAG,CAAC,cAAmB,mBAAQ,CAAC,KAAK,EAAE,QAAc,EAAE,WAAwB,EAAE,cAAuB;QAC/H,IAAI,cAAc,CAAC;QACnB,EAAE,CAAC,CAAC,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC;YACvD,cAAc,GAAG,uCAAoB,CAAC,aAAK,CAAC,QAAQ,CAAC,CAAC;QAC1D,CAAC;QACD,IAAI,CAAC,CAAC;YACF,cAAc,GAAG,uCAAoB,CAAC,QAAQ,CAAC,CAAC;QACpD,CAAC;QACD,IAAI,eAAe,GAAG,EAAE,CAAC;QACzB,EAAE,CAAC,CAAC,OAAO,WAAW,KAAK,WAAW,IAAI,WAAW,KAAK,IAAI,CAAC,CAAC,CAAC;YAC7D,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,CAAC,CAAC;YACF,eAAe,GAAG,CAAC,GAAG,WAAW,EAAE,cAAc,CAAC,CAAC;QACvD,CAAC;QACD,MAAM,gBAAgB,GAAI,YAAoB,EAAE,CAAC;QACjD,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACvC,EAAE,CAAC,CAAC,OAAO,cAAc,KAAK,WAAW,CAAC,CAAC,CAAC;YACxC,MAAM,CAAC,mBAAW,CACd,WAAW,EACX,cAAc,EACd,uBAAe,CAAC,GAAG,eAAe,CAAC,CACtC,CAAC;QACN,CAAC;QACD,IAAI,CAAC,CAAC;YACF,MAAM,CAAC,mBAAW,CACd,WAAW,EACX,uBAAe,CAAC,GAAG,eAAe,CAAC,CACtC,CAAC;QACN,CAAC;IACL,CAAC,CAAC;AACN,CAAC,EAtDa,KAAK,GAAL,aAAK,KAAL,aAAK,QAsDlB","file":"Store.js","sourcesContent":["import { createStore, applyMiddleware } from 'redux';\r\nimport * as createLogger from 'redux-logger'\r\nimport { createEpicMiddleware } from 'redux-observable';\r\nimport { Epics } from './Epics';\r\nimport { Reducers } from './Reducers';\r\n\r\n/**\r\n * Module for configuring a store.\r\n * \r\n * It is actually a redux based data store, that lets you keep your application data in on place, allows you to access (get and update) the application state or subscribe to its listeners.\r\n * \r\n * Two middlewares are built-in:\r\n * * [redux-observable](https://redux-observable.js.org/) is as RxJS 5-based middleware for Redux. It's needed to compose and cancel async actions to create side effects and more, \r\n * so that your app are able to get or post data to Sense/Net Content Repository through OData with ajax requests.\r\n * * [redux-logger](https://github.com/evgenyrodionov/redux-logger) creates a detailed log on the dev toolbar console on all state changes.\r\n * You can add other middlewares too through the configureStore functions second param as an array of middlewares. But the built-in middlewares will be the part of the applied middleware group\r\n * in every way.\r\n * \r\n * ```\r\n * import * as React from \"react\";\r\n * import * as ReactDOM from \"react-dom\";\r\n * import Authentication from 'redux-authentication'\r\n * import { myRootReducer } from '../myApp/Reducers'\r\n * import { myRootEpic } from '../myApp/Epics'\r\n * \r\n * const store = Store.configureStore(myRootReducer, myRootEpic, [Authentication]);\r\n * \r\n * ReactDOM.render(\r\n * ,\r\n * document.getElementById(\"root\")\r\n * );\r\n * ```\r\n */\r\nexport module Store {\r\n /**\r\n * Method to create a Redux store that holds the application state.\r\n * @param {any} [rootReducer=Reducers.snApp] Root reducer of your application.\r\n * @param {any} [rootEpic=Epics.rootEpic] Root epic of your application.\r\n * @param {Array=} middlewares Array of middlewares.\r\n * @param {Object=} persistedState Persisted state.\r\n * @returns {Store} Returns a Redux store, an object that holds the application state.\r\n * ```\r\n * import * as React from \"react\";\r\n * import * as ReactDOM from \"react-dom\";\r\n * import Authentication from 'redux-authentication'\r\n * import { myRootReducer } from '../myApp/Reducers'\r\n * import { myRootEpic } from '../myApp/Epics'\r\n * \r\n * const store = Store.configureStore(myRootReducer, myRootEpic, [Authentication]);\r\n * \r\n * ReactDOM.render(\r\n * ,\r\n * document.getElementById(\"root\")\r\n * );\r\n * ```\r\n */\r\n export const configureStore = (rootReducer: any = Reducers.snApp, rootEpic?: any, middlewares?: Array, persistedState?: Object) => {\r\n let epicMiddleware;\r\n if (typeof rootEpic === 'undefined' || rootEpic === null) {\r\n epicMiddleware = createEpicMiddleware(Epics.rootEpic);\r\n }\r\n else {\r\n epicMiddleware = createEpicMiddleware(rootEpic);\r\n }\r\n let middlewareArray = [];\r\n if (typeof middlewares === 'undefined' || middlewares === null) {\r\n middlewareArray.push(epicMiddleware);\r\n }\r\n else {\r\n middlewareArray = [...middlewares, epicMiddleware];\r\n }\r\n const loggerMiddleware = (createLogger as any)();\r\n middlewareArray.push(loggerMiddleware);\r\n if (typeof persistedState !== 'undefined') {\r\n return createStore(\r\n rootReducer,\r\n persistedState,\r\n applyMiddleware(...middlewareArray)\r\n );\r\n }\r\n else {\r\n return createStore(\r\n rootReducer,\r\n applyMiddleware(...middlewareArray)\r\n );\r\n }\r\n };\r\n}"]}
\ No newline at end of file
diff --git a/dist/src/sn-redux.js b/dist/src/sn-redux.js
deleted file mode 100644
index c0f5a12..0000000
--- a/dist/src/sn-redux.js
+++ /dev/null
@@ -1,19 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-require("./Actions");
-require("./Epics");
-require("./Reducers");
-require("./Schema");
-require("./Store");
-var Actions_1 = require("./Actions");
-exports.Actions = Actions_1.Actions;
-var Epics_1 = require("./Epics");
-exports.Epics = Epics_1.Epics;
-var Reducers_1 = require("./Reducers");
-exports.Reducers = Reducers_1.Reducers;
-var Schema_1 = require("./Schema");
-exports.Schemas = Schema_1.Schemas;
-var Store_1 = require("./Store");
-exports.Store = Store_1.Store;
-
-//# sourceMappingURL=sn-redux.js.map
diff --git a/dist/src/sn-redux.js.map b/dist/src/sn-redux.js.map
deleted file mode 100644
index b1aca5d..0000000
--- a/dist/src/sn-redux.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["src/sn-redux.ts"],"names":[],"mappings":";;AAAA,qBAAmB;AACnB,mBAAiB;AACjB,sBAAoB;AACpB,oBAAkB;AAClB,mBAAiB;AAEjB,qCAAoC;AAA3B,4BAAA,OAAO,CAAA;AAChB,iCAAgC;AAAvB,wBAAA,KAAK,CAAA;AACd,uCAAsC;AAA7B,8BAAA,QAAQ,CAAA;AACjB,mCAAmC;AAA1B,2BAAA,OAAO,CAAA;AAChB,iCAAgC;AAAvB,wBAAA,KAAK,CAAA","file":"sn-redux.js","sourcesContent":["import './Actions';\r\nimport './Epics';\r\nimport './Reducers';\r\nimport './Schema';\r\nimport './Store';\r\n\r\nexport { Actions } from './Actions';\r\nexport { Epics } from './Epics';\r\nexport { Reducers } from './Reducers';\r\nexport { Schemas } from './Schema';\r\nexport { Store } from './Store';"]}
\ No newline at end of file
diff --git a/dist/test/ActionsTests.js b/dist/test/ActionsTests.js
deleted file mode 100644
index 220031a..0000000
--- a/dist/test/ActionsTests.js
+++ /dev/null
@@ -1,478 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const SN = require("sn-client-js");
-const Actions_1 = require("../src/Actions");
-const Chai = require("chai");
-const expect = Chai.expect;
-describe('Actions', () => {
- const path = '/workspaces/project';
- describe('FetchContent', () => {
- it('should create an action to a fetch content request', () => {
- const expectedAction = {
- type: 'FETCH_CONTENT_REQUEST',
- path: '/workspaces/project',
- filter: "?$select=Id,Type&metadata=no"
- };
- expect(Actions_1.Actions.RequestContent(path, {})).to.deep.equal(expectedAction);
- });
- it('should create an action to receive content', () => {
- const expectedAction = {
- type: 'FETCH_CONTENT_SUCCESS',
- response: { entities: {}, result: [] },
- filter: "?$select=Id,Type&metadata=no"
- };
- expect(Actions_1.Actions.ReceiveContent({ d: { results: [] } }, '?$select=Id,Type&metadata=no')).to.deep.equal(expectedAction);
- });
- it('should create an action to content fetch request failure', () => {
- const expectedAction = {
- type: 'FETCH_CONTENT_FAILURE',
- message: 'error',
- filter: "?$select=Id,Type&metadata=no"
- };
- expect(Actions_1.Actions.ReceiveContentFailure('?$select=Id,Type&metadata=no', { message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('CreateContent', () => {
- const content = SN.Content.Create('Article', { DisplayName: 'My content', Id: 123 });
- it('should create an action to a create content request', () => {
- const expectedAction = {
- type: 'CREATE_CONTENT_REQUEST',
- path: '/workspaces/project',
- content: content
- };
- expect(Actions_1.Actions.CreateContent(path, content)).to.deep.equal(expectedAction);
- });
- it('should create an action to create content success', () => {
- const expectedAction = {
- type: 'CREATE_CONTENT_SUCCESS',
- response: {
- entities: {
- collection: {
- 123: {
- DisplayName: 'My content',
- Id: 123
- }
- }
- },
- result: 123
- }
- };
- expect(Actions_1.Actions.CreateContentSuccess({ response: { d: { DisplayName: 'My content', Id: 123 } } })).to.deep.equal(expectedAction);
- });
- it('should create an action to content creation failure', () => {
- const expectedAction = {
- type: 'CREATE_CONTENT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.CreateContentFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('UpdateContent', () => {
- it('should create an action to an update content request', () => {
- const expectedAction = {
- type: 'UPDATE_CONTENT_REQUEST',
- id: 123,
- fields: { Index: 2 }
- };
- expect(Actions_1.Actions.UpdateContent(123, { Index: 2 })).to.deep.equal(expectedAction);
- });
- it('should create an action to update content success', () => {
- const expectedAction = {
- type: 'UPDATE_CONTENT_SUCCESS',
- response: {
- entities: {
- collection: {
- 123: {
- DisplayName: "My content",
- Id: 123,
- Index: 2
- }
- }
- }, result: 123
- }
- };
- expect(Actions_1.Actions.UpdateContentSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction);
- });
- it('should create an action to content update request failure', () => {
- const expectedAction = {
- type: 'UPDATE_CONTENT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.UpdateContentFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('DeleteContent', () => {
- it('should create an action to a delete content request', () => {
- const expectedAction = {
- type: 'DELETE_CONTENT_REQUEST',
- id: 123,
- permanently: false
- };
- expect(Actions_1.Actions.Delete(123, false)).to.deep.equal(expectedAction);
- });
- it('should create an action to delete content success', () => {
- const expectedAction = {
- type: 'DELETE_CONTENT_SUCCESS',
- id: 123,
- index: 0
- };
- expect(Actions_1.Actions.DeleteSuccess(0, 123)).to.deep.equal(expectedAction);
- });
- it('should create an action to delete content failure', () => {
- const expectedAction = {
- type: 'DELETE_CONTENT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.DeleteFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('DeleteBatchContent', () => {
- it('should create an action to a delete content request', () => {
- const expectedAction = {
- type: 'DELETE_BATCH_REQUEST',
- path: path,
- ids: ['1', '2', '3'],
- permanently: false
- };
- expect(Actions_1.Actions.DeleteBatch(path, ['1', '2', '3'], false)).to.deep.equal(expectedAction);
- });
- it('should create an action to delete content success', () => {
- const expectedAction = {
- type: 'DELETE_BATCH_SUCCESS',
- indexes: [0, 1, 2]
- };
- expect(Actions_1.Actions.DeleteBatchSuccess([0, 1, 2])).to.deep.equal(expectedAction);
- });
- it('should create an action to delete content failure', () => {
- const expectedAction = {
- type: 'DELETE_BATCH_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.DeleteBatchFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('CheckoutContent', () => {
- it('should create an action to a checkout content request', () => {
- const expectedAction = {
- type: 'CHECKOUT_CONTENT_REQUEST',
- id: 123
- };
- expect(Actions_1.Actions.CheckOut(123)).to.deep.equal(expectedAction);
- });
- it('should create an action to checkout content success', () => {
- const expectedAction = {
- type: 'CHECKOUT_CONTENT_SUCCESS',
- response: {
- entities: {
- collection: {
- 123: {
- DisplayName: "My content",
- Id: 123,
- Index: 2
- }
- }
- }, result: 123
- }
- };
- expect(Actions_1.Actions.CheckOutSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction);
- });
- it('should create an action to checkout content failure', () => {
- const expectedAction = {
- type: 'CHECKOUT_CONTENT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.CheckOutFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('CheckinContent', () => {
- it('should create an action to a checkin content request', () => {
- const expectedAction = {
- type: 'CHECKIN_CONTENT_REQUEST',
- id: 123,
- checkInComment: 'comment'
- };
- expect(Actions_1.Actions.CheckIn(123, 'comment')).to.deep.equal(expectedAction);
- });
- it('should create an action to checkin content success', () => {
- const expectedAction = {
- type: 'CHECKIN_CONTENT_SUCCESS',
- response: {
- entities: {
- collection: {
- 123: {
- DisplayName: "My content",
- Id: 123,
- Index: 2
- }
- }
- }, result: 123
- }
- };
- expect(Actions_1.Actions.CheckInSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction);
- });
- it('should create an action to checkin content failure', () => {
- const expectedAction = {
- type: 'CHECKIN_CONTENT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.CheckInFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('PublishContent', () => {
- it('should create an action to a publish content request', () => {
- const expectedAction = {
- type: 'PUBLISH_CONTENT_REQUEST',
- id: 123
- };
- expect(Actions_1.Actions.Publish(123)).to.deep.equal(expectedAction);
- });
- it('should create an action to publish content success', () => {
- const expectedAction = {
- type: 'PUBLISH_CONTENT_SUCCESS',
- response: {
- entities: {
- collection: {
- 123: {
- DisplayName: "My content",
- Id: 123,
- Index: 2
- }
- }
- }, result: 123
- }
- };
- expect(Actions_1.Actions.PublishSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction);
- });
- it('should create an action to publish content failure', () => {
- const expectedAction = {
- type: 'PUBLISH_CONTENT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.PublishFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('ApproveContent', () => {
- it('should create an action to an approve content request', () => {
- const expectedAction = {
- type: 'APPROVE_CONTENT_REQUEST',
- id: 123
- };
- expect(Actions_1.Actions.Approve(123)).to.deep.equal(expectedAction);
- });
- it('should create an action to approve content success', () => {
- const expectedAction = {
- type: 'APPROVE_CONTENT_SUCCESS',
- response: {
- entities: {
- collection: {
- 123: {
- DisplayName: "My content",
- Id: 123,
- Index: 2
- }
- }
- }, result: 123
- }
- };
- expect(Actions_1.Actions.ApproveSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction);
- });
- it('should create an action to approve content failure', () => {
- const expectedAction = {
- type: 'APPROVE_CONTENT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.ApproveFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('RejectContent', () => {
- it('should create an action to an reject content request', () => {
- const expectedAction = {
- type: 'REJECT_CONTENT_REQUEST',
- id: 123,
- rejectReason: 'reason'
- };
- expect(Actions_1.Actions.Reject(123, 'reason')).to.deep.equal(expectedAction);
- });
- it('should create an action to reject content success', () => {
- const expectedAction = {
- type: 'REJECT_CONTENT_SUCCESS',
- response: {
- entities: {
- collection: {
- 123: {
- DisplayName: "My content",
- Id: 123,
- Index: 2
- }
- }
- }, result: 123
- }
- };
- expect(Actions_1.Actions.RejectSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction);
- });
- it('should create an action to reject content failure', () => {
- const expectedAction = {
- type: 'REJECT_CONTENT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.RejectFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('UndoCheckoutContent', () => {
- it('should create an action to an undo-checkout content request', () => {
- const expectedAction = {
- type: 'UNDOCHECKOUT_CONTENT_REQUEST',
- id: 123
- };
- expect(Actions_1.Actions.UndoCheckout(123)).to.deep.equal(expectedAction);
- });
- it('should create an action to undo-checkout content success', () => {
- const expectedAction = {
- type: 'UNDOCHECKOUT_CONTENT_SUCCESS',
- response: {
- entities: {
- collection: {
- 123: {
- DisplayName: "My content",
- Id: 123,
- Index: 2
- }
- }
- }, result: 123
- }
- };
- expect(Actions_1.Actions.UndoCheckoutSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction);
- });
- it('should create an action to undo-checkout content failure', () => {
- const expectedAction = {
- type: 'UNDOCHECKOUT_CONTENT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.UndoCheckoutFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('ForceUndoCheckoutContent', () => {
- it('should create an action to a force undo-checkout content request', () => {
- const expectedAction = {
- type: 'FORCEUNDOCHECKOUT_CONTENT_REQUEST',
- id: 123
- };
- expect(Actions_1.Actions.ForceUndoCheckout(123)).to.deep.equal(expectedAction);
- });
- it('should create an action to force undo-checkout content success', () => {
- const expectedAction = {
- type: 'FORCEUNDOCHECKOUT_CONTENT_SUCCESS',
- response: {
- entities: {
- collection: {
- 123: {
- DisplayName: "My content",
- Id: 123,
- Index: 2
- }
- }
- }, result: 123
- }
- };
- expect(Actions_1.Actions.ForceUndoCheckoutSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction);
- });
- it('should create an action to force undo-checkout content failure', () => {
- const expectedAction = {
- type: 'FORCEUNDOCHECKOUT_CONTENT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.ForceUndoCheckoutFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('RestoreVersion', () => {
- it('should create an action to a version restore request', () => {
- const expectedAction = {
- type: 'RESTOREVERSION_CONTENT_REQUEST',
- id: 123,
- version: 'A.1.0'
- };
- expect(Actions_1.Actions.RestoreVersion(123, 'A.1.0')).to.deep.equal(expectedAction);
- });
- it('should create an action to a version restore success', () => {
- const expectedAction = {
- type: 'RESTOREVERSION_CONTENT_SUCCESS',
- response: {
- entities: {
- collection: {
- 123: {
- DisplayName: "My content",
- Id: 123,
- Index: 2
- }
- }
- }, result: 123
- }
- };
- expect(Actions_1.Actions.RestoreVersionSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction);
- });
- it('should create an action to a version restore failure', () => {
- const expectedAction = {
- type: 'RESTOREVERSION_CONTENT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.RestoreVersionFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
- describe('UserLogin', () => {
- it('should create an action to a user login request', () => {
- const expectedAction = {
- type: 'USER_LOGIN_REQUEST',
- userName: 'alba',
- password: 'alba'
- };
- expect(Actions_1.Actions.UserLogin('alba', 'alba')).to.deep.equal(expectedAction);
- });
- it('should create an action to a user login success', () => {
- const expectedAction = {
- type: 'USER_LOGIN_SUCCESS',
- response: {
- Name: 'alba',
- DisplayName: 'Alba Monday'
- }
- };
- expect(Actions_1.Actions.UserLoginSuccess({ response: { d: { Name: 'alba', DisplayName: 'Alba Monday' } } })).to.deep.equal(expectedAction);
- });
- it('should create an action to a user login failure', () => {
- const expectedAction = {
- type: 'USER_LOGIN_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.UserLoginFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- it('should create an action to a user login failure with the proper message when 403', () => {
- const expectedAction = {
- type: 'USER_LOGIN_FAILURE',
- message: 'The username or the password is not valid!'
- };
- expect(Actions_1.Actions.UserLoginFailure({ message: 'The username or the password is not valid!', status: 403 })).to.deep.equal(expectedAction);
- });
- });
- describe('UserLogout', () => {
- it('should create an action to a user logout request', () => {
- const expectedAction = {
- type: 'USER_LOGOUT_REQUEST'
- };
- expect(Actions_1.Actions.UserLogout()).to.deep.equal(expectedAction);
- });
- it('should create an action to a user logout success', () => {
- const expectedAction = {
- type: 'USER_LOGOUT_SUCCESS'
- };
- expect(Actions_1.Actions.UserLogoutSuccess({})).to.deep.equal(expectedAction);
- });
- it('should create an action to a user logout failure', () => {
- const expectedAction = {
- type: 'USER_LOGOUT_FAILURE',
- message: 'error'
- };
- expect(Actions_1.Actions.UserLogoutFailure({ message: 'error' })).to.deep.equal(expectedAction);
- });
- });
-});
-
-//# sourceMappingURL=ActionsTests.js.map
diff --git a/dist/test/ActionsTests.js.map b/dist/test/ActionsTests.js.map
deleted file mode 100644
index 643891f..0000000
--- a/dist/test/ActionsTests.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["test/ActionsTests.ts"],"names":[],"mappings":";;AACA,mCAAmC;AACnC,4CAAwC;AACxC,6BAA6B;AAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAE3B,QAAQ,CAAC,SAAS,EAAE;IAChB,MAAM,IAAI,GAAG,qBAAqB,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE;QACrB,EAAE,CAAC,oDAAoD,EAAE;YACrD,MAAM,cAAc,GAAG;gBACnB,IAAI,EAAE,uBAAuB;gBAC7B,IAAI,EAAE,qBAAqB;gBAC3B,MAAM,EAAE,8BAA8B;aACzC,CAAA;YACD,MAAM,CAAC,iBAAO,CAAC,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAC1E,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,4CAA4C,EAAE;YAC7C,MAAM,cAAc,GAAG;gBACnB,IAAI,EAAE,uBAAuB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,MAAM,CAAC,iBAAO,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,4CAA4C,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAC1I,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,YAAY,EAAE;QACnB,EAAE,CAAC,kDAAkD,EAAE;YACnD,MAAM,cAAc,GAAG;gBACnB,IAAI,EAAE,qBAAqB;aAC9B,CAAA;YACD,MAAM,CAAC,iBAAO,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAC9D,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,kDAAkD,EAAE;YACnD,MAAM,cAAc,GAAG;gBACnB,IAAI,EAAE,qBAAqB;aAC9B,CAAA;YACD,MAAM,CAAC,iBAAO,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QACvE,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,kDAAkD,EAAE;YACnD,MAAM,cAAc,GAAG;gBACnB,IAAI,EAAE,qBAAqB;gBAC3B,OAAO,EAAE,OAAO;aACnB,CAAA;YACD,MAAM,CAAC,iBAAO,CAAC,iBAAiB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QACzF,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","file":"ActionsTests.js","sourcesContent":["///\r\nimport * as SN from 'sn-client-js';\r\nimport { Actions } from '../src/Actions'\r\nimport * as Chai from 'chai';\r\nconst expect = Chai.expect;\r\n\r\ndescribe('Actions', () => {\r\n const path = '/workspaces/project';\r\n describe('FetchContent', () => {\r\n it('should create an action to a fetch content request', () => {\r\n const expectedAction = {\r\n type: 'FETCH_CONTENT_REQUEST',\r\n path: '/workspaces/project',\r\n filter: \"?$select=Id,Type&metadata=no\"\r\n }\r\n expect(Actions.RequestContent(path, {})).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to receive content', () => {\r\n const expectedAction = {\r\n type: 'FETCH_CONTENT_SUCCESS',\r\n response: { entities: {}, result: [] },\r\n filter: \"?$select=Id,Type&metadata=no\"\r\n }\r\n expect(Actions.ReceiveContent({ d: { results: [] } }, '?$select=Id,Type&metadata=no')).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to content fetch request failure', () => {\r\n const expectedAction = {\r\n type: 'FETCH_CONTENT_FAILURE',\r\n message: 'error',\r\n filter: \"?$select=Id,Type&metadata=no\"\r\n }\r\n expect(Actions.ReceiveContentFailure('?$select=Id,Type&metadata=no', { message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('CreateContent', () => {\r\n const content = SN.Content.Create('Article', { DisplayName: 'My content', Id: 123 })\r\n it('should create an action to a create content request', () => {\r\n const expectedAction = {\r\n type: 'CREATE_CONTENT_REQUEST',\r\n path: '/workspaces/project',\r\n content: content\r\n }\r\n expect(Actions.CreateContent(path, content)).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to create content success', () => {\r\n const expectedAction = {\r\n type: 'CREATE_CONTENT_SUCCESS',\r\n response: {\r\n entities: {\r\n collection: {\r\n 123: {\r\n DisplayName: 'My content',\r\n Id: 123\r\n }\r\n }\r\n },\r\n result: 123\r\n }\r\n }\r\n expect(Actions.CreateContentSuccess({ response: { d: { DisplayName: 'My content', Id: 123 } } })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to content creation failure', () => {\r\n const expectedAction = {\r\n type: 'CREATE_CONTENT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.CreateContentFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('UpdateContent', () => {\r\n it('should create an action to an update content request', () => {\r\n const expectedAction = {\r\n type: 'UPDATE_CONTENT_REQUEST',\r\n id: 123,\r\n fields: { Index: 2 }\r\n }\r\n expect(Actions.UpdateContent(123, { Index: 2 })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to update content success', () => {\r\n const expectedAction = {\r\n type: 'UPDATE_CONTENT_SUCCESS',\r\n response: {\r\n entities: {\r\n collection: {\r\n 123: {\r\n DisplayName: \"My content\",\r\n Id: 123,\r\n Index: 2\r\n }\r\n }\r\n }, result: 123\r\n }\r\n }\r\n expect(Actions.UpdateContentSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to content update request failure', () => {\r\n const expectedAction = {\r\n type: 'UPDATE_CONTENT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.UpdateContentFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('DeleteContent', () => {\r\n it('should create an action to a delete content request', () => {\r\n const expectedAction = {\r\n type: 'DELETE_CONTENT_REQUEST',\r\n id: 123,\r\n permanently: false\r\n }\r\n expect(Actions.Delete(123, false)).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to delete content success', () => {\r\n const expectedAction = {\r\n type: 'DELETE_CONTENT_SUCCESS',\r\n id: 123,\r\n index: 0\r\n }\r\n expect(Actions.DeleteSuccess(0, 123)).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to delete content failure', () => {\r\n const expectedAction = {\r\n type: 'DELETE_CONTENT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.DeleteFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('DeleteBatchContent', () => {\r\n it('should create an action to a delete content request', () => {\r\n const expectedAction = {\r\n type: 'DELETE_BATCH_REQUEST',\r\n path: path,\r\n ids: ['1', '2', '3'],\r\n permanently: false\r\n }\r\n expect(Actions.DeleteBatch(path, ['1', '2', '3'], false)).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to delete content success', () => {\r\n const expectedAction = {\r\n type: 'DELETE_BATCH_SUCCESS',\r\n indexes: [0, 1, 2]\r\n }\r\n expect(Actions.DeleteBatchSuccess([0, 1, 2])).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to delete content failure', () => {\r\n const expectedAction = {\r\n type: 'DELETE_BATCH_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.DeleteBatchFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('CheckoutContent', () => {\r\n it('should create an action to a checkout content request', () => {\r\n const expectedAction = {\r\n type: 'CHECKOUT_CONTENT_REQUEST',\r\n id: 123\r\n }\r\n expect(Actions.CheckOut(123)).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to checkout content success', () => {\r\n const expectedAction = {\r\n type: 'CHECKOUT_CONTENT_SUCCESS',\r\n response: {\r\n entities: {\r\n collection: {\r\n 123: {\r\n DisplayName: \"My content\",\r\n Id: 123,\r\n Index: 2\r\n }\r\n }\r\n }, result: 123\r\n }\r\n }\r\n expect(Actions.CheckOutSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to checkout content failure', () => {\r\n const expectedAction = {\r\n type: 'CHECKOUT_CONTENT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.CheckOutFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('CheckinContent', () => {\r\n it('should create an action to a checkin content request', () => {\r\n const expectedAction = {\r\n type: 'CHECKIN_CONTENT_REQUEST',\r\n id: 123,\r\n checkInComment: 'comment'\r\n }\r\n expect(Actions.CheckIn(123, 'comment')).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to checkin content success', () => {\r\n const expectedAction = {\r\n type: 'CHECKIN_CONTENT_SUCCESS',\r\n response: {\r\n entities: {\r\n collection: {\r\n 123: {\r\n DisplayName: \"My content\",\r\n Id: 123,\r\n Index: 2\r\n }\r\n }\r\n }, result: 123\r\n }\r\n }\r\n expect(Actions.CheckInSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to checkin content failure', () => {\r\n const expectedAction = {\r\n type: 'CHECKIN_CONTENT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.CheckInFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('PublishContent', () => {\r\n it('should create an action to a publish content request', () => {\r\n const expectedAction = {\r\n type: 'PUBLISH_CONTENT_REQUEST',\r\n id: 123\r\n }\r\n expect(Actions.Publish(123)).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to publish content success', () => {\r\n const expectedAction = {\r\n type: 'PUBLISH_CONTENT_SUCCESS',\r\n response: {\r\n entities: {\r\n collection: {\r\n 123: {\r\n DisplayName: \"My content\",\r\n Id: 123,\r\n Index: 2\r\n }\r\n }\r\n }, result: 123\r\n }\r\n }\r\n expect(Actions.PublishSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to publish content failure', () => {\r\n const expectedAction = {\r\n type: 'PUBLISH_CONTENT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.PublishFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('ApproveContent', () => {\r\n it('should create an action to an approve content request', () => {\r\n const expectedAction = {\r\n type: 'APPROVE_CONTENT_REQUEST',\r\n id: 123\r\n }\r\n expect(Actions.Approve(123)).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to approve content success', () => {\r\n const expectedAction = {\r\n type: 'APPROVE_CONTENT_SUCCESS',\r\n response: {\r\n entities: {\r\n collection: {\r\n 123: {\r\n DisplayName: \"My content\",\r\n Id: 123,\r\n Index: 2\r\n }\r\n }\r\n }, result: 123\r\n }\r\n }\r\n expect(Actions.ApproveSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to approve content failure', () => {\r\n const expectedAction = {\r\n type: 'APPROVE_CONTENT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.ApproveFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('RejectContent', () => {\r\n it('should create an action to an reject content request', () => {\r\n const expectedAction = {\r\n type: 'REJECT_CONTENT_REQUEST',\r\n id: 123,\r\n rejectReason: 'reason'\r\n }\r\n expect(Actions.Reject(123, 'reason')).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to reject content success', () => {\r\n const expectedAction = {\r\n type: 'REJECT_CONTENT_SUCCESS',\r\n response: {\r\n entities: {\r\n collection: {\r\n 123: {\r\n DisplayName: \"My content\",\r\n Id: 123,\r\n Index: 2\r\n }\r\n }\r\n }, result: 123\r\n }\r\n }\r\n expect(Actions.RejectSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to reject content failure', () => {\r\n const expectedAction = {\r\n type: 'REJECT_CONTENT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.RejectFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('UndoCheckoutContent', () => {\r\n it('should create an action to an undo-checkout content request', () => {\r\n const expectedAction = {\r\n type: 'UNDOCHECKOUT_CONTENT_REQUEST',\r\n id: 123\r\n }\r\n expect(Actions.UndoCheckout(123)).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to undo-checkout content success', () => {\r\n const expectedAction = {\r\n type: 'UNDOCHECKOUT_CONTENT_SUCCESS',\r\n response: {\r\n entities: {\r\n collection: {\r\n 123: {\r\n DisplayName: \"My content\",\r\n Id: 123,\r\n Index: 2\r\n }\r\n }\r\n }, result: 123\r\n }\r\n }\r\n expect(Actions.UndoCheckoutSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to undo-checkout content failure', () => {\r\n const expectedAction = {\r\n type: 'UNDOCHECKOUT_CONTENT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.UndoCheckoutFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('ForceUndoCheckoutContent', () => {\r\n it('should create an action to a force undo-checkout content request', () => {\r\n const expectedAction = {\r\n type: 'FORCEUNDOCHECKOUT_CONTENT_REQUEST',\r\n id: 123\r\n }\r\n expect(Actions.ForceUndoCheckout(123)).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to force undo-checkout content success', () => {\r\n const expectedAction = {\r\n type: 'FORCEUNDOCHECKOUT_CONTENT_SUCCESS',\r\n response: {\r\n entities: {\r\n collection: {\r\n 123: {\r\n DisplayName: \"My content\",\r\n Id: 123,\r\n Index: 2\r\n }\r\n }\r\n }, result: 123\r\n }\r\n }\r\n expect(Actions.ForceUndoCheckoutSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to force undo-checkout content failure', () => {\r\n const expectedAction = {\r\n type: 'FORCEUNDOCHECKOUT_CONTENT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.ForceUndoCheckoutFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('RestoreVersion', () => {\r\n it('should create an action to a version restore request', () => {\r\n const expectedAction = {\r\n type: 'RESTOREVERSION_CONTENT_REQUEST',\r\n id: 123,\r\n version: 'A.1.0'\r\n }\r\n expect(Actions.RestoreVersion(123, 'A.1.0')).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to a version restore success', () => {\r\n const expectedAction = {\r\n type: 'RESTOREVERSION_CONTENT_SUCCESS',\r\n response: {\r\n entities: {\r\n collection: {\r\n 123: {\r\n DisplayName: \"My content\",\r\n Id: 123,\r\n Index: 2\r\n }\r\n }\r\n }, result: 123\r\n }\r\n }\r\n expect(Actions.RestoreVersionSuccess({ response: { d: { DisplayName: 'My content', Id: 123, Index: 2 } } })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to a version restore failure', () => {\r\n const expectedAction = {\r\n type: 'RESTOREVERSION_CONTENT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.RestoreVersionFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('UserLogin', () => {\r\n it('should create an action to a user login request', () => {\r\n const expectedAction = {\r\n type: 'USER_LOGIN_REQUEST',\r\n userName: 'alba',\r\n password: 'alba'\r\n }\r\n expect(Actions.UserLogin('alba', 'alba')).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to a user login success', () => {\r\n const expectedAction = {\r\n type: 'USER_LOGIN_SUCCESS',\r\n response: {\r\n Name: 'alba',\r\n DisplayName: 'Alba Monday'\r\n }\r\n }\r\n expect(Actions.UserLoginSuccess({ response: { d: { Name: 'alba', DisplayName: 'Alba Monday' } } })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to a user login failure', () => {\r\n const expectedAction = {\r\n type: 'USER_LOGIN_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.UserLoginFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to a user login failure with the proper message when 403', () => {\r\n const expectedAction = {\r\n type: 'USER_LOGIN_FAILURE',\r\n message: 'The username or the password is not valid!'\r\n }\r\n expect(Actions.UserLoginFailure({ message: 'The username or the password is not valid!', status: 403 })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n describe('UserLogout', () => {\r\n it('should create an action to a user logout request', () => {\r\n const expectedAction = {\r\n type: 'USER_LOGOUT_REQUEST'\r\n }\r\n expect(Actions.UserLogout()).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to a user logout success', () => {\r\n const expectedAction = {\r\n type: 'USER_LOGOUT_SUCCESS'\r\n }\r\n expect(Actions.UserLogoutSuccess({})).to.deep.equal(expectedAction)\r\n });\r\n it('should create an action to a user logout failure', () => {\r\n const expectedAction = {\r\n type: 'USER_LOGOUT_FAILURE',\r\n message: 'error'\r\n }\r\n expect(Actions.UserLogoutFailure({ message: 'error' })).to.deep.equal(expectedAction)\r\n });\r\n });\r\n});"]}
\ No newline at end of file
diff --git a/dist/test/EpicsTests.js b/dist/test/EpicsTests.js
deleted file mode 100644
index 8bf8f62..0000000
--- a/dist/test/EpicsTests.js
+++ /dev/null
@@ -1,391 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-require("rxjs");
-const nock = require("nock");
-const Chai = require("chai");
-const redux_mock_store_1 = require("redux-mock-store");
-const redux_observable_1 = require("redux-observable");
-const SN = require("sn-client-js");
-const Epics_1 = require("../src/Epics");
-const expect = Chai.expect;
-describe('Epics', () => {
- let window = {
- 'siteUrl': 'https://daily.demo.sensenet.com'
- };
- beforeEach(() => {
- window['siteUrl'] = "https://daily.demo.sensenet.com";
- });
- describe('fetchContent Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.fetchContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.fetchContentEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'FETCH_CONTENT_REQUEST', path: '/workspaces/Project' });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'FETCH_CONTENT_REQUEST',
- path: '/workspaces/Project'
- },
- {
- type: 'FETCH_CONTENT_FAILURE',
- filter: 'undefined',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('createContent Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.createContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.createContentEpic);
- });
- it('handles the error', () => {
- const content = SN.Content.Create('Article', { DisplayName: 'My article' });
- store.dispatch({ type: 'CREATE_CONTENT_REQUEST', path: '/workspaces/Project', content });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'CREATE_CONTENT_REQUEST',
- path: '/workspaces/Project',
- content
- },
- {
- type: 'CREATE_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('updateContent Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.updateContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.updateContentEpic);
- });
- it('handles the error', () => {
- const fields = { DisplayName: 'My article', Index: 2 };
- store.dispatch({ type: 'UPDATE_CONTENT_REQUEST', id: 111, fields });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'UPDATE_CONTENT_REQUEST',
- id: 111,
- fields
- },
- {
- type: 'UPDATE_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('deleteContent Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.deleteContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.deleteContentEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'DELETE_CONTENT_REQUEST', id: 111, permanently: false });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'DELETE_CONTENT_REQUEST',
- id: 111,
- permanently: false
- },
- {
- type: 'DELETE_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('deleteBatch Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.deleteBatchEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.deleteBatchEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'DELETE_BATCH_REQUEST', path: '/workspaces/Project', paths: ['1', '2'], permanently: false });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'DELETE_BATCH_REQUEST',
- path: '/workspaces/Project',
- paths: ['1', '2'],
- permanently: false
- },
- {
- type: 'DELETE_BATCH_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('checkoutContent Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.checkoutContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.checkoutContentEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'CHECKOUT_CONTENT_REQUEST', id: 111 });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'CHECKOUT_CONTENT_REQUEST',
- id: 111
- },
- {
- type: 'CHECKOUT_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('checkinContent Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.checkinContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.checkinContentEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'CHECKIN_CONTENT_REQUEST', id: 111, checkinComment: 'comment' });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'CHECKIN_CONTENT_REQUEST',
- id: 111,
- checkinComment: 'comment'
- },
- {
- type: 'CHECKIN_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('publishContent Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.publishContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.publishContentEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'PUBLISH_CONTENT_REQUEST', id: 111 });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'PUBLISH_CONTENT_REQUEST',
- id: 111
- },
- {
- type: 'PUBLISH_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('approveContent Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.approveContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.approveContentEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'APPROVE_CONTENT_REQUEST', id: 111 });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'APPROVE_CONTENT_REQUEST',
- id: 111
- },
- {
- type: 'APPROVE_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('rejectContent Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.rejectContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- beforeEach(() => {
- store = mockStore();
- });
- afterEach(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.rejectContentEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'REJECT_CONTENT_REQUEST', id: 111, rejectReason: 'reason' });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'REJECT_CONTENT_REQUEST',
- id: 111,
- rejectReason: 'reason'
- },
- {
- type: 'REJECT_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'REJECT_CONTENT_REQUEST', id: 111 });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'REJECT_CONTENT_REQUEST',
- id: 111
- },
- {
- type: 'REJECT_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('undocheckoutContent Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.undocheckoutContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.undocheckoutContentEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'UNDOCHECKOUT_CONTENT_REQUEST', id: 111 });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'UNDOCHECKOUT_CONTENT_REQUEST',
- id: 111
- },
- {
- type: 'UNDOCHECKOUT_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('forceundocheckoutContent Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.forceundocheckoutContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.forceundocheckoutContentEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'FORCEUNDOCHECKOUT_CONTENT_REQUEST', id: 111 });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'FORCEUNDOCHECKOUT_CONTENT_REQUEST',
- id: 111
- },
- {
- type: 'FORCEUNDOCHECKOUT_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('restoreVersion Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.restoreversionContentEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.restoreversionContentEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'RESTOREVERSION_CONTENT_REQUEST', id: 111, version: 'A.1.0' });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'RESTOREVERSION_CONTENT_REQUEST',
- id: 111,
- version: 'A.1.0'
- },
- {
- type: 'RESTOREVERSION_CONTENT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('login Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.userLoginEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.userLoginEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'USER_LOGIN_REQUEST', id: 111, username: 'alba', password: 'alba' });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'USER_LOGIN_REQUEST',
- id: 111,
- username: 'alba',
- password: 'alba'
- },
- {
- type: 'USER_LOGIN_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
- describe('logout Epic', () => {
- let store;
- const epicMiddleware = redux_observable_1.createEpicMiddleware(Epics_1.Epics.userLogoutEpic);
- const mockStore = redux_mock_store_1.default([epicMiddleware]);
- before(() => {
- store = mockStore();
- });
- after(() => {
- nock.cleanAll();
- epicMiddleware.replaceEpic(Epics_1.Epics.userLogoutEpic);
- });
- it('handles the error', () => {
- store.dispatch({ type: 'USER_LOGOUT_REQUEST', id: 111, username: 'alba', password: 'alba' });
- expect(store.getActions()).to.be.deep.eq([{
- type: 'USER_LOGOUT_REQUEST',
- id: 111,
- username: 'alba',
- password: 'alba'
- },
- {
- type: 'USER_LOGOUT_FAILURE',
- message: 'XMLHttpRequest is not supported by your browser'
- }]);
- });
- });
-});
-
-//# sourceMappingURL=EpicsTests.js.map
diff --git a/dist/test/EpicsTests.js.map b/dist/test/EpicsTests.js.map
deleted file mode 100644
index 03ff8d2..0000000
--- a/dist/test/EpicsTests.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["test/EpicsTests.ts"],"names":[],"mappings":";;AACA,gBAAc;AACd,6BAA6B;AAC7B,6BAA6B;AAC7B,uDAAkD;AAClD,uDAAwD;AACxD,mCAAmC;AACnC,wCAAoC;AACpC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAE3B,QAAQ,CAAC,OAAO,EAAE;IACd,IAAI,MAAM,GAAG;QACT,SAAS,EAAE,iCAAiC;KAC/C,CAAA;IACD,UAAU,CAAC;QACP,MAAM,CAAC,SAAS,CAAC,GAAG,iCAAiC,CAAC;IAC1D,CAAC,CAAC,CAAA;IACF,QAAQ,CAAC,mBAAmB,EAAE;QAC1B,IAAI,KAAK,CAAC;QACV,MAAM,cAAc,GAAG,uCAAoB,CAAC,aAAK,CAAC,gBAAgB,CAAC,CAAC;QACpE,MAAM,SAAS,GAAG,0BAAkB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;QAEvD,MAAM,CAAC;YACH,KAAK,GAAG,SAAS,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC;YACF,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,cAAc,CAAC,WAAW,CAAC,aAAK,CAAC,gBAAgB,CAAC,CAAC;QACvD,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,mBAAmB,EAAE;YACpB,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC;YAC/E,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CACpC,CAAC;oBACG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AAC,CAAA;IACN,CAAC,CAAC,CAAC;IACH,QAAQ,CAAC,aAAa,EAAE;QACpB,IAAI,KAAK,CAAC;QACV,MAAM,cAAc,GAAG,uCAAoB,CAAC,aAAK,CAAC,cAAc,CAAC,CAAC;QAClE,MAAM,SAAS,GAAG,0BAAkB,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;QAEvD,MAAM,CAAC;YACH,KAAK,GAAG,SAAS,EAAE,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,KAAK,CAAC;YACF,IAAI,CAAC,QAAQ,EAAE,CAAC;YAChB,cAAc,CAAC,WAAW,CAAC,aAAK,CAAC,cAAc,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,mBAAmB,EAAE;YACpB,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAC7F,MAAM,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CACpC,CAAC;oBACG,IAAI,EAAE,qBAAqB;oBAC3B,EAAE,EAAE,GAAG;oBACP,QAAQ,EAAE,MAAM;oBAChB,QAAQ,EAAE,MAAM;iBACnB;gBACD;oBACI,IAAI,EAAE,qBAAqB;oBAC3B,OAAO,EAAE,iDAAiD;iBAC7D,CAAC,CAAC,CAAC;QACZ,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","file":"EpicsTests.js","sourcesContent":["///\r\nimport 'rxjs';\r\nimport * as nock from 'nock';\r\nimport * as Chai from 'chai';\r\nimport configureMockStore from 'redux-mock-store';\r\nimport { createEpicMiddleware } from 'redux-observable';\r\nimport * as SN from 'sn-client-js';\r\nimport { Epics } from '../src/Epics'\r\nconst expect = Chai.expect;\r\n\r\ndescribe('Epics', () => {\r\n let window = {\r\n 'siteUrl': 'https://daily.demo.sensenet.com'\r\n }\r\n beforeEach(() => {\r\n window['siteUrl'] = \"https://daily.demo.sensenet.com\";\r\n })\r\n describe('fetchContent Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.fetchContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.fetchContentEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'FETCH_CONTENT_REQUEST', path: '/workspaces/Project' });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'FETCH_CONTENT_REQUEST',\r\n path: '/workspaces/Project'\r\n },\r\n {\r\n type: 'FETCH_CONTENT_FAILURE',\r\n filter: 'undefined',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('createContent Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.createContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.createContentEpic);\r\n });\r\n it('handles the error', () => {\r\n const content = SN.Content.Create('Article', { DisplayName: 'My article' })\r\n store.dispatch({ type: 'CREATE_CONTENT_REQUEST', path: '/workspaces/Project', content });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'CREATE_CONTENT_REQUEST',\r\n path: '/workspaces/Project',\r\n content\r\n },\r\n {\r\n type: 'CREATE_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('updateContent Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.updateContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.updateContentEpic);\r\n });\r\n it('handles the error', () => {\r\n const fields = { DisplayName: 'My article', Index: 2 };\r\n store.dispatch({ type: 'UPDATE_CONTENT_REQUEST', id: 111, fields });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'UPDATE_CONTENT_REQUEST',\r\n id: 111,\r\n fields\r\n },\r\n {\r\n type: 'UPDATE_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('deleteContent Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.deleteContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.deleteContentEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'DELETE_CONTENT_REQUEST', id: 111, permanently: false });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'DELETE_CONTENT_REQUEST',\r\n id: 111,\r\n permanently: false\r\n },\r\n {\r\n type: 'DELETE_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('deleteBatch Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.deleteBatchEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.deleteBatchEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'DELETE_BATCH_REQUEST', path: '/workspaces/Project', paths: ['1', '2'], permanently: false });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'DELETE_BATCH_REQUEST',\r\n path: '/workspaces/Project',\r\n paths: ['1', '2'],\r\n permanently: false\r\n },\r\n {\r\n type: 'DELETE_BATCH_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('checkoutContent Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.checkoutContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.checkoutContentEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'CHECKOUT_CONTENT_REQUEST', id: 111 });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'CHECKOUT_CONTENT_REQUEST',\r\n id: 111\r\n },\r\n {\r\n type: 'CHECKOUT_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('checkinContent Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.checkinContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.checkinContentEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'CHECKIN_CONTENT_REQUEST', id: 111, checkinComment: 'comment' });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'CHECKIN_CONTENT_REQUEST',\r\n id: 111,\r\n checkinComment: 'comment'\r\n },\r\n {\r\n type: 'CHECKIN_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('publishContent Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.publishContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.publishContentEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'PUBLISH_CONTENT_REQUEST', id: 111 });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'PUBLISH_CONTENT_REQUEST',\r\n id: 111\r\n },\r\n {\r\n type: 'PUBLISH_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('approveContent Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.approveContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.approveContentEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'APPROVE_CONTENT_REQUEST', id: 111 });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'APPROVE_CONTENT_REQUEST',\r\n id: 111\r\n },\r\n {\r\n type: 'APPROVE_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('rejectContent Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.rejectContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n beforeEach(() => {\r\n store = mockStore();\r\n });\r\n\r\n afterEach(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.rejectContentEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'REJECT_CONTENT_REQUEST', id: 111, rejectReason: 'reason' });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'REJECT_CONTENT_REQUEST',\r\n id: 111,\r\n rejectReason: 'reason'\r\n },\r\n {\r\n type: 'REJECT_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'REJECT_CONTENT_REQUEST', id: 111 });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'REJECT_CONTENT_REQUEST',\r\n id: 111\r\n },\r\n {\r\n type: 'REJECT_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('undocheckoutContent Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.undocheckoutContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.undocheckoutContentEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'UNDOCHECKOUT_CONTENT_REQUEST', id: 111 });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'UNDOCHECKOUT_CONTENT_REQUEST',\r\n id: 111\r\n },\r\n {\r\n type: 'UNDOCHECKOUT_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('forceundocheckoutContent Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.forceundocheckoutContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.forceundocheckoutContentEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'FORCEUNDOCHECKOUT_CONTENT_REQUEST', id: 111 });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'FORCEUNDOCHECKOUT_CONTENT_REQUEST',\r\n id: 111\r\n },\r\n {\r\n type: 'FORCEUNDOCHECKOUT_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('restoreVersion Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.restoreversionContentEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.restoreversionContentEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'RESTOREVERSION_CONTENT_REQUEST', id: 111, version: 'A.1.0' });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'RESTOREVERSION_CONTENT_REQUEST',\r\n id: 111,\r\n version: 'A.1.0'\r\n },\r\n {\r\n type: 'RESTOREVERSION_CONTENT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('login Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.userLoginEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.userLoginEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'USER_LOGIN_REQUEST', id: 111, username: 'alba', password: 'alba' });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'USER_LOGIN_REQUEST',\r\n id: 111,\r\n username: 'alba',\r\n password: 'alba'\r\n },\r\n {\r\n type: 'USER_LOGIN_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n describe('logout Epic', () => {\r\n let store;\r\n const epicMiddleware = createEpicMiddleware(Epics.userLogoutEpic);\r\n const mockStore = configureMockStore([epicMiddleware]);\r\n\r\n before(() => {\r\n store = mockStore();\r\n });\r\n\r\n after(() => {\r\n nock.cleanAll();\r\n epicMiddleware.replaceEpic(Epics.userLogoutEpic);\r\n });\r\n it('handles the error', () => {\r\n store.dispatch({ type: 'USER_LOGOUT_REQUEST', id: 111, username: 'alba', password: 'alba' });\r\n expect(store.getActions()).to.be.deep.eq(\r\n [{\r\n type: 'USER_LOGOUT_REQUEST',\r\n id: 111,\r\n username: 'alba',\r\n password: 'alba'\r\n },\r\n {\r\n type: 'USER_LOGOUT_FAILURE',\r\n message: 'XMLHttpRequest is not supported by your browser'\r\n }]);\r\n })\r\n });\r\n});"]}
\ No newline at end of file
diff --git a/dist/test/ReducersTests.js b/dist/test/ReducersTests.js
deleted file mode 100644
index edab658..0000000
--- a/dist/test/ReducersTests.js
+++ /dev/null
@@ -1,341 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-const Reducers_1 = require("../src/Reducers");
-const Chai = require("chai");
-const expect = Chai.expect;
-describe('byId reducer', () => {
- it('should return the initial state', () => {
- expect(Reducers_1.Reducers.byId(undefined, {})).to.be.deep.equal({});
- });
- it('should handle DELETE_CONTENT_SUCCESS', () => {
- const ids = [1, 2, 3];
- expect(Reducers_1.Reducers.byId(ids, { type: 'DELETE_CONTENT_SUCCESS', id: 1 })).to.be.deep.equal({ 0: 1, 2: 3 });
- });
- it('should return a new state with the given response', () => {
- expect(Reducers_1.Reducers.byId({}, { response: { entities: { collection: { a: 0, b: 2 } } } }))
- .to.be.deep.eq({ a: 0, b: 2 });
- });
-});
-describe('ids reducer', () => {
- it('should return the initial state', () => {
- expect(Reducers_1.Reducers.ids(undefined, {})).to.be.deep.equal([]);
- });
- it('should handle FETCH_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.ids([], {
- type: 'FETCH_CONTENT_SUCCESS',
- response: {
- result: [5145, 5146],
- entities: {
- collection: {
- 5145: {
- Id: 5145,
- DisplayName: 'Some Article',
- Status: ['Active']
- },
- 5146: {
- Id: 5146,
- Displayname: 'Other Article',
- Status: ['Completed']
- }
- }
- }
- },
- filter: "?$select=Id,Type&metadata=no"
- }))
- .to.be.deep.equal([5145, 5146]);
- });
- it('should handle CREATE_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.ids([], {
- type: 'CREATE_CONTENT_SUCCESS',
- response: {
- entities: {
- collection: {
- 123: {
- DisplayName: 'My content',
- Id: 123
- }
- }
- },
- result: 123
- },
- filter: "?$select=Id,Type&metadata=no"
- }))
- .to.be.deep.equal([123]);
- });
- it('should handle DELETE_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.ids([1, 2, 3], {
- type: 'DELETE_CONTENT_SUCCESS',
- index: 0,
- id: 1
- }))
- .to.be.deep.equal([2, 3]);
- });
-});
-describe('isFetching reducer', () => {
- it('should return the initial state', () => {
- expect(Reducers_1.Reducers.isFetching(undefined, {})).to.be.eq(false);
- });
- it('should handle FETCH_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.isFetching(false, { type: 'FETCH_CONTENT_REQUEST' })).to.be.eq(true);
- });
- it('should handle FETCH_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.isFetching(true, { type: 'FETCH_CONTENT_SUCCESS' })).to.be.eq(false);
- });
- it('should handle FETCH_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.isFetching(true, { type: 'FETCH_CONTENT_FAILURE' })).to.be.eq(false);
- });
-});
-describe('user reducer', () => {
- const userInitialState = {
- data: null,
- isLoading: false,
- isAuthenticated: false,
- errorMessage: ''
- };
- const user = {
- data: {
- userName: 'alba',
- fullName: 'Alba Monday'
- }
- };
- it('should return the initial state', () => {
- expect(Reducers_1.Reducers.user(undefined, {})).to.be.deep.equal(userInitialState);
- });
- it('should handle USER_LOGIN_REQUEST', () => {
- expect(Reducers_1.Reducers.user(userInitialState, { type: 'USER_LOGIN_REQUEST' })).to.be.deep.equal({
- data: null,
- isLoading: true,
- errorMessage: '',
- isAuthenticated: false
- });
- });
- it('should handle USER_LOGIN_SUCCESS', () => {
- expect(Reducers_1.Reducers.user(userInitialState, { type: 'USER_LOGIN_SUCCESS', response: { LoginName: 'alba', FullName: 'Alba Monday' } })).to.be.deep.equal({
- data: {
- userName: 'alba',
- fullName: 'Alba Monday'
- },
- isLoading: false,
- isAuthenticated: true
- });
- });
- it('should handle USER_LOGIN_FAILURE', () => {
- expect(Reducers_1.Reducers.user(userInitialState, { type: 'USER_LOGIN_FAILURE', message: 'aaa' })).to.be.deep.equal({
- data: null,
- isLoading: false,
- errorMessage: 'aaa',
- isAuthenticated: false
- });
- });
- it('should handle USER_LOGOUT_REQUEST', () => {
- expect(Reducers_1.Reducers.user(userInitialState, { type: 'USER_LOGOUT_REQUEST' })).to.be.deep.equal({
- data: null,
- isLoading: true,
- errorMessage: '',
- isAuthenticated: false
- });
- });
- it('should handle USER_LOGOUT_SUCCESS', () => {
- expect(Reducers_1.Reducers.user(userInitialState, { type: 'USER_LOGOUT_SUCCESS' })).to.be.deep.equal({
- data: null,
- isLoading: false,
- errorMessage: '',
- isAuthenticated: false
- });
- });
- it('should handle USER_LOGOUT_FAILURE', () => {
- expect(Reducers_1.Reducers.user(userInitialState, { type: 'USER_LOGOUT_FAILURE', message: 'aaa' })).to.be.deep.equal({
- data: null,
- isLoading: false,
- errorMessage: 'aaa',
- isAuthenticated: true
- });
- });
-});
-describe('errorMessage reducer', () => {
- it('should return the initial state', () => {
- expect(Reducers_1.Reducers.errorMessage(undefined, {})).to.be.eq(null);
- });
- it('should handle FETCH_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'FETCH_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle CREATE_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'CREATE_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle UPDATE_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'UPDATE_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle DELETE_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'DELETE_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle CHECKIN_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'CHECKIN_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle CHECKOUT_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'CHECKOUT_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle PUBLISH_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'PUBLISH_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle APPROVE_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'APPROVE_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle REJECT_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'REJECT_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle UNDOCHECKOUT_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'UNDOCHECKOUT_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle FORCEUNDOCHECKOUT_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'FORCEUNDOCHECKOUT_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle RESTOREVERSION_CONTENT_FAILURE', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'RESTOREVERSION_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');
- });
- it('should handle FETCH_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'FETCH_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle FETCH_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'FETCH_CONTENT_SUCCESS' })).to.be.eq(null);
- });
- it('should handle CREATE_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'CREATE_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle CREATE_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'CREATE_CONTENT_SUCCESS' })).to.be.eq(null);
- });
- it('should handle UPDATE_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'UPDATE_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle UPDATE_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'UPDATE_CONTENT_SUCCESS' })).to.be.eq(null);
- });
- it('should handle DELETE_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'DELETE_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle DELETE_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'DELETE_CONTENT_SUCCESS' })).to.be.eq(null);
- });
- it('should handle CHECKIN_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'CHECKIN_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle CHECKIN_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'CHECKIN_CONTENT_SUCCESS' })).to.be.eq(null);
- });
- it('should handle CHECKOUT_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'CHECKOUT_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle CHECKOUT_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'CHECKOUT_CONTENT_SUCCESS' })).to.be.eq(null);
- });
- it('should handle APPROVE_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'APPROVE_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle APPROVE_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'APPROVE_CONTENT_SUCCESS' })).to.be.eq(null);
- });
- it('should handle PUBLISH_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'PUBLISH_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle PUBLISH_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'PUBLISH_CONTENT_SUCCESS' })).to.be.eq(null);
- });
- it('should handle REJECT_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'REJECT_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle REJECT_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'REJECT_CONTENT_SUCCESS' })).to.be.eq(null);
- });
- it('should handle UNDOCHECKOUT_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'UNDOCHECKOUT_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle UNDOCHECKOUT_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'UNDOCHECKOUT_CONTENT_SUCCESS' })).to.be.eq(null);
- });
- it('should handle FORCEUNDOCHECKOUT_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'FORCEUNDOCHECKOUT_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle FORCEUNDOCHECKOUT_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'FORCEUNDOCHECKOUT_CONTENT_SUCCESS' })).to.be.eq(null);
- });
- it('should handle RESTOREVERSION_CONTENT_REQUEST', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'RESTOREVERSION_CONTENT_REQUEST' })).to.be.eq(null);
- });
- it('should handle RESTOREVERSION_CONTENT_SUCCESS', () => {
- expect(Reducers_1.Reducers.errorMessage(null, { type: 'RESTOREVERSION_CONTENT_SUCCESS' })).to.be.eq(null);
- });
-});
-describe('getContent', () => {
- const state = {
- entities: {
- collection: {
- 5145: {
- Id: 5145,
- DisplayName: 'Some Article',
- Status: ['Active']
- },
- 5146: {
- Id: 5146,
- Displayname: 'Other Article',
- Status: ['Completed']
- }
- }
- }
- };
- it('should return the content from the state by the given id', () => {
- expect(Reducers_1.Reducers.getContent(state.entities.collection, 5145)).to.be.deep.eq({
- Id: 5145,
- DisplayName: 'Some Article',
- Status: ['Active']
- });
- });
-});
-describe('getIds', () => {
- const state = {
- ids: [5145, 5146]
- };
- it('should return the id array from the current state', () => {
- expect(Reducers_1.Reducers.getIds(state)).to.be.deep.eq([5145, 5146]);
- });
-});
-describe('getFetching', () => {
- const state = {
- ids: [5145, 5146],
- isFetching: false
- };
- it('should return the value of isFetching from the current state', () => {
- expect(Reducers_1.Reducers.getFetching(state)).to.be.eq(false);
- });
-});
-describe('getError', () => {
- const state = {
- ids: [5145, 5146],
- isFetching: false,
- errorMessage: 'error'
- };
- it('should return the value of errorMessage from the current state', () => {
- expect(Reducers_1.Reducers.getError(state)).to.be.eq('error');
- });
-});
-describe('getAuthenticationStatus', () => {
- const state = {
- user: {
- isAuthenticated: true
- }
- };
- it('should return true if the user is authenticated state', () => {
- expect(Reducers_1.Reducers.getAuthenticationStatus(state)).to.be.eq(true);
- });
-});
-describe('getAuthenticationError', () => {
- const state = {
- user: {
- errorMessage: 'error'
- }
- };
- it('should return the value of errorMessage from the current state', () => {
- expect(Reducers_1.Reducers.getAuthenticationError(state)).to.be.eq('error');
- });
-});
-
-//# sourceMappingURL=ReducersTests.js.map
diff --git a/dist/test/ReducersTests.js.map b/dist/test/ReducersTests.js.map
deleted file mode 100644
index 2da6024..0000000
--- a/dist/test/ReducersTests.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["test/ReducersTests.ts"],"names":[],"mappings":";;AACA,8CAA2C;AAE3C,6BAA6B;AAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAE3B,QAA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EAAE,OAAO;KACxB,CAAA;IACD,EAAE,CAAC,gEAAgE,EAAE;QACjE,MAAM,CAAC,mBAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,yBAAyB,EAAE;IAChC,MAAM,KAAK,GAAG;QACV,IAAI,EAAE;YACF,eAAe,EAAE,IAAI;SACxB;KACJ,CAAA;IACD,EAAE,CAAC,uDAAuD,EAAE;QACxD,MAAM,CAAC,mBAAQ,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,wBAAwB,EAAE;IAC/B,MAAM,KAAK,GAAG;QACV,IAAI,EAAE;YACF,YAAY,EAAE,OAAO;SACxB;KACJ,CAAA;IACD,EAAE,CAAC,gEAAgE,EAAE;QACjE,MAAM,CAAC,mBAAQ,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;IACrE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","file":"ReducersTests.js","sourcesContent":["///\r\nimport { Reducers } from '../src/Reducers';\r\nimport { Actions } from '../src/Actions';\r\nimport * as Chai from 'chai';\r\nconst expect = Chai.expect;\r\n\r\ndescribe('byId reducer', () => {\r\n it('should return the initial state', () => {\r\n expect(Reducers.byId(undefined, {})).to.be.deep.equal({});\r\n });\r\n it('should handle DELETE_CONTENT_SUCCESS', () => {\r\n const ids = [1, 2, 3];\r\n expect(Reducers.byId(ids, { type: 'DELETE_CONTENT_SUCCESS', id: 1 })).to.be.deep.equal({ 0: 1, 2: 3 });\r\n });\r\n it('should return a new state with the given response', () => {\r\n expect(Reducers.byId({}, { response: { entities: { collection: { a: 0, b: 2 } } } }))\r\n .to.be.deep.eq({ a: 0, b: 2 });\r\n });\r\n});\r\n\r\ndescribe('ids reducer', () => {\r\n it('should return the initial state', () => {\r\n expect(Reducers.ids(undefined, {})).to.be.deep.equal([]);\r\n });\r\n it('should handle FETCH_CONTENT_SUCCESS', () => {\r\n expect(Reducers.ids([],\r\n {\r\n type: 'FETCH_CONTENT_SUCCESS',\r\n response: {\r\n result: [5145, 5146],\r\n entities: {\r\n collection: {\r\n 5145: {\r\n Id: 5145,\r\n DisplayName: 'Some Article',\r\n Status: ['Active']\r\n },\r\n 5146: {\r\n Id: 5146,\r\n Displayname: 'Other Article',\r\n Status: ['Completed']\r\n }\r\n }\r\n }\r\n },\r\n filter: \"?$select=Id,Type&metadata=no\"\r\n }))\r\n .to.be.deep.equal([5145, 5146]);\r\n });\r\n it('should handle CREATE_CONTENT_SUCCESS', () => {\r\n expect(Reducers.ids([],\r\n {\r\n type: 'CREATE_CONTENT_SUCCESS',\r\n response: {\r\n entities: {\r\n collection: {\r\n 123: {\r\n DisplayName: 'My content',\r\n Id: 123\r\n }\r\n }\r\n },\r\n result: 123\r\n },\r\n filter: \"?$select=Id,Type&metadata=no\"\r\n }))\r\n .to.be.deep.equal([123]);\r\n });\r\n it('should handle DELETE_CONTENT_SUCCESS', () => {\r\n expect(Reducers.ids(\r\n [1, 2, 3],\r\n {\r\n type: 'DELETE_CONTENT_SUCCESS',\r\n index: 0,\r\n id: 1\r\n }))\r\n .to.be.deep.equal([2, 3]);\r\n });\r\n});\r\n\r\ndescribe('isFetching reducer', () => {\r\n it('should return the initial state', () => {\r\n expect(Reducers.isFetching(undefined, {})).to.be.eq(false);\r\n });\r\n it('should handle FETCH_CONTENT_SUCCESS', () => {\r\n expect(Reducers.isFetching(false, { type: 'FETCH_CONTENT_REQUEST' })).to.be.eq(true);\r\n });\r\n it('should handle FETCH_CONTENT_SUCCESS', () => {\r\n expect(Reducers.isFetching(true, { type: 'FETCH_CONTENT_SUCCESS' })).to.be.eq(false);\r\n });\r\n it('should handle FETCH_CONTENT_FAILURE', () => {\r\n expect(Reducers.isFetching(true, { type: 'FETCH_CONTENT_FAILURE' })).to.be.eq(false);\r\n });\r\n});\r\n\r\ndescribe('user reducer', () => {\r\n const userInitialState = {\r\n data: null,\r\n isLoading: false,\r\n isAuthenticated: false,\r\n errorMessage: ''\r\n };\r\n const user = {\r\n data: {\r\n userName: 'alba',\r\n fullName: 'Alba Monday'\r\n }\r\n }\r\n it('should return the initial state', () => {\r\n expect(Reducers.user(undefined, {})).to.be.deep.equal(userInitialState);\r\n });\r\n it('should handle USER_LOGIN_REQUEST', () => {\r\n expect(Reducers.user(userInitialState, { type: 'USER_LOGIN_REQUEST' })).to.be.deep.equal(\r\n {\r\n data: null,\r\n isLoading: true,\r\n errorMessage: '',\r\n isAuthenticated: false\r\n }\r\n );\r\n });\r\n it('should handle USER_LOGIN_SUCCESS', () => {\r\n expect(Reducers.user(userInitialState, { type: 'USER_LOGIN_SUCCESS', response: { LoginName: 'alba', FullName: 'Alba Monday' } })).to.be.deep.equal(\r\n {\r\n data: {\r\n userName: 'alba',\r\n fullName: 'Alba Monday'\r\n },\r\n isLoading: false,\r\n isAuthenticated: true\r\n }\r\n );\r\n });\r\n it('should handle USER_LOGIN_FAILURE', () => {\r\n expect(Reducers.user(userInitialState, { type: 'USER_LOGIN_FAILURE', message: 'aaa' })).to.be.deep.equal(\r\n {\r\n data: null,\r\n isLoading: false,\r\n errorMessage: 'aaa',\r\n isAuthenticated: false\r\n }\r\n );\r\n });\r\n it('should handle USER_LOGOUT_REQUEST', () => {\r\n expect(Reducers.user(userInitialState, { type: 'USER_LOGOUT_REQUEST' })).to.be.deep.equal(\r\n {\r\n data: null,\r\n isLoading: true,\r\n errorMessage: '',\r\n isAuthenticated: false\r\n }\r\n );\r\n });\r\n it('should handle USER_LOGOUT_SUCCESS', () => {\r\n expect(Reducers.user(userInitialState, { type: 'USER_LOGOUT_SUCCESS' })).to.be.deep.equal(\r\n {\r\n data: null,\r\n isLoading: false,\r\n errorMessage: '',\r\n isAuthenticated: false\r\n }\r\n );\r\n });\r\n it('should handle USER_LOGOUT_FAILURE', () => {\r\n expect(Reducers.user(userInitialState, { type: 'USER_LOGOUT_FAILURE', message: 'aaa' })).to.be.deep.equal(\r\n {\r\n data: null,\r\n isLoading: false,\r\n errorMessage: 'aaa',\r\n isAuthenticated: true\r\n }\r\n );\r\n });\r\n});\r\n\r\ndescribe('errorMessage reducer', () => {\r\n it('should return the initial state', () => {\r\n expect(Reducers.errorMessage(undefined, {})).to.be.eq(null);\r\n });\r\n it('should handle FETCH_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'FETCH_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle CREATE_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'CREATE_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle UPDATE_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'UPDATE_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle DELETE_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'DELETE_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle CHECKIN_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'CHECKIN_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle CHECKOUT_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'CHECKOUT_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle PUBLISH_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'PUBLISH_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle APPROVE_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'APPROVE_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle REJECT_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'REJECT_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle UNDOCHECKOUT_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'UNDOCHECKOUT_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle FORCEUNDOCHECKOUT_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'FORCEUNDOCHECKOUT_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle RESTOREVERSION_CONTENT_FAILURE', () => {\r\n expect(Reducers.errorMessage(null, { type: 'RESTOREVERSION_CONTENT_FAILURE', message: 'error' })).to.be.eq('error');\r\n });\r\n it('should handle FETCH_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'FETCH_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle FETCH_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'FETCH_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n it('should handle CREATE_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'CREATE_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle CREATE_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'CREATE_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n it('should handle UPDATE_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'UPDATE_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle UPDATE_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'UPDATE_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n it('should handle DELETE_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'DELETE_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle DELETE_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'DELETE_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n it('should handle CHECKIN_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'CHECKIN_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle CHECKIN_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'CHECKIN_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n it('should handle CHECKOUT_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'CHECKOUT_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle CHECKOUT_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'CHECKOUT_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n it('should handle APPROVE_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'APPROVE_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle APPROVE_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'APPROVE_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n it('should handle PUBLISH_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'PUBLISH_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle PUBLISH_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'PUBLISH_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n it('should handle REJECT_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'REJECT_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle REJECT_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'REJECT_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n it('should handle UNDOCHECKOUT_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'UNDOCHECKOUT_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle UNDOCHECKOUT_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'UNDOCHECKOUT_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n it('should handle FORCEUNDOCHECKOUT_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'FORCEUNDOCHECKOUT_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle FORCEUNDOCHECKOUT_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'FORCEUNDOCHECKOUT_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n it('should handle RESTOREVERSION_CONTENT_REQUEST', () => {\r\n expect(Reducers.errorMessage(null, { type: 'RESTOREVERSION_CONTENT_REQUEST' })).to.be.eq(null);\r\n });\r\n it('should handle RESTOREVERSION_CONTENT_SUCCESS', () => {\r\n expect(Reducers.errorMessage(null, { type: 'RESTOREVERSION_CONTENT_SUCCESS' })).to.be.eq(null);\r\n });\r\n});\r\n\r\ndescribe('getContent', () => {\r\n const state = {\r\n entities: {\r\n collection: {\r\n 5145: {\r\n Id: 5145,\r\n DisplayName: 'Some Article',\r\n Status: ['Active']\r\n },\r\n 5146: {\r\n Id: 5146,\r\n Displayname: 'Other Article',\r\n Status: ['Completed']\r\n }\r\n }\r\n }\r\n }\r\n it('should return the content from the state by the given id', () => {\r\n expect(Reducers.getContent(state.entities.collection, 5145)).to.be.deep.eq(\r\n {\r\n Id: 5145,\r\n DisplayName: 'Some Article',\r\n Status: ['Active']\r\n }\r\n );\r\n });\r\n});\r\n\r\ndescribe('getIds', () => {\r\n const state = {\r\n ids: [5145, 5146]\r\n }\r\n it('should return the id array from the current state', () => {\r\n expect(Reducers.getIds(state)).to.be.deep.eq([5145, 5146]);\r\n });\r\n});\r\n\r\ndescribe('getFetching', () => {\r\n const state = {\r\n ids: [5145, 5146],\r\n isFetching: false\r\n }\r\n it('should return the value of isFetching from the current state', () => {\r\n expect(Reducers.getFetching(state)).to.be.eq(false);\r\n });\r\n});\r\n\r\ndescribe('getError', () => {\r\n const state = {\r\n ids: [5145, 5146],\r\n isFetching: false,\r\n errorMessage: 'error'\r\n }\r\n it('should return the value of errorMessage from the current state', () => {\r\n expect(Reducers.getError(state)).to.be.eq('error');\r\n });\r\n});\r\n\r\ndescribe('getAuthenticationStatus', () => {\r\n const state = {\r\n user: {\r\n isAuthenticated: true\r\n }\r\n }\r\n it('should return true if the user is authenticated state', () => {\r\n expect(Reducers.getAuthenticationStatus(state)).to.be.eq(true);\r\n });\r\n});\r\n\r\ndescribe('getAuthenticationError', () => {\r\n const state = {\r\n user: {\r\n errorMessage: 'error'\r\n }\r\n }\r\n it('should return the value of errorMessage from the current state', () => {\r\n expect(Reducers.getAuthenticationError(state)).to.be.eq('error');\r\n });\r\n});"]}
\ No newline at end of file
diff --git a/gulpfile.js b/gulpfile.js
index 0c8dbc6..252eb56 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -1,94 +1,66 @@
const gulp = require('gulp');
-const ts = require('gulp-typescript');
-const mocha = require('gulp-mocha');
-const sourcemaps = require('gulp-sourcemaps');
-const istanbul = require('gulp-istanbul');
-const remapIstanbul = require('remap-istanbul/lib/gulpRemapIstanbul');
const typedoc = require("gulp-typedoc");
+var rename = require("gulp-rename");
const del = require('del');
const __coverageThreshold = 60;
-const tsProject = ts.createProject('./tsconfig.json');
-const tslint = require("gulp-tslint");
-
-gulp.task("build:lint", function () {
- return gulp.src(["./**/*.ts", "!./node_modules/**/*", "!./test/**/*"])
- .pipe(tslint({
- configuration: {
- rules: {
- "variable-name": false,
- "quotemark": [true, "single", "avoid-escape"],
- "max-file-line-count": false
- }
- }
- }))
- .pipe(tslint.report())
-});
-
-gulp.task('build:clean', function () {
- return del([
- './dist',
- './coverage',
- './coverage-report'
- ]);
-});
-
-gulp.task('build', ['build:clean'], function () {
- return gulp.src([
- './src/**/*.ts',
- './test/**/*.ts'
- ], { base: '.' })
- .pipe(sourcemaps.init())
- .pipe(tsProject())
- .pipe(sourcemaps.write('.'))
- .pipe(gulp.dest('./dist'));
-})
-
-gulp.task('test:instrument', ['build'], function () {
- return gulp.src('./dist/src/**/*.js')
- .pipe(istanbul())
- .pipe(istanbul.hookRequire());
-});
-
-gulp.task('test:cover', ['test:instrument'], function () {
- return gulp.src('./dist/**/*Tests.js')
- .pipe(mocha({ ui: 'bdd' }))
- .pipe(istanbul.writeReports({
- reporters: ['json', 'html']
- })).on('end', remapCoverageFiles);
+gulp.task("typedoc", function () {
+ return gulp
+ .src([
+ "./src/**/*.ts",
+ "!./src/**/index.ts",
+ "!./src/SN.ts",
+ "!./src/SN.d.ts"
+ ])
+ .pipe(typedoc({
+ module: "commonjs",
+ target: "es2015",
+ includeDeclarations: false,
+ out: "./documentation/html",
+ name: "sn-client-js",
+ theme: "default",
+ ignoreCompilerErrors: true,
+ version: true,
+ mode: "modules",
+ readme: "sn-client-js/README.md",
+ excludeExternals: true,
+ excludePrivate: true,
+ includes: "docs",
+ experimentalDecorators: true
+ }));
});
-function remapCoverageFiles() {
- return gulp.src('./coverage/coverage-final.json')
- .pipe(remapIstanbul({
- basePath: '.',
- reports: {
- 'html': './coverage',
- 'text-summary': null,
- 'lcovonly': './coverage/lcov.info'
- }
- }));
-}
-gulp.task("typedoc", function () {
+gulp.task("typedoc:md:generate", function () {
return gulp
- .src(["src/*.ts", "!src/sn-redux.ts"])
+ .src([
+ "./src/**/*.ts",
+ "!./src/**/index.ts",
+ "!./src/SN.ts",
+ "!./src/SN.d.ts"
+ ])
.pipe(typedoc({
- module: "commonjs",
- target: "es2015",
- includeDeclarations: false,
- out: "./documentation",
- name: "sn-redux",
- theme: "default",
- ignoreCompilerErrors: true,
- version: true,
- readme: "sn-redux/README.md",
- excludeExternals: true,
- excludePrivate: true,
- includes: "docs"
- }));
+ module: "commonjs",
+ target: "es2015",
+ includeDeclarations: false,
+ out: "./documentation/markdown",
+ name: "sn-client-js",
+ theme: "node_modules/typedoc-md-theme/bin",
+ ignoreCompilerErrors: true,
+ version: true,
+ mode: "modules",
+ readme: "sn-client-js/README.md",
+ excludeExternals: true,
+ excludePrivate: true,
+ includes: "docs"
+ }));
});
-gulp.task('test', ['test:cover']);
-gulp.task('default', ['build:lint', 'build', 'test']);
\ No newline at end of file
+gulp.task('typedoc:md', ['typedoc:md:generate'], ()=>{
+ gulp.src('./documentation/markdown/**/*.*')
+ .pipe(rename((path)=>{
+ path.extname= path.extname == '.html' ? '.md' : path.extname
+ }))
+ .pipe(gulp.dest('documentation/markdown_renamed'))
+});
\ No newline at end of file
diff --git a/package.json b/package.json
index 476de3c..af903f6 100644
--- a/package.json
+++ b/package.json
@@ -1,16 +1,31 @@
{
"name": "sn-redux",
- "version": "1.1.0-beta.2",
+ "version": "2.0.0-RC.1",
"description": "A set of redux actions, reducers and redux-ovbservable epics for Sense/Net ECM",
- "main": "dist/sn-redux.js",
+ "main": "dist/src/sn-redux.js",
"scripts": {
+ "lint": "node tslint --project ./tsconfig.json",
+ "clean": "rimraf dist",
+ "precommit": "npm run lint",
"commit": "git-cz",
"gulp": "gulp",
- "test": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec dist/test/*Tests.js",
+ "pretest": "npm run build",
+ "test": "nyc mocha dist/test/index.js",
"check-coverage": "istanbul check-coverage ",
"report-coverage": "cat ./coverage/lcov.info | codecov",
- "semantic-release": "semantic-release pre && semantic-release post"
+ "prebuild": "npm run lint && npm run clean",
+ "build": "tsc",
+ "typedoc:md": "gulp typedoc:md",
+ "typedoc:html": "gulp typedoc",
+ "semantic-release": "semantic-release pre && semantic-release post",
+ "publish:development": "npm publish --tag development"
},
+ "files": [
+ "dist",
+ "src",
+ "test",
+ "documentation"
+ ],
"repository": {
"type": "git",
"url": "https://github.com/SenseNet/sn-redux.git"
@@ -26,52 +41,56 @@
"bugs": {
"url": "https://github.com/SenseNet/sn-redux/issues"
},
+ "nyc": {
+ "cache": true,
+ "include": "dist/src/**/*.*",
+ "exclude": "dist/src/**/sn-redux.js",
+ "all": true,
+ "reporter": [
+ "lcov",
+ "text-summary",
+ "json"
+ ]
+ },
"homepage": "https://sensenet.com",
"dependencies": {
- "isomorphic-fetch": "2.2.1",
- "rxjs": "5.2.0",
- "normalizr": "3.2.2",
+ "@reactivex/rxjs": "^5.3.1",
+ "normalizr": "^3.2.2",
+ "nyc": "^10.3.0",
"redux": "3.6.0",
"redux-logger": "2.8.2",
- "redux-observable": "0.14.1",
- "sn-client-js": "1.1.0-beta.5",
- "ts-json-properties": "1.1.4"
+ "redux-observable": "^0.14.1",
+ "redux-thunk": "^2.2.0",
+ "rimraf": "^2.6.1",
+ "rxjs": "^5.3.1",
+ "sn-client-js": "^2.0.0-RC.1"
},
"devDependencies": {
- "@reactivex/rxjs": "5.2.0",
"@types/chai": "3.4.35",
"@types/mocha": "2.2.39",
"@types/nock": "8.2.1",
"@types/orchestrator": "0.0.30",
"@types/redux-mock-store": "0.0.7",
- "@types/sinon": "1.16.35",
"chai": "3.5.0",
"codecov.io": "0.1.6",
"commitizen": "2.9.6",
"cz-conventional-changelog": "2.0.0",
"del": "2.2.2",
"gulp": "3.9.1",
- "gulp-istanbul": "1.1.1",
- "gulp-mocha": "3.0.1",
- "gulp-sourcemaps": "2.4.1",
- "gulp-tslint": "7.1.0",
+ "gulp-rename": "^1.2.2",
"gulp-typedoc": "2.0.2",
- "gulp-typescript": "3.1.5",
- "isomorphic-fetch": "2.2.1",
- "mocha": "3.2.0",
+ "mocha": "3.3.0",
"nock": "9.0.9",
"normalizr": "3.2.2",
- "redux": "3.6.0",
- "redux-mock-store": "1.2.2",
+ "redux": "^3.6.0",
+ "redux-mock-store": "1.2.3",
"redux-observable": "0.14.1",
- "remap-istanbul": "0.9.1",
- "rxjs": "5.2.0",
"semantic-release": "^6.3.2",
- "sinon": "1.17.7",
- "sn-client-js": "1.1.0-beta.5",
- "tslint": "4.5.1",
- "typedoc": "0.5.7",
- "typescript": "2.2.1"
+ "tslint": "5.2.0",
+ "typedoc": "0.6.0",
+ "typedoc-md-theme": "^1.0.1",
+ "typedoc-plugin-external-module-name": "^1.0.9",
+ "typescript": "2.3.2"
},
"czConfig": {
"path": "node_modules/cz-conventional-changelog"
diff --git a/src/Actions.ts b/src/Actions.ts
index c46a57a..f397ca8 100644
--- a/src/Actions.ts
+++ b/src/Actions.ts
@@ -1,23 +1,23 @@
import { normalize } from 'normalizr';
import { Schemas } from './Schema';
-import * as SN from 'sn-client-js';
+import { Content, ODataApi, ODataHelper, Repository } from 'sn-client-js';
/**
- * Module that contains the action creators.
- *
- * _Redux actions are payloads of information that send data from your application to your store. They are the only source of information for the store. You send them to the store using
+ * Module that contains the action creators.
+ *
+ * _Redux actions are payloads of information that send data from your application to your store. They are the only source of information for the store. You send them to the store using
* ```store.dispatch()```. Actions are plain JavaScript objects. Actions must have a type property that indicates the type of action being performed._
- *
+ *
* Learn more about Redux actions [here](http://redux.js.org/docs/basics/Actions.html)
- *
- * Following are Redux actions but they're all related with a Sense/Net built-in action. Since this Sense/Net built-in actions are OData actions and functions and they get and set
+ *
+ * Following are Redux actions but they're all related with a Sense/Net built-in action. Since this Sense/Net built-in actions are OData actions and functions and they get and set
* data throught ajax request we have to handle the main steps of their process separately. So there're three separate redux action for every Sense/Net action:
* one for the request itself and two for the two possible end of an ajax request, success and fail.
- *
- * All of the JSON responses with content or collection are normalized so you shouldn't care about how to handle nested data structure, normalizr takes JSON and a schema and replaces
+ *
+ * All of the JSON responses with content or collection are normalized so you shouldn't care about how to handle nested data structure, normalizr takes JSON and a schema and replaces
* nested entities with their IDs, gathering all entities in dictionaries.
* For further information about normalizr check this [link](https://github.com/paularmstrong/normalizr).
- *
+ *
* ```
* [{
* Id: 5145,
@@ -28,11 +28,11 @@ import * as SN from 'sn-client-js';
* Displayname: 'Other Article',
* Status: ['Completed']
* }]
- *
+ *
* ```
- *
+ *
* is normalized to
- *
+ *
* ```
* result: [5145, 5146],
* entities: {
@@ -50,12 +50,12 @@ import * as SN from 'sn-client-js';
* }
* }
* ```
- *
+ *
* Following module now cover the CRUD operations, so it contains Actions which are related to fetching, creating, deleting and updating Content. Other built-in SenseNet OData
* Actions and Functions will be the parts of this module too and you are be able to add your custom Actions too by combining your reducers with the built-in ones.
- *
+ *
* ### Using built-in redux actions in your views
- *
+ *
* ```
* import * as React from 'react'
* import { connect } from 'react-redux'
@@ -63,10 +63,10 @@ import * as SN from 'sn-client-js';
* import RaisedButton from 'material-ui/RaisedButton';
* import { Actions } from 'sn-redux';
* import { Content } from './SenseNet/Content';
- *
+ *
* let AddTodo = ({ dispatch }) => {
* let input
- *
+ *
* return (
*