@zavudev/sdk 0.55.0 → 0.57.0
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/CHANGELOG.md +26 -0
- package/client.d.mts +25 -13
- package/client.d.mts.map +1 -1
- package/client.d.ts +25 -13
- package/client.d.ts.map +1 -1
- package/client.js +15 -3
- package/client.js.map +1 -1
- package/client.mjs +15 -3
- package/client.mjs.map +1 -1
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/tslib.js +17 -17
- package/internal/utils/query.d.mts +0 -3
- package/internal/utils/query.d.mts.map +1 -1
- package/internal/utils/query.d.ts +0 -3
- package/internal/utils/query.d.ts.map +1 -1
- package/internal/utils/query.js +3 -16
- package/internal/utils/query.js.map +1 -1
- package/internal/utils/query.mjs +2 -16
- package/internal/utils/query.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agent-templates.d.mts +97 -0
- package/resources/agent-templates.d.mts.map +1 -0
- package/resources/agent-templates.d.ts +97 -0
- package/resources/agent-templates.d.ts.map +1 -0
- package/resources/agent-templates.js +39 -0
- package/resources/agent-templates.js.map +1 -0
- package/resources/agent-templates.mjs +35 -0
- package/resources/agent-templates.mjs.map +1 -0
- package/resources/agents/agents.d.mts +462 -0
- package/resources/agents/agents.d.mts.map +1 -0
- package/resources/agents/agents.d.ts +462 -0
- package/resources/agents/agents.d.ts.map +1 -0
- package/resources/agents/agents.js +129 -0
- package/resources/agents/agents.js.map +1 -0
- package/resources/agents/agents.mjs +124 -0
- package/resources/agents/agents.mjs.map +1 -0
- package/resources/agents/index.d.mts +3 -0
- package/resources/agents/index.d.mts.map +1 -0
- package/resources/agents/index.d.ts +3 -0
- package/resources/agents/index.d.ts.map +1 -0
- package/resources/agents/index.js +9 -0
- package/resources/agents/index.js.map +1 -0
- package/resources/agents/index.mjs +4 -0
- package/resources/agents/index.mjs.map +1 -0
- package/resources/agents/senders.d.mts +54 -0
- package/resources/agents/senders.d.mts.map +1 -0
- package/resources/agents/senders.d.ts +54 -0
- package/resources/agents/senders.d.ts.map +1 -0
- package/resources/agents/senders.js +45 -0
- package/resources/agents/senders.js.map +1 -0
- package/resources/agents/senders.mjs +41 -0
- package/resources/agents/senders.mjs.map +1 -0
- package/resources/agents.d.mts +2 -0
- package/resources/agents.d.mts.map +1 -0
- package/resources/agents.d.ts +2 -0
- package/resources/agents.d.ts.map +1 -0
- package/resources/agents.js +6 -0
- package/resources/agents.js.map +1 -0
- package/resources/agents.mjs +3 -0
- package/resources/agents.mjs.map +1 -0
- package/resources/broadcasts/broadcasts.d.mts +16 -9
- package/resources/broadcasts/broadcasts.d.mts.map +1 -1
- package/resources/broadcasts/broadcasts.d.ts +16 -9
- package/resources/broadcasts/broadcasts.d.ts.map +1 -1
- package/resources/broadcasts/broadcasts.js +16 -9
- package/resources/broadcasts/broadcasts.js.map +1 -1
- package/resources/broadcasts/broadcasts.mjs +16 -9
- package/resources/broadcasts/broadcasts.mjs.map +1 -1
- package/resources/calls.d.mts +539 -0
- package/resources/calls.d.mts.map +1 -0
- package/resources/calls.d.ts +539 -0
- package/resources/calls.d.ts.map +1 -0
- package/resources/calls.js +85 -0
- package/resources/calls.js.map +1 -0
- package/resources/calls.mjs +81 -0
- package/resources/calls.mjs.map +1 -0
- package/resources/contacts/contacts.d.mts +32 -13
- package/resources/contacts/contacts.d.mts.map +1 -1
- package/resources/contacts/contacts.d.ts +32 -13
- package/resources/contacts/contacts.d.ts.map +1 -1
- package/resources/contacts/contacts.js +0 -14
- package/resources/contacts/contacts.js.map +1 -1
- package/resources/contacts/contacts.mjs +0 -14
- package/resources/contacts/contacts.mjs.map +1 -1
- package/resources/conversations.d.mts +360 -0
- package/resources/conversations.d.mts.map +1 -0
- package/resources/conversations.d.ts +360 -0
- package/resources/conversations.d.ts.map +1 -0
- package/resources/conversations.js +47 -0
- package/resources/conversations.js.map +1 -0
- package/resources/conversations.mjs +43 -0
- package/resources/conversations.mjs.map +1 -0
- package/resources/email-domains.d.mts +260 -0
- package/resources/email-domains.d.mts.map +1 -0
- package/resources/email-domains.d.ts +260 -0
- package/resources/email-domains.d.ts.map +1 -0
- package/resources/email-domains.js +77 -0
- package/resources/email-domains.js.map +1 -0
- package/resources/email-domains.mjs +73 -0
- package/resources/email-domains.mjs.map +1 -0
- package/resources/functions/functions.d.mts +122 -1
- package/resources/functions/functions.d.mts.map +1 -1
- package/resources/functions/functions.d.ts +122 -1
- package/resources/functions/functions.d.ts.map +1 -1
- package/resources/functions/functions.js +53 -0
- package/resources/functions/functions.js.map +1 -1
- package/resources/functions/functions.mjs +53 -0
- package/resources/functions/functions.mjs.map +1 -1
- package/resources/functions/git-link.d.mts +295 -0
- package/resources/functions/git-link.d.mts.map +1 -0
- package/resources/functions/git-link.d.ts +295 -0
- package/resources/functions/git-link.d.ts.map +1 -0
- package/resources/functions/git-link.js +97 -0
- package/resources/functions/git-link.js.map +1 -0
- package/resources/functions/git-link.mjs +93 -0
- package/resources/functions/git-link.mjs.map +1 -0
- package/resources/functions/index.d.mts +3 -1
- package/resources/functions/index.d.mts.map +1 -1
- package/resources/functions/index.d.ts +3 -1
- package/resources/functions/index.d.ts.map +1 -1
- package/resources/functions/index.js +5 -1
- package/resources/functions/index.js.map +1 -1
- package/resources/functions/index.mjs +2 -0
- package/resources/functions/index.mjs.map +1 -1
- package/resources/functions/triggers.d.mts +164 -0
- package/resources/functions/triggers.d.mts.map +1 -0
- package/resources/functions/triggers.d.ts +164 -0
- package/resources/functions/triggers.d.ts.map +1 -0
- package/resources/functions/triggers.js +74 -0
- package/resources/functions/triggers.js.map +1 -0
- package/resources/functions/triggers.mjs +70 -0
- package/resources/functions/triggers.mjs.map +1 -0
- package/resources/index.d.mts +10 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +10 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +11 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +5 -0
- package/resources/index.mjs.map +1 -1
- package/resources/introspect.d.mts +74 -1
- package/resources/introspect.d.mts.map +1 -1
- package/resources/introspect.d.ts +74 -1
- package/resources/introspect.d.ts.map +1 -1
- package/resources/introspect.js +22 -0
- package/resources/introspect.js.map +1 -1
- package/resources/introspect.mjs +22 -0
- package/resources/introspect.mjs.map +1 -1
- package/resources/messages.d.mts +89 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +89 -1
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +48 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +48 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/number-10dlc/brands.d.mts +10 -5
- package/resources/number-10dlc/brands.d.mts.map +1 -1
- package/resources/number-10dlc/brands.d.ts +10 -5
- package/resources/number-10dlc/brands.d.ts.map +1 -1
- package/resources/number-10dlc/brands.js +10 -5
- package/resources/number-10dlc/brands.js.map +1 -1
- package/resources/number-10dlc/brands.mjs +10 -5
- package/resources/number-10dlc/brands.mjs.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.d.mts +8 -7
- package/resources/number-10dlc/campaigns/campaigns.d.mts.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.d.ts +8 -7
- package/resources/number-10dlc/campaigns/campaigns.d.ts.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.js +8 -7
- package/resources/number-10dlc/campaigns/campaigns.js.map +1 -1
- package/resources/number-10dlc/campaigns/campaigns.mjs +8 -7
- package/resources/number-10dlc/campaigns/campaigns.mjs.map +1 -1
- package/resources/phone-numbers.d.mts +6 -1
- package/resources/phone-numbers.d.mts.map +1 -1
- package/resources/phone-numbers.d.ts +6 -1
- package/resources/phone-numbers.d.ts.map +1 -1
- package/resources/senders/agent/agent.d.mts +4 -3
- package/resources/senders/agent/agent.d.mts.map +1 -1
- package/resources/senders/agent/agent.d.ts +4 -3
- package/resources/senders/agent/agent.d.ts.map +1 -1
- package/resources/senders/agent/agent.js +2 -2
- package/resources/senders/agent/agent.js.map +1 -1
- package/resources/senders/agent/agent.mjs +2 -2
- package/resources/senders/agent/agent.mjs.map +1 -1
- package/resources/senders/agent/index.d.mts +2 -2
- package/resources/senders/agent/index.d.mts.map +1 -1
- package/resources/senders/agent/index.d.ts +2 -2
- package/resources/senders/agent/index.d.ts.map +1 -1
- package/resources/senders/agent/index.js +2 -2
- package/resources/senders/agent/index.js.map +1 -1
- package/resources/senders/agent/index.mjs +1 -1
- package/resources/senders/agent/index.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.d.mts +56 -1
- package/resources/senders/agent/knowledge-bases/documents.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.d.ts +56 -1
- package/resources/senders/agent/knowledge-bases/documents.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.js +33 -0
- package/resources/senders/agent/knowledge-bases/documents.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/documents.mjs +33 -0
- package/resources/senders/agent/knowledge-bases/documents.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.mts +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.ts +1 -1
- package/resources/senders/agent/knowledge-bases/index.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/index.mjs.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts +2 -2
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.mts.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts +2 -2
- package/resources/senders/agent/knowledge-bases/knowledge-bases.d.ts.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.js.map +1 -1
- package/resources/senders/agent/knowledge-bases/knowledge-bases.mjs.map +1 -1
- package/resources/senders/agent/tools/index.d.mts +3 -0
- package/resources/senders/agent/tools/index.d.mts.map +1 -0
- package/resources/senders/agent/tools/index.d.ts +3 -0
- package/resources/senders/agent/tools/index.d.ts.map +1 -0
- package/resources/senders/agent/tools/index.js +9 -0
- package/resources/senders/agent/tools/index.js.map +1 -0
- package/resources/senders/agent/tools/index.mjs +4 -0
- package/resources/senders/agent/tools/index.mjs.map +1 -0
- package/resources/senders/agent/tools/tools.d.mts +338 -0
- package/resources/senders/agent/tools/tools.d.mts.map +1 -0
- package/resources/senders/agent/tools/tools.d.ts +338 -0
- package/resources/senders/agent/tools/tools.d.ts.map +1 -0
- package/resources/senders/agent/tools/tools.js +163 -0
- package/resources/senders/agent/tools/tools.js.map +1 -0
- package/resources/senders/agent/tools/tools.mjs +158 -0
- package/resources/senders/agent/tools/tools.mjs.map +1 -0
- package/resources/senders/agent/tools/webhook.d.mts +28 -0
- package/resources/senders/agent/tools/webhook.d.mts.map +1 -0
- package/resources/senders/agent/tools/webhook.d.ts +28 -0
- package/resources/senders/agent/tools/webhook.d.ts.map +1 -0
- package/resources/senders/agent/tools/webhook.js +28 -0
- package/resources/senders/agent/tools/webhook.js.map +1 -0
- package/resources/senders/agent/tools/webhook.mjs +24 -0
- package/resources/senders/agent/tools/webhook.mjs.map +1 -0
- package/resources/senders/agent/tools.d.mts +1 -270
- package/resources/senders/agent/tools.d.mts.map +1 -1
- package/resources/senders/agent/tools.d.ts +1 -270
- package/resources/senders/agent/tools.d.ts.map +1 -1
- package/resources/senders/agent/tools.js +2 -131
- package/resources/senders/agent/tools.js.map +1 -1
- package/resources/senders/agent/tools.mjs +1 -129
- package/resources/senders/agent/tools.mjs.map +1 -1
- package/resources/senders/index.d.mts +2 -1
- package/resources/senders/index.d.mts.map +1 -1
- package/resources/senders/index.d.ts +2 -1
- package/resources/senders/index.d.ts.map +1 -1
- package/resources/senders/index.js +3 -1
- package/resources/senders/index.js.map +1 -1
- package/resources/senders/index.mjs +1 -0
- package/resources/senders/index.mjs.map +1 -1
- package/resources/senders/senders.d.mts +4 -0
- package/resources/senders/senders.d.mts.map +1 -1
- package/resources/senders/senders.d.ts +4 -0
- package/resources/senders/senders.d.ts.map +1 -1
- package/resources/senders/senders.js +4 -0
- package/resources/senders/senders.js.map +1 -1
- package/resources/senders/senders.mjs +4 -0
- package/resources/senders/senders.mjs.map +1 -1
- package/resources/senders/telegram.d.mts +48 -0
- package/resources/senders/telegram.d.mts.map +1 -0
- package/resources/senders/telegram.d.ts +48 -0
- package/resources/senders/telegram.d.ts.map +1 -0
- package/resources/senders/telegram.js +41 -0
- package/resources/senders/telegram.js.map +1 -0
- package/resources/senders/telegram.mjs +37 -0
- package/resources/senders/telegram.mjs.map +1 -0
- package/resources/templates.d.mts +66 -1
- package/resources/templates.d.mts.map +1 -1
- package/resources/templates.d.ts +66 -1
- package/resources/templates.d.ts.map +1 -1
- package/resources/templates.js +31 -0
- package/resources/templates.js.map +1 -1
- package/resources/templates.mjs +31 -0
- package/resources/templates.mjs.map +1 -1
- package/resources/urls.d.mts +24 -1
- package/resources/urls.d.mts.map +1 -1
- package/resources/urls.d.ts +24 -1
- package/resources/urls.d.ts.map +1 -1
- package/resources/urls.js +15 -0
- package/resources/urls.js.map +1 -1
- package/resources/urls.mjs +15 -0
- package/resources/urls.mjs.map +1 -1
- package/src/client.ts +129 -3
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/utils/query.ts +2 -18
- package/src/resources/agent-templates.ts +128 -0
- package/src/resources/agents/agents.ts +603 -0
- package/src/resources/agents/index.ts +21 -0
- package/src/resources/agents/senders.ts +79 -0
- package/src/resources/agents.ts +3 -0
- package/src/resources/broadcasts/broadcasts.ts +16 -9
- package/src/resources/calls.ts +647 -0
- package/src/resources/contacts/contacts.ts +35 -20
- package/src/resources/conversations.ts +472 -0
- package/src/resources/email-domains.ts +337 -0
- package/src/resources/functions/functions.ts +202 -0
- package/src/resources/functions/git-link.ts +398 -0
- package/src/resources/functions/index.ts +22 -0
- package/src/resources/functions/triggers.ts +227 -0
- package/src/resources/index.ts +57 -0
- package/src/resources/introspect.ts +105 -0
- package/src/resources/messages.ts +102 -0
- package/src/resources/number-10dlc/brands.ts +10 -5
- package/src/resources/number-10dlc/campaigns/campaigns.ts +8 -7
- package/src/resources/phone-numbers.ts +6 -1
- package/src/resources/senders/agent/agent.ts +23 -17
- package/src/resources/senders/agent/index.ts +4 -1
- package/src/resources/senders/agent/knowledge-bases/documents.ts +89 -0
- package/src/resources/senders/agent/knowledge-bases/index.ts +4 -0
- package/src/resources/senders/agent/knowledge-bases/knowledge-bases.ts +8 -0
- package/src/resources/senders/agent/tools/index.ts +21 -0
- package/src/resources/senders/agent/tools/tools.ts +460 -0
- package/src/resources/senders/agent/tools/webhook.ts +40 -0
- package/src/resources/senders/agent/tools.ts +1 -364
- package/src/resources/senders/index.ts +2 -0
- package/src/resources/senders/senders.ts +10 -0
- package/src/resources/senders/telegram.ts +73 -0
- package/src/resources/templates.ts +80 -0
- package/src/resources/urls.ts +35 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import { path } from '../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class GitLink extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* The link and its last deploy. Never returns the webhook secret.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const gitLink = await client.functions.gitLink.retrieve(
|
|
16
|
+
* 'functionId',
|
|
17
|
+
* );
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
retrieve(functionID: string, options?: RequestOptions): APIPromise<GitLinkRetrieveResponse> {
|
|
21
|
+
return this._client.get(path`/v1/functions/${functionID}/git-link`, options);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Change the branch, the root directory, or whether pushes deploy. Pass at least
|
|
26
|
+
* one field. `rootDir: null` clears the subdirectory.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const gitLink = await client.functions.gitLink.update(
|
|
31
|
+
* 'functionId',
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
update(
|
|
36
|
+
functionID: string,
|
|
37
|
+
body: GitLinkUpdateParams,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<GitLinkUpdateResponse> {
|
|
40
|
+
return this._client.patch(path`/v1/functions/${functionID}/git-link`, { body, ...options });
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Fetch the linked branch and deploy it without waiting for a push. Returns
|
|
45
|
+
* immediately; follow the outcome with `GET /v1/functions/{functionId}/git-link`,
|
|
46
|
+
* whose `lastStatus` and `lastError` describe the run.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const response = await client.functions.gitLink.deployNow(
|
|
51
|
+
* 'functionId',
|
|
52
|
+
* );
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
deployNow(functionID: string, options?: RequestOptions): APIPromise<GitLinkDeployNowResponse> {
|
|
56
|
+
return this._client.post(path`/v1/functions/${functionID}/git-link/deploy`, options);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Bind a repository to this function so every push to `branch` deploys it. A
|
|
61
|
+
* function holds at most one link; linking again returns 400.
|
|
62
|
+
*
|
|
63
|
+
* **The server decides how the link authenticates.** If the project has the Zavu
|
|
64
|
+
* GitHub App installed, the link uses that installation: private repositories work
|
|
65
|
+
* and there is nothing to configure in the repository. Otherwise it falls back to
|
|
66
|
+
* a manual link and the response carries a `webhookSecret` you add to the
|
|
67
|
+
* repository yourself. `connection` says which one you got.
|
|
68
|
+
*
|
|
69
|
+
* The repository is not checked against GitHub here, because it cannot be: an
|
|
70
|
+
* owner/repo that does not exist, or that the installation cannot see, is accepted
|
|
71
|
+
* and fails on the first deploy with a fetch error.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const response = await client.functions.gitLink.link(
|
|
76
|
+
* 'functionId',
|
|
77
|
+
* {
|
|
78
|
+
* owner: 'acme',
|
|
79
|
+
* repo: 'order-bot',
|
|
80
|
+
* branch: 'main',
|
|
81
|
+
* },
|
|
82
|
+
* );
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
link(
|
|
86
|
+
functionID: string,
|
|
87
|
+
body: GitLinkLinkParams,
|
|
88
|
+
options?: RequestOptions,
|
|
89
|
+
): APIPromise<GitLinkLinkResponse> {
|
|
90
|
+
return this._client.post(path`/v1/functions/${functionID}/git-link`, { body, ...options });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Remove the link. The function and its deployments stay. A manual webhook left in
|
|
95
|
+
* the repository stops being accepted, so remove it there too.
|
|
96
|
+
*
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* await client.functions.gitLink.unlink('functionId');
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
unlink(functionID: string, options?: RequestOptions): APIPromise<void> {
|
|
103
|
+
return this._client.delete(path`/v1/functions/${functionID}/git-link`, {
|
|
104
|
+
...options,
|
|
105
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface GitLinkRetrieveResponse {
|
|
111
|
+
/**
|
|
112
|
+
* A GitHub repository bound to a function. A push to `branch` deploys the
|
|
113
|
+
* function. A function holds at most one link.
|
|
114
|
+
*/
|
|
115
|
+
link: GitLinkRetrieveResponse.Link;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link,
|
|
119
|
+
* where you add it to the repository yourself.
|
|
120
|
+
*/
|
|
121
|
+
webhookUrl: string;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Shared secret for the repository's webhook. **Returned only when creating a
|
|
125
|
+
* `manual` link, and only there** — every later read strips it, and re-linking
|
|
126
|
+
* mints a new one. Absent entirely on an `app` link, which needs no secret of its
|
|
127
|
+
* own.
|
|
128
|
+
*/
|
|
129
|
+
webhookSecret?: string;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export namespace GitLinkRetrieveResponse {
|
|
133
|
+
/**
|
|
134
|
+
* A GitHub repository bound to a function. A push to `branch` deploys the
|
|
135
|
+
* function. A function holds at most one link.
|
|
136
|
+
*/
|
|
137
|
+
export interface Link {
|
|
138
|
+
id: string;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* When false the link is kept and pushes are ignored.
|
|
142
|
+
*/
|
|
143
|
+
autoDeploy: boolean;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Only pushes to this branch deploy.
|
|
147
|
+
*/
|
|
148
|
+
branch: string;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* How this link authenticates, decided by the server rather than by the caller.
|
|
152
|
+
*
|
|
153
|
+
* - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the
|
|
154
|
+
* app's webhook and private repositories work. Nothing to configure in the
|
|
155
|
+
* repository.
|
|
156
|
+
* - `manual`: no installation. The link carries its own secret and you add the
|
|
157
|
+
* webhook to the repository yourself.
|
|
158
|
+
*/
|
|
159
|
+
connection: 'app' | 'manual';
|
|
160
|
+
|
|
161
|
+
createdAt: string;
|
|
162
|
+
|
|
163
|
+
functionId: string;
|
|
164
|
+
|
|
165
|
+
owner: string;
|
|
166
|
+
|
|
167
|
+
provider: 'github';
|
|
168
|
+
|
|
169
|
+
repo: string;
|
|
170
|
+
|
|
171
|
+
updatedAt: string;
|
|
172
|
+
|
|
173
|
+
lastCommitMessage?: string | null;
|
|
174
|
+
|
|
175
|
+
lastCommitSha?: string | null;
|
|
176
|
+
|
|
177
|
+
lastDeployAt?: string | null;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Why the last deploy failed. Null otherwise.
|
|
181
|
+
*/
|
|
182
|
+
lastError?: string | null;
|
|
183
|
+
|
|
184
|
+
lastStatus?: 'deploying' | 'deployed' | 'failed' | null;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Subdirectory holding the project, for monorepos. Null when the project is at the
|
|
188
|
+
* repository root.
|
|
189
|
+
*/
|
|
190
|
+
rootDir?: string | null;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface GitLinkUpdateResponse {
|
|
195
|
+
/**
|
|
196
|
+
* A GitHub repository bound to a function. A push to `branch` deploys the
|
|
197
|
+
* function. A function holds at most one link.
|
|
198
|
+
*/
|
|
199
|
+
link: GitLinkUpdateResponse.Link;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link,
|
|
203
|
+
* where you add it to the repository yourself.
|
|
204
|
+
*/
|
|
205
|
+
webhookUrl: string;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Shared secret for the repository's webhook. **Returned only when creating a
|
|
209
|
+
* `manual` link, and only there** — every later read strips it, and re-linking
|
|
210
|
+
* mints a new one. Absent entirely on an `app` link, which needs no secret of its
|
|
211
|
+
* own.
|
|
212
|
+
*/
|
|
213
|
+
webhookSecret?: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export namespace GitLinkUpdateResponse {
|
|
217
|
+
/**
|
|
218
|
+
* A GitHub repository bound to a function. A push to `branch` deploys the
|
|
219
|
+
* function. A function holds at most one link.
|
|
220
|
+
*/
|
|
221
|
+
export interface Link {
|
|
222
|
+
id: string;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* When false the link is kept and pushes are ignored.
|
|
226
|
+
*/
|
|
227
|
+
autoDeploy: boolean;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Only pushes to this branch deploy.
|
|
231
|
+
*/
|
|
232
|
+
branch: string;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* How this link authenticates, decided by the server rather than by the caller.
|
|
236
|
+
*
|
|
237
|
+
* - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the
|
|
238
|
+
* app's webhook and private repositories work. Nothing to configure in the
|
|
239
|
+
* repository.
|
|
240
|
+
* - `manual`: no installation. The link carries its own secret and you add the
|
|
241
|
+
* webhook to the repository yourself.
|
|
242
|
+
*/
|
|
243
|
+
connection: 'app' | 'manual';
|
|
244
|
+
|
|
245
|
+
createdAt: string;
|
|
246
|
+
|
|
247
|
+
functionId: string;
|
|
248
|
+
|
|
249
|
+
owner: string;
|
|
250
|
+
|
|
251
|
+
provider: 'github';
|
|
252
|
+
|
|
253
|
+
repo: string;
|
|
254
|
+
|
|
255
|
+
updatedAt: string;
|
|
256
|
+
|
|
257
|
+
lastCommitMessage?: string | null;
|
|
258
|
+
|
|
259
|
+
lastCommitSha?: string | null;
|
|
260
|
+
|
|
261
|
+
lastDeployAt?: string | null;
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Why the last deploy failed. Null otherwise.
|
|
265
|
+
*/
|
|
266
|
+
lastError?: string | null;
|
|
267
|
+
|
|
268
|
+
lastStatus?: 'deploying' | 'deployed' | 'failed' | null;
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Subdirectory holding the project, for monorepos. Null when the project is at the
|
|
272
|
+
* repository root.
|
|
273
|
+
*/
|
|
274
|
+
rootDir?: string | null;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export interface GitLinkDeployNowResponse {
|
|
279
|
+
scheduled: boolean;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface GitLinkLinkResponse {
|
|
283
|
+
/**
|
|
284
|
+
* A GitHub repository bound to a function. A push to `branch` deploys the
|
|
285
|
+
* function. A function holds at most one link.
|
|
286
|
+
*/
|
|
287
|
+
link: GitLinkLinkResponse.Link;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Endpoint that receives GitHub's push deliveries. Only needed on a `manual` link,
|
|
291
|
+
* where you add it to the repository yourself.
|
|
292
|
+
*/
|
|
293
|
+
webhookUrl: string;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Shared secret for the repository's webhook. **Returned only when creating a
|
|
297
|
+
* `manual` link, and only there** — every later read strips it, and re-linking
|
|
298
|
+
* mints a new one. Absent entirely on an `app` link, which needs no secret of its
|
|
299
|
+
* own.
|
|
300
|
+
*/
|
|
301
|
+
webhookSecret?: string;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export namespace GitLinkLinkResponse {
|
|
305
|
+
/**
|
|
306
|
+
* A GitHub repository bound to a function. A push to `branch` deploys the
|
|
307
|
+
* function. A function holds at most one link.
|
|
308
|
+
*/
|
|
309
|
+
export interface Link {
|
|
310
|
+
id: string;
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* When false the link is kept and pushes are ignored.
|
|
314
|
+
*/
|
|
315
|
+
autoDeploy: boolean;
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Only pushes to this branch deploy.
|
|
319
|
+
*/
|
|
320
|
+
branch: string;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* How this link authenticates, decided by the server rather than by the caller.
|
|
324
|
+
*
|
|
325
|
+
* - `app`: the Zavu GitHub App is installed on the account. Pushes arrive on the
|
|
326
|
+
* app's webhook and private repositories work. Nothing to configure in the
|
|
327
|
+
* repository.
|
|
328
|
+
* - `manual`: no installation. The link carries its own secret and you add the
|
|
329
|
+
* webhook to the repository yourself.
|
|
330
|
+
*/
|
|
331
|
+
connection: 'app' | 'manual';
|
|
332
|
+
|
|
333
|
+
createdAt: string;
|
|
334
|
+
|
|
335
|
+
functionId: string;
|
|
336
|
+
|
|
337
|
+
owner: string;
|
|
338
|
+
|
|
339
|
+
provider: 'github';
|
|
340
|
+
|
|
341
|
+
repo: string;
|
|
342
|
+
|
|
343
|
+
updatedAt: string;
|
|
344
|
+
|
|
345
|
+
lastCommitMessage?: string | null;
|
|
346
|
+
|
|
347
|
+
lastCommitSha?: string | null;
|
|
348
|
+
|
|
349
|
+
lastDeployAt?: string | null;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Why the last deploy failed. Null otherwise.
|
|
353
|
+
*/
|
|
354
|
+
lastError?: string | null;
|
|
355
|
+
|
|
356
|
+
lastStatus?: 'deploying' | 'deployed' | 'failed' | null;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Subdirectory holding the project, for monorepos. Null when the project is at the
|
|
360
|
+
* repository root.
|
|
361
|
+
*/
|
|
362
|
+
rootDir?: string | null;
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export interface GitLinkUpdateParams {
|
|
367
|
+
autoDeploy?: boolean;
|
|
368
|
+
|
|
369
|
+
branch?: string;
|
|
370
|
+
|
|
371
|
+
rootDir?: string | null;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
export interface GitLinkLinkParams {
|
|
375
|
+
owner: string;
|
|
376
|
+
|
|
377
|
+
repo: string;
|
|
378
|
+
|
|
379
|
+
autoDeploy?: boolean;
|
|
380
|
+
|
|
381
|
+
branch?: string;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Subdirectory holding the project, for monorepos.
|
|
385
|
+
*/
|
|
386
|
+
rootDir?: string;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
export declare namespace GitLink {
|
|
390
|
+
export {
|
|
391
|
+
type GitLinkRetrieveResponse as GitLinkRetrieveResponse,
|
|
392
|
+
type GitLinkUpdateResponse as GitLinkUpdateResponse,
|
|
393
|
+
type GitLinkDeployNowResponse as GitLinkDeployNowResponse,
|
|
394
|
+
type GitLinkLinkResponse as GitLinkLinkResponse,
|
|
395
|
+
type GitLinkUpdateParams as GitLinkUpdateParams,
|
|
396
|
+
type GitLinkLinkParams as GitLinkLinkParams,
|
|
397
|
+
};
|
|
398
|
+
}
|
|
@@ -8,12 +8,26 @@ export {
|
|
|
8
8
|
type FunctionDeleteResponse,
|
|
9
9
|
type FunctionDeployResponse,
|
|
10
10
|
type FunctionGetDeploymentResponse,
|
|
11
|
+
type FunctionListDeploymentsResponse,
|
|
12
|
+
type FunctionListEventTypesResponse,
|
|
13
|
+
type FunctionRollbackDeploymentResponse,
|
|
11
14
|
type FunctionTailLogsResponse,
|
|
12
15
|
type FunctionCreateParams,
|
|
13
16
|
type FunctionUpdateParams,
|
|
14
17
|
type FunctionDeployParams,
|
|
18
|
+
type FunctionListDeploymentsParams,
|
|
19
|
+
type FunctionRollbackDeploymentParams,
|
|
15
20
|
type FunctionTailLogsParams,
|
|
16
21
|
} from './functions';
|
|
22
|
+
export {
|
|
23
|
+
GitLink,
|
|
24
|
+
type GitLinkRetrieveResponse,
|
|
25
|
+
type GitLinkUpdateResponse,
|
|
26
|
+
type GitLinkDeployNowResponse,
|
|
27
|
+
type GitLinkLinkResponse,
|
|
28
|
+
type GitLinkUpdateParams,
|
|
29
|
+
type GitLinkLinkParams,
|
|
30
|
+
} from './git-link';
|
|
17
31
|
export {
|
|
18
32
|
Secrets,
|
|
19
33
|
type SecretListResponse,
|
|
@@ -21,3 +35,11 @@ export {
|
|
|
21
35
|
type SecretSetParams,
|
|
22
36
|
type SecretUnsetParams,
|
|
23
37
|
} from './secrets';
|
|
38
|
+
export {
|
|
39
|
+
Triggers,
|
|
40
|
+
type TriggerCreateResponse,
|
|
41
|
+
type TriggerUpdateResponse,
|
|
42
|
+
type TriggerListResponse,
|
|
43
|
+
type TriggerCreateParams,
|
|
44
|
+
type TriggerUpdateParams,
|
|
45
|
+
} from './triggers';
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise';
|
|
5
|
+
import { buildHeaders } from '../../internal/headers';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
7
|
+
import { path } from '../../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class Triggers extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Subscribe a function to one or more event types, optionally scoped to specific
|
|
12
|
+
* senders. Provide eventTypes and senderIds (use null in senderIds for all
|
|
13
|
+
* senders); a trigger is created for each event type and sender combination.
|
|
14
|
+
*
|
|
15
|
+
* The special event type `cron` runs the function on a schedule instead of a
|
|
16
|
+
* messaging event: include a `cron` field with a 5-field UTC cron expression
|
|
17
|
+
* (minimum granularity one minute). A cron trigger ignores the sender axis, and a
|
|
18
|
+
* function may hold several cron triggers with different expressions. The function
|
|
19
|
+
* receives an event with `type: "cron"` and `data.cron`.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const trigger = await client.functions.triggers.create(
|
|
24
|
+
* 'functionId',
|
|
25
|
+
* { eventTypes: ['message.inbound'], senderIds: [null] },
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
create(
|
|
30
|
+
functionID: string,
|
|
31
|
+
body: TriggerCreateParams,
|
|
32
|
+
options?: RequestOptions,
|
|
33
|
+
): APIPromise<TriggerCreateResponse> {
|
|
34
|
+
return this._client.post(path`/v1/functions/${functionID}/triggers`, { body, ...options });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Enable or disable a trigger
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const trigger = await client.functions.triggers.update(
|
|
43
|
+
* 'triggerId',
|
|
44
|
+
* { active: true },
|
|
45
|
+
* );
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
update(
|
|
49
|
+
triggerID: string,
|
|
50
|
+
body: TriggerUpdateParams,
|
|
51
|
+
options?: RequestOptions,
|
|
52
|
+
): APIPromise<TriggerUpdateResponse> {
|
|
53
|
+
return this._client.patch(path`/v1/functions/triggers/${triggerID}`, { body, ...options });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* List function triggers
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const triggers = await client.functions.triggers.list(
|
|
62
|
+
* 'functionId',
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
list(functionID: string, options?: RequestOptions): APIPromise<TriggerListResponse> {
|
|
67
|
+
return this._client.get(path`/v1/functions/${functionID}/triggers`, options);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Delete a trigger
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* await client.functions.triggers.delete('triggerId');
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
delete(triggerID: string, options?: RequestOptions): APIPromise<void> {
|
|
79
|
+
return this._client.delete(path`/v1/functions/triggers/${triggerID}`, {
|
|
80
|
+
...options,
|
|
81
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface TriggerCreateResponse {
|
|
87
|
+
added: number;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Number of triggers that already existed.
|
|
91
|
+
*/
|
|
92
|
+
skipped: number;
|
|
93
|
+
|
|
94
|
+
triggers: Array<TriggerCreateResponse.Trigger>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export namespace TriggerCreateResponse {
|
|
98
|
+
/**
|
|
99
|
+
* A subscription that runs a Zavu Function when a messaging event fires.
|
|
100
|
+
*/
|
|
101
|
+
export interface Trigger {
|
|
102
|
+
id: string;
|
|
103
|
+
|
|
104
|
+
active: boolean;
|
|
105
|
+
|
|
106
|
+
createdAt: string;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Event type that fires the function. See GET /v1/functions/event-types for the
|
|
110
|
+
* supported list. The special type `cron` fires on a schedule instead of a
|
|
111
|
+
* messaging event and carries a `cron` expression.
|
|
112
|
+
*/
|
|
113
|
+
eventType: string;
|
|
114
|
+
|
|
115
|
+
functionId: string;
|
|
116
|
+
|
|
117
|
+
updatedAt: string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* 5-field cron expression (minute hour day-of-month month day-of-week), evaluated
|
|
121
|
+
* in UTC. Present only on `cron` triggers.
|
|
122
|
+
*/
|
|
123
|
+
cron?: string | null;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Last time the schedule fired. Null until the first fire.
|
|
127
|
+
*/
|
|
128
|
+
lastRunAt?: string | null;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Next scheduled fire time. Present only on `cron` triggers.
|
|
132
|
+
*/
|
|
133
|
+
nextRunAt?: string | null;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Restrict the trigger to a single sender. Null means all senders in the project.
|
|
137
|
+
*/
|
|
138
|
+
senderId?: string | null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export interface TriggerUpdateResponse {
|
|
143
|
+
active: boolean;
|
|
144
|
+
|
|
145
|
+
ok: boolean;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface TriggerListResponse {
|
|
149
|
+
triggers: Array<TriggerListResponse.Trigger>;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export namespace TriggerListResponse {
|
|
153
|
+
/**
|
|
154
|
+
* A subscription that runs a Zavu Function when a messaging event fires.
|
|
155
|
+
*/
|
|
156
|
+
export interface Trigger {
|
|
157
|
+
id: string;
|
|
158
|
+
|
|
159
|
+
active: boolean;
|
|
160
|
+
|
|
161
|
+
createdAt: string;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Event type that fires the function. See GET /v1/functions/event-types for the
|
|
165
|
+
* supported list. The special type `cron` fires on a schedule instead of a
|
|
166
|
+
* messaging event and carries a `cron` expression.
|
|
167
|
+
*/
|
|
168
|
+
eventType: string;
|
|
169
|
+
|
|
170
|
+
functionId: string;
|
|
171
|
+
|
|
172
|
+
updatedAt: string;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* 5-field cron expression (minute hour day-of-month month day-of-week), evaluated
|
|
176
|
+
* in UTC. Present only on `cron` triggers.
|
|
177
|
+
*/
|
|
178
|
+
cron?: string | null;
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Last time the schedule fired. Null until the first fire.
|
|
182
|
+
*/
|
|
183
|
+
lastRunAt?: string | null;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Next scheduled fire time. Present only on `cron` triggers.
|
|
187
|
+
*/
|
|
188
|
+
nextRunAt?: string | null;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Restrict the trigger to a single sender. Null means all senders in the project.
|
|
192
|
+
*/
|
|
193
|
+
senderId?: string | null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface TriggerCreateParams {
|
|
198
|
+
/**
|
|
199
|
+
* Event types to subscribe to.
|
|
200
|
+
*/
|
|
201
|
+
eventTypes: Array<string>;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Senders to scope the triggers to. Use null for all senders.
|
|
205
|
+
*/
|
|
206
|
+
senderIds: Array<string | null>;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Required when eventTypes includes `cron`: a 5-field cron expression (minute hour
|
|
210
|
+
* day-of-month month day-of-week), evaluated in UTC.
|
|
211
|
+
*/
|
|
212
|
+
cron?: string;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface TriggerUpdateParams {
|
|
216
|
+
active: boolean;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export declare namespace Triggers {
|
|
220
|
+
export {
|
|
221
|
+
type TriggerCreateResponse as TriggerCreateResponse,
|
|
222
|
+
type TriggerUpdateResponse as TriggerUpdateResponse,
|
|
223
|
+
type TriggerListResponse as TriggerListResponse,
|
|
224
|
+
type TriggerCreateParams as TriggerCreateParams,
|
|
225
|
+
type TriggerUpdateParams as TriggerUpdateParams,
|
|
226
|
+
};
|
|
227
|
+
}
|