@forklaunch/universal-sdk 0.6.1 → 0.6.3
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/lib/index.js +5 -22
- package/lib/index.mjs +5 -22
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -350,45 +350,28 @@ function getSdkPath(path) {
|
|
|
350
350
|
|
|
351
351
|
// src/universalSdk.ts
|
|
352
352
|
var UniversalSdk = class _UniversalSdk {
|
|
353
|
-
constructor(host, ajv, registryOptions, contentTypeParserMap
|
|
353
|
+
constructor(host, ajv, registryOptions, contentTypeParserMap) {
|
|
354
354
|
this.host = host;
|
|
355
355
|
this.ajv = ajv;
|
|
356
356
|
this.registryOptions = registryOptions;
|
|
357
357
|
this.contentTypeParserMap = contentTypeParserMap;
|
|
358
|
-
this.registryOpenApiJson = registryOpenApiJson;
|
|
359
|
-
this.registryOpenApiHash = registryOpenApiHash;
|
|
360
|
-
this.sdkPathMap = sdkPathMap;
|
|
361
358
|
}
|
|
359
|
+
registryOpenApiJson;
|
|
360
|
+
registryOpenApiHash;
|
|
361
|
+
sdkPathMap;
|
|
362
362
|
/**
|
|
363
363
|
* Creates an instance of UniversalSdk.
|
|
364
364
|
*
|
|
365
365
|
* @param {string} host - The host URL for the SDK.
|
|
366
366
|
*/
|
|
367
367
|
static async create(host, registryOptions, contentTypeParserMap) {
|
|
368
|
-
const refreshResult = await refreshOpenApi(host, registryOptions);
|
|
369
|
-
let registryOpenApiJson;
|
|
370
|
-
let registryOpenApiHash;
|
|
371
|
-
let sdkPathMap;
|
|
372
|
-
if (refreshResult.updateRequired) {
|
|
373
|
-
registryOpenApiJson = refreshResult.registryOpenApiJson;
|
|
374
|
-
registryOpenApiHash = refreshResult.registryOpenApiHash;
|
|
375
|
-
sdkPathMap = refreshResult.sdkPathMap;
|
|
376
|
-
}
|
|
377
368
|
const ajv = new import_ajv.default({
|
|
378
369
|
coerceTypes: true,
|
|
379
370
|
allErrors: true,
|
|
380
371
|
strict: false
|
|
381
372
|
});
|
|
382
373
|
(0, import_ajv_formats.default)(ajv);
|
|
383
|
-
return new _UniversalSdk(
|
|
384
|
-
host,
|
|
385
|
-
ajv,
|
|
386
|
-
registryOptions,
|
|
387
|
-
contentTypeParserMap,
|
|
388
|
-
registryOpenApiJson,
|
|
389
|
-
registryOpenApiHash,
|
|
390
|
-
sdkPathMap
|
|
391
|
-
);
|
|
374
|
+
return new _UniversalSdk(host, ajv, registryOptions, contentTypeParserMap);
|
|
392
375
|
}
|
|
393
376
|
async executeFetchCall(path, request) {
|
|
394
377
|
if (!this.host) {
|
package/lib/index.mjs
CHANGED
|
@@ -318,45 +318,28 @@ function getSdkPath(path) {
|
|
|
318
318
|
|
|
319
319
|
// src/universalSdk.ts
|
|
320
320
|
var UniversalSdk = class _UniversalSdk {
|
|
321
|
-
constructor(host, ajv, registryOptions, contentTypeParserMap
|
|
321
|
+
constructor(host, ajv, registryOptions, contentTypeParserMap) {
|
|
322
322
|
this.host = host;
|
|
323
323
|
this.ajv = ajv;
|
|
324
324
|
this.registryOptions = registryOptions;
|
|
325
325
|
this.contentTypeParserMap = contentTypeParserMap;
|
|
326
|
-
this.registryOpenApiJson = registryOpenApiJson;
|
|
327
|
-
this.registryOpenApiHash = registryOpenApiHash;
|
|
328
|
-
this.sdkPathMap = sdkPathMap;
|
|
329
326
|
}
|
|
327
|
+
registryOpenApiJson;
|
|
328
|
+
registryOpenApiHash;
|
|
329
|
+
sdkPathMap;
|
|
330
330
|
/**
|
|
331
331
|
* Creates an instance of UniversalSdk.
|
|
332
332
|
*
|
|
333
333
|
* @param {string} host - The host URL for the SDK.
|
|
334
334
|
*/
|
|
335
335
|
static async create(host, registryOptions, contentTypeParserMap) {
|
|
336
|
-
const refreshResult = await refreshOpenApi(host, registryOptions);
|
|
337
|
-
let registryOpenApiJson;
|
|
338
|
-
let registryOpenApiHash;
|
|
339
|
-
let sdkPathMap;
|
|
340
|
-
if (refreshResult.updateRequired) {
|
|
341
|
-
registryOpenApiJson = refreshResult.registryOpenApiJson;
|
|
342
|
-
registryOpenApiHash = refreshResult.registryOpenApiHash;
|
|
343
|
-
sdkPathMap = refreshResult.sdkPathMap;
|
|
344
|
-
}
|
|
345
336
|
const ajv = new Ajv({
|
|
346
337
|
coerceTypes: true,
|
|
347
338
|
allErrors: true,
|
|
348
339
|
strict: false
|
|
349
340
|
});
|
|
350
341
|
addFormats(ajv);
|
|
351
|
-
return new _UniversalSdk(
|
|
352
|
-
host,
|
|
353
|
-
ajv,
|
|
354
|
-
registryOptions,
|
|
355
|
-
contentTypeParserMap,
|
|
356
|
-
registryOpenApiJson,
|
|
357
|
-
registryOpenApiHash,
|
|
358
|
-
sdkPathMap
|
|
359
|
-
);
|
|
342
|
+
return new _UniversalSdk(host, ajv, registryOptions, contentTypeParserMap);
|
|
360
343
|
}
|
|
361
344
|
async executeFetchCall(path, request) {
|
|
362
345
|
if (!this.host) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forklaunch/universal-sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Cross runtime fetch library for forklaunch router sdks",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"fetch",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"ajv": "^8.17.1",
|
|
35
35
|
"ajv-formats": "^3.0.1",
|
|
36
|
-
"@forklaunch/common": "0.5.
|
|
36
|
+
"@forklaunch/common": "0.5.3"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^24.3.0",
|
|
40
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
40
|
+
"@typescript/native-preview": "7.0.0-dev.20250824.1",
|
|
41
41
|
"fetch-mock": "^12.5.3",
|
|
42
42
|
"jest": "^30.0.5",
|
|
43
43
|
"openapi3-ts": "^4.5.0",
|