@knocklabs/node 0.4.20 → 0.4.22
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 +1 -0
- package/dist/src/resources/objects/index.d.ts +1 -0
- package/dist/src/resources/objects/index.js +6 -0
- package/dist/src/resources/objects/interfaces.d.ts +1 -0
- package/dist/src/resources/users/index.d.ts +1 -0
- package/dist/src/resources/users/index.js +12 -0
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -32,6 +32,7 @@ export declare class Objects {
|
|
|
32
32
|
setCategoriesPreferences(collection: string, objectId: string, categoryPreferences: WorkflowPreferences, options?: PreferenceOptions): Promise<PreferenceSet>;
|
|
33
33
|
setCategoryPreferences(collection: string, objectId: string, categoryKey: string, setting: WorkflowPreferenceSetting, options?: PreferenceOptions): Promise<PreferenceSet>;
|
|
34
34
|
listSubscriptions(collection: string, objectId: string, options?: ListObjectSubscriptionsOptions): Promise<PaginatedEntriesResponse<ObjectSubscription>>;
|
|
35
|
+
getSubscriptions(collection: string, objectId: string, options?: ListObjectSubscriptionsOptions): Promise<PaginatedEntriesResponse<ObjectSubscription>>;
|
|
35
36
|
addSubscriptions(collection: string, objectId: string, properties?: AddObjectSubscriptionProperties): Promise<ObjectSubscription[]>;
|
|
36
37
|
deleteSubscriptions(collection: string, objectId: string, properties?: DeleteObjectSubscriptionProperties): Promise<ObjectSubscription[]>;
|
|
37
38
|
getSchedules(collection: string, objectId: string, filteringOptions?: ListSchedulesProps): Promise<PaginatedEntriesResponse<Schedule>>;
|
|
@@ -169,6 +169,12 @@ class Objects {
|
|
|
169
169
|
return data;
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
|
+
getSubscriptions(collection, objectId, options = {}) {
|
|
173
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
174
|
+
const { data } = yield this.knock.get(`/v1/objects/${collection}/${objectId}/subscriptions`, Object.assign(Object.assign({}, options), { mode: "recipient" }));
|
|
175
|
+
return data;
|
|
176
|
+
});
|
|
177
|
+
}
|
|
172
178
|
addSubscriptions(collection, objectId, properties = { recipients: [] }) {
|
|
173
179
|
return __awaiter(this, void 0, void 0, function* () {
|
|
174
180
|
const { data } = yield this.knock.post(`/v1/objects/${collection}/${objectId}/subscriptions`, properties);
|
|
@@ -35,4 +35,5 @@ export declare class Users {
|
|
|
35
35
|
unsetChannelData(userId: string, channelId: string): Promise<any>;
|
|
36
36
|
getMessages(userId: string, filteringOptions?: ListMessagesOptions): Promise<PaginatedItemsResponse<Message>>;
|
|
37
37
|
getSchedules(userId: string, filteringOptions?: ListSchedulesProps): Promise<PaginatedEntriesResponse<Schedule>>;
|
|
38
|
+
getSubscriptions(userId: string, filteringOptions?: ListSchedulesProps): Promise<PaginatedEntriesResponse<Schedule>>;
|
|
38
39
|
}
|
|
@@ -224,5 +224,17 @@ class Users {
|
|
|
224
224
|
return data;
|
|
225
225
|
});
|
|
226
226
|
}
|
|
227
|
+
//
|
|
228
|
+
// Subscriptions
|
|
229
|
+
//
|
|
230
|
+
getSubscriptions(userId, filteringOptions = {}) {
|
|
231
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
232
|
+
if (!userId) {
|
|
233
|
+
throw new Error(`Incomplete arguments. You must provide a 'userId'`);
|
|
234
|
+
}
|
|
235
|
+
const { data } = yield this.knock.get(`/v1/users/${userId}/subscriptions`, filteringOptions);
|
|
236
|
+
return data;
|
|
237
|
+
});
|
|
238
|
+
}
|
|
227
239
|
}
|
|
228
240
|
exports.Users = Users;
|