@notionhq/client
Advanced tools
Comparing version 0.4.8 to 0.4.9
{ | ||
"name": "@notionhq/client", | ||
"version": "0.4.8", | ||
"version": "0.4.9", | ||
"description": "A simple and easy to use client for the Notion API", | ||
@@ -5,0 +5,0 @@ "engines": { |
@@ -44,4 +44,4 @@ "use strict"; | ||
method: api_endpoints_1.getBlock.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.getBlock.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.getBlock.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.getBlock.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.getBlock.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -57,4 +57,4 @@ }); | ||
method: api_endpoints_1.updateBlock.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.updateBlock.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.updateBlock.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.updateBlock.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.updateBlock.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -70,4 +70,4 @@ }); | ||
method: api_endpoints_1.deleteBlock.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.deleteBlock.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.deleteBlock.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.deleteBlock.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.deleteBlock.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -84,4 +84,4 @@ }); | ||
method: api_endpoints_1.appendBlockChildren.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.appendBlockChildren.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.appendBlockChildren.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.appendBlockChildren.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.appendBlockChildren.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -97,4 +97,4 @@ }); | ||
method: api_endpoints_1.listBlockChildren.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.listBlockChildren.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.listBlockChildren.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.listBlockChildren.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.listBlockChildren.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -115,4 +115,4 @@ }); | ||
method: api_endpoints_1.listDatabases.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.listDatabases.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.listDatabases.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.listDatabases.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.listDatabases.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -128,4 +128,4 @@ }); | ||
method: api_endpoints_1.getDatabase.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.getDatabase.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.getDatabase.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.getDatabase.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.getDatabase.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -141,4 +141,4 @@ }); | ||
method: api_endpoints_1.queryDatabase.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.queryDatabase.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.queryDatabase.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.queryDatabase.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.queryDatabase.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -154,4 +154,4 @@ }); | ||
method: api_endpoints_1.createDatabase.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.createDatabase.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.createDatabase.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.createDatabase.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.createDatabase.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -167,4 +167,4 @@ }); | ||
method: api_endpoints_1.updateDatabase.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.updateDatabase.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.updateDatabase.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.updateDatabase.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.updateDatabase.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -182,4 +182,4 @@ }); | ||
method: api_endpoints_1.createPage.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.createPage.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.createPage.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.createPage.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.createPage.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -195,4 +195,4 @@ }); | ||
method: api_endpoints_1.getPage.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.getPage.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.getPage.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.getPage.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.getPage.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -208,4 +208,4 @@ }); | ||
method: api_endpoints_1.updatePage.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.updatePage.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.updatePage.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.updatePage.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.updatePage.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -222,4 +222,4 @@ }); | ||
method: api_endpoints_1.getPageProperty.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.getPageProperty.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.getPageProperty.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.getPageProperty.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.getPageProperty.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -238,4 +238,4 @@ }); | ||
method: api_endpoints_1.getUser.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.getUser.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.getUser.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.getUser.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.getUser.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -251,4 +251,4 @@ }); | ||
method: api_endpoints_1.listUsers.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.listUsers.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.listUsers.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.listUsers.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.listUsers.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -264,4 +264,4 @@ }); | ||
method: api_endpoints_1.getSelf.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.getSelf.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.getSelf.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.getSelf.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.getSelf.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -273,3 +273,3 @@ }); | ||
__classPrivateFieldSet(this, _Client_logLevel, (_a = options === null || options === void 0 ? void 0 : options.logLevel) !== null && _a !== void 0 ? _a : logging_1.LogLevel.WARN, "f"); | ||
__classPrivateFieldSet(this, _Client_logger, (_b = options === null || options === void 0 ? void 0 : options.logger) !== null && _b !== void 0 ? _b : (0, logging_1.makeConsoleLogger)(package_json_1.name), "f"); | ||
__classPrivateFieldSet(this, _Client_logger, (_b = options === null || options === void 0 ? void 0 : options.logger) !== null && _b !== void 0 ? _b : logging_1.makeConsoleLogger(package_json_1.name), "f"); | ||
__classPrivateFieldSet(this, _Client_prefixUrl, ((_c = options === null || options === void 0 ? void 0 : options.baseUrl) !== null && _c !== void 0 ? _c : "https://api.notion.com") + "/v1/", "f"); | ||
@@ -322,3 +322,3 @@ __classPrivateFieldSet(this, _Client_timeoutMs, (_d = options === null || options === void 0 ? void 0 : options.timeoutMs) !== null && _d !== void 0 ? _d : 60000, "f"); | ||
if (!response.ok) { | ||
throw (0, errors_1.buildRequestError)(response, responseText); | ||
throw errors_1.buildRequestError(response, responseText); | ||
} | ||
@@ -330,3 +330,3 @@ const responseJson = JSON.parse(responseText); | ||
catch (error) { | ||
if (!(0, errors_1.isNotionClientError)(error)) { | ||
if (!errors_1.isNotionClientError(error)) { | ||
throw error; | ||
@@ -339,3 +339,3 @@ } | ||
}); | ||
if ((0, errors_1.isHTTPResponseError)(error)) { | ||
if (errors_1.isHTTPResponseError(error)) { | ||
// The response body may contain sensitive information so it is logged separately at the DEBUG level | ||
@@ -356,4 +356,4 @@ this.log(logging_1.LogLevel.DEBUG, `failed response body`, { | ||
method: api_endpoints_1.search.method, | ||
query: (0, helpers_1.pick)(args, api_endpoints_1.search.queryParams), | ||
body: (0, helpers_1.pick)(args, api_endpoints_1.search.bodyParams), | ||
query: helpers_1.pick(args, api_endpoints_1.search.queryParams), | ||
body: helpers_1.pick(args, api_endpoints_1.search.bodyParams), | ||
auth: args === null || args === void 0 ? void 0 : args.auth, | ||
@@ -369,3 +369,3 @@ }); | ||
log(level, message, extraInfo) { | ||
if ((0, logging_1.logLevelSeverity)(level) >= (0, logging_1.logLevelSeverity)(__classPrivateFieldGet(this, _Client_logLevel, "f"))) { | ||
if (logging_1.logLevelSeverity(level) >= logging_1.logLevelSeverity(__classPrivateFieldGet(this, _Client_logLevel, "f"))) { | ||
__classPrivateFieldGet(this, _Client_logger, "f").call(this, level, message, extraInfo); | ||
@@ -372,0 +372,0 @@ } |
@@ -40,3 +40,3 @@ "use strict"; | ||
function isNotionClientError(error) { | ||
return (0, helpers_1.isObject)(error) && error instanceof NotionClientErrorBase; | ||
return helpers_1.isObject(error) && error instanceof NotionClientErrorBase; | ||
} | ||
@@ -190,3 +190,3 @@ exports.isNotionClientError = isNotionClientError; | ||
} | ||
if (!(0, helpers_1.isObject)(parsed) || | ||
if (!helpers_1.isObject(parsed) || | ||
typeof parsed["message"] !== "string" || | ||
@@ -193,0 +193,0 @@ !isAPIErrorCode(parsed["code"])) { |
@@ -32,3 +32,3 @@ "use strict"; | ||
default: | ||
return (0, helpers_1.assertNever)(level); | ||
return helpers_1.assertNever(level); | ||
} | ||
@@ -35,0 +35,0 @@ } |
{ | ||
"name": "@notionhq/client", | ||
"version": "0.4.8", | ||
"version": "0.4.9", | ||
"description": "A simple and easy to use client for the Notion API", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
5178750
45257