@taskcluster/client-web 88.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,144 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+
3
+ import Client from '../Client';
4
+
5
+ export default class Notify extends Client {
6
+ constructor(options = {}) {
7
+ super({
8
+ serviceName: 'notify',
9
+ serviceVersion: 'v1',
10
+ exchangePrefix: '',
11
+ ...options,
12
+ });
13
+ this.ping.entry = {"args":[],"category":"Monitoring","method":"get","name":"ping","query":[],"route":"/ping","stability":"stable","type":"function"}; // eslint-disable-line
14
+ this.lbheartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"lbheartbeat","query":[],"route":"/__lbheartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
15
+ this.version.entry = {"args":[],"category":"Monitoring","method":"get","name":"version","query":[],"route":"/__version__","stability":"stable","type":"function"}; // eslint-disable-line
16
+ this.email.entry = {"args":[],"category":"Notifications","input":true,"method":"post","name":"email","query":[],"route":"/email","scopes":"notify:email:<address>","stability":"experimental","type":"function"}; // eslint-disable-line
17
+ this.pulse.entry = {"args":[],"category":"Notifications","input":true,"method":"post","name":"pulse","query":[],"route":"/pulse","scopes":"notify:pulse:<routingKey>","stability":"experimental","type":"function"}; // eslint-disable-line
18
+ this.matrix.entry = {"args":[],"category":"Notifications","input":true,"method":"post","name":"matrix","query":[],"route":"/matrix","scopes":"notify:matrix-room:<roomId>","stability":"experimental","type":"function"}; // eslint-disable-line
19
+ this.slack.entry = {"args":[],"category":"Notifications","input":true,"method":"post","name":"slack","query":[],"route":"/slack","scopes":"notify:slack-channel:<channelId>","stability":"experimental","type":"function"}; // eslint-disable-line
20
+ this.addDenylistAddress.entry = {"args":[],"category":"Denylist","input":true,"method":"post","name":"addDenylistAddress","query":[],"route":"/denylist/add","scopes":"notify:manage-denylist","stability":"experimental","type":"function"}; // eslint-disable-line
21
+ this.deleteDenylistAddress.entry = {"args":[],"category":"Denylist","input":true,"method":"delete","name":"deleteDenylistAddress","query":[],"route":"/denylist/delete","scopes":"notify:manage-denylist","stability":"experimental","type":"function"}; // eslint-disable-line
22
+ this.listDenylist.entry = {"args":[],"category":"Denylist","method":"get","name":"listDenylist","output":true,"query":["continuationToken","limit"],"route":"/denylist/list","scopes":"notify:manage-denylist","stability":"experimental","type":"function"}; // eslint-disable-line
23
+ this.heartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"heartbeat","query":[],"route":"/__heartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
24
+ }
25
+ /* eslint-disable max-len */
26
+ // Respond without doing anything.
27
+ // This endpoint is used to check that the service is up.
28
+ /* eslint-enable max-len */
29
+ ping(...args) {
30
+ this.validate(this.ping.entry, args);
31
+
32
+ return this.request(this.ping.entry, args);
33
+ }
34
+ /* eslint-disable max-len */
35
+ // Respond without doing anything.
36
+ // This endpoint is used to check that the service is up.
37
+ /* eslint-enable max-len */
38
+ lbheartbeat(...args) {
39
+ this.validate(this.lbheartbeat.entry, args);
40
+
41
+ return this.request(this.lbheartbeat.entry, args);
42
+ }
43
+ /* eslint-disable max-len */
44
+ // Respond with the JSON version object.
45
+ // https://github.com/mozilla-services/Dockerflow/blob/main/docs/version_object.md
46
+ /* eslint-enable max-len */
47
+ version(...args) {
48
+ this.validate(this.version.entry, args);
49
+
50
+ return this.request(this.version.entry, args);
51
+ }
52
+ /* eslint-disable max-len */
53
+ // Send an email to `address`. The content is markdown and will be rendered
54
+ // to HTML, but both the HTML and raw markdown text will be sent in the
55
+ // email. If a link is included, it will be rendered to a nice button in the
56
+ // HTML version of the email
57
+ // In case when duplicate message has been detected and no email was sent,
58
+ // this endpoint will return 204 status code.
59
+ /* eslint-enable max-len */
60
+ email(...args) {
61
+ this.validate(this.email.entry, args);
62
+
63
+ return this.request(this.email.entry, args);
64
+ }
65
+ /* eslint-disable max-len */
66
+ // Publish a message on pulse with the given `routingKey`.
67
+ // Endpoint will return 204 when duplicate message has been detected
68
+ /* eslint-enable max-len */
69
+ pulse(...args) {
70
+ this.validate(this.pulse.entry, args);
71
+
72
+ return this.request(this.pulse.entry, args);
73
+ }
74
+ /* eslint-disable max-len */
75
+ // Post a message to a room in Matrix. Optionally includes formatted message.
76
+ // The `roomId` in the scopes is a fully formed `roomId` with leading `!` such
77
+ // as `!foo:bar.com`.
78
+ // Note that the matrix client used by taskcluster must be invited to a room before
79
+ // it can post there!
80
+ // In case when duplicate message has been detected and no message was sent,
81
+ // this endpoint will return 204 status code.
82
+ /* eslint-enable max-len */
83
+ matrix(...args) {
84
+ this.validate(this.matrix.entry, args);
85
+
86
+ return this.request(this.matrix.entry, args);
87
+ }
88
+ /* eslint-disable max-len */
89
+ // Post a message to a Slack channel.
90
+ // The `channelId` in the scopes is a Slack channel ID, starting with a capital C.
91
+ // The Slack app can post into public channels by default but will need to be added
92
+ // to private channels before it can post messages there.
93
+ // In case when duplicate message has been detected and no message was sent,
94
+ // this endpoint will return 204 status code.
95
+ /* eslint-enable max-len */
96
+ slack(...args) {
97
+ this.validate(this.slack.entry, args);
98
+
99
+ return this.request(this.slack.entry, args);
100
+ }
101
+ /* eslint-disable max-len */
102
+ // Add the given address to the notification denylist. Addresses in the denylist will be ignored
103
+ // by the notification service.
104
+ /* eslint-enable max-len */
105
+ addDenylistAddress(...args) {
106
+ this.validate(this.addDenylistAddress.entry, args);
107
+
108
+ return this.request(this.addDenylistAddress.entry, args);
109
+ }
110
+ /* eslint-disable max-len */
111
+ // Delete the specified address from the notification denylist.
112
+ /* eslint-enable max-len */
113
+ deleteDenylistAddress(...args) {
114
+ this.validate(this.deleteDenylistAddress.entry, args);
115
+
116
+ return this.request(this.deleteDenylistAddress.entry, args);
117
+ }
118
+ /* eslint-disable max-len */
119
+ // Lists all the denylisted addresses.
120
+ // By default this end-point will try to return up to 1000 addresses in one
121
+ // request. But it **may return less**, even if more tasks are available.
122
+ // It may also return a `continuationToken` even though there are no more
123
+ // results. However, you can only be sure to have seen all results if you
124
+ // keep calling `list` with the last `continuationToken` until you
125
+ // get a result without a `continuationToken`.
126
+ // If you are not interested in listing all the members at once, you may
127
+ // use the query-string option `limit` to return fewer.
128
+ /* eslint-enable max-len */
129
+ listDenylist(...args) {
130
+ this.validate(this.listDenylist.entry, args);
131
+
132
+ return this.request(this.listDenylist.entry, args);
133
+ }
134
+ /* eslint-disable max-len */
135
+ // Respond with a service heartbeat.
136
+ // This endpoint is used to check on backing services this service
137
+ // depends on.
138
+ /* eslint-enable max-len */
139
+ heartbeat(...args) {
140
+ this.validate(this.heartbeat.entry, args);
141
+
142
+ return this.request(this.heartbeat.entry, args);
143
+ }
144
+ }
@@ -0,0 +1,27 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+
3
+ import Client from '../Client';
4
+
5
+ export default class NotifyEvents extends Client {
6
+ constructor(options = {}) {
7
+ super({
8
+ serviceName: 'notify',
9
+ serviceVersion: 'v1',
10
+ exchangePrefix: 'exchange/taskcluster-notify/v1/',
11
+ ...options,
12
+ });
13
+ }
14
+ /* eslint-disable max-len */
15
+ // An arbitrary message that a taskcluster user
16
+ // can trigger if they like.
17
+ // The standard one that is published by us watching
18
+ // for the completion of tasks is just the task status
19
+ // data that we pull from the queue `status()` endpoint
20
+ // when we notice a task is complete.
21
+ /* eslint-enable max-len */
22
+ notify(pattern) {
23
+ const entry = {"exchange":"notification","name":"notify","routingKey":[{"constant":"primary","multipleWords":false,"name":"routingKeyKind","required":true},{"multipleWords":true,"name":"topic","required":true}],"schema":"v1/notification-message.json#","type":"topic-exchange"}; // eslint-disable-line
24
+
25
+ return this.normalizePattern(entry, pattern);
26
+ }
27
+ }
@@ -0,0 +1,135 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+
3
+ import Client from '../Client';
4
+
5
+ export default class Object extends Client {
6
+ constructor(options = {}) {
7
+ super({
8
+ serviceName: 'object',
9
+ serviceVersion: 'v1',
10
+ exchangePrefix: '',
11
+ ...options,
12
+ });
13
+ this.ping.entry = {"args":[],"category":"Monitoring","method":"get","name":"ping","query":[],"route":"/ping","stability":"stable","type":"function"}; // eslint-disable-line
14
+ this.lbheartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"lbheartbeat","query":[],"route":"/__lbheartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
15
+ this.version.entry = {"args":[],"category":"Monitoring","method":"get","name":"version","query":[],"route":"/__version__","stability":"stable","type":"function"}; // eslint-disable-line
16
+ this.createUpload.entry = {"args":["name"],"category":"Upload","input":true,"method":"put","name":"createUpload","output":true,"query":[],"route":"/upload/<name>","scopes":"object:upload:<projectId>:<name>","stability":"stable","type":"function"}; // eslint-disable-line
17
+ this.finishUpload.entry = {"args":["name"],"category":"Upload","input":true,"method":"post","name":"finishUpload","query":[],"route":"/finish-upload/<name>","scopes":"object:upload:<projectId>:<name>","stability":"stable","type":"function"}; // eslint-disable-line
18
+ this.startDownload.entry = {"args":["name"],"category":"Download","input":true,"method":"put","name":"startDownload","output":true,"query":[],"route":"/start-download/<name>","scopes":"object:download:<name>","stability":"stable","type":"function"}; // eslint-disable-line
19
+ this.object.entry = {"args":["name"],"category":"Objects","method":"get","name":"object","output":true,"query":[],"route":"/metadata/<name>","scopes":"object:download:<name>","stability":"stable","type":"function"}; // eslint-disable-line
20
+ this.download.entry = {"args":["name"],"category":"Download","method":"get","name":"download","query":[],"route":"/download/<name>","scopes":"object:download:<name>","stability":"stable","type":"function"}; // eslint-disable-line
21
+ this.heartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"heartbeat","query":[],"route":"/__heartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
22
+ }
23
+ /* eslint-disable max-len */
24
+ // Respond without doing anything.
25
+ // This endpoint is used to check that the service is up.
26
+ /* eslint-enable max-len */
27
+ ping(...args) {
28
+ this.validate(this.ping.entry, args);
29
+
30
+ return this.request(this.ping.entry, args);
31
+ }
32
+ /* eslint-disable max-len */
33
+ // Respond without doing anything.
34
+ // This endpoint is used to check that the service is up.
35
+ /* eslint-enable max-len */
36
+ lbheartbeat(...args) {
37
+ this.validate(this.lbheartbeat.entry, args);
38
+
39
+ return this.request(this.lbheartbeat.entry, args);
40
+ }
41
+ /* eslint-disable max-len */
42
+ // Respond with the JSON version object.
43
+ // https://github.com/mozilla-services/Dockerflow/blob/main/docs/version_object.md
44
+ /* eslint-enable max-len */
45
+ version(...args) {
46
+ this.validate(this.version.entry, args);
47
+
48
+ return this.request(this.version.entry, args);
49
+ }
50
+ /* eslint-disable max-len */
51
+ // Create a new object by initiating upload of its data.
52
+ // This endpoint implements negotiation of upload methods. It can be called
53
+ // multiple times if necessary, either to propose new upload methods or to
54
+ // renew credentials for an already-agreed upload.
55
+ // The `name` parameter can contain any printable ASCII character (0x20 - 0x7e).
56
+ // The `uploadId` must be supplied by the caller, and any attempts to upload
57
+ // an object with the same name but a different `uploadId` will fail.
58
+ // Thus the first call to this method establishes the `uploadId` for the
59
+ // object, and as long as that value is kept secret, no other caller can
60
+ // upload an object of that name, regardless of scopes. Object expiration
61
+ // cannot be changed after the initial call, either. It is possible to call
62
+ // this method with no proposed upload methods, which has the effect of "locking
63
+ // in" the `expiration`, `projectId`, and `uploadId` properties and any
64
+ // supplied hashes.
65
+ // Unfinished uploads expire after 1 day.
66
+ /* eslint-enable max-len */
67
+ createUpload(...args) {
68
+ this.validate(this.createUpload.entry, args);
69
+
70
+ return this.request(this.createUpload.entry, args);
71
+ }
72
+ /* eslint-disable max-len */
73
+ // This endpoint marks an upload as complete. This indicates that all data has been
74
+ // transmitted to the backend. After this call, no further calls to `uploadObject` are
75
+ // allowed, and downloads of the object may begin. This method is idempotent, but will
76
+ // fail if given an incorrect uploadId for an unfinished upload.
77
+ // It is possible to finish an upload with no hashes specified via either
78
+ // `startUpload` or `finishUpload`. However, many clients will refuse to
79
+ // download an object with no hashes. The utility methods included with the
80
+ // client libraries always include hashes as of version 44.0.0.
81
+ // Note that, once `finishUpload` is complete, the object is considered immutable.
82
+ /* eslint-enable max-len */
83
+ finishUpload(...args) {
84
+ this.validate(this.finishUpload.entry, args);
85
+
86
+ return this.request(this.finishUpload.entry, args);
87
+ }
88
+ /* eslint-disable max-len */
89
+ // Start the process of downloading an object's data. Call this endpoint with a list of acceptable
90
+ // download methods, and the server will select a method and return the corresponding payload.
91
+ // Returns a 406 error if none of the given download methods are available.
92
+ // See [Download Methods](https://docs.taskcluster.net/docs/reference/platform/object/download-methods) for more detail.
93
+ /* eslint-enable max-len */
94
+ startDownload(...args) {
95
+ this.validate(this.startDownload.entry, args);
96
+
97
+ return this.request(this.startDownload.entry, args);
98
+ }
99
+ /* eslint-disable max-len */
100
+ // Get the metadata for the named object. This metadata is not sufficient to
101
+ // get the object's content; for that use `startDownload`.
102
+ /* eslint-enable max-len */
103
+ object(...args) {
104
+ this.validate(this.object.entry, args);
105
+
106
+ return this.request(this.object.entry, args);
107
+ }
108
+ /* eslint-disable max-len */
109
+ // Get the data in an object directly. This method does not return a JSON body, but
110
+ // redirects to a location that will serve the object content directly.
111
+ // URLs for this endpoint, perhaps with attached authentication (`?bewit=..`),
112
+ // are typically used for downloads of objects by simple HTTP clients such as
113
+ // web browsers, curl, or wget.
114
+ // This method is limited by the common capabilities of HTTP, so it may not be
115
+ // the most efficient, resilient, or featureful way to retrieve an artifact.
116
+ // Situations where such functionality is required should ues the
117
+ // `startDownload` API endpoint.
118
+ // See [Simple Downloads](https://docs.taskcluster.net/docs/reference/platform/object/simple-downloads) for more detail.
119
+ /* eslint-enable max-len */
120
+ download(...args) {
121
+ this.validate(this.download.entry, args);
122
+
123
+ return this.request(this.download.entry, args);
124
+ }
125
+ /* eslint-disable max-len */
126
+ // Respond with a service heartbeat.
127
+ // This endpoint is used to check on backing services this service
128
+ // depends on.
129
+ /* eslint-enable max-len */
130
+ heartbeat(...args) {
131
+ this.validate(this.heartbeat.entry, args);
132
+
133
+ return this.request(this.heartbeat.entry, args);
134
+ }
135
+ }
@@ -0,0 +1,92 @@
1
+ // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
+
3
+ import Client from '../Client';
4
+
5
+ export default class PurgeCache extends Client {
6
+ constructor(options = {}) {
7
+ super({
8
+ serviceName: 'purge-cache',
9
+ serviceVersion: 'v1',
10
+ exchangePrefix: '',
11
+ ...options,
12
+ });
13
+ this.ping.entry = {"args":[],"category":"Monitoring","method":"get","name":"ping","query":[],"route":"/ping","stability":"stable","type":"function"}; // eslint-disable-line
14
+ this.lbheartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"lbheartbeat","query":[],"route":"/__lbheartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
15
+ this.version.entry = {"args":[],"category":"Monitoring","method":"get","name":"version","query":[],"route":"/__version__","stability":"stable","type":"function"}; // eslint-disable-line
16
+ this.purgeCache.entry = {"args":["workerPoolId"],"category":"Purge-Cache Service","input":true,"method":"post","name":"purgeCache","query":[],"route":"/purge-cache/<workerPoolId>","scopes":"purge-cache:<workerPoolId>:<cacheName>","stability":"stable","type":"function"}; // eslint-disable-line
17
+ this.allPurgeRequests.entry = {"args":[],"category":"Purge-Cache Service","method":"get","name":"allPurgeRequests","output":true,"query":["continuationToken","limit"],"route":"/purge-cache/list","scopes":"purge-cache:all-purge-requests","stability":"stable","type":"function"}; // eslint-disable-line
18
+ this.purgeRequests.entry = {"args":["workerPoolId"],"category":"Purge-Cache Service","method":"get","name":"purgeRequests","output":true,"query":["since"],"route":"/purge-cache/<workerPoolId>","scopes":"purge-cache:purge-requests::<workerPoolId>","stability":"stable","type":"function"}; // eslint-disable-line
19
+ this.heartbeat.entry = {"args":[],"category":"Monitoring","method":"get","name":"heartbeat","query":[],"route":"/__heartbeat__","stability":"stable","type":"function"}; // eslint-disable-line
20
+ }
21
+ /* eslint-disable max-len */
22
+ // Respond without doing anything.
23
+ // This endpoint is used to check that the service is up.
24
+ /* eslint-enable max-len */
25
+ ping(...args) {
26
+ this.validate(this.ping.entry, args);
27
+
28
+ return this.request(this.ping.entry, args);
29
+ }
30
+ /* eslint-disable max-len */
31
+ // Respond without doing anything.
32
+ // This endpoint is used to check that the service is up.
33
+ /* eslint-enable max-len */
34
+ lbheartbeat(...args) {
35
+ this.validate(this.lbheartbeat.entry, args);
36
+
37
+ return this.request(this.lbheartbeat.entry, args);
38
+ }
39
+ /* eslint-disable max-len */
40
+ // Respond with the JSON version object.
41
+ // https://github.com/mozilla-services/Dockerflow/blob/main/docs/version_object.md
42
+ /* eslint-enable max-len */
43
+ version(...args) {
44
+ this.validate(this.version.entry, args);
45
+
46
+ return this.request(this.version.entry, args);
47
+ }
48
+ /* eslint-disable max-len */
49
+ // Publish a request to purge caches named `cacheName` with
50
+ // on `workerPoolId` workers.
51
+ // If such a request already exists, its `before` timestamp is updated to
52
+ // the current time.
53
+ /* eslint-enable max-len */
54
+ purgeCache(...args) {
55
+ this.validate(this.purgeCache.entry, args);
56
+
57
+ return this.request(this.purgeCache.entry, args);
58
+ }
59
+ /* eslint-disable max-len */
60
+ // View all active purge requests.
61
+ // This is useful mostly for administors to view
62
+ // the set of open purge requests. It should not
63
+ // be used by workers. They should use the purgeRequests
64
+ // endpoint that is specific to their workerType and
65
+ // provisionerId.
66
+ /* eslint-enable max-len */
67
+ allPurgeRequests(...args) {
68
+ this.validate(this.allPurgeRequests.entry, args);
69
+
70
+ return this.request(this.allPurgeRequests.entry, args);
71
+ }
72
+ /* eslint-disable max-len */
73
+ // List the caches for this `workerPoolId` that should to be
74
+ // purged if they are from before the time given in the response.
75
+ // This is intended to be used by workers to determine which caches to purge.
76
+ /* eslint-enable max-len */
77
+ purgeRequests(...args) {
78
+ this.validate(this.purgeRequests.entry, args);
79
+
80
+ return this.request(this.purgeRequests.entry, args);
81
+ }
82
+ /* eslint-disable max-len */
83
+ // Respond with a service heartbeat.
84
+ // This endpoint is used to check on backing services this service
85
+ // depends on.
86
+ /* eslint-enable max-len */
87
+ heartbeat(...args) {
88
+ this.validate(this.heartbeat.entry, args);
89
+
90
+ return this.request(this.heartbeat.entry, args);
91
+ }
92
+ }