@owlworks/hoot-api
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -94,5 +94,4 @@ import { Activity } from "botframework-schema"; | ||
private adminSecret?; | ||
constructor(options?: IHootClientOptions); | ||
constructor(options: IHootClientOptions); | ||
account(accountId: string): Promise<IAccount>; | ||
accountId(): string | undefined; | ||
apikey(accountId: string, apiKeyId: string): Promise<IAccountKey>; | ||
@@ -99,0 +98,0 @@ channel(accountId: string, channelId: string): Promise<IChannel>; |
@@ -16,16 +16,5 @@ "use strict"; | ||
constructor(options) { | ||
var _a, _b, _c; | ||
this.apiUrl = (_b = (_a = options === null || options === void 0 ? void 0 : options.apiUrl) !== null && _a !== void 0 ? _a : process.env["HOOT_API_URL"]) !== null && _b !== void 0 ? _b : HootClient.DEFAULT_API_URL; | ||
const hootAccountId = process.env["HOOT_ACCOUNT_ID"]; | ||
const hootApiKey = process.env["HOOT_API_KEY"]; | ||
if (options === null || options === void 0 ? void 0 : options.accountSecret) { | ||
this.accountSecret = options.accountSecret; | ||
} | ||
else if (hootAccountId && hootApiKey) { | ||
this.accountSecret = { accountId: hootAccountId, apiKey: hootApiKey }; | ||
} | ||
this.adminSecret = (_c = options === null || options === void 0 ? void 0 : options.adminSecretKey) !== null && _c !== void 0 ? _c : process.env["HOOT_ADMIN_SECRET"]; | ||
if (!this.accountSecret && !this.adminSecret) { | ||
throw new Error("either account secret or admin secret must be provided"); | ||
} | ||
this.apiUrl = options.apiUrl || HootClient.DEFAULT_API_URL; | ||
this.accountSecret = options.accountSecret; | ||
this.adminSecret = options.adminSecretKey; | ||
} | ||
@@ -37,6 +26,2 @@ async account(accountId) { | ||
} | ||
accountId() { | ||
var _a; | ||
return (_a = this.accountSecret) === null || _a === void 0 ? void 0 : _a.accountId; | ||
} | ||
async apikey(accountId, apiKeyId) { | ||
@@ -149,2 +134,2 @@ const headers = this.requestHeadersWithAdminSecretOrAccountApiKey(); | ||
exports.HootClient = HootClient; | ||
HootClient.DEFAULT_API_URL = "https://hoots.owl.works/api"; | ||
HootClient.DEFAULT_API_URL = "https://hoots.owl.works/swagger"; |
@@ -45,3 +45,3 @@ { | ||
"types": "dist/index.d.ts", | ||
"version": "0.0.2" | ||
} | ||
"version": "0.0.3" | ||
} |
# How to publish NPM package | ||
1. npm run build | ||
2. Generate github private access token with read, write and delete package access | ||
3. npm login --scope=@owlworks --registry=https://npm.pkg.github.com/ --auth-type legacy | ||
4. Provide username as github handler and token as password | ||
5. npm publish | ||
2. npm login, use 2FA for the authentication if needed | ||
3. npm publish --access public |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 4 instances in 1 package
1
0
11373
247
4