/** * Returns an object of service objects. * * @param {object} state Global state tree * @returns {object} Keyring services, if known. */ export function getKeyringServices( state ) { return state.sharing.services.items; }
Object.keys(props.dictionary.services).map(host => ( <option value={host}> <Text id={`integration.caldav.services.${host}.name`} /> </option> ))
create (serviceName) { const ClassObj = this.services[serviceName] if (ClassObj === undefined) { throw new Error(`unknown service: ${serviceName}`) } return new ClassObj() }
constructor(id, options = {}) { options = _.merge({}, config, options); options.services = _.merge({}, getServices(options), options.services); options.tooling = _.merge({}, getTooling(options), options.tooling); options.proxy = _.set({}, 'appserver', [`${options.app}.${options._app._config.domain}:${options.port}`]); super(id, options); }
describe("Test ServiceCatalog constructor", () => { let broker = new ServiceBroker({ logger: false }); let registry = broker.registry; it("test without CB", () => { let catalog = new ServiceCatalog(registry, broker); expect(catalog).toBeDefined(); expect(catalog.registry).toBe(registry); expect(catalog.broker).toBe(broker); expect(catalog.logger).toBe(registry.logger); expect(catalog.services).toBeInstanceOf(Array); }); });
async deleteCategory(ctx) { const { name } = ctx.params; strapi.reload.isWatching = false; const componentCategoryService = strapi.plugins['content-type-builder'].services.componentcategories; await componentCategoryService.deleteCategory(name); setImmediate(() => strapi.reload()); ctx.send({ name }); }
constructor(id, options = {}) { options = _.merge({}, config, options); super(id, options, { services: _.set( {}, options.name, utils.normalizeOverrides(options.services, options._app.root, options.volumes) ), networks: options.networks, volumes: options.volumes, }); }
/** * Removes unwanted fields from a permission * @param permission * @returns {*} */ const sanitizePermission = perm => ({ ..._.pick(perm, ['id', 'action', 'subject', 'fields']), conditions: strapi.admin.services.condition.removeUnkownConditionIds(perm.conditions), })
/* * Helper to build build object needed by lando.shell.sh */ const buildShell = (run, name, compose, opts = {}) => ({ cmd: buildCmd(run, name, compose, {services: opts.services, cmd: opts.cmd}, mergeOpts(run, opts)), opts: {mode: 'spawn', cstdio: opts.cstdio, silent: opts.silent}, })
async findOne(ctx) { const { params: { id }, } = ctx; const data = await strapi.plugins.upload.services.upload.fetch({ id }); if (!data) { return ctx.notFound('file.notFound'); } ctx.body = data; }
async updateSettings(ctx) { const { request: { body }, } = ctx; const data = await validateSettings(body); await strapi.plugins.upload.services.upload.setSettings(data); ctx.body = { data }; }
/** * Check the service is exist * * @param {String} fullName * @param {String} nodeID * @returns * @memberof ServiceCatalog */ has(fullName, nodeID) { return this.services.find(svc => svc.equals(fullName, nodeID)) != null; }
async uploadFiles(ctx) { const { request: { body, files: { files } = {} }, } = ctx; ctx.body = await strapi.plugins.upload.services.upload.upload({ data: await validateUploadBody(body), files, }); }
/** * Get a service by fullName & nodeID * * @param {String} fullName * @param {String} nodeID * @returns * @memberof ServiceCatalog */ get(fullName, nodeID) { return this.services.find(svc => svc.equals(fullName, nodeID)); }