@osaas/client-core
Advanced tools
Comparing version 0.14.1 to 0.15.0
@@ -82,2 +82,3 @@ import { Context, Service } from './context'; | ||
export declare function valueOrSecret(value: string): string; | ||
export declare function waitForInstanceReady(serviceId: string, name: string, ctx: Context): Promise<void>; | ||
//# sourceMappingURL=core.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.valueOrSecret = exports.instanceValue = exports.getInstanceHealth = exports.getLogsForInstance = exports.getPortsForInstance = exports.listInstances = exports.getInstance = exports.removeInstance = exports.createInstance = exports.isValidInstanceName = exports.getService = void 0; | ||
exports.waitForInstanceReady = exports.valueOrSecret = exports.instanceValue = exports.getInstanceHealth = exports.getLogsForInstance = exports.getPortsForInstance = exports.listInstances = exports.getInstance = exports.removeInstance = exports.createInstance = exports.isValidInstanceName = exports.getService = void 0; | ||
const errors_1 = require("./errors"); | ||
const fetch_1 = require("./fetch"); | ||
const log_1 = require("./log"); | ||
const delay = (ms) => new Promise((res) => setTimeout(res, ms)); | ||
async function getService(context, serviceId) { | ||
@@ -201,2 +202,14 @@ const serviceUrl = new URL(`https://catalog.svc.${context.getEnvironment()}.osaas.io/mysubscriptions`); | ||
exports.valueOrSecret = valueOrSecret; | ||
async function waitForInstanceReady(serviceId, name, ctx) { | ||
const serviceAccessToken = await ctx.getServiceAccessToken(serviceId); | ||
let instanceOk = false; | ||
while (!instanceOk) { | ||
await delay(1000); | ||
const status = await getInstanceHealth(ctx, serviceId, name, serviceAccessToken); | ||
if (status && status === 'running') { | ||
instanceOk = true; | ||
} | ||
} | ||
} | ||
exports.waitForInstanceReady = waitForInstanceReady; | ||
//# sourceMappingURL=core.js.map |
@@ -6,3 +6,3 @@ /** @module @osaas/client-core */ | ||
export { Platform } from './platform'; | ||
export { createInstance, removeInstance, getInstance, listInstances, getPortsForInstance, getLogsForInstance, getInstanceHealth, instanceValue, valueOrSecret } from './core'; | ||
export { createInstance, removeInstance, getInstance, listInstances, getPortsForInstance, getLogsForInstance, getInstanceHealth, instanceValue, valueOrSecret, isValidInstanceName, waitForInstanceReady } from './core'; | ||
export { listSubscriptions, removeSubscription, Subscription } from './admin'; | ||
@@ -9,0 +9,0 @@ export { createJob, removeJob, getJob, listJobs, waitForJobToComplete } from './job'; |
@@ -17,3 +17,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.waitForJobToComplete = exports.listJobs = exports.getJob = exports.removeJob = exports.createJob = exports.removeSubscription = exports.listSubscriptions = exports.valueOrSecret = exports.instanceValue = exports.getInstanceHealth = exports.getLogsForInstance = exports.getPortsForInstance = exports.listInstances = exports.getInstance = exports.removeInstance = exports.createInstance = exports.Platform = exports.Context = exports.FetchError = exports.createFetch = exports.Log = void 0; | ||
exports.waitForJobToComplete = exports.listJobs = exports.getJob = exports.removeJob = exports.createJob = exports.removeSubscription = exports.listSubscriptions = exports.waitForInstanceReady = exports.isValidInstanceName = exports.valueOrSecret = exports.instanceValue = exports.getInstanceHealth = exports.getLogsForInstance = exports.getPortsForInstance = exports.listInstances = exports.getInstance = exports.removeInstance = exports.createInstance = exports.Platform = exports.Context = exports.FetchError = exports.createFetch = exports.Log = void 0; | ||
/** @module @osaas/client-core */ | ||
@@ -39,2 +39,4 @@ var log_1 = require("./log"); | ||
Object.defineProperty(exports, "valueOrSecret", { enumerable: true, get: function () { return core_1.valueOrSecret; } }); | ||
Object.defineProperty(exports, "isValidInstanceName", { enumerable: true, get: function () { return core_1.isValidInstanceName; } }); | ||
Object.defineProperty(exports, "waitForInstanceReady", { enumerable: true, get: function () { return core_1.waitForInstanceReady; } }); | ||
var admin_1 = require("./admin"); | ||
@@ -41,0 +43,0 @@ Object.defineProperty(exports, "listSubscriptions", { enumerable: true, get: function () { return admin_1.listSubscriptions; } }); |
{ | ||
"name": "@osaas/client-core", | ||
"version": "0.14.1", | ||
"version": "0.15.0", | ||
"description": "Open Source Cloud Client SDK core library", | ||
@@ -34,3 +34,3 @@ "author": "Eyevinn Open Source Cloud <osc@eyevinn.se>", | ||
}, | ||
"gitHead": "150c79d6eb21b0d67c947706facf4918a1b9f907" | ||
"gitHead": "eb88400f144914fba52d8d37dfc9b26a7966a8bc" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
66681
960