Fógraí
Tógadh Notify go príomha le húsáid le Slack's Incoming cuaillí gréasáin, ach seolfar pálasta simplí leo freisin críochphointe ar bith. Níl sé seo gníomhach faoi láthair ach amháin don npm publish
ordú.
Úsáid
Sampla le crúca HipChat, Stride agus Google Hangouts Chat:
Tacaíonn Verdaccio le haon API, bíodh leisce ort níos mó samplaí a chur leis.
Fógra aonair
notify:
method: POST
headers: [{ 'Content-Type': 'application/json' }]
endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken
content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}'
Fógra iolrach
notify:
'example-google-chat':
method: POST
headers: [{ 'Content-Type': 'application/json' }]
endpoint: https://chat.googleapis.com/v1/spaces/AAAAB_TcJYs/messages?key=myKey&token=myToken
content: '{"text":"New package published: `{{ name }}{{#each versions}} v{{version}}{{/each}}`"}'
'example-hipchat':
method: POST
headers: [{ 'Content-Type': 'application/json' }]
endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken
content: '{"color":"green","message":"New package published: * {{ name }}*","notify":true,"message_format":"text"}'
'example-stride':
method: POST
headers: [{ 'Content-Type': 'application/json' }, { 'authorization': 'Bearer secretToken' }]
endpoint: https://api.atlassian.com/site/{cloudId}/conversation/{conversationId}/message
content: '{"body": {"version": 1,"type": "doc","content": [{"type": "paragraph","content": [{"type": "text","text": "New package published: * {{ name }}* Publisher name: * {{ publisher.name }}"}]}]}}'
Teimpléad
Úsáidimid Barra Láimhe mar phríomh-inneall teimpléid.
Samplaí Formáid
# ait gach leagan
{{ name }}{{#each versions}} v{{version}}{{/each}}
# foilsitheoir agus pacáiste `dist-tag` foilsithe
D'fhoilsigh {{ publisher.name }} {{ publishedPackage }}
Airíonna
List of properties accesible via template:
- Meiteashonraí
- Foilsitheoir (atá ag foilsiú)
- Pacáiste Foilsithe (pacáiste@1.0.0)
Meiteashonraí
Meiteashonraí pacáiste a bhfuil rochtain ag an teimpléad orthu
{
"_id": "@test/pkg1",
"name": "@test/pkg1",
"description": "",
"dist-tags": {
"beta": "1.0.54"
},
"versions": {
"1.0.54": {
"name": "@test/pkg1",
"version": "1.0.54",
"description": "some description",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": {
"name": "Author Name",
"email": "author@domain.com"
},
"license": "MIT",
"dependencies": {
"webpack": "4.12.0"
},
"readmeFilename": "README.md",
"_id": "@ test/pkg1@1.0.54",
"_npmVersion": "6.1.0",
"_nodeVersion": "9.9.0",
"_npmUser": {},
"dist": {
"integrity": "sha512-JlXWpLtMUBAqvVZBvH7UVLhXkGE1ctmXbDjbH/l0zMuG7wVzQ7GshTYvD/b5C+G2vOL2oiIS1RtayA/kKkTwKw==",
"shasum": "29c55c52c1e76e966e706165e5b9f22e32aa9f22",
"tarball": "http://localhost:4873/@test/pkg1/-/@test/pkg1-1.0.54.tgz"
}
}
},
"readme": "# test",
"_attachments": {
"@test/pkg1-1.0.54.tgz": {
"content_type": "application/octet-stream",
"data": "H4sIAAAAAAAAE+y9Z5PjyJIgOJ ...",
"length": 33112
}
},
"time": {}
}
Foilsitheoir
Is féidir leat rochtain a fháil ar fhaisnéis foilsitheora an phacáiste san ábhar
de chuaille gréasáin trí úsáid a bhaint as an réad foilsitheoir
.
Féach thíos an cineál oibiachta foilsitheoir
:
{
name: string,
groups: string[],
real_groups: string[]
}
Sampla:
notify:
method: POST
headers: [{'Content-Type': 'application/json'}]
endpoint: https://usagge.hipchat.com/v2/room/3729485/notification?auth_token=mySecretToken
content: '{"color":"green","message":"New package published: * {{ name }}*. Publisher name: * {{ publisher.name }} *.","notify":true,"message_format":"text"}'
Tabhair faoi deara: ní féidir faisnéis an fhoilsitheora a fháil má tá an t-airí foilsitheoir
ag an gcomhad package.json
cheana féin.
Pacáiste Foilsithe
Is féidir leat rochtain a fháil ar an bpacáiste atá á fhoilsiú leis an eochairfhocal {{publishedPackage}}
mar seo a leanas.
{{ publisher.name }} d'fhoilsigh{{ publishedPackage }}
Cumraíocht
Maoin | Cineál | Ag teastáil | Tacaíocht | Réamhshocrú | Cur síos |
---|---|---|---|---|---|
method | string | Níl | go léir | Briathar HTTP | |
packagePattern | string | Níl | go léir | Ná rith an fógra seo ach amháin má thagann ainm an phacáiste leis an slonn rialta | |
packagePatternFlags | string | Níl | go léir | Aon bhratacha a úsáidfear leis an slonn rialta | |
headers | array/object | Tá | go léir | Má tá ceanntásca sonracha ag teastáil ón gcríochphointe seo, socraigh anseo iad mar raon eochair: luach réad. | |
endpoint | string | Tá | go léir | socraigh críochphointe URL don ghlao seo | |
content | string | Tá | go léir | aon slonn Barra Láimhe |