Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contential/prompt

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contential/prompt - npm Package Compare versions

Comparing version 0.0.1-test to 0.0.2-test

14

dist/index.d.ts
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc