@kintone/rest-api-client
Advanced tools
Comparing version 1.8.2 to 1.9.0
@@ -6,2 +6,13 @@ # Change Log | ||
# [1.9.0](https://github.com/kintone/js-sdk/compare/@kintone/rest-api-client@1.8.2...@kintone/rest-api-client@1.9.0) (2021-02-09) | ||
### Features | ||
* **rest-api-client:** implement PUT /k/v1/preview/app/notifications/perRecord.json ([#611](https://github.com/kintone/js-sdk/issues/611)) ([e0d502e](https://github.com/kintone/js-sdk/commit/e0d502e64158fad2a50fd1b6a1a946fbeaa3a2ee)) | ||
## [1.8.2](https://github.com/kintone/js-sdk/compare/@kintone/rest-api-client@1.8.1...@kintone/rest-api-client@1.8.2) (2021-02-02) | ||
@@ -8,0 +19,0 @@ |
@@ -1104,2 +1104,41 @@ var __assign = (this && this.__assign) || function () { | ||
}); | ||
describe("updatePerRecordNotifications", function () { | ||
var params = { | ||
app: APP_ID, | ||
notifications: [ | ||
{ | ||
filterCond: 'Customer = "foo"', | ||
title: "Send a notification", | ||
targets: [ | ||
{ | ||
entity: { | ||
type: "USER", | ||
code: "foo", | ||
}, | ||
includeSubs: false, | ||
}, | ||
], | ||
}, | ||
], | ||
}; | ||
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, appClient.updatePerRecordNotifications(params)]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
it("should pass the path to the http client", function () { | ||
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/notifications/perRecord.json"); | ||
}); | ||
it("should send a put request", function () { | ||
expect(mockClient.getLogs()[0].method).toBe("put"); | ||
}); | ||
it("should pass app and rights as a param to the http client", function () { | ||
expect(mockClient.getLogs()[0].params).toEqual(params); | ||
}); | ||
}); | ||
}); | ||
@@ -1106,0 +1145,0 @@ describe("AppClient with guestSpaceId", function () { |
import { HttpClient } from "../http"; | ||
import { AppID, RecordID, Revision, Properties, Lang, Layout, ViewForResponse, ViewForParameter, App, StateForResponse, StateForParameter, ActionForResponse, ActionForParameter, DeployStatus, FieldRightForResponse, FieldRightForParameter, AppRightEntityForResponse, AppRightEntityForParameter, EvaluatedRecordRight, RecordRightForResponse, RecordRightForParameter, AppCustomizeScope, AppCustomizeForResponse, AppCustomizeForParameter } from "./types"; | ||
import { AppID, RecordID, Revision, Properties, Lang, Layout, ViewForResponse, ViewForParameter, App, StateForResponse, StateForParameter, ActionForResponse, ActionForParameter, DeployStatus, FieldRightForResponse, FieldRightForParameter, AppRightEntityForResponse, AppRightEntityForParameter, EvaluatedRecordRight, RecordRightForResponse, RecordRightForParameter, AppCustomizeScope, AppCustomizeForResponse, AppCustomizeForParameter, PerRecordNotificationsForParameter } from "./types"; | ||
declare type RowLayoutForParameter = { | ||
@@ -260,4 +260,11 @@ type: "ROW"; | ||
}>; | ||
updatePerRecordNotifications(params: { | ||
app: AppID; | ||
notifications: PerRecordNotificationsForParameter[]; | ||
revision?: Revision; | ||
}): Promise<{ | ||
revision: string; | ||
}>; | ||
private buildPathWithGuestSpaceId; | ||
} | ||
export {}; |
@@ -284,2 +284,9 @@ var __assign = (this && this.__assign) || function () { | ||
}; | ||
AppClient.prototype.updatePerRecordNotifications = function (params) { | ||
var path = this.buildPathWithGuestSpaceId({ | ||
endpointName: "app/notifications/perRecord", | ||
preview: true, | ||
}); | ||
return this.client.put(path, params); | ||
}; | ||
AppClient.prototype.buildPathWithGuestSpaceId = function (params) { | ||
@@ -286,0 +293,0 @@ return buildPath(__assign(__assign({}, params), { guestSpaceId: this.guestSpaceId })); |
@@ -26,1 +26,2 @@ export declare type Lang = "ja" | "en" | "zh" | "user" | "default"; | ||
export * from "./customize"; | ||
export * from "./notification"; |
@@ -6,1 +6,2 @@ export * from "./form"; | ||
export * from "./customize"; | ||
export * from "./notification"; |
@@ -1106,2 +1106,41 @@ "use strict"; | ||
}); | ||
describe("updatePerRecordNotifications", function () { | ||
var params = { | ||
app: APP_ID, | ||
notifications: [ | ||
{ | ||
filterCond: 'Customer = "foo"', | ||
title: "Send a notification", | ||
targets: [ | ||
{ | ||
entity: { | ||
type: "USER", | ||
code: "foo", | ||
}, | ||
includeSubs: false, | ||
}, | ||
], | ||
}, | ||
], | ||
}; | ||
beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, appClient.updatePerRecordNotifications(params)]; | ||
case 1: | ||
_a.sent(); | ||
return [2 /*return*/]; | ||
} | ||
}); | ||
}); }); | ||
it("should pass the path to the http client", function () { | ||
expect(mockClient.getLogs()[0].path).toBe("/k/v1/preview/app/notifications/perRecord.json"); | ||
}); | ||
it("should send a put request", function () { | ||
expect(mockClient.getLogs()[0].method).toBe("put"); | ||
}); | ||
it("should pass app and rights as a param to the http client", function () { | ||
expect(mockClient.getLogs()[0].params).toEqual(params); | ||
}); | ||
}); | ||
}); | ||
@@ -1108,0 +1147,0 @@ describe("AppClient with guestSpaceId", function () { |
import { HttpClient } from "../http"; | ||
import { AppID, RecordID, Revision, Properties, Lang, Layout, ViewForResponse, ViewForParameter, App, StateForResponse, StateForParameter, ActionForResponse, ActionForParameter, DeployStatus, FieldRightForResponse, FieldRightForParameter, AppRightEntityForResponse, AppRightEntityForParameter, EvaluatedRecordRight, RecordRightForResponse, RecordRightForParameter, AppCustomizeScope, AppCustomizeForResponse, AppCustomizeForParameter } from "./types"; | ||
import { AppID, RecordID, Revision, Properties, Lang, Layout, ViewForResponse, ViewForParameter, App, StateForResponse, StateForParameter, ActionForResponse, ActionForParameter, DeployStatus, FieldRightForResponse, FieldRightForParameter, AppRightEntityForResponse, AppRightEntityForParameter, EvaluatedRecordRight, RecordRightForResponse, RecordRightForParameter, AppCustomizeScope, AppCustomizeForResponse, AppCustomizeForParameter, PerRecordNotificationsForParameter } from "./types"; | ||
declare type RowLayoutForParameter = { | ||
@@ -260,4 +260,11 @@ type: "ROW"; | ||
}>; | ||
updatePerRecordNotifications(params: { | ||
app: AppID; | ||
notifications: PerRecordNotificationsForParameter[]; | ||
revision?: Revision; | ||
}): Promise<{ | ||
revision: string; | ||
}>; | ||
private buildPathWithGuestSpaceId; | ||
} | ||
export {}; |
@@ -287,2 +287,9 @@ "use strict"; | ||
}; | ||
AppClient.prototype.updatePerRecordNotifications = function (params) { | ||
var path = this.buildPathWithGuestSpaceId({ | ||
endpointName: "app/notifications/perRecord", | ||
preview: true, | ||
}); | ||
return this.client.put(path, params); | ||
}; | ||
AppClient.prototype.buildPathWithGuestSpaceId = function (params) { | ||
@@ -289,0 +296,0 @@ return url_1.buildPath(__assign(__assign({}, params), { guestSpaceId: this.guestSpaceId })); |
@@ -26,1 +26,2 @@ export declare type Lang = "ja" | "en" | "zh" | "user" | "default"; | ||
export * from "./customize"; | ||
export * from "./notification"; |
@@ -18,1 +18,2 @@ "use strict"; | ||
__exportStar(require("./customize"), exports); | ||
__exportStar(require("./notification"), exports); |
{ | ||
"name": "@kintone/rest-api-client", | ||
"version": "1.8.2", | ||
"version": "1.9.0", | ||
"publishConfig": { | ||
@@ -70,3 +70,3 @@ "access": "public" | ||
"@types/qs": "^6.9.5", | ||
"rollup": "^2.38.3", | ||
"rollup": "^2.38.5", | ||
"rollup-plugin-ecma-version-validator": "^0.1.6", | ||
@@ -96,3 +96,3 @@ "rollup-plugin-node-builtins": "^2.1.2", | ||
}, | ||
"gitHead": "809348d02d7d45112da8c1f71d08ae5b9f130c04" | ||
"gitHead": "53faabd35c63e403d002c72e8873f44be3fa3fb7" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1760476
251
27097