@owbase/node 2.1.0 → 2.2.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.
- package/dist/client.js +2 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +2 -2
- package/dist/client.mjs.map +1 -1
- package/dist/models.d.mts +8 -0
- package/dist/models.d.ts +8 -0
- package/dist/services/sites.d.mts +4 -4
- package/dist/services/sites.d.ts +4 -4
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/webhooks.d.mts +14 -2
- package/dist/services/webhooks.d.ts +14 -2
- package/dist/services/webhooks.js +22 -2
- package/dist/services/webhooks.js.map +1 -1
- package/dist/services/webhooks.mjs +22 -2
- package/dist/services/webhooks.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -67,6 +67,8 @@ declare class Webhooks {
|
|
|
67
67
|
* @param {string} params.authPassword - Webhook HTTP password. Max length: 2048 chars.
|
|
68
68
|
* @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
69
69
|
* @param {string} params.description - Optional description for the webhook.
|
|
70
|
+
* @param {object} params.headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {"Authorization":"Bearer token"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.
|
|
71
|
+
* @param {string} params.bodyTemplate - Optional body template. Empty sends the event JSON. Otherwise the template is sent after each {{variable}} becomes its JSON value. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.
|
|
70
72
|
* @throws {OwbaseException}
|
|
71
73
|
* @returns {Promise<Models.Webhook>}
|
|
72
74
|
*/
|
|
@@ -81,6 +83,8 @@ declare class Webhooks {
|
|
|
81
83
|
authPassword?: string;
|
|
82
84
|
secret?: string;
|
|
83
85
|
description?: string;
|
|
86
|
+
headers?: object;
|
|
87
|
+
bodyTemplate?: string;
|
|
84
88
|
}): Promise<Models.Webhook>;
|
|
85
89
|
/**
|
|
86
90
|
* Create a new webhook. Use this endpoint to configure a URL that will receive events from Owbase when specific events occur.
|
|
@@ -95,11 +99,13 @@ declare class Webhooks {
|
|
|
95
99
|
* @param {string} authPassword - Webhook HTTP password. Max length: 2048 chars.
|
|
96
100
|
* @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
97
101
|
* @param {string} description - Optional description for the webhook.
|
|
102
|
+
* @param {object} headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {"Authorization":"Bearer token"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.
|
|
103
|
+
* @param {string} bodyTemplate - Optional body template. Empty sends the event JSON. Otherwise the template is sent after each {{variable}} becomes its JSON value. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.
|
|
98
104
|
* @throws {OwbaseException}
|
|
99
105
|
* @returns {Promise<Models.Webhook>}
|
|
100
106
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
101
107
|
*/
|
|
102
|
-
create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string, description?: string): Promise<Models.Webhook>;
|
|
108
|
+
create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string, description?: string, headers?: object, bodyTemplate?: string): Promise<Models.Webhook>;
|
|
103
109
|
/**
|
|
104
110
|
* Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.
|
|
105
111
|
*
|
|
@@ -131,6 +137,8 @@ declare class Webhooks {
|
|
|
131
137
|
* @param {string} params.authUsername - Webhook HTTP user. Max length: 255 chars.
|
|
132
138
|
* @param {string} params.authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled.
|
|
133
139
|
* @param {string} params.description - Optional description for the webhook.
|
|
140
|
+
* @param {object} params.headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {"Authorization":"Bearer token"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.
|
|
141
|
+
* @param {string} params.bodyTemplate - Optional body template. Omit to keep the current one, send an empty text to go back to the event JSON. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.
|
|
134
142
|
* @throws {OwbaseException}
|
|
135
143
|
* @returns {Promise<Models.Webhook>}
|
|
136
144
|
*/
|
|
@@ -144,6 +152,8 @@ declare class Webhooks {
|
|
|
144
152
|
authUsername?: string;
|
|
145
153
|
authPassword?: string;
|
|
146
154
|
description?: string;
|
|
155
|
+
headers?: object;
|
|
156
|
+
bodyTemplate?: string;
|
|
147
157
|
}): Promise<Models.Webhook>;
|
|
148
158
|
/**
|
|
149
159
|
* Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.
|
|
@@ -157,11 +167,13 @@ declare class Webhooks {
|
|
|
157
167
|
* @param {string} authUsername - Webhook HTTP user. Max length: 255 chars.
|
|
158
168
|
* @param {string} authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled.
|
|
159
169
|
* @param {string} description - Optional description for the webhook.
|
|
170
|
+
* @param {object} headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {"Authorization":"Bearer token"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.
|
|
171
|
+
* @param {string} bodyTemplate - Optional body template. Omit to keep the current one, send an empty text to go back to the event JSON. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.
|
|
160
172
|
* @throws {OwbaseException}
|
|
161
173
|
* @returns {Promise<Models.Webhook>}
|
|
162
174
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
163
175
|
*/
|
|
164
|
-
update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, description?: string): Promise<Models.Webhook>;
|
|
176
|
+
update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, description?: string, headers?: object, bodyTemplate?: string): Promise<Models.Webhook>;
|
|
165
177
|
/**
|
|
166
178
|
* Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.
|
|
167
179
|
*
|
|
@@ -67,6 +67,8 @@ declare class Webhooks {
|
|
|
67
67
|
* @param {string} params.authPassword - Webhook HTTP password. Max length: 2048 chars.
|
|
68
68
|
* @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
69
69
|
* @param {string} params.description - Optional description for the webhook.
|
|
70
|
+
* @param {object} params.headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {"Authorization":"Bearer token"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.
|
|
71
|
+
* @param {string} params.bodyTemplate - Optional body template. Empty sends the event JSON. Otherwise the template is sent after each {{variable}} becomes its JSON value. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.
|
|
70
72
|
* @throws {OwbaseException}
|
|
71
73
|
* @returns {Promise<Models.Webhook>}
|
|
72
74
|
*/
|
|
@@ -81,6 +83,8 @@ declare class Webhooks {
|
|
|
81
83
|
authPassword?: string;
|
|
82
84
|
secret?: string;
|
|
83
85
|
description?: string;
|
|
86
|
+
headers?: object;
|
|
87
|
+
bodyTemplate?: string;
|
|
84
88
|
}): Promise<Models.Webhook>;
|
|
85
89
|
/**
|
|
86
90
|
* Create a new webhook. Use this endpoint to configure a URL that will receive events from Owbase when specific events occur.
|
|
@@ -95,11 +99,13 @@ declare class Webhooks {
|
|
|
95
99
|
* @param {string} authPassword - Webhook HTTP password. Max length: 2048 chars.
|
|
96
100
|
* @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.
|
|
97
101
|
* @param {string} description - Optional description for the webhook.
|
|
102
|
+
* @param {object} headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {"Authorization":"Bearer token"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.
|
|
103
|
+
* @param {string} bodyTemplate - Optional body template. Empty sends the event JSON. Otherwise the template is sent after each {{variable}} becomes its JSON value. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.
|
|
98
104
|
* @throws {OwbaseException}
|
|
99
105
|
* @returns {Promise<Models.Webhook>}
|
|
100
106
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
101
107
|
*/
|
|
102
|
-
create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string, description?: string): Promise<Models.Webhook>;
|
|
108
|
+
create(webhookId: string, url: string, name: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, secret?: string, description?: string, headers?: object, bodyTemplate?: string): Promise<Models.Webhook>;
|
|
103
109
|
/**
|
|
104
110
|
* Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.
|
|
105
111
|
*
|
|
@@ -131,6 +137,8 @@ declare class Webhooks {
|
|
|
131
137
|
* @param {string} params.authUsername - Webhook HTTP user. Max length: 255 chars.
|
|
132
138
|
* @param {string} params.authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled.
|
|
133
139
|
* @param {string} params.description - Optional description for the webhook.
|
|
140
|
+
* @param {object} params.headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {"Authorization":"Bearer token"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.
|
|
141
|
+
* @param {string} params.bodyTemplate - Optional body template. Omit to keep the current one, send an empty text to go back to the event JSON. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.
|
|
134
142
|
* @throws {OwbaseException}
|
|
135
143
|
* @returns {Promise<Models.Webhook>}
|
|
136
144
|
*/
|
|
@@ -144,6 +152,8 @@ declare class Webhooks {
|
|
|
144
152
|
authUsername?: string;
|
|
145
153
|
authPassword?: string;
|
|
146
154
|
description?: string;
|
|
155
|
+
headers?: object;
|
|
156
|
+
bodyTemplate?: string;
|
|
147
157
|
}): Promise<Models.Webhook>;
|
|
148
158
|
/**
|
|
149
159
|
* Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.
|
|
@@ -157,11 +167,13 @@ declare class Webhooks {
|
|
|
157
167
|
* @param {string} authUsername - Webhook HTTP user. Max length: 255 chars.
|
|
158
168
|
* @param {string} authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled.
|
|
159
169
|
* @param {string} description - Optional description for the webhook.
|
|
170
|
+
* @param {object} headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {"Authorization":"Bearer token"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.
|
|
171
|
+
* @param {string} bodyTemplate - Optional body template. Omit to keep the current one, send an empty text to go back to the event JSON. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.
|
|
160
172
|
* @throws {OwbaseException}
|
|
161
173
|
* @returns {Promise<Models.Webhook>}
|
|
162
174
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
163
175
|
*/
|
|
164
|
-
update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, description?: string): Promise<Models.Webhook>;
|
|
176
|
+
update(webhookId: string, name: string, url: string, events: string[], enabled?: boolean, tls?: boolean, authUsername?: string, authPassword?: string, description?: string, headers?: object, bodyTemplate?: string): Promise<Models.Webhook>;
|
|
165
177
|
/**
|
|
166
178
|
* Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.
|
|
167
179
|
*
|
|
@@ -48,7 +48,9 @@ class Webhooks {
|
|
|
48
48
|
authUsername: rest[5],
|
|
49
49
|
authPassword: rest[6],
|
|
50
50
|
secret: rest[7],
|
|
51
|
-
description: rest[8]
|
|
51
|
+
description: rest[8],
|
|
52
|
+
headers: rest[9],
|
|
53
|
+
bodyTemplate: rest[10]
|
|
52
54
|
};
|
|
53
55
|
}
|
|
54
56
|
const webhookId = params.webhookId;
|
|
@@ -61,6 +63,8 @@ class Webhooks {
|
|
|
61
63
|
const authPassword = params.authPassword;
|
|
62
64
|
const secret = params.secret;
|
|
63
65
|
const description = params.description;
|
|
66
|
+
const headers = params.headers;
|
|
67
|
+
const bodyTemplate = params.bodyTemplate;
|
|
64
68
|
if (typeof webhookId === "undefined") {
|
|
65
69
|
throw new client.OwbaseException(
|
|
66
70
|
'Missing required parameter: "webhookId"'
|
|
@@ -107,6 +111,12 @@ class Webhooks {
|
|
|
107
111
|
if (typeof description !== "undefined") {
|
|
108
112
|
apiPayload["description"] = description;
|
|
109
113
|
}
|
|
114
|
+
if (typeof headers !== "undefined") {
|
|
115
|
+
apiPayload["headers"] = headers;
|
|
116
|
+
}
|
|
117
|
+
if (typeof bodyTemplate !== "undefined") {
|
|
118
|
+
apiPayload["bodyTemplate"] = bodyTemplate;
|
|
119
|
+
}
|
|
110
120
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
111
121
|
const apiHeaders = {
|
|
112
122
|
"X-Owbase-Project": this.client.config.project,
|
|
@@ -156,7 +166,9 @@ class Webhooks {
|
|
|
156
166
|
tls: rest[4],
|
|
157
167
|
authUsername: rest[5],
|
|
158
168
|
authPassword: rest[6],
|
|
159
|
-
description: rest[7]
|
|
169
|
+
description: rest[7],
|
|
170
|
+
headers: rest[8],
|
|
171
|
+
bodyTemplate: rest[9]
|
|
160
172
|
};
|
|
161
173
|
}
|
|
162
174
|
const webhookId = params.webhookId;
|
|
@@ -168,6 +180,8 @@ class Webhooks {
|
|
|
168
180
|
const authUsername = params.authUsername;
|
|
169
181
|
const authPassword = params.authPassword;
|
|
170
182
|
const description = params.description;
|
|
183
|
+
const headers = params.headers;
|
|
184
|
+
const bodyTemplate = params.bodyTemplate;
|
|
171
185
|
if (typeof webhookId === "undefined" || webhookId === "") {
|
|
172
186
|
throw new client.OwbaseException(
|
|
173
187
|
'Missing required parameter: "webhookId"'
|
|
@@ -211,6 +225,12 @@ class Webhooks {
|
|
|
211
225
|
if (typeof description !== "undefined") {
|
|
212
226
|
apiPayload["description"] = description;
|
|
213
227
|
}
|
|
228
|
+
if (typeof headers !== "undefined") {
|
|
229
|
+
apiPayload["headers"] = headers;
|
|
230
|
+
}
|
|
231
|
+
if (typeof bodyTemplate !== "undefined") {
|
|
232
|
+
apiPayload["bodyTemplate"] = bodyTemplate;
|
|
233
|
+
}
|
|
214
234
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
215
235
|
const apiHeaders = {
|
|
216
236
|
"X-Owbase-Project": this.client.config.project,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/services/webhooks.ts"],"names":["OwbaseException"],"mappings":";;;;AAGO,MAAM,QAAA,CAAS;AAAA,EAGlB,YAAY,MAAA,EAAgB;AACxB,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AAAA,EAClB;AAAA,EAwBA,IAAA,CACI,kBACG,IAAA,EACwB;AAC3B,IAAA,IAAI,MAAA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cAAA,EAAgB,kBAAA;AAAA,MAChB,MAAA,EAAQ;AAAA,KACZ;AAEA,IAAA,OAAO,KAAK,MAAA,CAAO,IAAA,CAAK,OAAA,EAAS,GAAA,EAAK,YAAY,UAAU,CAAA;AAAA,EAChE;AACJ","file":"webhooks.js","sourcesContent":["import { OwbaseException, Client, type Payload } from '../client';\nimport type { Models } from '../models';\n\nexport class Webhooks {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Get a list of all webhooks belonging to the project. You can use the query params to filter your results.\n *\n * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://docs.owbase.dev/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, authUsername, tls, events, enabled, logs, attempts\n * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {OwbaseException}\n * @returns {Promise<Models.WebhookList>}\n */\n list(params?: {\n queries?: string[];\n total?: boolean;\n }): Promise<Models.WebhookList>;\n /**\n * Get a list of all webhooks belonging to the project. You can use the query params to filter your results.\n *\n * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://docs.owbase.dev/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, authUsername, tls, events, enabled, logs, attempts\n * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {OwbaseException}\n * @returns {Promise<Models.WebhookList>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n list(queries?: string[], total?: boolean): Promise<Models.WebhookList>;\n list(\n paramsOrFirst?: { queries?: string[]; total?: boolean } | string[],\n ...rest: [boolean?]\n ): Promise<Models.WebhookList> {\n let params: { queries?: string[]; total?: boolean };\n\n if (\n (typeof paramsOrFirst === 'undefined' && rest.length === 0) ||\n (paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst))\n ) {\n params = (paramsOrFirst || {}) as {\n queries?: string[];\n total?: boolean;\n };\n } else {\n params = {\n queries: paramsOrFirst as string[],\n total: rest[0] as boolean,\n };\n }\n\n const queries = params.queries;\n const total = params.total;\n const apiPath = '/webhooks';\n const apiPayload: Payload = {};\n if (typeof queries !== 'undefined') {\n apiPayload['queries'] = queries;\n }\n if (typeof total !== 'undefined') {\n apiPayload['total'] = total;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n accept: 'application/json',\n };\n\n return this.client.call('get', uri, apiHeaders, apiPayload);\n }\n\n /**\n * Create a new webhook. Use this endpoint to configure a URL that will receive events from Owbase when specific events occur.\n *\n * @param {string} params.webhookId - Webhook ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.\n * @param {string} params.url - Webhook URL.\n * @param {string} params.name - Webhook name. Max length: 128 chars.\n * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} params.enabled - Enable or disable a webhook.\n * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} params.authUsername - Webhook HTTP user. Max length: 255 chars.\n * @param {string} params.authPassword - Webhook HTTP password. Max length: 2048 chars.\n * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @param {string} params.description - Optional description for the webhook.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n */\n create(params: {\n webhookId: string;\n url: string;\n name: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n secret?: string;\n description?: string;\n }): Promise<Models.Webhook>;\n /**\n * Create a new webhook. Use this endpoint to configure a URL that will receive events from Owbase when specific events occur.\n *\n * @param {string} webhookId - Webhook ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.\n * @param {string} url - Webhook URL.\n * @param {string} name - Webhook name. Max length: 128 chars.\n * @param {string[]} events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} enabled - Enable or disable a webhook.\n * @param {boolean} tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} authUsername - Webhook HTTP user. Max length: 255 chars.\n * @param {string} authPassword - Webhook HTTP password. Max length: 2048 chars.\n * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @param {string} description - Optional description for the webhook.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n create(\n webhookId: string,\n url: string,\n name: string,\n events: string[],\n enabled?: boolean,\n tls?: boolean,\n authUsername?: string,\n authPassword?: string,\n secret?: string,\n description?: string,\n ): Promise<Models.Webhook>;\n create(\n paramsOrFirst:\n | {\n webhookId: string;\n url: string;\n name: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n secret?: string;\n description?: string;\n }\n | string,\n ...rest: [\n string?,\n string?,\n string[]?,\n boolean?,\n boolean?,\n string?,\n string?,\n string?,\n string?,\n ]\n ): Promise<Models.Webhook> {\n let params: {\n webhookId: string;\n url: string;\n name: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n secret?: string;\n description?: string;\n };\n\n if (\n paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst)\n ) {\n params = (paramsOrFirst || {}) as {\n webhookId: string;\n url: string;\n name: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n secret?: string;\n description?: string;\n };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n url: rest[0] as string,\n name: rest[1] as string,\n events: rest[2] as string[],\n enabled: rest[3] as boolean,\n tls: rest[4] as boolean,\n authUsername: rest[5] as string,\n authPassword: rest[6] as string,\n secret: rest[7] as string,\n description: rest[8] as string,\n };\n }\n\n const webhookId = params.webhookId;\n const url = params.url;\n const name = params.name;\n const events = params.events;\n const enabled = params.enabled;\n const tls = params.tls;\n const authUsername = params.authUsername;\n const authPassword = params.authPassword;\n const secret = params.secret;\n const description = params.description;\n if (typeof webhookId === 'undefined') {\n throw new OwbaseException(\n 'Missing required parameter: \"webhookId\"',\n );\n }\n if (typeof url === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"url\"');\n }\n if (typeof name === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"name\"');\n }\n if (typeof events === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"events\"');\n }\n const apiPath = '/webhooks';\n const apiPayload: Payload = {};\n if (typeof webhookId !== 'undefined') {\n apiPayload['webhookId'] = webhookId;\n }\n if (typeof url !== 'undefined') {\n apiPayload['url'] = url;\n }\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof events !== 'undefined') {\n apiPayload['events'] = events;\n }\n if (typeof enabled !== 'undefined') {\n apiPayload['enabled'] = enabled;\n }\n if (typeof tls !== 'undefined') {\n apiPayload['tls'] = tls;\n }\n if (typeof authUsername !== 'undefined') {\n apiPayload['authUsername'] = authUsername;\n }\n if (typeof authPassword !== 'undefined') {\n apiPayload['authPassword'] = authPassword;\n }\n if (typeof secret !== 'undefined') {\n apiPayload['secret'] = secret;\n }\n if (typeof description !== 'undefined') {\n apiPayload['description'] = description;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n 'content-type': 'application/json',\n accept: 'application/json',\n };\n\n return this.client.call('post', uri, apiHeaders, apiPayload);\n }\n\n /**\n * Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n */\n get(params: { webhookId: string }): Promise<Models.Webhook>;\n /**\n * Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.\n *\n * @param {string} webhookId - Webhook ID.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n get(webhookId: string): Promise<Models.Webhook>;\n get(\n paramsOrFirst: { webhookId: string } | string,\n ): Promise<Models.Webhook> {\n let params: { webhookId: string };\n\n if (\n paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst)\n ) {\n params = (paramsOrFirst || {}) as { webhookId: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n };\n }\n\n const webhookId = params.webhookId;\n if (typeof webhookId === 'undefined' || webhookId === '') {\n throw new OwbaseException(\n 'Missing required parameter: \"webhookId\"',\n );\n }\n const apiPath = '/webhooks/{webhookId}'.replace(\n '{webhookId}',\n encodeURIComponent(String(webhookId)),\n );\n const apiPayload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n accept: 'application/json',\n };\n\n return this.client.call('get', uri, apiHeaders, apiPayload);\n }\n\n /**\n * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @param {string} params.name - Webhook name. Max length: 128 chars.\n * @param {string} params.url - Webhook URL.\n * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} params.enabled - Enable or disable a webhook.\n * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} params.authUsername - Webhook HTTP user. Max length: 255 chars.\n * @param {string} params.authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled.\n * @param {string} params.description - Optional description for the webhook.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n */\n update(params: {\n webhookId: string;\n name: string;\n url: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n description?: string;\n }): Promise<Models.Webhook>;\n /**\n * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.\n *\n * @param {string} webhookId - Webhook ID.\n * @param {string} name - Webhook name. Max length: 128 chars.\n * @param {string} url - Webhook URL.\n * @param {string[]} events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} enabled - Enable or disable a webhook.\n * @param {boolean} tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} authUsername - Webhook HTTP user. Max length: 255 chars.\n * @param {string} authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled.\n * @param {string} description - Optional description for the webhook.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n update(\n webhookId: string,\n name: string,\n url: string,\n events: string[],\n enabled?: boolean,\n tls?: boolean,\n authUsername?: string,\n authPassword?: string,\n description?: string,\n ): Promise<Models.Webhook>;\n update(\n paramsOrFirst:\n | {\n webhookId: string;\n name: string;\n url: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n description?: string;\n }\n | string,\n ...rest: [\n string?,\n string?,\n string[]?,\n boolean?,\n boolean?,\n string?,\n string?,\n string?,\n ]\n ): Promise<Models.Webhook> {\n let params: {\n webhookId: string;\n name: string;\n url: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n description?: string;\n };\n\n if (\n paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst)\n ) {\n params = (paramsOrFirst || {}) as {\n webhookId: string;\n name: string;\n url: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n description?: string;\n };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n name: rest[0] as string,\n url: rest[1] as string,\n events: rest[2] as string[],\n enabled: rest[3] as boolean,\n tls: rest[4] as boolean,\n authUsername: rest[5] as string,\n authPassword: rest[6] as string,\n description: rest[7] as string,\n };\n }\n\n const webhookId = params.webhookId;\n const name = params.name;\n const url = params.url;\n const events = params.events;\n const enabled = params.enabled;\n const tls = params.tls;\n const authUsername = params.authUsername;\n const authPassword = params.authPassword;\n const description = params.description;\n if (typeof webhookId === 'undefined' || webhookId === '') {\n throw new OwbaseException(\n 'Missing required parameter: \"webhookId\"',\n );\n }\n if (typeof name === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"name\"');\n }\n if (typeof url === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"url\"');\n }\n if (typeof events === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"events\"');\n }\n const apiPath = '/webhooks/{webhookId}'.replace(\n '{webhookId}',\n encodeURIComponent(String(webhookId)),\n );\n const apiPayload: Payload = {};\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof url !== 'undefined') {\n apiPayload['url'] = url;\n }\n if (typeof events !== 'undefined') {\n apiPayload['events'] = events;\n }\n if (typeof enabled !== 'undefined') {\n apiPayload['enabled'] = enabled;\n }\n if (typeof tls !== 'undefined') {\n apiPayload['tls'] = tls;\n }\n if (typeof authUsername !== 'undefined') {\n apiPayload['authUsername'] = authUsername;\n }\n if (typeof authPassword !== 'undefined') {\n apiPayload['authPassword'] = authPassword;\n }\n if (typeof description !== 'undefined') {\n apiPayload['description'] = description;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n 'content-type': 'application/json',\n accept: 'application/json',\n };\n\n return this.client.call('put', uri, apiHeaders, apiPayload);\n }\n\n /**\n * Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @throws {OwbaseException}\n * @returns {Promise<{}>}\n */\n delete(params: { webhookId: string }): Promise<{}>;\n /**\n * Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.\n *\n * @param {string} webhookId - Webhook ID.\n * @throws {OwbaseException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n delete(webhookId: string): Promise<{}>;\n delete(paramsOrFirst: { webhookId: string } | string): Promise<{}> {\n let params: { webhookId: string };\n\n if (\n paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst)\n ) {\n params = (paramsOrFirst || {}) as { webhookId: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n };\n }\n\n const webhookId = params.webhookId;\n if (typeof webhookId === 'undefined' || webhookId === '') {\n throw new OwbaseException(\n 'Missing required parameter: \"webhookId\"',\n );\n }\n const apiPath = '/webhooks/{webhookId}'.replace(\n '{webhookId}',\n encodeURIComponent(String(webhookId)),\n );\n const apiPayload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n 'content-type': 'application/json',\n accept: 'application/json',\n };\n\n return this.client.call('delete', uri, apiHeaders, apiPayload);\n }\n\n /**\n * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n */\n updateSecret(params: {\n webhookId: string;\n secret?: string;\n }): Promise<Models.Webhook>;\n /**\n * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.\n *\n * @param {string} webhookId - Webhook ID.\n * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n updateSecret(webhookId: string, secret?: string): Promise<Models.Webhook>;\n updateSecret(\n paramsOrFirst: { webhookId: string; secret?: string } | string,\n ...rest: [string?]\n ): Promise<Models.Webhook> {\n let params: { webhookId: string; secret?: string };\n\n if (\n paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst)\n ) {\n params = (paramsOrFirst || {}) as {\n webhookId: string;\n secret?: string;\n };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n secret: rest[0] as string,\n };\n }\n\n const webhookId = params.webhookId;\n const secret = params.secret;\n if (typeof webhookId === 'undefined' || webhookId === '') {\n throw new OwbaseException(\n 'Missing required parameter: \"webhookId\"',\n );\n }\n const apiPath = '/webhooks/{webhookId}/secret'.replace(\n '{webhookId}',\n encodeURIComponent(String(webhookId)),\n );\n const apiPayload: Payload = {};\n if (typeof secret !== 'undefined') {\n apiPayload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n 'content-type': 'application/json',\n accept: 'application/json',\n };\n\n return this.client.call('patch', uri, apiHeaders, apiPayload);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/services/webhooks.ts"],"names":["OwbaseException"],"mappings":";;;;AAGO,MAAM,QAAA,CAAS;AAAA,EAGlB,YAAY,MAAA,EAAgB;AACxB,IAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AAAA,EAClB;AAAA,EAwBA,IAAA,CACI,kBACG,IAAA,EACwB;AAC3B,IAAA,IAAI,MAAA;AAEJ,IAAA,IACK,OAAO,aAAA,KAAkB,WAAA,IAAe,IAAA,CAAK,WAAW,CAAA,IACxD,aAAA,IACG,OAAO,aAAA,KAAkB,QAAA,IACzB,CAAC,KAAA,CAAM,OAAA,CAAQ,aAAa,CAAA,EAClC;AACE,MAAA,MAAA,GAAU,iBAAiB,EAAC;AAAA,IAIhC,CAAA,MAAO;AACH,MAAA,MAAA,GAAS;AAAA,QACL,OAAA,EAAS,aAAA;AAAA,QACT,KAAA,EAAO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AAA,CAA+B,OAAA;AAAA,MAC3C,aAAA;AAAA,MACA,kBAAA,CAAmB,MAAA,CAAO,SAAS,CAAC;AAAA,KACxC;AACA,IAAA,MAAM,aAAsB,EAAC;AAC7B,IAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AAC/B,MAAA,UAAA,CAAW,QAAQ,CAAA,GAAI,MAAA;AAAA,IAC3B;AACA,IAAA,MAAM,MAAM,IAAI,GAAA,CAAI,KAAK,MAAA,CAAO,MAAA,CAAO,WAAW,OAAO,CAAA;AAEzD,IAAA,MAAM,UAAA,GAA2C;AAAA,MAC7C,kBAAA,EAAoB,IAAA,CAAK,MAAA,CAAO,MAAA,CAAO,OAAA;AAAA,MACvC,cAAA,EAAgB,kBAAA;AAAA,MAChB,MAAA,EAAQ;AAAA,KACZ;AAEA,IAAA,OAAO,KAAK,MAAA,CAAO,IAAA,CAAK,OAAA,EAAS,GAAA,EAAK,YAAY,UAAU,CAAA;AAAA,EAChE;AACJ","file":"webhooks.js","sourcesContent":["import { OwbaseException, Client, type Payload } from '../client';\nimport type { Models } from '../models';\n\nexport class Webhooks {\n client: Client;\n\n constructor(client: Client) {\n this.client = client;\n }\n\n /**\n * Get a list of all webhooks belonging to the project. You can use the query params to filter your results.\n *\n * @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://docs.owbase.dev/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, authUsername, tls, events, enabled, logs, attempts\n * @param {boolean} params.total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {OwbaseException}\n * @returns {Promise<Models.WebhookList>}\n */\n list(params?: {\n queries?: string[];\n total?: boolean;\n }): Promise<Models.WebhookList>;\n /**\n * Get a list of all webhooks belonging to the project. You can use the query params to filter your results.\n *\n * @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://docs.owbase.dev/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, url, authUsername, tls, events, enabled, logs, attempts\n * @param {boolean} total - When set to false, the total count returned will be 0 and will not be calculated.\n * @throws {OwbaseException}\n * @returns {Promise<Models.WebhookList>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n list(queries?: string[], total?: boolean): Promise<Models.WebhookList>;\n list(\n paramsOrFirst?: { queries?: string[]; total?: boolean } | string[],\n ...rest: [boolean?]\n ): Promise<Models.WebhookList> {\n let params: { queries?: string[]; total?: boolean };\n\n if (\n (typeof paramsOrFirst === 'undefined' && rest.length === 0) ||\n (paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst))\n ) {\n params = (paramsOrFirst || {}) as {\n queries?: string[];\n total?: boolean;\n };\n } else {\n params = {\n queries: paramsOrFirst as string[],\n total: rest[0] as boolean,\n };\n }\n\n const queries = params.queries;\n const total = params.total;\n const apiPath = '/webhooks';\n const apiPayload: Payload = {};\n if (typeof queries !== 'undefined') {\n apiPayload['queries'] = queries;\n }\n if (typeof total !== 'undefined') {\n apiPayload['total'] = total;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n accept: 'application/json',\n };\n\n return this.client.call('get', uri, apiHeaders, apiPayload);\n }\n\n /**\n * Create a new webhook. Use this endpoint to configure a URL that will receive events from Owbase when specific events occur.\n *\n * @param {string} params.webhookId - Webhook ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.\n * @param {string} params.url - Webhook URL.\n * @param {string} params.name - Webhook name. Max length: 128 chars.\n * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} params.enabled - Enable or disable a webhook.\n * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} params.authUsername - Webhook HTTP user. Max length: 255 chars.\n * @param {string} params.authPassword - Webhook HTTP password. Max length: 2048 chars.\n * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @param {string} params.description - Optional description for the webhook.\n * @param {object} params.headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {\"Authorization\":\"Bearer token\"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.\n * @param {string} params.bodyTemplate - Optional body template. Empty sends the event JSON. Otherwise the template is sent after each {{variable}} becomes its JSON value. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n */\n create(params: {\n webhookId: string;\n url: string;\n name: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n secret?: string;\n description?: string;\n headers?: object;\n bodyTemplate?: string;\n }): Promise<Models.Webhook>;\n /**\n * Create a new webhook. Use this endpoint to configure a URL that will receive events from Owbase when specific events occur.\n *\n * @param {string} webhookId - Webhook ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.\n * @param {string} url - Webhook URL.\n * @param {string} name - Webhook name. Max length: 128 chars.\n * @param {string[]} events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} enabled - Enable or disable a webhook.\n * @param {boolean} tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} authUsername - Webhook HTTP user. Max length: 255 chars.\n * @param {string} authPassword - Webhook HTTP password. Max length: 2048 chars.\n * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @param {string} description - Optional description for the webhook.\n * @param {object} headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {\"Authorization\":\"Bearer token\"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.\n * @param {string} bodyTemplate - Optional body template. Empty sends the event JSON. Otherwise the template is sent after each {{variable}} becomes its JSON value. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n create(\n webhookId: string,\n url: string,\n name: string,\n events: string[],\n enabled?: boolean,\n tls?: boolean,\n authUsername?: string,\n authPassword?: string,\n secret?: string,\n description?: string,\n headers?: object,\n bodyTemplate?: string,\n ): Promise<Models.Webhook>;\n create(\n paramsOrFirst:\n | {\n webhookId: string;\n url: string;\n name: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n secret?: string;\n description?: string;\n headers?: object;\n bodyTemplate?: string;\n }\n | string,\n ...rest: [\n string?,\n string?,\n string[]?,\n boolean?,\n boolean?,\n string?,\n string?,\n string?,\n string?,\n object?,\n string?,\n ]\n ): Promise<Models.Webhook> {\n let params: {\n webhookId: string;\n url: string;\n name: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n secret?: string;\n description?: string;\n headers?: object;\n bodyTemplate?: string;\n };\n\n if (\n paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst)\n ) {\n params = (paramsOrFirst || {}) as {\n webhookId: string;\n url: string;\n name: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n secret?: string;\n description?: string;\n headers?: object;\n bodyTemplate?: string;\n };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n url: rest[0] as string,\n name: rest[1] as string,\n events: rest[2] as string[],\n enabled: rest[3] as boolean,\n tls: rest[4] as boolean,\n authUsername: rest[5] as string,\n authPassword: rest[6] as string,\n secret: rest[7] as string,\n description: rest[8] as string,\n headers: rest[9] as object,\n bodyTemplate: rest[10] as string,\n };\n }\n\n const webhookId = params.webhookId;\n const url = params.url;\n const name = params.name;\n const events = params.events;\n const enabled = params.enabled;\n const tls = params.tls;\n const authUsername = params.authUsername;\n const authPassword = params.authPassword;\n const secret = params.secret;\n const description = params.description;\n const headers = params.headers;\n const bodyTemplate = params.bodyTemplate;\n if (typeof webhookId === 'undefined') {\n throw new OwbaseException(\n 'Missing required parameter: \"webhookId\"',\n );\n }\n if (typeof url === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"url\"');\n }\n if (typeof name === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"name\"');\n }\n if (typeof events === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"events\"');\n }\n const apiPath = '/webhooks';\n const apiPayload: Payload = {};\n if (typeof webhookId !== 'undefined') {\n apiPayload['webhookId'] = webhookId;\n }\n if (typeof url !== 'undefined') {\n apiPayload['url'] = url;\n }\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof events !== 'undefined') {\n apiPayload['events'] = events;\n }\n if (typeof enabled !== 'undefined') {\n apiPayload['enabled'] = enabled;\n }\n if (typeof tls !== 'undefined') {\n apiPayload['tls'] = tls;\n }\n if (typeof authUsername !== 'undefined') {\n apiPayload['authUsername'] = authUsername;\n }\n if (typeof authPassword !== 'undefined') {\n apiPayload['authPassword'] = authPassword;\n }\n if (typeof secret !== 'undefined') {\n apiPayload['secret'] = secret;\n }\n if (typeof description !== 'undefined') {\n apiPayload['description'] = description;\n }\n if (typeof headers !== 'undefined') {\n apiPayload['headers'] = headers;\n }\n if (typeof bodyTemplate !== 'undefined') {\n apiPayload['bodyTemplate'] = bodyTemplate;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n 'content-type': 'application/json',\n accept: 'application/json',\n };\n\n return this.client.call('post', uri, apiHeaders, apiPayload);\n }\n\n /**\n * Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n */\n get(params: { webhookId: string }): Promise<Models.Webhook>;\n /**\n * Get a webhook by its unique ID. This endpoint returns details about a specific webhook configured for a project.\n *\n * @param {string} webhookId - Webhook ID.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n get(webhookId: string): Promise<Models.Webhook>;\n get(\n paramsOrFirst: { webhookId: string } | string,\n ): Promise<Models.Webhook> {\n let params: { webhookId: string };\n\n if (\n paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst)\n ) {\n params = (paramsOrFirst || {}) as { webhookId: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n };\n }\n\n const webhookId = params.webhookId;\n if (typeof webhookId === 'undefined' || webhookId === '') {\n throw new OwbaseException(\n 'Missing required parameter: \"webhookId\"',\n );\n }\n const apiPath = '/webhooks/{webhookId}'.replace(\n '{webhookId}',\n encodeURIComponent(String(webhookId)),\n );\n const apiPayload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n accept: 'application/json',\n };\n\n return this.client.call('get', uri, apiHeaders, apiPayload);\n }\n\n /**\n * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @param {string} params.name - Webhook name. Max length: 128 chars.\n * @param {string} params.url - Webhook URL.\n * @param {string[]} params.events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} params.enabled - Enable or disable a webhook.\n * @param {boolean} params.tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} params.authUsername - Webhook HTTP user. Max length: 255 chars.\n * @param {string} params.authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled.\n * @param {string} params.description - Optional description for the webhook.\n * @param {object} params.headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {\"Authorization\":\"Bearer token\"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.\n * @param {string} params.bodyTemplate - Optional body template. Omit to keep the current one, send an empty text to go back to the event JSON. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n */\n update(params: {\n webhookId: string;\n name: string;\n url: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n description?: string;\n headers?: object;\n bodyTemplate?: string;\n }): Promise<Models.Webhook>;\n /**\n * Update a webhook by its unique ID. Use this endpoint to update the URL, events, or status of an existing webhook.\n *\n * @param {string} webhookId - Webhook ID.\n * @param {string} name - Webhook name. Max length: 128 chars.\n * @param {string} url - Webhook URL.\n * @param {string[]} events - Events list. Maximum of 100 events are allowed.\n * @param {boolean} enabled - Enable or disable a webhook.\n * @param {boolean} tls - Certificate verification, false for disabled or true for enabled.\n * @param {string} authUsername - Webhook HTTP user. Max length: 255 chars.\n * @param {string} authPassword - Webhook HTTP password. Max length: 2048 chars. Omit to keep the current password; it is cleared when the URL changes or TLS verification is disabled.\n * @param {string} description - Optional description for the webhook.\n * @param {object} headers - Custom HTTP headers sent with every delivery, as an object of name and value, for example {\"Authorization\":\"Bearer token\"}. Up to 10 headers. Write-only: the values are never returned, only their names (headerNames). On update, omit to keep the current headers, send an object to replace them or an empty object to remove them; they are removed when the URL changes or TLS verification is disabled.\n * @param {string} bodyTemplate - Optional body template. Omit to keep the current one, send an empty text to go back to the event JSON. Variables: event, events, projectId, webhookId, deliveryId, timestamp, payload and payload.<path>. Max length: 4096 chars.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n update(\n webhookId: string,\n name: string,\n url: string,\n events: string[],\n enabled?: boolean,\n tls?: boolean,\n authUsername?: string,\n authPassword?: string,\n description?: string,\n headers?: object,\n bodyTemplate?: string,\n ): Promise<Models.Webhook>;\n update(\n paramsOrFirst:\n | {\n webhookId: string;\n name: string;\n url: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n description?: string;\n headers?: object;\n bodyTemplate?: string;\n }\n | string,\n ...rest: [\n string?,\n string?,\n string[]?,\n boolean?,\n boolean?,\n string?,\n string?,\n string?,\n object?,\n string?,\n ]\n ): Promise<Models.Webhook> {\n let params: {\n webhookId: string;\n name: string;\n url: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n description?: string;\n headers?: object;\n bodyTemplate?: string;\n };\n\n if (\n paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst)\n ) {\n params = (paramsOrFirst || {}) as {\n webhookId: string;\n name: string;\n url: string;\n events: string[];\n enabled?: boolean;\n tls?: boolean;\n authUsername?: string;\n authPassword?: string;\n description?: string;\n headers?: object;\n bodyTemplate?: string;\n };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n name: rest[0] as string,\n url: rest[1] as string,\n events: rest[2] as string[],\n enabled: rest[3] as boolean,\n tls: rest[4] as boolean,\n authUsername: rest[5] as string,\n authPassword: rest[6] as string,\n description: rest[7] as string,\n headers: rest[8] as object,\n bodyTemplate: rest[9] as string,\n };\n }\n\n const webhookId = params.webhookId;\n const name = params.name;\n const url = params.url;\n const events = params.events;\n const enabled = params.enabled;\n const tls = params.tls;\n const authUsername = params.authUsername;\n const authPassword = params.authPassword;\n const description = params.description;\n const headers = params.headers;\n const bodyTemplate = params.bodyTemplate;\n if (typeof webhookId === 'undefined' || webhookId === '') {\n throw new OwbaseException(\n 'Missing required parameter: \"webhookId\"',\n );\n }\n if (typeof name === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"name\"');\n }\n if (typeof url === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"url\"');\n }\n if (typeof events === 'undefined') {\n throw new OwbaseException('Missing required parameter: \"events\"');\n }\n const apiPath = '/webhooks/{webhookId}'.replace(\n '{webhookId}',\n encodeURIComponent(String(webhookId)),\n );\n const apiPayload: Payload = {};\n if (typeof name !== 'undefined') {\n apiPayload['name'] = name;\n }\n if (typeof url !== 'undefined') {\n apiPayload['url'] = url;\n }\n if (typeof events !== 'undefined') {\n apiPayload['events'] = events;\n }\n if (typeof enabled !== 'undefined') {\n apiPayload['enabled'] = enabled;\n }\n if (typeof tls !== 'undefined') {\n apiPayload['tls'] = tls;\n }\n if (typeof authUsername !== 'undefined') {\n apiPayload['authUsername'] = authUsername;\n }\n if (typeof authPassword !== 'undefined') {\n apiPayload['authPassword'] = authPassword;\n }\n if (typeof description !== 'undefined') {\n apiPayload['description'] = description;\n }\n if (typeof headers !== 'undefined') {\n apiPayload['headers'] = headers;\n }\n if (typeof bodyTemplate !== 'undefined') {\n apiPayload['bodyTemplate'] = bodyTemplate;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n 'content-type': 'application/json',\n accept: 'application/json',\n };\n\n return this.client.call('put', uri, apiHeaders, apiPayload);\n }\n\n /**\n * Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @throws {OwbaseException}\n * @returns {Promise<{}>}\n */\n delete(params: { webhookId: string }): Promise<{}>;\n /**\n * Delete a webhook by its unique ID. Once deleted, the webhook will no longer receive project events.\n *\n * @param {string} webhookId - Webhook ID.\n * @throws {OwbaseException}\n * @returns {Promise<{}>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n delete(webhookId: string): Promise<{}>;\n delete(paramsOrFirst: { webhookId: string } | string): Promise<{}> {\n let params: { webhookId: string };\n\n if (\n paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst)\n ) {\n params = (paramsOrFirst || {}) as { webhookId: string };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n };\n }\n\n const webhookId = params.webhookId;\n if (typeof webhookId === 'undefined' || webhookId === '') {\n throw new OwbaseException(\n 'Missing required parameter: \"webhookId\"',\n );\n }\n const apiPath = '/webhooks/{webhookId}'.replace(\n '{webhookId}',\n encodeURIComponent(String(webhookId)),\n );\n const apiPayload: Payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n 'content-type': 'application/json',\n accept: 'application/json',\n };\n\n return this.client.call('delete', uri, apiHeaders, apiPayload);\n }\n\n /**\n * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.\n *\n * @param {string} params.webhookId - Webhook ID.\n * @param {string} params.secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n */\n updateSecret(params: {\n webhookId: string;\n secret?: string;\n }): Promise<Models.Webhook>;\n /**\n * Update the webhook signing key. This endpoint can be used to regenerate the signing key used to sign and validate payload deliveries for a specific webhook.\n *\n * @param {string} webhookId - Webhook ID.\n * @param {string} secret - Webhook secret key. If not provided, a new key will be generated automatically. Key must be at least 8 characters long, and at max 256 characters.\n * @throws {OwbaseException}\n * @returns {Promise<Models.Webhook>}\n * @deprecated Use the object parameter style method for a better developer experience.\n */\n updateSecret(webhookId: string, secret?: string): Promise<Models.Webhook>;\n updateSecret(\n paramsOrFirst: { webhookId: string; secret?: string } | string,\n ...rest: [string?]\n ): Promise<Models.Webhook> {\n let params: { webhookId: string; secret?: string };\n\n if (\n paramsOrFirst &&\n typeof paramsOrFirst === 'object' &&\n !Array.isArray(paramsOrFirst)\n ) {\n params = (paramsOrFirst || {}) as {\n webhookId: string;\n secret?: string;\n };\n } else {\n params = {\n webhookId: paramsOrFirst as string,\n secret: rest[0] as string,\n };\n }\n\n const webhookId = params.webhookId;\n const secret = params.secret;\n if (typeof webhookId === 'undefined' || webhookId === '') {\n throw new OwbaseException(\n 'Missing required parameter: \"webhookId\"',\n );\n }\n const apiPath = '/webhooks/{webhookId}/secret'.replace(\n '{webhookId}',\n encodeURIComponent(String(webhookId)),\n );\n const apiPayload: Payload = {};\n if (typeof secret !== 'undefined') {\n apiPayload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n\n const apiHeaders: { [header: string]: string } = {\n 'X-Owbase-Project': this.client.config.project,\n 'content-type': 'application/json',\n accept: 'application/json',\n };\n\n return this.client.call('patch', uri, apiHeaders, apiPayload);\n }\n}\n"]}
|
|
@@ -47,7 +47,9 @@ var Webhooks = class {
|
|
|
47
47
|
authUsername: rest[5],
|
|
48
48
|
authPassword: rest[6],
|
|
49
49
|
secret: rest[7],
|
|
50
|
-
description: rest[8]
|
|
50
|
+
description: rest[8],
|
|
51
|
+
headers: rest[9],
|
|
52
|
+
bodyTemplate: rest[10]
|
|
51
53
|
};
|
|
52
54
|
}
|
|
53
55
|
const webhookId = params.webhookId;
|
|
@@ -60,6 +62,8 @@ var Webhooks = class {
|
|
|
60
62
|
const authPassword = params.authPassword;
|
|
61
63
|
const secret = params.secret;
|
|
62
64
|
const description = params.description;
|
|
65
|
+
const headers = params.headers;
|
|
66
|
+
const bodyTemplate = params.bodyTemplate;
|
|
63
67
|
if (typeof webhookId === "undefined") {
|
|
64
68
|
throw new OwbaseException(
|
|
65
69
|
'Missing required parameter: "webhookId"'
|
|
@@ -106,6 +110,12 @@ var Webhooks = class {
|
|
|
106
110
|
if (typeof description !== "undefined") {
|
|
107
111
|
apiPayload["description"] = description;
|
|
108
112
|
}
|
|
113
|
+
if (typeof headers !== "undefined") {
|
|
114
|
+
apiPayload["headers"] = headers;
|
|
115
|
+
}
|
|
116
|
+
if (typeof bodyTemplate !== "undefined") {
|
|
117
|
+
apiPayload["bodyTemplate"] = bodyTemplate;
|
|
118
|
+
}
|
|
109
119
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
110
120
|
const apiHeaders = {
|
|
111
121
|
"X-Owbase-Project": this.client.config.project,
|
|
@@ -155,7 +165,9 @@ var Webhooks = class {
|
|
|
155
165
|
tls: rest[4],
|
|
156
166
|
authUsername: rest[5],
|
|
157
167
|
authPassword: rest[6],
|
|
158
|
-
description: rest[7]
|
|
168
|
+
description: rest[7],
|
|
169
|
+
headers: rest[8],
|
|
170
|
+
bodyTemplate: rest[9]
|
|
159
171
|
};
|
|
160
172
|
}
|
|
161
173
|
const webhookId = params.webhookId;
|
|
@@ -167,6 +179,8 @@ var Webhooks = class {
|
|
|
167
179
|
const authUsername = params.authUsername;
|
|
168
180
|
const authPassword = params.authPassword;
|
|
169
181
|
const description = params.description;
|
|
182
|
+
const headers = params.headers;
|
|
183
|
+
const bodyTemplate = params.bodyTemplate;
|
|
170
184
|
if (typeof webhookId === "undefined" || webhookId === "") {
|
|
171
185
|
throw new OwbaseException(
|
|
172
186
|
'Missing required parameter: "webhookId"'
|
|
@@ -210,6 +224,12 @@ var Webhooks = class {
|
|
|
210
224
|
if (typeof description !== "undefined") {
|
|
211
225
|
apiPayload["description"] = description;
|
|
212
226
|
}
|
|
227
|
+
if (typeof headers !== "undefined") {
|
|
228
|
+
apiPayload["headers"] = headers;
|
|
229
|
+
}
|
|
230
|
+
if (typeof bodyTemplate !== "undefined") {
|
|
231
|
+
apiPayload["bodyTemplate"] = bodyTemplate;
|
|
232
|
+
}
|
|
213
233
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
214
234
|
const apiHeaders = {
|
|
215
235
|
"X-Owbase-Project": this.client.config.project,
|