orangeslice 2.1.4-beta.0 → 2.1.4-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -48,6 +48,16 @@ const CONFIG_PATH = path.join(CONFIG_DIR, "config.json");
48
48
  const AGENTS_IMPORT_LINE = "@orangeslice-docs/AGENTS.md";
49
49
  const CLAUDE_IMPORT_LINE = "@orangeslice-docs/CLAUDE.md";
50
50
  const SUPPORTED_RUNNERS = ["npm", "bun", "pnpm", "yarn"];
51
+ function getOwnVersion() {
52
+ try {
53
+ const pkgPath = path.join(__dirname, "..", "package.json");
54
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8"));
55
+ return pkg.version || "latest";
56
+ }
57
+ catch {
58
+ return "latest";
59
+ }
60
+ }
51
61
  function isDir(p) {
52
62
  try {
53
63
  return fs.statSync(p).isDirectory();
@@ -126,13 +136,15 @@ function getRunnerCommand(packageManager, suffix = "") {
126
136
  return suffix ? `${command} ${suffix}` : command;
127
137
  }
128
138
  function getInstallCommand(packageManager) {
139
+ const version = getOwnVersion();
140
+ const spec = version === "latest" ? "orangeslice" : `orangeslice@${version}`;
129
141
  if (packageManager === "bun")
130
- return "bun add orangeslice";
142
+ return `bun add ${spec}`;
131
143
  if (packageManager === "pnpm")
132
- return "pnpm add orangeslice";
144
+ return `pnpm add ${spec}`;
133
145
  if (packageManager === "yarn")
134
- return "yarn add orangeslice";
135
- return "npm install orangeslice";
146
+ return `yarn add ${spec}`;
147
+ return `npm install ${spec}`;
136
148
  }
137
149
  function getSupportedRunnerExamples() {
138
150
  return SUPPORTED_RUNNERS.map((packageManager) => getRunnerCommand(packageManager));
package/dist/ctx.d.ts CHANGED
@@ -2,7 +2,8 @@
2
2
  * Spreadsheet context API for the orangeslice SDK.
3
3
  *
4
4
  * Usage:
5
- * import { ctx } from "orangeslice";
5
+ * import { services } from "orangeslice";
6
+ * const { ctx } = services;
6
7
  *
7
8
  * const ss = await ctx.createSpreadsheet({ name: "Leads" });
8
9
  * await ctx.sql(ss.id, 'CREATE TABLE contacts (name, email, website)');
package/dist/ctx.js CHANGED
@@ -3,7 +3,8 @@
3
3
  * Spreadsheet context API for the orangeslice SDK.
4
4
  *
5
5
  * Usage:
6
- * import { ctx } from "orangeslice";
6
+ * import { services } from "orangeslice";
7
+ * const { ctx } = services;
7
8
  *
8
9
  * const ss = await ctx.createSpreadsheet({ name: "Leads" });
9
10
  * await ctx.sql(ss.id, 'CREATE TABLE contacts (name, email, website)');
package/dist/index.d.ts CHANGED
@@ -32,6 +32,25 @@ import { generateObject } from "./generateObject";
32
32
  import { googleMapsScrape } from "./googleMaps";
33
33
  import { webBatchSearch, webSearch } from "./serp";
34
34
  export declare const services: {
35
+ ctx: {
36
+ createSpreadsheet: (opts: {
37
+ name: string;
38
+ }) => Promise<import("./ctx").Spreadsheet>;
39
+ listSpreadsheets: () => Promise<{
40
+ spreadsheets: import("./ctx").SpreadsheetListItem[];
41
+ }>;
42
+ deleteSpreadsheet: (spreadsheetId: string) => Promise<{
43
+ success: boolean;
44
+ }>;
45
+ sql: (spreadsheetId: string, sql: string) => Promise<import("./ctx").SqlResult>;
46
+ spreadsheet: (spreadsheetId: string) => {
47
+ sql: (sql: string) => Promise<import("./ctx").SqlResult>;
48
+ sheet: (sheetName: string) => {
49
+ addRow: (row: Record<string, unknown>) => Promise<import("./ctx").SqlResult>;
50
+ addRows: (rows: Record<string, unknown>[]) => Promise<import("./ctx").SqlResult>;
51
+ };
52
+ };
53
+ };
35
54
  crunchbase: {
36
55
  search: typeof crunchbaseSearch;
37
56
  };
package/dist/index.js CHANGED
@@ -41,6 +41,7 @@ const apify_2 = require("./apify");
41
41
  const b2b_2 = require("./b2b");
42
42
  const browser_2 = require("./browser");
43
43
  const crunchbase_2 = require("./crunchbase");
44
+ const ctx_2 = require("./ctx");
44
45
  const expansion_2 = require("./expansion");
45
46
  const firecrawl_2 = require("./firecrawl");
46
47
  const generateObject_2 = require("./generateObject");
@@ -48,6 +49,7 @@ const googleMaps_2 = require("./googleMaps");
48
49
  const predictLeads_2 = require("./predictLeads");
49
50
  const serp_2 = require("./serp");
50
51
  exports.services = {
52
+ ctx: ctx_2.ctx,
51
53
  crunchbase: {
52
54
  search: crunchbase_2.crunchbaseSearch
53
55
  },
@@ -9,7 +9,8 @@ Manage Orange Slice spreadsheets programmatically. Create spreadsheets, add shee
9
9
  ## Quick start
10
10
 
11
11
  ```typescript
12
- import { ctx } from "orangeslice";
12
+ import { services } from "orangeslice";
13
+ const { ctx } = services;
13
14
 
14
15
  // Create a spreadsheet
15
16
  const ss = await ctx.createSpreadsheet({ name: "Leads" });
@@ -39,6 +40,7 @@ console.log(result.rows);
39
40
  Call `ctx.spreadsheet(id)` to get a handle bound to a specific spreadsheet:
40
41
 
41
42
  ```typescript
43
+ const { ctx } = services;
42
44
  const ss = ctx.spreadsheet("uuid-here");
43
45
  await ss.sql("SELECT * FROM contacts");
44
46
  await ss.sheet("contacts").addRow({ name: "Corp", email: "corp@example.com" });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orangeslice",
3
- "version": "2.1.4-beta.0",
3
+ "version": "2.1.4-beta.2",
4
4
  "description": "B2B LinkedIn database prospector - 1.15B profiles, 85M companies",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",