@knocklabs/node 1.0.0 → 1.2.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 +38 -0
- package/README.md +1 -1
- package/api-promise.js +2 -15
- package/api-promise.js.map +1 -1
- package/client.d.mts +4 -1
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -1
- package/client.d.ts.map +1 -1
- package/client.js +27 -44
- package/client.js.map +1 -1
- package/client.mjs +18 -12
- package/client.mjs.map +1 -1
- package/core/api-promise.d.mts +0 -1
- package/core/api-promise.d.mts.map +1 -1
- package/core/api-promise.d.ts +0 -1
- package/core/api-promise.d.ts.map +1 -1
- package/core/api-promise.js +4 -14
- package/core/api-promise.js.map +1 -1
- package/core/api-promise.mjs +1 -11
- package/core/api-promise.mjs.map +1 -1
- package/core/error.d.mts +0 -1
- package/core/error.d.mts.map +1 -1
- package/core/error.d.ts +0 -1
- package/core/error.d.ts.map +1 -1
- package/core/error.js.map +1 -1
- package/core/error.mjs.map +1 -1
- package/core/pagination.d.mts +0 -1
- package/core/pagination.d.mts.map +1 -1
- package/core/pagination.d.ts +0 -1
- package/core/pagination.d.ts.map +1 -1
- package/core/pagination.js +3 -13
- package/core/pagination.js.map +1 -1
- package/core/pagination.mjs +1 -11
- package/core/pagination.mjs.map +1 -1
- package/error.js +2 -15
- package/error.js.map +1 -1
- package/internal/builtin-types.d.mts +0 -2
- package/internal/builtin-types.d.mts.map +1 -1
- package/internal/builtin-types.d.ts +0 -2
- package/internal/builtin-types.d.ts.map +1 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/errors.d.mts.map +1 -1
- package/internal/errors.d.ts.map +1 -1
- package/internal/errors.js +2 -2
- package/internal/errors.js.map +1 -1
- package/internal/errors.mjs.map +1 -1
- package/internal/headers.d.mts +0 -1
- package/internal/headers.d.mts.map +1 -1
- package/internal/headers.d.ts +0 -1
- package/internal/headers.d.ts.map +1 -1
- package/internal/headers.js +1 -1
- package/internal/headers.js.map +1 -1
- package/internal/headers.mjs +1 -1
- package/internal/headers.mjs.map +1 -1
- package/internal/parse.d.mts +0 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts +0 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +1 -2
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs.map +1 -1
- package/internal/qs/stringify.js +1 -2
- package/internal/qs/stringify.js.map +1 -1
- package/internal/qs/stringify.mjs.map +1 -1
- package/internal/qs/utils.js +9 -9
- package/internal/qs/utils.js.map +1 -1
- package/internal/qs/utils.mjs.map +1 -1
- package/internal/request-options.d.mts +0 -1
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +0 -1
- package/internal/request-options.d.ts.map +1 -1
- package/internal/shims.js +5 -6
- package/internal/shims.js.map +1 -1
- package/internal/shims.mjs.map +1 -1
- package/internal/to-file.d.mts +0 -1
- package/internal/to-file.d.mts.map +1 -1
- package/internal/to-file.d.ts +0 -1
- package/internal/to-file.d.ts.map +1 -1
- package/internal/to-file.js +4 -4
- package/internal/to-file.js.map +1 -1
- package/internal/to-file.mjs +3 -2
- package/internal/to-file.mjs.map +1 -1
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +0 -1
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +0 -1
- package/internal/types.d.ts.map +1 -1
- package/internal/uploads.d.mts +1 -3
- package/internal/uploads.d.mts.map +1 -1
- package/internal/uploads.d.ts +1 -3
- package/internal/uploads.d.ts.map +1 -1
- package/internal/uploads.js +16 -6
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +12 -3
- package/internal/uploads.mjs.map +1 -1
- package/internal/utils/base64.d.mts.map +1 -1
- package/internal/utils/base64.d.ts.map +1 -1
- package/internal/utils/base64.js.map +1 -1
- package/internal/utils/base64.mjs.map +1 -1
- package/internal/utils/bytes.d.mts +1 -1
- package/internal/utils/bytes.d.mts.map +1 -1
- package/internal/utils/bytes.d.ts +1 -1
- package/internal/utils/bytes.d.ts.map +1 -1
- package/internal/utils/bytes.js +3 -4
- package/internal/utils/bytes.js.map +1 -1
- package/internal/utils/bytes.mjs.map +1 -1
- package/internal/utils/env.d.mts.map +1 -1
- package/internal/utils/env.d.ts.map +1 -1
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs.map +1 -1
- package/internal/utils/log.d.mts +0 -1
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts +0 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -2
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs.map +1 -1
- package/internal/utils/path.d.mts.map +1 -1
- package/internal/utils/path.d.ts.map +1 -1
- package/internal/utils/path.js +2 -2
- package/internal/utils/path.js.map +1 -1
- package/internal/utils/path.mjs.map +1 -1
- package/internal/utils/sleep.d.mts.map +1 -1
- package/internal/utils/sleep.d.ts.map +1 -1
- package/internal/utils/uuid.d.mts +1 -1
- package/internal/utils/uuid.d.mts.map +1 -1
- package/internal/utils/uuid.d.ts +1 -1
- package/internal/utils/uuid.d.ts.map +1 -1
- package/internal/utils/uuid.js +1 -2
- package/internal/utils/uuid.js.map +1 -1
- package/internal/utils/uuid.mjs +1 -2
- package/internal/utils/uuid.mjs.map +1 -1
- package/internal/utils/values.d.mts.map +1 -1
- package/internal/utils/values.d.ts.map +1 -1
- package/internal/utils/values.js +5 -5
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs.map +1 -1
- package/internal/utils.js +7 -20
- package/internal/utils.js.map +1 -1
- package/lib/index.js +3 -16
- package/lib/index.js.map +1 -1
- package/lib/tokenSigner.js +5 -28
- package/lib/tokenSigner.js.map +1 -1
- package/lib/tokenSigner.mjs.map +1 -1
- package/lib/userTokens.js +1 -1
- package/lib/userTokens.js.map +1 -1
- package/package.json +2 -6
- package/pagination.js +2 -15
- package/pagination.js.map +1 -1
- package/resource.js +2 -15
- package/resource.js.map +1 -1
- package/resources/audiences.d.mts +37 -0
- package/resources/audiences.d.mts.map +1 -1
- package/resources/audiences.d.ts +37 -0
- package/resources/audiences.d.ts.map +1 -1
- package/resources/audiences.js +25 -0
- package/resources/audiences.js.map +1 -1
- package/resources/audiences.mjs +25 -0
- package/resources/audiences.mjs.map +1 -1
- package/resources/bulk-operations.d.mts +7 -0
- package/resources/bulk-operations.d.mts.map +1 -1
- package/resources/bulk-operations.d.ts +7 -0
- package/resources/bulk-operations.d.ts.map +1 -1
- package/resources/bulk-operations.js +7 -0
- package/resources/bulk-operations.js.map +1 -1
- package/resources/bulk-operations.mjs +7 -0
- package/resources/bulk-operations.mjs.map +1 -1
- package/resources/channels/bulk.d.mts +21 -0
- package/resources/channels/bulk.d.mts.map +1 -1
- package/resources/channels/bulk.d.ts +21 -0
- package/resources/channels/bulk.d.ts.map +1 -1
- package/resources/channels/bulk.js +21 -0
- package/resources/channels/bulk.js.map +1 -1
- package/resources/channels/bulk.mjs +21 -0
- package/resources/channels/bulk.mjs.map +1 -1
- package/resources/channels/channels.js +2 -24
- package/resources/channels/channels.js.map +1 -1
- package/resources/channels.js +2 -15
- package/resources/channels.js.map +1 -1
- package/resources/integrations/integrations.js +3 -25
- package/resources/integrations/integrations.js.map +1 -1
- package/resources/integrations.js +2 -15
- package/resources/integrations.js.map +1 -1
- package/resources/messages/batch.d.mts +76 -0
- package/resources/messages/batch.d.mts.map +1 -1
- package/resources/messages/batch.d.ts +76 -0
- package/resources/messages/batch.d.ts.map +1 -1
- package/resources/messages/batch.js +76 -0
- package/resources/messages/batch.js.map +1 -1
- package/resources/messages/batch.mjs +76 -0
- package/resources/messages/batch.mjs.map +1 -1
- package/resources/messages/index.d.mts +0 -1
- package/resources/messages/index.d.mts.map +1 -1
- package/resources/messages/index.d.ts +0 -1
- package/resources/messages/index.d.ts.map +1 -1
- package/resources/messages/index.js +1 -3
- package/resources/messages/index.js.map +1 -1
- package/resources/messages/index.mjs +0 -1
- package/resources/messages/index.mjs.map +1 -1
- package/resources/messages/messages.d.mts +101 -4
- package/resources/messages/messages.d.mts.map +1 -1
- package/resources/messages/messages.d.ts +101 -4
- package/resources/messages/messages.d.ts.map +1 -1
- package/resources/messages/messages.js +103 -28
- package/resources/messages/messages.js.map +1 -1
- package/resources/messages/messages.mjs +101 -4
- package/resources/messages/messages.mjs.map +1 -1
- package/resources/messages.js +2 -15
- package/resources/messages.js.map +1 -1
- package/resources/objects/bulk.d.mts +49 -0
- package/resources/objects/bulk.d.mts.map +1 -1
- package/resources/objects/bulk.d.ts +49 -0
- package/resources/objects/bulk.d.ts.map +1 -1
- package/resources/objects/bulk.js +49 -0
- package/resources/objects/bulk.js.map +1 -1
- package/resources/objects/bulk.mjs +49 -0
- package/resources/objects/bulk.mjs.map +1 -1
- package/resources/objects/objects.d.mts +179 -5
- package/resources/objects/objects.d.mts.map +1 -1
- package/resources/objects/objects.d.ts +179 -5
- package/resources/objects/objects.d.ts.map +1 -1
- package/resources/objects/objects.js +173 -24
- package/resources/objects/objects.js.map +1 -1
- package/resources/objects/objects.mjs +171 -0
- package/resources/objects/objects.mjs.map +1 -1
- package/resources/objects.js +2 -15
- package/resources/objects.js.map +1 -1
- package/resources/providers/ms-teams.d.mts +40 -0
- package/resources/providers/ms-teams.d.mts.map +1 -1
- package/resources/providers/ms-teams.d.ts +40 -0
- package/resources/providers/ms-teams.d.ts.map +1 -1
- package/resources/providers/ms-teams.js +40 -0
- package/resources/providers/ms-teams.js.map +1 -1
- package/resources/providers/ms-teams.mjs +40 -0
- package/resources/providers/ms-teams.mjs.map +1 -1
- package/resources/providers/providers.js +3 -25
- package/resources/providers/providers.js.map +1 -1
- package/resources/providers/slack.d.mts +27 -0
- package/resources/providers/slack.d.mts.map +1 -1
- package/resources/providers/slack.d.ts +27 -0
- package/resources/providers/slack.d.ts.map +1 -1
- package/resources/providers/slack.js +27 -0
- package/resources/providers/slack.js.map +1 -1
- package/resources/providers/slack.mjs +27 -0
- package/resources/providers/slack.mjs.map +1 -1
- package/resources/providers.js +2 -15
- package/resources/providers.js.map +1 -1
- package/resources/recipients/channel-data.d.mts +1 -1
- package/resources/recipients/channel-data.d.mts.map +1 -1
- package/resources/recipients/channel-data.d.ts +1 -1
- package/resources/recipients/channel-data.d.ts.map +1 -1
- package/resources/recipients/recipients.js +4 -26
- package/resources/recipients/recipients.js.map +1 -1
- package/resources/recipients.js +2 -15
- package/resources/recipients.js.map +1 -1
- package/resources/schedules/bulk.d.mts +30 -0
- package/resources/schedules/bulk.d.mts.map +1 -1
- package/resources/schedules/bulk.d.ts +30 -0
- package/resources/schedules/bulk.d.ts.map +1 -1
- package/resources/schedules/bulk.js +30 -0
- package/resources/schedules/bulk.js.map +1 -1
- package/resources/schedules/bulk.mjs +30 -0
- package/resources/schedules/bulk.mjs.map +1 -1
- package/resources/schedules/schedules.d.mts +75 -2
- package/resources/schedules/schedules.d.mts.map +1 -1
- package/resources/schedules/schedules.d.ts +75 -2
- package/resources/schedules/schedules.d.ts.map +1 -1
- package/resources/schedules/schedules.js +76 -24
- package/resources/schedules/schedules.js.map +1 -1
- package/resources/schedules/schedules.mjs +74 -0
- package/resources/schedules/schedules.mjs.map +1 -1
- package/resources/schedules.js +2 -15
- package/resources/schedules.js.map +1 -1
- package/resources/tenants/bulk.d.mts +14 -0
- package/resources/tenants/bulk.d.mts.map +1 -1
- package/resources/tenants/bulk.d.ts +14 -0
- package/resources/tenants/bulk.d.ts.map +1 -1
- package/resources/tenants/bulk.js +14 -0
- package/resources/tenants/bulk.js.map +1 -1
- package/resources/tenants/bulk.mjs +14 -0
- package/resources/tenants/bulk.mjs.map +1 -1
- package/resources/tenants/tenants.d.mts +33 -0
- package/resources/tenants/tenants.d.mts.map +1 -1
- package/resources/tenants/tenants.d.ts +33 -0
- package/resources/tenants/tenants.d.ts.map +1 -1
- package/resources/tenants/tenants.js +35 -24
- package/resources/tenants/tenants.js.map +1 -1
- package/resources/tenants/tenants.mjs +33 -0
- package/resources/tenants/tenants.mjs.map +1 -1
- package/resources/tenants.js +2 -15
- package/resources/tenants.js.map +1 -1
- package/resources/users/bulk.d.mts +41 -0
- package/resources/users/bulk.d.mts.map +1 -1
- package/resources/users/bulk.d.ts +41 -0
- package/resources/users/bulk.d.ts.map +1 -1
- package/resources/users/bulk.js +41 -0
- package/resources/users/bulk.js.map +1 -1
- package/resources/users/bulk.mjs +41 -0
- package/resources/users/bulk.mjs.map +1 -1
- package/resources/users/feeds.d.mts +19 -0
- package/resources/users/feeds.d.mts.map +1 -1
- package/resources/users/feeds.d.ts +19 -0
- package/resources/users/feeds.d.ts.map +1 -1
- package/resources/users/feeds.js +19 -0
- package/resources/users/feeds.js.map +1 -1
- package/resources/users/feeds.mjs +19 -0
- package/resources/users/feeds.mjs.map +1 -1
- package/resources/users/guides.d.mts +68 -0
- package/resources/users/guides.d.mts.map +1 -1
- package/resources/users/guides.d.ts +68 -0
- package/resources/users/guides.d.ts.map +1 -1
- package/resources/users/guides.js +68 -0
- package/resources/users/guides.js.map +1 -1
- package/resources/users/guides.mjs +68 -0
- package/resources/users/guides.mjs.map +1 -1
- package/resources/users/users.d.mts +182 -15
- package/resources/users/users.d.mts.map +1 -1
- package/resources/users/users.d.ts +182 -15
- package/resources/users/users.d.ts.map +1 -1
- package/resources/users/users.js +143 -26
- package/resources/users/users.js.map +1 -1
- package/resources/users/users.mjs +139 -0
- package/resources/users/users.mjs.map +1 -1
- package/resources/users.js +2 -15
- package/resources/users.js.map +1 -1
- package/resources/workflows.d.mts +30 -0
- package/resources/workflows.d.mts.map +1 -1
- package/resources/workflows.d.ts +30 -0
- package/resources/workflows.d.ts.map +1 -1
- package/resources/workflows.js +30 -0
- package/resources/workflows.js.map +1 -1
- package/resources/workflows.mjs +30 -0
- package/resources/workflows.mjs.map +1 -1
- package/resources.js +2 -15
- package/resources.js.map +1 -1
- package/src/client.ts +17 -0
- package/src/internal/headers.ts +1 -1
- package/src/internal/to-file.ts +4 -2
- package/src/internal/uploads.ts +16 -4
- package/src/internal/utils/uuid.ts +1 -3
- package/src/resources/audiences.ts +37 -0
- package/src/resources/bulk-operations.ts +7 -0
- package/src/resources/channels/bulk.ts +21 -0
- package/src/resources/messages/batch.ts +76 -0
- package/src/resources/messages/index.ts +0 -1
- package/src/resources/messages/messages.ts +101 -6
- package/src/resources/objects/bulk.ts +49 -0
- package/src/resources/objects/objects.ts +179 -5
- package/src/resources/providers/ms-teams.ts +40 -0
- package/src/resources/providers/slack.ts +27 -0
- package/src/resources/recipients/channel-data.ts +4 -1
- package/src/resources/schedules/bulk.ts +30 -0
- package/src/resources/schedules/schedules.ts +75 -2
- package/src/resources/tenants/bulk.ts +14 -0
- package/src/resources/tenants/tenants.ts +33 -0
- package/src/resources/users/bulk.ts +41 -0
- package/src/resources/users/feeds.ts +19 -0
- package/src/resources/users/guides.ts +68 -0
- package/src/resources/users/users.ts +188 -15
- package/src/resources/workflows.ts +30 -0
- package/src/version.ts +1 -1
- package/uploads.js +2 -15
- package/uploads.js.map +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/internal/shims/crypto.d.mts +0 -13
- package/internal/shims/crypto.d.mts.map +0 -1
- package/internal/shims/crypto.d.ts +0 -13
- package/internal/shims/crypto.d.ts.map +0 -1
- package/internal/shims/crypto.js +0 -13
- package/internal/shims/crypto.js.map +0 -1
- package/internal/shims/crypto.mjs +0 -9
- package/internal/shims/crypto.mjs.map +0 -1
- package/internal/shims/file.d.mts +0 -23
- package/internal/shims/file.d.mts.map +0 -1
- package/internal/shims/file.d.ts +0 -23
- package/internal/shims/file.d.ts.map +0 -1
- package/internal/shims/file.js +0 -16
- package/internal/shims/file.js.map +0 -1
- package/internal/shims/file.mjs +0 -12
- package/internal/shims/file.mjs.map +0 -1
- package/internal/shims/getBuiltinModule.d.mts +0 -11
- package/internal/shims/getBuiltinModule.d.mts.map +0 -1
- package/internal/shims/getBuiltinModule.d.ts +0 -11
- package/internal/shims/getBuiltinModule.d.ts.map +0 -1
- package/internal/shims/getBuiltinModule.js +0 -71
- package/internal/shims/getBuiltinModule.js.map +0 -1
- package/internal/shims/getBuiltinModule.mjs +0 -67
- package/internal/shims/getBuiltinModule.mjs.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.mts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.mts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.d.ts +0 -2
- package/internal/shims/nullGetBuiltinModule.d.ts.map +0 -1
- package/internal/shims/nullGetBuiltinModule.js +0 -5
- package/internal/shims/nullGetBuiltinModule.js.map +0 -1
- package/internal/shims/nullGetBuiltinModule.mjs +0 -2
- package/internal/shims/nullGetBuiltinModule.mjs.map +0 -1
- package/resources/messages/activities.d.mts +0 -22
- package/resources/messages/activities.d.mts.map +0 -1
- package/resources/messages/activities.d.ts +0 -22
- package/resources/messages/activities.d.ts.map +0 -1
- package/resources/messages/activities.js +0 -17
- package/resources/messages/activities.js.map +0 -1
- package/resources/messages/activities.mjs +0 -13
- package/resources/messages/activities.mjs.map +0 -1
- package/src/internal/shims/crypto.ts +0 -18
- package/src/internal/shims/file.ts +0 -32
- package/src/internal/shims/getBuiltinModule.ts +0 -66
- package/src/internal/shims/nullGetBuiltinModule.ts +0 -1
- package/src/resources/messages/activities.ts +0 -38
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
|
-
import * as ActivitiesAPI from './activities';
|
|
5
|
-
import { Activities, ActivityListParams } from './activities';
|
|
6
4
|
import * as BatchAPI from './batch';
|
|
7
5
|
import {
|
|
8
6
|
Batch,
|
|
@@ -37,10 +35,17 @@ import { path } from '../../internal/utils/path';
|
|
|
37
35
|
|
|
38
36
|
export class Messages extends APIResource {
|
|
39
37
|
batch: BatchAPI.Batch = new BatchAPI.Batch(this._client);
|
|
40
|
-
activities: ActivitiesAPI.Activities = new ActivitiesAPI.Activities(this._client);
|
|
41
38
|
|
|
42
39
|
/**
|
|
43
40
|
* Returns a paginated list of messages for the current environment.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* // Automatically fetches more pages as needed.
|
|
45
|
+
* for await (const message of client.messages.list()) {
|
|
46
|
+
* // ...
|
|
47
|
+
* }
|
|
48
|
+
* ```
|
|
44
49
|
*/
|
|
45
50
|
list(
|
|
46
51
|
query: MessageListParams | null | undefined = {},
|
|
@@ -52,6 +57,13 @@ export class Messages extends APIResource {
|
|
|
52
57
|
/**
|
|
53
58
|
* Archives a message for the user. Archived messages are hidden from the default
|
|
54
59
|
* message list in the feed but can still be accessed and unarchived later.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const message = await client.messages.archive(
|
|
64
|
+
* '1jNaXzB2RZX3LY8wVQnfCKyPnv7',
|
|
65
|
+
* );
|
|
66
|
+
* ```
|
|
55
67
|
*/
|
|
56
68
|
archive(messageID: string, options?: RequestOptions): APIPromise<Message> {
|
|
57
69
|
return this._client.put(path`/v1/messages/${messageID}/archived`, options);
|
|
@@ -59,6 +71,13 @@ export class Messages extends APIResource {
|
|
|
59
71
|
|
|
60
72
|
/**
|
|
61
73
|
* Retrieves a specific message by its ID.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const message = await client.messages.get(
|
|
78
|
+
* '1jNaXzB2RZX3LY8wVQnfCKyPnv7',
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
62
81
|
*/
|
|
63
82
|
get(messageID: string, options?: RequestOptions): APIPromise<Message> {
|
|
64
83
|
return this._client.get(path`/v1/messages/${messageID}`, options);
|
|
@@ -67,6 +86,13 @@ export class Messages extends APIResource {
|
|
|
67
86
|
/**
|
|
68
87
|
* Returns the fully rendered contents of a message, where the response depends on
|
|
69
88
|
* which channel the message was sent through.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```ts
|
|
92
|
+
* const response = await client.messages.getContent(
|
|
93
|
+
* 'message_id',
|
|
94
|
+
* );
|
|
95
|
+
* ```
|
|
70
96
|
*/
|
|
71
97
|
getContent(messageID: string, options?: RequestOptions): APIPromise<MessageGetContentResponse> {
|
|
72
98
|
return this._client.get(path`/v1/messages/${messageID}/content`, options);
|
|
@@ -74,6 +100,16 @@ export class Messages extends APIResource {
|
|
|
74
100
|
|
|
75
101
|
/**
|
|
76
102
|
* Returns a paginated list of activities for the specified message.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* // Automatically fetches more pages as needed.
|
|
107
|
+
* for await (const activity of client.messages.listActivities(
|
|
108
|
+
* 'message_id',
|
|
109
|
+
* )) {
|
|
110
|
+
* // ...
|
|
111
|
+
* }
|
|
112
|
+
* ```
|
|
77
113
|
*/
|
|
78
114
|
listActivities(
|
|
79
115
|
messageID: string,
|
|
@@ -88,6 +124,16 @@ export class Messages extends APIResource {
|
|
|
88
124
|
|
|
89
125
|
/**
|
|
90
126
|
* Returns a paginated list of delivery logs for the specified message.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* // Automatically fetches more pages as needed.
|
|
131
|
+
* for await (const messageDeliveryLog of client.messages.listDeliveryLogs(
|
|
132
|
+
* 'message_id',
|
|
133
|
+
* )) {
|
|
134
|
+
* // ...
|
|
135
|
+
* }
|
|
136
|
+
* ```
|
|
91
137
|
*/
|
|
92
138
|
listDeliveryLogs(
|
|
93
139
|
messageID: string,
|
|
@@ -103,6 +149,16 @@ export class Messages extends APIResource {
|
|
|
103
149
|
|
|
104
150
|
/**
|
|
105
151
|
* Returns a paginated list of events for the specified message.
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```ts
|
|
155
|
+
* // Automatically fetches more pages as needed.
|
|
156
|
+
* for await (const messageEvent of client.messages.listEvents(
|
|
157
|
+
* 'message_id',
|
|
158
|
+
* )) {
|
|
159
|
+
* // ...
|
|
160
|
+
* }
|
|
161
|
+
* ```
|
|
106
162
|
*/
|
|
107
163
|
listEvents(
|
|
108
164
|
messageID: string,
|
|
@@ -121,6 +177,13 @@ export class Messages extends APIResource {
|
|
|
121
177
|
* Cannot include more than 5 key-value pairs, must not contain nested data. Read
|
|
122
178
|
* more about message engagement statuses
|
|
123
179
|
* [here](/send-notifications/message-statuses#engagement-status).
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* ```ts
|
|
183
|
+
* const message = await client.messages.markAsInteracted(
|
|
184
|
+
* '1jNaXzB2RZX3LY8wVQnfCKyPnv7',
|
|
185
|
+
* );
|
|
186
|
+
* ```
|
|
124
187
|
*/
|
|
125
188
|
markAsInteracted(
|
|
126
189
|
messageID: string,
|
|
@@ -134,6 +197,13 @@ export class Messages extends APIResource {
|
|
|
134
197
|
* Marks a message as `read`. This indicates that the user has read the message
|
|
135
198
|
* content. Read more about message engagement statuses
|
|
136
199
|
* [here](/send-notifications/message-statuses#engagement-status).
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```ts
|
|
203
|
+
* const message = await client.messages.markAsRead(
|
|
204
|
+
* '1jNaXzB2RZX3LY8wVQnfCKyPnv7',
|
|
205
|
+
* );
|
|
206
|
+
* ```
|
|
137
207
|
*/
|
|
138
208
|
markAsRead(messageID: string, options?: RequestOptions): APIPromise<Message> {
|
|
139
209
|
return this._client.put(path`/v1/messages/${messageID}/read`, options);
|
|
@@ -143,6 +213,13 @@ export class Messages extends APIResource {
|
|
|
143
213
|
* Marks a message as `seen`. This indicates that the user has viewed the message
|
|
144
214
|
* in their feed or inbox. Read more about message engagement statuses
|
|
145
215
|
* [here](/send-notifications/message-statuses#engagement-status).
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```ts
|
|
219
|
+
* const message = await client.messages.markAsSeen(
|
|
220
|
+
* '1jNaXzB2RZX3LY8wVQnfCKyPnv7',
|
|
221
|
+
* );
|
|
222
|
+
* ```
|
|
146
223
|
*/
|
|
147
224
|
markAsSeen(messageID: string, options?: RequestOptions): APIPromise<Message> {
|
|
148
225
|
return this._client.put(path`/v1/messages/${messageID}/seen`, options);
|
|
@@ -152,6 +229,13 @@ export class Messages extends APIResource {
|
|
|
152
229
|
* Marks a message as `unread`. This reverses the `read` state. Read more about
|
|
153
230
|
* message engagement statuses
|
|
154
231
|
* [here](/send-notifications/message-statuses#engagement-status).
|
|
232
|
+
*
|
|
233
|
+
* @example
|
|
234
|
+
* ```ts
|
|
235
|
+
* const message = await client.messages.markAsUnread(
|
|
236
|
+
* '1jNaXzB2RZX3LY8wVQnfCKyPnv7',
|
|
237
|
+
* );
|
|
238
|
+
* ```
|
|
155
239
|
*/
|
|
156
240
|
markAsUnread(messageID: string, options?: RequestOptions): APIPromise<Message> {
|
|
157
241
|
return this._client.delete(path`/v1/messages/${messageID}/read`, options);
|
|
@@ -161,6 +245,13 @@ export class Messages extends APIResource {
|
|
|
161
245
|
* Marks a message as `unseen`. This reverses the `seen` state. Read more about
|
|
162
246
|
* message engagement statuses
|
|
163
247
|
* [here](/send-notifications/message-statuses#engagement-status).
|
|
248
|
+
*
|
|
249
|
+
* @example
|
|
250
|
+
* ```ts
|
|
251
|
+
* const message = await client.messages.markAsUnseen(
|
|
252
|
+
* '1jNaXzB2RZX3LY8wVQnfCKyPnv7',
|
|
253
|
+
* );
|
|
254
|
+
* ```
|
|
164
255
|
*/
|
|
165
256
|
markAsUnseen(messageID: string, options?: RequestOptions): APIPromise<Message> {
|
|
166
257
|
return this._client.delete(path`/v1/messages/${messageID}/seen`, options);
|
|
@@ -169,6 +260,13 @@ export class Messages extends APIResource {
|
|
|
169
260
|
/**
|
|
170
261
|
* Removes a message from the archived state, making it visible in the default
|
|
171
262
|
* message list in the feed again.
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```ts
|
|
266
|
+
* const message = await client.messages.unarchive(
|
|
267
|
+
* '1jNaXzB2RZX3LY8wVQnfCKyPnv7',
|
|
268
|
+
* );
|
|
269
|
+
* ```
|
|
172
270
|
*/
|
|
173
271
|
unarchive(messageID: string, options?: RequestOptions): APIPromise<Message> {
|
|
174
272
|
return this._client.delete(path`/v1/messages/${messageID}/archived`, options);
|
|
@@ -910,7 +1008,6 @@ export interface MessageMarkAsInteractedParams {
|
|
|
910
1008
|
}
|
|
911
1009
|
|
|
912
1010
|
Messages.Batch = Batch;
|
|
913
|
-
Messages.Activities = Activities;
|
|
914
1011
|
|
|
915
1012
|
export declare namespace Messages {
|
|
916
1013
|
export {
|
|
@@ -949,6 +1046,4 @@ export declare namespace Messages {
|
|
|
949
1046
|
type BatchMarkAsUnseenParams as BatchMarkAsUnseenParams,
|
|
950
1047
|
type BatchUnarchiveParams as BatchUnarchiveParams,
|
|
951
1048
|
};
|
|
952
|
-
|
|
953
|
-
export { Activities as Activities, type ActivityListParams as ActivityListParams };
|
|
954
1049
|
}
|
|
@@ -11,6 +11,14 @@ import { path } from '../../internal/utils/path';
|
|
|
11
11
|
export class Bulk extends APIResource {
|
|
12
12
|
/**
|
|
13
13
|
* Bulk deletes objects from the specified collection.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const bulkOperation = await client.objects.bulk.delete(
|
|
18
|
+
* 'collection',
|
|
19
|
+
* { object_ids: ['obj_123', 'obj_456', 'obj_789'] },
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
14
22
|
*/
|
|
15
23
|
delete(
|
|
16
24
|
collection: string,
|
|
@@ -26,6 +34,20 @@ export class Bulk extends APIResource {
|
|
|
26
34
|
* also handles
|
|
27
35
|
* [inline identifications](/managing-recipients/identifying-recipients#inline-identifying-recipients)
|
|
28
36
|
* for the `recipient` field.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const bulkOperation =
|
|
41
|
+
* await client.objects.bulk.addSubscriptions('projects', {
|
|
42
|
+
* subscriptions: [
|
|
43
|
+
* {
|
|
44
|
+
* id: 'project-1',
|
|
45
|
+
* properties: null,
|
|
46
|
+
* recipients: [{ id: 'user_1' }],
|
|
47
|
+
* },
|
|
48
|
+
* ],
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
29
51
|
*/
|
|
30
52
|
addSubscriptions(
|
|
31
53
|
collection: string,
|
|
@@ -37,6 +59,33 @@ export class Bulk extends APIResource {
|
|
|
37
59
|
|
|
38
60
|
/**
|
|
39
61
|
* Bulk sets up to 1,000 objects at a time in the specified collection.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* const bulkOperation = await client.objects.bulk.set(
|
|
66
|
+
* 'collection',
|
|
67
|
+
* {
|
|
68
|
+
* objects: [
|
|
69
|
+
* {
|
|
70
|
+
* collection: 'projects',
|
|
71
|
+
* id: 'project_1',
|
|
72
|
+
* name: {
|
|
73
|
+
* '0': 'M',
|
|
74
|
+
* '1': 'y',
|
|
75
|
+
* '2': ' ',
|
|
76
|
+
* '3': 'p',
|
|
77
|
+
* '4': 'r',
|
|
78
|
+
* '5': 'o',
|
|
79
|
+
* '6': 'j',
|
|
80
|
+
* '7': 'e',
|
|
81
|
+
* '8': 'c',
|
|
82
|
+
* '9': 't',
|
|
83
|
+
* },
|
|
84
|
+
* },
|
|
85
|
+
* ],
|
|
86
|
+
* },
|
|
87
|
+
* );
|
|
88
|
+
* ```
|
|
40
89
|
*/
|
|
41
90
|
set(
|
|
42
91
|
collection: string,
|
|
@@ -24,6 +24,16 @@ export class Objects extends APIResource {
|
|
|
24
24
|
/**
|
|
25
25
|
* Returns a paginated list of objects from the specified collection. Optionally
|
|
26
26
|
* includes preference data for the objects.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* // Automatically fetches more pages as needed.
|
|
31
|
+
* for await (const object of client.objects.list(
|
|
32
|
+
* 'collection',
|
|
33
|
+
* )) {
|
|
34
|
+
* // ...
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
27
37
|
*/
|
|
28
38
|
list(
|
|
29
39
|
collection: string,
|
|
@@ -39,6 +49,14 @@ export class Objects extends APIResource {
|
|
|
39
49
|
/**
|
|
40
50
|
* Permanently removes an object from the specified collection. This operation
|
|
41
51
|
* cannot be undone.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const object = await client.objects.delete(
|
|
56
|
+
* 'collection',
|
|
57
|
+
* 'id',
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
42
60
|
*/
|
|
43
61
|
delete(collection: string, id: string, options?: RequestOptions): APIPromise<string> {
|
|
44
62
|
return this._client.delete(path`/v1/objects/${collection}/${id}`, options);
|
|
@@ -49,6 +67,18 @@ export class Objects extends APIResource {
|
|
|
49
67
|
* updated. This endpoint also handles
|
|
50
68
|
* [inline identifications](/managing-recipients/identifying-recipients#inline-identifying-recipients)
|
|
51
69
|
* for the `recipient`.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const subscriptions = await client.objects.addSubscriptions(
|
|
74
|
+
* 'collection',
|
|
75
|
+
* 'object_id',
|
|
76
|
+
* {
|
|
77
|
+
* recipients: ['user_1', 'user_2'],
|
|
78
|
+
* properties: { key: 'value' },
|
|
79
|
+
* },
|
|
80
|
+
* );
|
|
81
|
+
* ```
|
|
52
82
|
*/
|
|
53
83
|
addSubscriptions(
|
|
54
84
|
collection: string,
|
|
@@ -62,6 +92,16 @@ export class Objects extends APIResource {
|
|
|
62
92
|
/**
|
|
63
93
|
* Delete subscriptions for the specified recipients from an object. Returns the
|
|
64
94
|
* list of deleted subscriptions.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const subscriptions =
|
|
99
|
+
* await client.objects.deleteSubscriptions(
|
|
100
|
+
* 'collection',
|
|
101
|
+
* 'object_id',
|
|
102
|
+
* { recipients: ['user_123'] },
|
|
103
|
+
* );
|
|
104
|
+
* ```
|
|
65
105
|
*/
|
|
66
106
|
deleteSubscriptions(
|
|
67
107
|
collection: string,
|
|
@@ -78,6 +118,11 @@ export class Objects extends APIResource {
|
|
|
78
118
|
/**
|
|
79
119
|
* Retrieves a specific object by its ID from the specified collection. Returns the
|
|
80
120
|
* object with all its properties.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* const object = await client.objects.get('collection', 'id');
|
|
125
|
+
* ```
|
|
81
126
|
*/
|
|
82
127
|
get(collection: string, id: string, options?: RequestOptions): APIPromise<Object> {
|
|
83
128
|
return this._client.get(path`/v1/objects/${collection}/${id}`, options);
|
|
@@ -85,6 +130,15 @@ export class Objects extends APIResource {
|
|
|
85
130
|
|
|
86
131
|
/**
|
|
87
132
|
* Returns the channel data for the specified object and channel.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* const channelData = await client.objects.getChannelData(
|
|
137
|
+
* 'collection',
|
|
138
|
+
* 'object_id',
|
|
139
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
140
|
+
* );
|
|
141
|
+
* ```
|
|
88
142
|
*/
|
|
89
143
|
getChannelData(
|
|
90
144
|
collection: string,
|
|
@@ -97,6 +151,15 @@ export class Objects extends APIResource {
|
|
|
97
151
|
|
|
98
152
|
/**
|
|
99
153
|
* Returns the preference set for the specified object and preference set `id`.
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* ```ts
|
|
157
|
+
* const preferenceSet = await client.objects.getPreferences(
|
|
158
|
+
* 'collection',
|
|
159
|
+
* 'object_id',
|
|
160
|
+
* 'default',
|
|
161
|
+
* );
|
|
162
|
+
* ```
|
|
100
163
|
*/
|
|
101
164
|
getPreferences(
|
|
102
165
|
collection: string,
|
|
@@ -111,6 +174,17 @@ export class Objects extends APIResource {
|
|
|
111
174
|
* Returns a paginated list of messages for a specific object in the given
|
|
112
175
|
* collection. Allows filtering by message status and provides various sorting
|
|
113
176
|
* options.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* // Automatically fetches more pages as needed.
|
|
181
|
+
* for await (const message of client.objects.listMessages(
|
|
182
|
+
* 'projects',
|
|
183
|
+
* 'project-123',
|
|
184
|
+
* )) {
|
|
185
|
+
* // ...
|
|
186
|
+
* }
|
|
187
|
+
* ```
|
|
114
188
|
*/
|
|
115
189
|
listMessages(
|
|
116
190
|
collection: string,
|
|
@@ -127,6 +201,14 @@ export class Objects extends APIResource {
|
|
|
127
201
|
|
|
128
202
|
/**
|
|
129
203
|
* Returns a paginated list of preference sets for the specified object.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```ts
|
|
207
|
+
* const preferenceSets = await client.objects.listPreferences(
|
|
208
|
+
* 'collection',
|
|
209
|
+
* 'object_id',
|
|
210
|
+
* );
|
|
211
|
+
* ```
|
|
130
212
|
*/
|
|
131
213
|
listPreferences(
|
|
132
214
|
collection: string,
|
|
@@ -138,6 +220,17 @@ export class Objects extends APIResource {
|
|
|
138
220
|
|
|
139
221
|
/**
|
|
140
222
|
* Returns a paginated list of schedules for an object.
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```ts
|
|
226
|
+
* // Automatically fetches more pages as needed.
|
|
227
|
+
* for await (const schedule of client.objects.listSchedules(
|
|
228
|
+
* 'collection',
|
|
229
|
+
* 'id',
|
|
230
|
+
* )) {
|
|
231
|
+
* // ...
|
|
232
|
+
* }
|
|
233
|
+
* ```
|
|
141
234
|
*/
|
|
142
235
|
listSchedules(
|
|
143
236
|
collection: string,
|
|
@@ -156,6 +249,17 @@ export class Objects extends APIResource {
|
|
|
156
249
|
* List subscriptions for an object. Either list the recipients that subscribe to
|
|
157
250
|
* the provided object, or list the objects that the provided object is subscribed
|
|
158
251
|
* to. Determined by the `mode` query parameter.
|
|
252
|
+
*
|
|
253
|
+
* @example
|
|
254
|
+
* ```ts
|
|
255
|
+
* // Automatically fetches more pages as needed.
|
|
256
|
+
* for await (const subscription of client.objects.listSubscriptions(
|
|
257
|
+
* 'collection',
|
|
258
|
+
* 'object_id',
|
|
259
|
+
* )) {
|
|
260
|
+
* // ...
|
|
261
|
+
* }
|
|
262
|
+
* ```
|
|
159
263
|
*/
|
|
160
264
|
listSubscriptions(
|
|
161
265
|
collection: string,
|
|
@@ -174,6 +278,33 @@ export class Objects extends APIResource {
|
|
|
174
278
|
* Creates a new object or updates an existing one in the specified collection.
|
|
175
279
|
* This operation is used to identify objects with their properties, as well as
|
|
176
280
|
* optional preferences and channel data.
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```ts
|
|
284
|
+
* const object = await client.objects.set(
|
|
285
|
+
* 'collection',
|
|
286
|
+
* 'id',
|
|
287
|
+
* {
|
|
288
|
+
* channel_data: {
|
|
289
|
+
* '97c5837d-c65c-4d54-aa39-080eeb81c69d': {
|
|
290
|
+
* tokens: ['push_token_123'],
|
|
291
|
+
* },
|
|
292
|
+
* },
|
|
293
|
+
* locale: 'en-US',
|
|
294
|
+
* preferences: {
|
|
295
|
+
* default: {
|
|
296
|
+
* channel_types: { email: true },
|
|
297
|
+
* workflows: {
|
|
298
|
+
* 'dinosaurs-loose': {
|
|
299
|
+
* channel_types: { email: true },
|
|
300
|
+
* },
|
|
301
|
+
* },
|
|
302
|
+
* },
|
|
303
|
+
* },
|
|
304
|
+
* timezone: 'America/New_York',
|
|
305
|
+
* },
|
|
306
|
+
* );
|
|
307
|
+
* ```
|
|
177
308
|
*/
|
|
178
309
|
set(collection: string, id: string, body: ObjectSetParams, options?: RequestOptions): APIPromise<Object> {
|
|
179
310
|
return this._client.put(path`/v1/objects/${collection}/${id}`, { body, ...options });
|
|
@@ -183,6 +314,16 @@ export class Objects extends APIResource {
|
|
|
183
314
|
* Sets the channel data for the specified object and channel. If no object exists
|
|
184
315
|
* in the current environment for the given `collection` and `object_id`, Knock
|
|
185
316
|
* will create the object as part of this request.
|
|
317
|
+
*
|
|
318
|
+
* @example
|
|
319
|
+
* ```ts
|
|
320
|
+
* const channelData = await client.objects.setChannelData(
|
|
321
|
+
* 'collection',
|
|
322
|
+
* 'object_id',
|
|
323
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
324
|
+
* { data: { tokens: ['push_token_1'] } },
|
|
325
|
+
* );
|
|
326
|
+
* ```
|
|
186
327
|
*/
|
|
187
328
|
setChannelData(
|
|
188
329
|
collection: string,
|
|
@@ -204,6 +345,27 @@ export class Objects extends APIResource {
|
|
|
204
345
|
* `:object_id`, Knock will create the object as part of this request. The
|
|
205
346
|
* preference set `:id` can be either `default` or a `tenant.id`. Learn more about
|
|
206
347
|
* [per-tenant preferences](/preferences/tenant-preferences).
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* ```ts
|
|
351
|
+
* const preferenceSet = await client.objects.setPreferences(
|
|
352
|
+
* 'collection',
|
|
353
|
+
* 'object_id',
|
|
354
|
+
* 'default',
|
|
355
|
+
* {
|
|
356
|
+
* categories: {
|
|
357
|
+
* marketing: false,
|
|
358
|
+
* transactional: { channel_types: { email: false } },
|
|
359
|
+
* },
|
|
360
|
+
* channel_types: { email: true },
|
|
361
|
+
* workflows: {
|
|
362
|
+
* 'dinosaurs-loose': {
|
|
363
|
+
* channel_types: { email: false },
|
|
364
|
+
* },
|
|
365
|
+
* },
|
|
366
|
+
* },
|
|
367
|
+
* );
|
|
368
|
+
* ```
|
|
207
369
|
*/
|
|
208
370
|
setPreferences(
|
|
209
371
|
collection: string,
|
|
@@ -220,6 +382,15 @@ export class Objects extends APIResource {
|
|
|
220
382
|
|
|
221
383
|
/**
|
|
222
384
|
* Unsets the channel data for the specified object and channel.
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* ```ts
|
|
388
|
+
* const response = await client.objects.unsetChannelData(
|
|
389
|
+
* 'collection',
|
|
390
|
+
* 'object_id',
|
|
391
|
+
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
|
|
392
|
+
* );
|
|
393
|
+
* ```
|
|
223
394
|
*/
|
|
224
395
|
unsetChannelData(
|
|
225
396
|
collection: string,
|
|
@@ -297,7 +468,10 @@ export interface Object {
|
|
|
297
468
|
*/
|
|
298
469
|
created_at?: string | null;
|
|
299
470
|
|
|
300
|
-
|
|
471
|
+
/**
|
|
472
|
+
* The custom properties associated with the object.
|
|
473
|
+
*/
|
|
474
|
+
properties?: Record<string, unknown>;
|
|
301
475
|
}
|
|
302
476
|
|
|
303
477
|
/**
|
|
@@ -508,10 +682,10 @@ export interface ObjectSetParams {
|
|
|
508
682
|
preferences?: PreferencesAPI.InlinePreferenceSetRequest;
|
|
509
683
|
|
|
510
684
|
/**
|
|
511
|
-
* The timezone of the object. Must be a
|
|
512
|
-
* [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
|
|
513
|
-
* Used
|
|
514
|
-
* [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
|
|
685
|
+
* The timezone of the object. Must be a
|
|
686
|
+
* valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
|
|
687
|
+
* Used
|
|
688
|
+
* for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
|
|
515
689
|
*/
|
|
516
690
|
timezone?: string | null;
|
|
517
691
|
|
|
@@ -10,6 +10,14 @@ export class MsTeams extends APIResource {
|
|
|
10
10
|
/**
|
|
11
11
|
* Check if a connection to Microsoft Teams has been authorized for a given
|
|
12
12
|
* Microsoft Teams tenant object.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const response = await client.providers.msTeams.checkAuth(
|
|
17
|
+
* 'channel_id',
|
|
18
|
+
* { ms_teams_tenant_object: 'ms_teams_tenant_object' },
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
13
21
|
*/
|
|
14
22
|
checkAuth(
|
|
15
23
|
channelID: string,
|
|
@@ -22,6 +30,18 @@ export class MsTeams extends APIResource {
|
|
|
22
30
|
/**
|
|
23
31
|
* List the Microsoft Teams channels within a team. By default, archived and
|
|
24
32
|
* private channels are excluded from the results.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const response =
|
|
37
|
+
* await client.providers.msTeams.listChannels(
|
|
38
|
+
* 'channel_id',
|
|
39
|
+
* {
|
|
40
|
+
* ms_teams_tenant_object: 'ms_teams_tenant_object',
|
|
41
|
+
* team_id: 'team_id',
|
|
42
|
+
* },
|
|
43
|
+
* );
|
|
44
|
+
* ```
|
|
25
45
|
*/
|
|
26
46
|
listChannels(
|
|
27
47
|
channelID: string,
|
|
@@ -34,6 +54,17 @@ export class MsTeams extends APIResource {
|
|
|
34
54
|
/**
|
|
35
55
|
* Get a list of teams belonging to the Microsoft Entra tenant. By default,
|
|
36
56
|
* archived and private channels are excluded from the results.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* // Automatically fetches more pages as needed.
|
|
61
|
+
* for await (const msTeamListTeamsResponse of client.providers.msTeams.listTeams(
|
|
62
|
+
* 'channel_id',
|
|
63
|
+
* { ms_teams_tenant_object: 'ms_teams_tenant_object' },
|
|
64
|
+
* )) {
|
|
65
|
+
* // ...
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
37
68
|
*/
|
|
38
69
|
listTeams(
|
|
39
70
|
channelID: string,
|
|
@@ -49,6 +80,15 @@ export class MsTeams extends APIResource {
|
|
|
49
80
|
|
|
50
81
|
/**
|
|
51
82
|
* Remove a Microsoft Entra tenant ID from a Microsoft Teams tenant object.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const response =
|
|
87
|
+
* await client.providers.msTeams.revokeAccess(
|
|
88
|
+
* 'channel_id',
|
|
89
|
+
* { ms_teams_tenant_object: 'ms_teams_tenant_object' },
|
|
90
|
+
* );
|
|
91
|
+
* ```
|
|
52
92
|
*/
|
|
53
93
|
revokeAccess(
|
|
54
94
|
channelID: string,
|
|
@@ -9,6 +9,14 @@ import { path } from '../../internal/utils/path';
|
|
|
9
9
|
export class Slack extends APIResource {
|
|
10
10
|
/**
|
|
11
11
|
* Check if a Slack channel is authenticated.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const response = await client.providers.slack.checkAuth(
|
|
16
|
+
* 'channel_id',
|
|
17
|
+
* { access_token_object: 'access_token_object' },
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
12
20
|
*/
|
|
13
21
|
checkAuth(
|
|
14
22
|
channelID: string,
|
|
@@ -20,6 +28,17 @@ export class Slack extends APIResource {
|
|
|
20
28
|
|
|
21
29
|
/**
|
|
22
30
|
* List Slack channels for a Slack workspace.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* // Automatically fetches more pages as needed.
|
|
35
|
+
* for await (const slackListChannelsResponse of client.providers.slack.listChannels(
|
|
36
|
+
* 'channel_id',
|
|
37
|
+
* { access_token_object: 'access_token_object' },
|
|
38
|
+
* )) {
|
|
39
|
+
* // ...
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
23
42
|
*/
|
|
24
43
|
listChannels(
|
|
25
44
|
channelID: string,
|
|
@@ -35,6 +54,14 @@ export class Slack extends APIResource {
|
|
|
35
54
|
|
|
36
55
|
/**
|
|
37
56
|
* Revoke access for a Slack channel.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const response = await client.providers.slack.revokeAccess(
|
|
61
|
+
* 'channel_id',
|
|
62
|
+
* { access_token_object: 'access_token_object' },
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
38
65
|
*/
|
|
39
66
|
revokeAccess(
|
|
40
67
|
channelID: string,
|
|
@@ -96,7 +96,10 @@ export namespace DiscordChannelData {
|
|
|
96
96
|
/**
|
|
97
97
|
* A request to set channel data for a type of channel inline.
|
|
98
98
|
*/
|
|
99
|
-
export type InlineChannelDataRequest = Record<
|
|
99
|
+
export type InlineChannelDataRequest = Record<
|
|
100
|
+
string,
|
|
101
|
+
PushChannelData | OneSignalChannelData | SlackChannelData | MsTeamsChannelData | DiscordChannelData
|
|
102
|
+
>;
|
|
100
103
|
|
|
101
104
|
/**
|
|
102
105
|
* Microsoft Teams channel connection.
|