{"_id":"@codespiral/facts-rest","_rev":"8-a3d3728066d2076b4cf29b55bafba8f4","name":"@codespiral/facts-rest","dist-tags":{"latest":"0.0.9"},"versions":{"0.0.2":{"name":"@codespiral/facts-rest","version":"0.0.2","keywords":[],"author":"","license":"ISC","_id":"@codespiral/facts-rest@0.0.2","maintainers":[{"name":"dlashua","email":"daniel@inklog.net"}],"dist":{"shasum":"e033a4a0874d1ae1a228f2022f38dd9ac7f976f6","tarball":"https://registry.npmjs.org/@codespiral/facts-rest/-/facts-rest-0.0.2.tgz","fileCount":11,"integrity":"sha512-RQjJIRfF0kAmHVPM8dtcmpX4RC+pa4har3m0m0GgY6mH2HU3a1pKiCd6YrKNfaiJeaW61uSwwUPtoxzzlpjw8A==","signatures":[{"sig":"MEUCIFnt2TXSA2Es3OfMj6jejRpM6d1CMmWi1mffcXswOe0+AiEAkwAE7Fm1pTkdSl5QXi8p0aOF0IGKx0s16XSDjDEZV4c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":80691},"type":"module","_from":"file:codespiral-facts-rest-0.0.2.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","source":"./src/index.ts"},"./package.json":"./package.json"},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:ui":"vitest --ui","test:watch":"vitest"},"_npmUser":{"name":"dlashua","email":"daniel@inklog.net"},"_resolved":"/tmp/d5924a65773bfd5e1bafe24d73416156/codespiral-facts-rest-0.0.2.tgz","_integrity":"sha512-RQjJIRfF0kAmHVPM8dtcmpX4RC+pa4har3m0m0GgY6mH2HU3a1pKiCd6YrKNfaiJeaW61uSwwUPtoxzzlpjw8A==","_npmVersion":"10.9.2","description":"The REST API data store provides a generic interface for working with various REST API patterns. It supports multiple configurations to handle different API designs.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"@types/node":"^22.16.5","@codespiral/logic":"0.0.2","@codespiral/facts-abstract":"0.0.2"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/facts-rest_0.0.2_1754082204886_0.11867663569911957","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@codespiral/facts-rest","version":"0.0.3","keywords":[],"author":"","license":"ISC","_id":"@codespiral/facts-rest@0.0.3","maintainers":[{"name":"dlashua","email":"daniel@inklog.net"}],"dist":{"shasum":"ae17c4dfb20d7ec2664f57f2939cead83fba9b1e","tarball":"https://registry.npmjs.org/@codespiral/facts-rest/-/facts-rest-0.0.3.tgz","fileCount":12,"integrity":"sha512-PFHyKs9KwLETWSUTgmd7ZRLqYGqtCbh8g9TqmdJ4ZhSgCR5BQ5cKhFrsSEe57LcFDwjm7Xnm7yRavA0kQCc9mA==","signatures":[{"sig":"MEYCIQDmV8mlbONB3wUOotizfhIpL3JdXFH+yeDWMAmnuGLQ3gIhALeNn7+LZIWfmucPaS57owGRDLqESEqfdKQXPxAuGHeQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":80824},"type":"module","_from":"file:codespiral-facts-rest-0.0.3.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","source":"./src/index.ts"},"./package.json":"./package.json"},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:ui":"vitest --ui","test:watch":"vitest"},"_npmUser":{"name":"dlashua","email":"daniel@inklog.net"},"_resolved":"/tmp/f4abfb65ba3e312b03f5f1b0f19ed6e0/codespiral-facts-rest-0.0.3.tgz","_integrity":"sha512-PFHyKs9KwLETWSUTgmd7ZRLqYGqtCbh8g9TqmdJ4ZhSgCR5BQ5cKhFrsSEe57LcFDwjm7Xnm7yRavA0kQCc9mA==","_npmVersion":"10.9.2","description":"The REST API data store provides a generic interface for working with various REST API patterns. It supports multiple configurations to handle different API designs.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"@types/node":"^22.16.5","@codespiral/logic":"0.0.4","@codespiral/facts-abstract":"0.0.3"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/facts-rest_0.0.3_1754083127762_0.7635230161645767","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@codespiral/facts-rest","version":"0.0.4","keywords":[],"author":"","license":"ISC","_id":"@codespiral/facts-rest@0.0.4","maintainers":[{"name":"dlashua","email":"daniel@inklog.net"}],"dist":{"shasum":"d622a39f0aba661d4dcd4174f0f0a6f2e6e1232d","tarball":"https://registry.npmjs.org/@codespiral/facts-rest/-/facts-rest-0.0.4.tgz","fileCount":12,"integrity":"sha512-g/I1hpKQkQBumbROLUxpbZzQsTOaXLKHMCZuhiF0C5hzvc4HKF3nQrwpJKYdBb57Wqz6SDr49TP6tCgqSMsfrg==","signatures":[{"sig":"MEUCIQCEYvW1uIUfS2QBk/h1J71RUduAPPpPLTtapRsNuMcwYAIgXld4xtnsVzc/1ZK1yKC6ognIsH07EVHyfs31o5zXlFI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":80971},"type":"module","_from":"file:codespiral-facts-rest-0.0.4.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","source":"./src/index.ts"},"./package.json":"./package.json"},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:ui":"vitest --ui","test:watch":"vitest"},"_npmUser":{"name":"dlashua","email":"daniel@inklog.net"},"_resolved":"/tmp/0cb61a74312b7f71b993426d50be04aa/codespiral-facts-rest-0.0.4.tgz","_integrity":"sha512-g/I1hpKQkQBumbROLUxpbZzQsTOaXLKHMCZuhiF0C5hzvc4HKF3nQrwpJKYdBb57Wqz6SDr49TP6tCgqSMsfrg==","_npmVersion":"10.9.2","description":"The REST API data store provides a generic interface for working with various REST API patterns. It supports multiple configurations to handle different API designs.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"@types/node":"^22.16.5","@codespiral/logic":"0.0.5","@codespiral/facts-abstract":"0.0.4"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/facts-rest_0.0.4_1754084026954_0.1457339231837831","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@codespiral/facts-rest","version":"0.0.5","keywords":[],"author":"","license":"ISC","_id":"@codespiral/facts-rest@0.0.5","maintainers":[{"name":"dlashua","email":"daniel@inklog.net"}],"dist":{"shasum":"bccf1c2e616d4dc125603857dcebb9e4fccbe1b5","tarball":"https://registry.npmjs.org/@codespiral/facts-rest/-/facts-rest-0.0.5.tgz","fileCount":12,"integrity":"sha512-LWOKAhdpDchwpr10PMXplM30XwuQYpm1I8xc+/UD64Ftd3nWUhJZUl6GFs01IwB0SEidJ/eRX2FJKPDjHZHebA==","signatures":[{"sig":"MEQCIHQQvMaJl8G0iW2CaB5VpMMaRYllqWJGiaoaWne5mvvnAiAk/1/7FX7geu0M7cfvl94yVnBr8/jy6P6QbvnO2b4wWw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":81096},"type":"module","_from":"file:codespiral-facts-rest-0.0.5.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","source":"./src/index.ts"},"./package.json":"./package.json"},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:ui":"vitest --ui","test:watch":"vitest"},"_npmUser":{"name":"dlashua","email":"daniel@inklog.net"},"_resolved":"/tmp/3a6d3c1e7f24d30a8571ebb24e2542db/codespiral-facts-rest-0.0.5.tgz","_integrity":"sha512-LWOKAhdpDchwpr10PMXplM30XwuQYpm1I8xc+/UD64Ftd3nWUhJZUl6GFs01IwB0SEidJ/eRX2FJKPDjHZHebA==","_npmVersion":"10.9.2","description":"The REST API data store provides a generic interface for working with various REST API patterns. It supports multiple configurations to handle different API designs.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"@types/node":"^22.16.5","@codespiral/logic":"0.0.6","@codespiral/facts-abstract":"0.0.5"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/facts-rest_0.0.5_1754100237873_0.3464970984799334","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"@codespiral/facts-rest","version":"0.0.6","keywords":[],"author":"","license":"ISC","_id":"@codespiral/facts-rest@0.0.6","maintainers":[{"name":"dlashua","email":"daniel@inklog.net"}],"dist":{"shasum":"ea985419a31f768cfcdce8cde5dd782826a5f04c","tarball":"https://registry.npmjs.org/@codespiral/facts-rest/-/facts-rest-0.0.6.tgz","fileCount":12,"integrity":"sha512-Fvy0XNtfQueLIhSse+u4EaVp9YY2phLI1/4czwuFLOhUEMmKp13+AAFlCu5ISGB/IkciFLhS7gbxXx5TqNczuQ==","signatures":[{"sig":"MEYCIQCGJCLwh8dFjgEiHRcMVX7v2yXFDv6FBGFgqIBayzp/iAIhAPSSDbvSBd6Srzbsai5jJD/HtdZd5MmFUU+wCZxHHetM","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":81221},"type":"module","_from":"file:codespiral-facts-rest-0.0.6.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","source":"./src/index.ts"},"./package.json":"./package.json"},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:ui":"vitest --ui","test:watch":"vitest"},"_npmUser":{"name":"dlashua","email":"daniel@inklog.net"},"_resolved":"/tmp/839adfe0e8449ef4957b718ecdd741df/codespiral-facts-rest-0.0.6.tgz","_integrity":"sha512-Fvy0XNtfQueLIhSse+u4EaVp9YY2phLI1/4czwuFLOhUEMmKp13+AAFlCu5ISGB/IkciFLhS7gbxXx5TqNczuQ==","_npmVersion":"10.9.2","description":"The REST API data store provides a generic interface for working with various REST API patterns. It supports multiple configurations to handle different API designs.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"@types/node":"^22.16.5","@codespiral/logic":"0.0.7","@codespiral/facts-abstract":"0.0.6"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/facts-rest_0.0.6_1754100438739_0.3057609299992088","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"@codespiral/facts-rest","version":"0.0.7","keywords":[],"author":"","license":"ISC","_id":"@codespiral/facts-rest@0.0.7","maintainers":[{"name":"dlashua","email":"daniel@inklog.net"}],"dist":{"shasum":"6078b622847241c68579d2d02b3710742f9299c1","tarball":"https://registry.npmjs.org/@codespiral/facts-rest/-/facts-rest-0.0.7.tgz","fileCount":12,"integrity":"sha512-5SImOYHTjJKijWOcCW+alN6Ykxzn0np1RVmMtYzKlAMqPFr4J5K54tWdKSJKVYmX3VPtJ1aERQ6GEkZklsz5wg==","signatures":[{"sig":"MEQCIGjao4Zt6IzIEJ0Q3mgDG0EsF962AU7HwaJxVBwzcIHnAiBDLQl55RIVW+RPQ7pCrV/OUhHpjA33WEwSStdZMuw8Ug==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":81370},"type":"module","_from":"file:codespiral-facts-rest-0.0.7.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","source":"./src/index.ts"},"./package.json":"./package.json"},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:ui":"vitest --ui","test:watch":"vitest"},"_npmUser":{"name":"dlashua","email":"daniel@inklog.net"},"_resolved":"/tmp/7f30a5b20a4c9bd812672e52c1bdedb3/codespiral-facts-rest-0.0.7.tgz","_integrity":"sha512-5SImOYHTjJKijWOcCW+alN6Ykxzn0np1RVmMtYzKlAMqPFr4J5K54tWdKSJKVYmX3VPtJ1aERQ6GEkZklsz5wg==","_npmVersion":"10.9.2","description":"The REST API data store provides a generic interface for working with various REST API patterns. It supports multiple configurations to handle different API designs.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"@types/node":"^22.16.5","@codespiral/logic":"0.0.8","@codespiral/facts-abstract":"0.0.7"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/facts-rest_0.0.7_1754102514733_0.029696672955303427","host":"s3://npm-registry-packages-npm-production"}},"0.0.8":{"name":"@codespiral/facts-rest","version":"0.0.8","keywords":[],"author":"","license":"ISC","_id":"@codespiral/facts-rest@0.0.8","maintainers":[{"name":"dlashua","email":"daniel@inklog.net"}],"dist":{"shasum":"f654b687b1c9f5a236ba0ab1bc97ff03d6385ffd","tarball":"https://registry.npmjs.org/@codespiral/facts-rest/-/facts-rest-0.0.8.tgz","fileCount":12,"integrity":"sha512-yWSnf4kZ3DrHdapsbjPJQD7VNEw5Bos5/gzz21Qaj5MbVv1ZszB6DZ4JU1zafp1vZa8jo10JgEz8IkIObewE5A==","signatures":[{"sig":"MEQCIHyY43Q8WtvfYeqlIR/WP7UDF8uKGrWlBG8gB62tK3xWAiAIc7ypY32GvX1u/GWCLvnUID1jg60pih2I+2VKXpBDNQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":81506},"type":"module","_from":"file:codespiral-facts-rest-0.0.8.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","source":"./src/index.ts"},"./package.json":"./package.json"},"scripts":{"dev":"tsup --watch","test":"vitest run","build":"tsup","test:ui":"vitest --ui","test:watch":"vitest"},"_npmUser":{"name":"dlashua","email":"daniel@inklog.net"},"_resolved":"/tmp/8b78dd16442436088e52496e1a0e52fb/codespiral-facts-rest-0.0.8.tgz","_integrity":"sha512-yWSnf4kZ3DrHdapsbjPJQD7VNEw5Bos5/gzz21Qaj5MbVv1ZszB6DZ4JU1zafp1vZa8jo10JgEz8IkIObewE5A==","_npmVersion":"10.9.2","description":"The REST API data store provides a generic interface for working with various REST API patterns. It supports multiple configurations to handle different API designs.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"@types/node":"^22.16.5","@codespiral/logic":"0.0.9","@codespiral/facts-abstract":"0.0.8"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/facts-rest_0.0.8_1754128597938_0.7369794091098945","host":"s3://npm-registry-packages-npm-production"}},"0.0.9":{"name":"@codespiral/facts-rest","version":"0.0.9","description":"The REST API data store provides a generic interface for working with various REST API patterns. It supports multiple configurations to handle different API designs.","type":"module","exports":{".":{"source":"./src/index.ts","import":"./dist/index.js","types":"./dist/index.d.ts"},"./package.json":"./package.json"},"keywords":[],"author":"","license":"ISC","dependencies":{"@types/node":"^22.16.5","@codespiral/logic":"0.0.10","@codespiral/facts-abstract":"0.0.9"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","test:ui":"vitest --ui","test:watch":"vitest"},"_id":"@codespiral/facts-rest@0.0.9","_integrity":"sha512-w4jrDtEEdr6gP6WMTofR67hZ0ssD7iWeysj7XQHZdXl22t6o48pLltvaowdnsN0LnygvhONnoor0dX6LMLUNKQ==","_resolved":"/tmp/68cdede650f270ab2f97e516a1b9dd08/codespiral-facts-rest-0.0.9.tgz","_from":"file:codespiral-facts-rest-0.0.9.tgz","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-w4jrDtEEdr6gP6WMTofR67hZ0ssD7iWeysj7XQHZdXl22t6o48pLltvaowdnsN0LnygvhONnoor0dX6LMLUNKQ==","shasum":"22a098bf32b523c28c7d42c940d64169dd4697c6","tarball":"https://registry.npmjs.org/@codespiral/facts-rest/-/facts-rest-0.0.9.tgz","fileCount":12,"unpackedSize":81665,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFK1wQG93RohwRkdNplUvDGY0YZ2OmvYPE1A/2f9TJmmAiA7iFl21yrejIGZwJpLPDxj5xjJt+AZsiX4llE+5vblDQ=="}]},"_npmUser":{"name":"dlashua","email":"daniel@inklog.net"},"directories":{},"maintainers":[{"name":"dlashua","email":"daniel@inklog.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/facts-rest_0.0.9_1754135996903_0.5549667024236145"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-01T21:03:24.774Z","modified":"2025-08-02T11:59:57.255Z","0.0.2":"2025-08-01T21:03:25.060Z","0.0.3":"2025-08-01T21:18:47.945Z","0.0.4":"2025-08-01T21:33:47.140Z","0.0.5":"2025-08-02T02:03:58.045Z","0.0.6":"2025-08-02T02:07:18.938Z","0.0.7":"2025-08-02T02:41:54.942Z","0.0.8":"2025-08-02T09:56:38.128Z","0.0.9":"2025-08-02T11:59:57.075Z"},"license":"ISC","keywords":[],"description":"The REST API data store provides a generic interface for working with various REST API patterns. It supports multiple configurations to handle different API designs.","maintainers":[{"name":"dlashua","email":"daniel@inklog.net"}],"readme":"# REST API Data Store\n\nThe REST API data store provides a generic interface for working with various REST API patterns. It supports multiple configurations to handle different API designs.\n\n## Features\n\n### Primary Key in URL Path\n\nMany REST APIs include the primary key in the URL path instead of query parameters:\n\n```typescript\nconst api = await makeRelREST({\n  baseUrl: \"https://api.example.com/v1\",\n  features: {\n    primaryKeyInPath: true,\n  },\n});\n\nconst users = api.rel(\"users\", {\n  restPrimaryKey: \"id\", // Specifies which field is the primary key\n});\n\n// This will generate: GET /users/123 instead of /users?id=123\nusers({ id: 123, name: $.name });\n```\n\n### Custom URL Builder\n\nFor complex URL patterns, you can provide a custom URL builder:\n\n```typescript\nconst api = await makeRelREST({\n  baseUrl: \"https://api.example.com\",\n  features: {\n    urlBuilder: (table, primaryKey, primaryKeyValue) => {\n      if (primaryKey && primaryKeyValue) {\n        return `https://api.example.com/${table}/${primaryKeyValue}/details`;\n      }\n      return `https://api.example.com/${table}`;\n    },\n  },\n});\n```\n\n### IN Operator Support\n\nSome APIs don't support comma-separated values for IN operations. When disabled, multiple requests are made:\n\n```typescript\nconst api = await makeRelREST({\n  baseUrl: \"https://api.example.com\",\n  features: {\n    supportsInOperator: false, // Will make separate requests for each value\n  },\n});\n\n// This will make 3 separate requests instead of one with ?id=1,2,3\nusers({ id: [1, 2, 3], name: $.name });\n```\n\n### Field Selection Support\n\nSome APIs don't support field selection. When disabled, the `fields` parameter is not sent:\n\n```typescript\nconst api = await makeRelREST({\n  baseUrl: \"https://api.example.com\",\n  features: {\n    supportsFieldSelection: false, // Won't send ?fields=name,email\n  },\n});\n```\n\n### Custom Query Parameter Formatting\n\nFor APIs with non-standard query parameter formats:\n\n```typescript\nconst api = await makeRelREST({\n  baseUrl: \"https://api.example.com\",\n  features: {\n    queryParamFormatter: (column, operator, value) => {\n      if (operator === \"gt\") {\n        return { key: `${column}_greater_than`, value: String(value) };\n      }\n      if (operator === \"like\") {\n        return { key: `search_${column}`, value: String(value) };\n      }\n      return { key: column, value: String(value) };\n    },\n  },\n});\n```\n\n## Configuration Options\n\n```typescript\ninterface RestDataStoreConfig {\n  baseUrl: string;\n  apiKey?: string;\n  timeout?: number;\n  headers?: Record<string, string>;\n  pagination?: {\n    limitParam?: string;\n    offsetParam?: string;\n    maxPageSize?: number;\n  };\n  features?: {\n    /** Whether to include primary key in URL path instead of query params */\n    primaryKeyInPath?: boolean;\n    /** Whether API supports comma-separated values for IN operations */\n    supportsInOperator?: boolean;\n    /** Whether API supports field selection via query params */\n    supportsFieldSelection?: boolean;\n    /** Custom URL builder for different API patterns */\n    urlBuilder?: (\n      table: string,\n      primaryKey?: string,\n      primaryKeyValue?: any,\n    ) => string;\n    /** Custom query parameter formatter */\n    queryParamFormatter?: (\n      column: string,\n      operator: string,\n      value: any,\n    ) => { key: string; value: string };\n  };\n}\n```\n\n## Examples\n\nSee `src/test/rest-test.ts` for complete examples of different REST API patterns.\n","readmeFilename":"README.md"}