{"id":15099505,"url":"https://github.com/arc-archive/arc-definitions","last_synced_at":"2025-10-08T05:30:47.113Z","repository":{"id":46939713,"uuid":"68840883","full_name":"arc-archive/arc-definitions","owner":"arc-archive","description":"⛔️ DEPRECATED This component is deprecated. Use `@advanced-rest-client/app` instead.","archived":true,"fork":false,"pushed_at":"2021-10-26T02:42:51.000Z","size":733,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-01T07:05:16.857Z","etag":null,"topics":["deprecated","obsolete"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arc-archive.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-21T17:22:54.000Z","updated_at":"2023-01-28T05:45:20.000Z","dependencies_parsed_at":"2022-09-26T18:51:13.500Z","dependency_job_id":null,"html_url":"https://github.com/arc-archive/arc-definitions","commit_stats":null,"previous_names":["advanced-rest-client/arc-definitions"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arc-archive%2Farc-definitions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arc-archive%2Farc-definitions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arc-archive%2Farc-definitions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arc-archive%2Farc-definitions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arc-archive","download_url":"https://codeload.github.com/arc-archive/arc-definitions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235683861,"owners_count":19029079,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deprecated","obsolete"],"created_at":"2024-09-25T17:22:21.146Z","updated_at":"2025-10-08T05:30:41.815Z","avatar_url":"https://github.com/arc-archive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deprecated\n\nThis component is deprecated. Use `@advanced-rest-client/app` instead.\n\n------\n\nRequest / response headers and status codes definitions database used in Adavanced REST Client and API Console.\n\nThe `\u003carc-definitions\u003e` element listens for query events.\nOther elements can dispatch the `query-headers` and `query-status-codes` events that are handled by this element. Events are stopped from propagation.\nHandled event receives new property on the `detail` object with the query result.\n\n## Usage\n\n### Dispatching query events\n\n#### Querying for headers data\n\nEach header definition item has the following properties:\n-   `key` - String, The name of the header\n-   `desc` - String, The documentation for the header\n-   `example` - String, Example value of the header\n-   `autocomplete` - Array of String, list of possible/example values for autocomplete functions. This property is not available for response headers.\n\n```json\n{\n  \"key\": \"Accept-Charset\",\n  \"desc\": \"Character sets that are acceptable\",\n  \"example\": \"Accept-Charset: utf-8\",\n  \"autocomplete\": [\"utf-8\"]\n}\n```\n\nTo query for the headers data dispatch `query-headers` event:\n\n```javascript\nconst e = new CustomEvent('query-headers', {\n  detail: {\n    type: 'request', // or \"response\"\n    query: 'Acce'\n  },\n  bubbles: true,\n  cancelable: true\n});\ndocument.body.dispatchEvent(e);\nconsole.log(event.defaultPrevented); // true\nconst headers = event.detail.headers;  // Array[...]\n```\n\nor use imperative API:\n\n```javascript\nconst data = document.querySelector('arc-definitions').queryHeaders('A', 'response');\nconsole.log(data); // list of headers with \"A\" in the name\n```\n\n#### Querying for status code data\n\nStatus code definition item has the following properties:\n-   `key` - Number, Code value\n-   `desc` - String, The documentation for the status code\n-   `label` - String, Status label associated with the code\n\n```json\n{\n  \"key\": 101,\n  \"label\": \"Switching Protocols\",\n  \"desc\":\"This means the requester has asked the server to switch protocols and the server is acknowledging that it will do so\"\n}\n```\n\nTo query for the status code definition dispatch `query-status-codes` event:\n\n```javascript\nconst e = new CustomEvent('query-status-codes', {\n  detail: {\n    code: 200\n  },\n  bubbles: true,\n  cancelable: true\n});\ndocument.body.dispatchEvent(e);\nconsole.log(event.defaultPrevented); // true\nconst statusCode = event.detail.statusCode; // {...}\n```\n\nor use imperative API:\n\n```javascript\nconst status = document.querySelector('arc-definitions').getStatusCode(201);\nconsole.log(status); // Status code definition for 201\n```\n\n### Installation\n```\nnpm install --save @advanced-rest-client/arc-definitions\n```\n\n### In an html file\n\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cscript type=\"module\"\u003e\n      import '@advanced-rest-client/arc-definitions/arc-definitions.js';\n    \u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003carc-definitions\u003e\u003c/arc-definitions\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n### In a LitElement\n\n```js\nimport { LitElement, html } from 'lit-element';\nimport '@advanced-rest-client/arc-definitions/arc-definitions.js';\n\nclass SampleElement extends LitElement {\n  render() {\n    return html`\n    \u003carc-definitions\u003e\u003c/arc-definitions\u003e\n    `;\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n### In a Polymer 3 element\n\n```js\nimport {PolymerElement, html} from '@polymer/polymer';\nimport '@advanced-rest-client/arc-definitions/arc-definitions.js';\n\nclass SampleElement extends PolymerElement {\n  static get template() {\n    return html`\n    \u003carc-definitions\u003e\u003c/arc-definitions\u003e\n    `;\n  }\n\n  _authChanged(e) {\n    console.log(e.detail);\n  }\n}\ncustomElements.define('sample-element', SampleElement);\n```\n\n## Development\n\n```sh\ngit clone https://github.com/advanced-rest-client/arc-definitions\ncd arc-definitions\nnpm install\n```\n\n### Running the demo locally\n\n```sh\nnpm start\n```\n\n### Running the tests\n\n```sh\nnpm test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farc-archive%2Farc-definitions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farc-archive%2Farc-definitions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farc-archive%2Farc-definitions/lists"}