@spooled/sdk 1.0.38 → 1.0.39
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/{index-D_Lb9_Bg.d.cts → index-Lgo8JxCV.d.cts} +2 -2
- package/dist/{index-D_Lb9_Bg.d.ts → index-Lgo8JxCV.d.ts} +2 -2
- package/dist/index.cjs +26 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +27 -9
- package/dist/index.js.map +1 -1
- package/dist/worker/index.cjs +1 -1
- package/dist/worker/index.cjs.map +1 -1
- package/dist/worker/index.d.cts +1 -1
- package/dist/worker/index.d.ts +1 -1
- package/dist/worker/index.js +1 -1
- package/dist/worker/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -107,11 +107,11 @@ declare const DEFAULT_CONFIG: {
|
|
|
107
107
|
successThreshold: number;
|
|
108
108
|
timeout: number;
|
|
109
109
|
};
|
|
110
|
-
readonly userAgent: "@spooled/sdk-nodejs/1.0.
|
|
110
|
+
readonly userAgent: "@spooled/sdk-nodejs/1.0.39";
|
|
111
111
|
readonly autoRefreshToken: true;
|
|
112
112
|
};
|
|
113
113
|
/** SDK version */
|
|
114
|
-
declare const SDK_VERSION = "1.0.
|
|
114
|
+
declare const SDK_VERSION = "1.0.39";
|
|
115
115
|
/** API version prefix */
|
|
116
116
|
declare const API_VERSION = "v1";
|
|
117
117
|
/**
|
|
@@ -107,11 +107,11 @@ declare const DEFAULT_CONFIG: {
|
|
|
107
107
|
successThreshold: number;
|
|
108
108
|
timeout: number;
|
|
109
109
|
};
|
|
110
|
-
readonly userAgent: "@spooled/sdk-nodejs/1.0.
|
|
110
|
+
readonly userAgent: "@spooled/sdk-nodejs/1.0.39";
|
|
111
111
|
readonly autoRefreshToken: true;
|
|
112
112
|
};
|
|
113
113
|
/** SDK version */
|
|
114
|
-
declare const SDK_VERSION = "1.0.
|
|
114
|
+
declare const SDK_VERSION = "1.0.39";
|
|
115
115
|
/** API version prefix */
|
|
116
116
|
declare const API_VERSION = "v1";
|
|
117
117
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -4,6 +4,7 @@ var crypto = require('crypto');
|
|
|
4
4
|
var buffer = require('buffer');
|
|
5
5
|
var grpc2 = require('@grpc/grpc-js');
|
|
6
6
|
var protoLoader = require('@grpc/proto-loader');
|
|
7
|
+
var fs = require('fs');
|
|
7
8
|
var url = require('url');
|
|
8
9
|
var path = require('path');
|
|
9
10
|
var os = require('os');
|
|
@@ -49,10 +50,10 @@ var DEFAULT_CONFIG = {
|
|
|
49
50
|
successThreshold: 3,
|
|
50
51
|
timeout: 3e4
|
|
51
52
|
},
|
|
52
|
-
userAgent: "@spooled/sdk-nodejs/1.0.
|
|
53
|
+
userAgent: "@spooled/sdk-nodejs/1.0.39",
|
|
53
54
|
autoRefreshToken: true
|
|
54
55
|
};
|
|
55
|
-
var SDK_VERSION = "1.0.
|
|
56
|
+
var SDK_VERSION = "1.0.39";
|
|
56
57
|
var API_VERSION = "v1";
|
|
57
58
|
var API_BASE_PATH = `/api/${API_VERSION}`;
|
|
58
59
|
function normalizeCredential(value) {
|
|
@@ -2559,13 +2560,30 @@ var PROTO_LOADER_OPTIONS = {
|
|
|
2559
2560
|
// Support oneofs
|
|
2560
2561
|
};
|
|
2561
2562
|
var cachedDefinition = null;
|
|
2562
|
-
function
|
|
2563
|
+
function getModuleDir() {
|
|
2563
2564
|
if (typeof (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)) !== "undefined") {
|
|
2564
|
-
|
|
2565
|
-
const __dirname2 = path.dirname(__filename);
|
|
2566
|
-
return path.join(__dirname2, "../../proto/spooled.proto");
|
|
2565
|
+
return path.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))));
|
|
2567
2566
|
}
|
|
2568
|
-
return
|
|
2567
|
+
return __dirname;
|
|
2568
|
+
}
|
|
2569
|
+
function getProtoPath() {
|
|
2570
|
+
const moduleDir = getModuleDir();
|
|
2571
|
+
const candidates = [
|
|
2572
|
+
// Bundled ESM/CJS: dist/index.js → ../proto/spooled.proto
|
|
2573
|
+
path.join(moduleDir, "../proto/spooled.proto"),
|
|
2574
|
+
// Source / unbundled: src/grpc/loader.ts → ../../proto/spooled.proto
|
|
2575
|
+
path.join(moduleDir, "../../proto/spooled.proto"),
|
|
2576
|
+
// Extra safety if moduleDir is package root
|
|
2577
|
+
path.join(moduleDir, "proto/spooled.proto")
|
|
2578
|
+
];
|
|
2579
|
+
for (const candidate of candidates) {
|
|
2580
|
+
if (fs.existsSync(candidate)) {
|
|
2581
|
+
return candidate;
|
|
2582
|
+
}
|
|
2583
|
+
}
|
|
2584
|
+
throw new Error(
|
|
2585
|
+
`Spooled gRPC proto not found. Tried: ${candidates.join(", ")}. Ensure the package's proto/spooled.proto is installed next to dist/.`
|
|
2586
|
+
);
|
|
2569
2587
|
}
|
|
2570
2588
|
function loadProtoDefinition() {
|
|
2571
2589
|
if (cachedDefinition) {
|
|
@@ -3776,6 +3794,7 @@ exports.createPaginatedResponse = createPaginatedResponse;
|
|
|
3776
3794
|
exports.createProcessJobsStream = createProcessJobsStream;
|
|
3777
3795
|
exports.createRetryWrapper = createRetryWrapper;
|
|
3778
3796
|
exports.dateToTimestamp = dateToTimestamp;
|
|
3797
|
+
exports.getProtoPath = getProtoPath;
|
|
3779
3798
|
exports.isRetryableError = isRetryableError;
|
|
3780
3799
|
exports.isSpooledError = isSpooledError;
|
|
3781
3800
|
exports.loadProtoDefinition = loadProtoDefinition;
|