{"_id":"@agrippa-io/rest-request","_rev":"5-578e2ea50bd1763536864249ace96885","name":"@agrippa-io/rest-request","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@agrippa-io/rest-request","version":"1.0.0","keywords":["edisen","sdk","client","state-management","http","actions"],"author":{"name":"Aggripa Development Team"},"license":"ISC","_id":"@agrippa-io/rest-request@1.0.0","maintainers":[{"name":"mattvalli","email":"matthew.valli@gmail.com"}],"dist":{"shasum":"bbf557fd09c5bf37f6efbb45b2504739fe732661","tarball":"https://registry.npmjs.org/@agrippa-io/rest-request/-/rest-request-1.0.0.tgz","fileCount":64,"integrity":"sha512-Se2NYwiJn13wfnYMKUsi6SR28pyi1JtT8OZyZgLc5d/ulk/qrzdFr6/oZgDc3ZdDaGaAaJeNTFJwXpcQG+Ejaw==","signatures":[{"sig":"MEQCIDtvaChCTQiXubZI428NP6cOxbG0DNBub6sL5F5jKmVzAiAbpXU/Uy8KAV9+foEbY6bnquFOH/Jwu5I2FxjD7L6ARg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":218473,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhwvTACRA9TVsSAnZWagAAxm8QAKS+BlmrBb9Rqmb7NgLZ\nS6CBqHNr8/VjQtOF1jSK0OBi1a8Welh/7c9mmlUU6+ipnruZatJnkrOhxE0a\n9nXtANqOpmpPcM3jOfseEcSfmslQeNuCOscuQ8dpG7kASwODsQeRhGob3iFC\nj+UcpmY0wsk2oupYgGVXeQT+tEfubvt6PQdonH0VE6xdTvoWe13T3xWbQRnK\n024m5sHp+P/MDKI4TkZJmCNIEh389gYNsjwXwuBcYG9EBQGrydq/aFjb55ly\nadKP+UUqjguvro5ZYtRM7E2z8D5jDpEsRoGXVQ/dVh42Tez0/uVb1S0GV/Hi\n7AVf8aDarHkaes6ymCxUXZuxo4Ku8SJ8PTDePjSrPaHYD5b1dEClatytSsSX\nd/PCiFBpN7sm1kuxMJwvLEdU1fVyVHUuW0L/JDvM6PLjCHGm/layWbu5h9vi\nCQM+43ZwJhMi0lc+1kUjnUgW5nT7RHpujY5CNp22hjZ+8f8BV8gtVVgohiw4\n6Hp7Zs5J4YWawtnSvdHIvw+sa/lcqVzoVIymjGgTlHv5dteyOmIQYb0234Ej\nuDiRu5SD1213VAHqw0YSL8HxsJYnmh2cV+ryYtEf6M+A7MtHosUu1O1f0nKB\n83cM/YAL2e8PGO8SAKaLIvda+23ENIX7hF9kLDfLhzHtzKWJNmaV6qKPXVrL\nDvnu\r\n=WLOO\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","gitHead":"e152b1bee8dc72349ab67320d3ebb256ecffc955","scripts":{"test":"mocha --recursive ./dist/**/*.spec.js","build":"tsc","pretest":"npm run build"},"_npmUser":{"name":"mattvalli","email":"matthew.valli@gmail.com"},"_npmVersion":"7.5.2","description":"Http Module wrapped for making RESTful requests to RESTful API Applications following the Aggripa Request patterns and conventions","directories":{},"_nodeVersion":"10.15.3","dependencies":{"npm":"^6.14.9","chai":"^4.2.0","axios":"^0.21.1","mocha":"^8.2.1","react":"^17.0.1","redux":"^4.0.5","lodash":"^4.17.20","change-case":"^4.1.1","qs-stringify":"^1.2.1"},"_hasShrinkwrap":false,"devDependencies":{"ts-node":"^9.0.0","typescript":"^4.0.5","@types/chai":"^4.2.14","@types/mocha":"^8.0.4","@types/react":"^17.0.0","@types/react-dom":"^17.0.0","@babel/plugin-proposal-optional-chaining":"^7.12.7"},"_npmOperationalInternal":{"tmp":"tmp/rest-request_1.0.0_1635408924342_0.8036350280824551","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@agrippa-io/rest-request","version":"1.0.1","description":"HTTP module for making RESTful requests following the Agrippa request patterns and conventions","main":"dist/index.js","types":"dist/index.d.ts","scripts":{"build":"tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json","test":"vitest run --passWithNoTests","test:watch":"vitest","lint":"eslint .","lint:fix":"eslint . --fix","typecheck":"tsc --noEmit"},"keywords":["sdk","client","http","actions"],"author":{"name":"Agrippa Development Team"},"license":"ISC","dependencies":{"axios":"^0.21.1","change-case":"^4.1.1","lodash":"^4.17.20","qs-stringify":"^1.2.1"},"devDependencies":{"@stylistic/eslint-plugin":"^2.12.0","@types/chai":"^4.3.20","@types/lodash":"^4.17.7","@types/node":"^22.19.19","@typescript-eslint/parser":"^8.18.0","chai":"^4.5.0","eslint":"^9.17.0","tsc-alias":"^1.8.10","typescript":"^5.9.3","vitest":"^2.1.8"},"gitHead":"c00eb9caf828f4a8175e33ab15b320c5bdc8f345","_id":"@agrippa-io/rest-request@1.0.1","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-69K7Fqx9rldHY8/Jy5NqDolZxVpuC9lNcCK4Qh+w0XLRdFuOE1incElclgsmM+UaEpyQ1R4JmzmfSlY+8GR/mQ==","shasum":"2072d883c74d859215a5af0df373e3543b1d56de","tarball":"https://registry.npmjs.org/@agrippa-io/rest-request/-/rest-request-1.0.1.tgz","fileCount":18,"unpackedSize":23374,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHWTCaIxn4B7d1UluzwRV1e7vsH64CqqVpjfNiALg9AhAiEAuHeyS83JJwNmW9p0OdPw9OIL9uNivmwVDtnH+IkSr9I="}]},"_npmUser":{"name":"mattvalli","email":"matthew.valli@gmail.com"},"directories":{},"maintainers":[{"name":"mattvalli","email":"matthew.valli@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rest-request_1.0.1_1779022705836_0.3173179120830021"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-28T08:15:24.342Z","modified":"2026-05-17T12:58:26.101Z","1.0.0":"2021-10-28T08:15:24.523Z","1.0.1":"2026-05-17T12:58:25.966Z"},"author":{"name":"Agrippa Development Team"},"license":"ISC","keywords":["sdk","client","http","actions"],"description":"HTTP module for making RESTful requests following the Agrippa request patterns and conventions","maintainers":[{"name":"mattvalli","email":"matthew.valli@gmail.com"}],"readme":"# edisen-rest-request\nUsed to make requests to REST Express applications following `edisen-api-express`\nREST conventions defined by the San Diego Edisen Development Team.\n\n## Components\n`edisen-rest-request` contains the following components:\n - `ActionObject` - A class responsible for validating `ActionRequest` configuration\n - `ActionRequest` - A class responsible for building and firing RESTful API Requests\n\n### ActionObject\nActionObject is constructed using a single argument object named `props`. `props`\nhas a limited set of valid properties\n \n#### `resource` [optional]\nThe API Resource for which to perform the request\n\n#### `method` [optional]\nHTTP Method used for the `ActionRequest`. The provided value match the `HTTP Methods` \navailable in the `axios` library.\n\n##### `method` options\nThe provided value must be in `CONSTANT_CASE`:\n - `POST` - Sends data for the API\n - `GET` - Retrieves data from the API\n - `PUT` - Sends data to update a resource in the API\n - `DELETE` - Removes data from the API\n\n#### `type` [optional]\nA single Action Type from the `/constants/types.action` enumeration used to determine\nwhich type of `URL Pattern` to contstruct.\n\n##### type options\nThe provided value must be in `CONSTANT_CASE`:\n   - `LIST` - Used for data interaction with multiple records\n   - `RESOURCE` - Used for data interaction with a single record\n   - `SUB_RESOURCE` - Used for data interaction with a `RESOURCE`'s `SUB_RESOURCE`\n   (Association)\n   - `ACTION` - Used to perform a `Remote Procedural Call`\n\n#### `subResource` [optional]\nThe name of the `SUB_RESOURCE` used for data interaction. This is `required` for\nwhen `type: TYPES_ACTION.SUB_RESOURCE`\n\n#### `data` [optional]\nThe `HTTP Request Body`. Required for `POST` and `PUT` requests.\n\n#### `params` [optional]\nAn object with values `keyed` by `URL Param` variable names.\n\nFor example, `/resouce/:id/subResource` accepts a `URL Param` variable named `id`.\n\nThe params object would be:\n```\n{\n  id: 'resource-id-123'\n}\n```\n\n#### `query`\nAccepts an object of parameters to append to the `URL Query`\n\nFor example, the following query:\n```\n{\n  minAge: 21,\n  maxAge: 65,\n  sex: 'female',\n  deparment: ['Development', 'DevOps', 'Hardware'] \n}\n```\nwould construct a `URL Query` create:\n`?minAge=21&maxAge=65&sex=female&department[]=Development&department[]=DevOps&department[]=Hardware`\n \n#### `sort`\nAccepts an object of sort parameters appended to the `URL Query`\n```\n{\n  sortOrder: 'ASC' || 'DESC',   // Accending or Descending\n  sortBy: 'createdAt'           // Property to sort by\n}\n```\n\n#### `paging`\nAccepts an object of paging parameters appended to the `URL Query`\n```\n{\n  page: 3,      // Page number to return (Zero-based)\n  pageSize: 20  // Number of records returned per page\n}\n```\n\n#### `urlPattern` [optional]\nUsed to override the default URL Pattern construction that applies the conventions\nset forth by `ExpressREST`\n\n## Usage - Standard\nUsing the standard usage of the `edisen-rest-request` library requires a minimum\nof the following configuration:\n```\nimport request, {\n  TYPES_ACTION,\n  TYPES_HTTP_METHOD\n} from '@onevigor/edisen-rest-request'\n\nasync function getAssets() {\n  // Constructs the Standard Request with minimal props\n  const getAssetsConfig = {\n    resource: 'Asset',\n    type: TYPE_ACTION.LIST,\n    method: TYPE_HTTP_METHODS.GET\n  }\n\n  // Construct the Request\n  // Generates Request: `GET /assets`\n  const getAssetsRequest = request(getAssetsConfig)\n\n  // Execute the Request by awaiting request.perform()\n  return await getAssetsRequest.perform()\n}\n```\n\nTo create the URL:\n\n`GET /assets/asset-id-123/metadata_requirements&sortOrder=ASC&sortBy=createdAt&pageSize=5&page=0`\n\nThe \n```\n// Create the ActionRequest object\nconst getAssetMetadata = new ActionRequest({\n    urlPattern: '/resource/:id/subResource',\n    resource: 'Asset',\n    type: 'subResource', // LIST, ITEM, ACTION, SUB_RESOURCE\n    subResource: 'MetadataRequirements',\n    method: 'GET', // GET, PUT, POST, DELETE\n    params: {\n        id: 'asset-id-123'\n    },\n    sort: {\n        sortOrder: 'ASC',\n        sortBy: 'createdAt'\n    },\n    paging: {\n        pageSize: 5,\n        page: 0\n    }\n})\n\n    getAssetMetadata.action\n    return await getAssetMetadata.perform()\n```\n\n## Usage - URL Override\n","readmeFilename":"README.md"}