@knocklabs/node 0.4.16 → 0.4.17
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/package.json +1 -1
- package/dist/src/common/interfaces.d.ts +2 -2
- package/dist/src/resources/messages/index.d.ts +4 -4
- package/dist/src/resources/objects/index.d.ts +4 -4
- package/dist/src/resources/tenants/index.d.ts +2 -2
- package/dist/src/resources/users/index.d.ts +4 -4
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -28,11 +28,11 @@ declare type PageInfo = {
|
|
|
28
28
|
after: string;
|
|
29
29
|
page_size: number;
|
|
30
30
|
};
|
|
31
|
-
export interface
|
|
31
|
+
export interface PaginatedEntriesResponse<T> {
|
|
32
32
|
entries: T[];
|
|
33
33
|
page_info: PageInfo;
|
|
34
34
|
}
|
|
35
|
-
export interface
|
|
35
|
+
export interface PaginatedItemsResponse<T> {
|
|
36
36
|
items: T[];
|
|
37
37
|
page_info: PageInfo;
|
|
38
38
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PaginatedItemsResponse, PaginationOptions } from "../../common/interfaces";
|
|
2
2
|
import { Message, MessageContent, MessageEvent, ListMessageActivitiesOptions, ListMessagesOptions, MessageEngagementStatus } from "./interfaces";
|
|
3
3
|
import { Activity } from "../activities/interfaces";
|
|
4
4
|
import { Knock } from "../../knock";
|
|
5
5
|
export declare class Messages {
|
|
6
6
|
readonly knock: Knock;
|
|
7
7
|
constructor(knock: Knock);
|
|
8
|
-
list(filteringOptions?: ListMessagesOptions): Promise<
|
|
8
|
+
list(filteringOptions?: ListMessagesOptions): Promise<PaginatedItemsResponse<Message>>;
|
|
9
9
|
get(messageId: string): Promise<Message>;
|
|
10
10
|
getContent(messageId: string): Promise<MessageContent>;
|
|
11
|
-
getEvents(messageId: string, paginationOptions?: PaginationOptions): Promise<
|
|
12
|
-
getActivities(messageId: string, filteringOptions?: ListMessageActivitiesOptions): Promise<
|
|
11
|
+
getEvents(messageId: string, paginationOptions?: PaginationOptions): Promise<PaginatedItemsResponse<MessageEvent>>;
|
|
12
|
+
getActivities(messageId: string, filteringOptions?: ListMessageActivitiesOptions): Promise<PaginatedItemsResponse<Activity>>;
|
|
13
13
|
setStatus(messageId: string, status: MessageEngagementStatus): Promise<Message>;
|
|
14
14
|
deleteStatus(messageId: string, status: MessageEngagementStatus): Promise<Message>;
|
|
15
15
|
batchSetStatus(messageIds: string[], status: MessageEngagementStatus | "unseen" | "unread" | "unarchived"): Promise<Message[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChannelData, CommonMetadata, SetChannelDataProperties,
|
|
1
|
+
import { ChannelData, CommonMetadata, SetChannelDataProperties, PaginatedEntriesResponse, ChannelType, PaginatedItemsResponse } from "../../common/interfaces";
|
|
2
2
|
import { Knock } from "../../knock";
|
|
3
3
|
import { AddObjectSubscriptionProperties, BulkSetObjectOption, DeleteObjectSubscriptionProperties, ListObjectOptions, ListObjectSubscriptionsOptions, Object, ObjectSubscription, SetObjectProperties } from "./interfaces";
|
|
4
4
|
import { BulkOperation } from "../bulk_operations/interfaces";
|
|
@@ -9,14 +9,14 @@ export declare class Objects {
|
|
|
9
9
|
constructor(knock: Knock);
|
|
10
10
|
get<T = CommonMetadata>(collection: string, id: string): Promise<Object<T>>;
|
|
11
11
|
set<T = CommonMetadata>(collection: string, id: string, properties: SetObjectProperties): Promise<Object<T>>;
|
|
12
|
-
list<T = CommonMetadata>(collection: string, filteringOptions?: ListObjectOptions): Promise<
|
|
12
|
+
list<T = CommonMetadata>(collection: string, filteringOptions?: ListObjectOptions): Promise<PaginatedEntriesResponse<Object<T>>>;
|
|
13
13
|
bulkSet(collection: string, objects: BulkSetObjectOption[]): Promise<BulkOperation>;
|
|
14
14
|
delete(collection: string, id: string): Promise<null>;
|
|
15
15
|
bulkDelete(collection: string, objectIds: string[]): Promise<BulkOperation>;
|
|
16
16
|
getChannelData<T = CommonMetadata>(collection: string, id: string, channelId: string): Promise<ChannelData<T>>;
|
|
17
17
|
setChannelData<T = CommonMetadata>(collection: string, id: string, channelId: string, channelData: SetChannelDataProperties): Promise<ChannelData<T>>;
|
|
18
18
|
unsetChannelData(collection: string, id: string, channelId: string): Promise<any>;
|
|
19
|
-
getMessages(collection: string, objectId: string, filteringOptions?: ListMessagesOptions): Promise<
|
|
19
|
+
getMessages(collection: string, objectId: string, filteringOptions?: ListMessagesOptions): Promise<PaginatedItemsResponse<Message>>;
|
|
20
20
|
getAllPreferences(collection: string, objectId: string): Promise<PreferenceSet[]>;
|
|
21
21
|
/**
|
|
22
22
|
* @deprecated Use `objects.getPreferences` instead
|
|
@@ -30,7 +30,7 @@ export declare class Objects {
|
|
|
30
30
|
setWorkflowPreferences(collection: string, objectId: string, workflowKey: string, setting: WorkflowPreferenceSetting, options?: PreferenceOptions): Promise<PreferenceSet>;
|
|
31
31
|
setCategoriesPreferences(collection: string, objectId: string, categoryPreferences: WorkflowPreferences, options?: PreferenceOptions): Promise<PreferenceSet>;
|
|
32
32
|
setCategoryPreferences(collection: string, objectId: string, categoryKey: string, setting: WorkflowPreferenceSetting, options?: PreferenceOptions): Promise<PreferenceSet>;
|
|
33
|
-
listSubscriptions(collection: string, objectId: string, options?: ListObjectSubscriptionsOptions): Promise<
|
|
33
|
+
listSubscriptions(collection: string, objectId: string, options?: ListObjectSubscriptionsOptions): Promise<PaginatedEntriesResponse<ObjectSubscription>>;
|
|
34
34
|
addSubscriptions(collection: string, objectId: string, properties?: AddObjectSubscriptionProperties): Promise<ObjectSubscription[]>;
|
|
35
35
|
deleteSubscriptions(collection: string, objectId: string, properties?: DeleteObjectSubscriptionProperties): Promise<ObjectSubscription[]>;
|
|
36
36
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CommonMetadata,
|
|
1
|
+
import { CommonMetadata, PaginatedEntriesResponse } from "../../common/interfaces";
|
|
2
2
|
import { Knock } from "../../knock";
|
|
3
3
|
import { Tenant, SetTenant, ListTenantsOptions } from "./interfaces";
|
|
4
4
|
export declare class Tenants {
|
|
5
5
|
readonly knock: Knock;
|
|
6
6
|
constructor(knock: Knock);
|
|
7
|
-
list(filteringOptions?: ListTenantsOptions): Promise<
|
|
7
|
+
list(filteringOptions?: ListTenantsOptions): Promise<PaginatedEntriesResponse<Tenant>>;
|
|
8
8
|
get<T = CommonMetadata>(id: string): Promise<Tenant<T>>;
|
|
9
9
|
set<T = CommonMetadata>(id: string, tenantData: SetTenant): Promise<Tenant<T>>;
|
|
10
10
|
delete(id: string): Promise<null>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChannelData, ChannelType, CommonMetadata,
|
|
1
|
+
import { ChannelData, ChannelType, CommonMetadata, PaginatedItemsResponse, PaginatedEntriesResponse } from "../../common/interfaces";
|
|
2
2
|
import { BulkOperation } from "../bulk_operations/interfaces";
|
|
3
3
|
import { ChannelTypePreferences, PreferenceOptions, PreferenceSet, SetPreferencesProperties, WorkflowPreferences, WorkflowPreferenceSetting } from "../preferences/interfaces";
|
|
4
4
|
import { ListMessagesOptions, Message } from "../messages/interfaces";
|
|
@@ -10,11 +10,11 @@ export declare class Users {
|
|
|
10
10
|
identify(userId: string, properties?: IdentifyProperties): Promise<User>;
|
|
11
11
|
bulkIdentify(users: BulkIdentifyUser[]): Promise<BulkOperation>;
|
|
12
12
|
get(userId: string): Promise<User>;
|
|
13
|
-
list(filteringOptions?: ListUserOptions): Promise<
|
|
13
|
+
list(filteringOptions?: ListUserOptions): Promise<PaginatedEntriesResponse<User>>;
|
|
14
14
|
delete(userId: string): Promise<null>;
|
|
15
15
|
bulkDelete(userIds: string[]): Promise<BulkOperation>;
|
|
16
16
|
merge(toUserId: string, fromUserId: string): Promise<User>;
|
|
17
|
-
getFeed(userId: string, channelId: string, feedOptions?: UserFeedOptions): Promise<
|
|
17
|
+
getFeed(userId: string, channelId: string, feedOptions?: UserFeedOptions): Promise<PaginatedEntriesResponse<any>>;
|
|
18
18
|
getAllPreferences(userId: string): Promise<any>;
|
|
19
19
|
/**
|
|
20
20
|
* @deprecated Use `users.getPreferences` instead
|
|
@@ -32,5 +32,5 @@ export declare class Users {
|
|
|
32
32
|
getChannelData<T = CommonMetadata>(userId: string, channelId: string): Promise<ChannelData<T>>;
|
|
33
33
|
setChannelData<T = CommonMetadata>(userId: string, channelId: string, channelData: Record<string, any>): Promise<ChannelData<T>>;
|
|
34
34
|
unsetChannelData(userId: string, channelId: string): Promise<any>;
|
|
35
|
-
getMessages(userId: string, filteringOptions?: ListMessagesOptions): Promise<
|
|
35
|
+
getMessages(userId: string, filteringOptions?: ListMessagesOptions): Promise<PaginatedItemsResponse<Message>>;
|
|
36
36
|
}
|