@contential/prompt
Advanced tools
Comparing version 0.0.1-test to 0.0.2-test
type PromptClientOptions = { | ||
apiUrl?: string; | ||
secretKey?: string; | ||
@@ -7,8 +8,15 @@ }; | ||
}; | ||
interface PromptOptions { | ||
prompt: string; | ||
onUpdate: PromptOnUpdate; | ||
} | ||
type PromptOnUpdate = (data: PromptOptionsData) => void; | ||
interface PromptOptionsData { | ||
text: string; | ||
} | ||
declare const prompt: (config: PromptConfig) => void; | ||
declare const getClient: (options?: PromptClientOptions) => { | ||
prompt: () => void; | ||
prompt: (options: PromptOptions) => Promise<{} | undefined>; | ||
}; | ||
export { prompt as default, getClient }; | ||
export { PromptClientOptions, PromptConfig, PromptOnUpdate, PromptOptions, PromptOptionsData, getClient }; |
@@ -19,2 +19,22 @@ "use strict"; | ||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); | ||
var __async = (__this, __arguments, generator) => { | ||
return new Promise((resolve, reject) => { | ||
var fulfilled = (value) => { | ||
try { | ||
step(generator.next(value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
}; | ||
var rejected = (value) => { | ||
try { | ||
step(generator.throw(value)); | ||
} catch (e) { | ||
reject(e); | ||
} | ||
}; | ||
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); | ||
step((generator = generator.apply(__this, __arguments)).next()); | ||
}); | ||
}; | ||
@@ -24,3 +44,2 @@ // src/index.ts | ||
__export(src_exports, { | ||
default: () => src_default, | ||
getClient: () => getClient | ||
@@ -30,19 +49,20 @@ }); | ||
// ../config/dist/index.mjs | ||
var config = { | ||
name: "theconfig 5" | ||
}; | ||
// src/index.ts | ||
var prompt = (config2) => { | ||
console.log(config); | ||
}; | ||
// src/prompt.ts | ||
var import_api = require("@contential/api"); | ||
var getClient = (options) => { | ||
const secretKey = (options == null ? void 0 : options.secretKey) || process.env.CONTENTIAL_SECRET_KEY; | ||
if (!secretKey) { | ||
throw new Error("Missing: secretKey"); | ||
} | ||
return { prompt: prompt.bind(null, { secretKey }) }; | ||
const apiClient = (0, import_api.getClient)({ | ||
url: options == null ? void 0 : options.apiUrl, | ||
secretKey: options == null ? void 0 : options.secretKey | ||
}); | ||
return { | ||
prompt: (options2) => __async(void 0, null, function* () { | ||
const result = yield apiClient.stream({ | ||
path: "/prompt", | ||
data: { prompt: options2.prompt }, | ||
onUpdate: options2.onUpdate | ||
}); | ||
return result; | ||
}) | ||
}; | ||
}; | ||
var src_default = prompt; | ||
// Annotate the CommonJS export names for ESM import in node: | ||
@@ -49,0 +69,0 @@ 0 && (module.exports = { |
{ | ||
"name": "@contential/prompt", | ||
"version": "0.0.1-test", | ||
"version": "0.0.2-test", | ||
"license": "MIT", | ||
@@ -9,2 +9,5 @@ "main": "dist/index.js", | ||
"private": false, | ||
"dependencies": { | ||
"@contential/api": "*" | ||
}, | ||
"scripts": { | ||
@@ -17,6 +20,3 @@ "dev": "tsup src/index.ts --format cjs,esm --dts --watch", | ||
"publish:prod": "changeset version && changeset publish" | ||
}, | ||
"devDependencies": { | ||
"@contential/config": "*" | ||
} | ||
} | ||
} |
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
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
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
5658
0
137
1
2
+ Added@contential/api@*
+ Added@contential/api@0.0.11(transitive)