@aneoconsultingfr/armonik.api
Version:
gRPC API to interact with ArmoniK built for the web
378 lines (363 loc) • 12.5 kB
JavaScript
;Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
var _chunkHV32ZXSXjs = require('./chunk-HV32ZXSX.js');
var _chunkGUDKJDNBjs = require('./chunk-GUDKJDNB.js');
var _chunkOLWH3YHBjs = require('./chunk-OLWH3YHB.js');
// src/generated/applications_common.ts
var _minimaljs = require('protobufjs/minimal.js'); var _minimaljs2 = _interopRequireDefault(_minimaljs);
var protobufPackage = "armonik.api.grpc.v1.applications";
function createBaseApplicationRaw() {
return { name: "", version: "", namespace: "", service: "" };
}
var ApplicationRaw = {
encode(message, writer = _minimaljs2.default.Writer.create()) {
if (message.name !== "") {
writer.uint32(10).string(message.name);
}
if (message.version !== "") {
writer.uint32(18).string(message.version);
}
if (message.namespace !== "") {
writer.uint32(26).string(message.namespace);
}
if (message.service !== "") {
writer.uint32(34).string(message.service);
}
return writer;
},
decode(input, length) {
const reader = input instanceof _minimaljs2.default.Reader ? input : _minimaljs2.default.Reader.create(input);
let end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseApplicationRaw();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.name = reader.string();
continue;
case 2:
if (tag !== 18) {
break;
}
message.version = reader.string();
continue;
case 3:
if (tag !== 26) {
break;
}
message.namespace = reader.string();
continue;
case 4:
if (tag !== 34) {
break;
}
message.service = reader.string();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
name: isSet(object.name) ? String(object.name) : "",
version: isSet(object.version) ? String(object.version) : "",
namespace: isSet(object.namespace) ? String(object.namespace) : "",
service: isSet(object.service) ? String(object.service) : ""
};
},
toJSON(message) {
const obj = {};
if (message.name !== "") {
obj.name = message.name;
}
if (message.version !== "") {
obj.version = message.version;
}
if (message.namespace !== "") {
obj.namespace = message.namespace;
}
if (message.service !== "") {
obj.service = message.service;
}
return obj;
},
create(base) {
return ApplicationRaw.fromPartial(_nullishCoalesce(base, () => ( {})));
},
fromPartial(object) {
const message = createBaseApplicationRaw();
message.name = _nullishCoalesce(object.name, () => ( ""));
message.version = _nullishCoalesce(object.version, () => ( ""));
message.namespace = _nullishCoalesce(object.namespace, () => ( ""));
message.service = _nullishCoalesce(object.service, () => ( ""));
return message;
}
};
function createBaseListApplicationsRequest() {
return { page: 0, pageSize: 0, filters: void 0, sort: void 0 };
}
var ListApplicationsRequest = {
encode(message, writer = _minimaljs2.default.Writer.create()) {
if (message.page !== 0) {
writer.uint32(8).int32(message.page);
}
if (message.pageSize !== 0) {
writer.uint32(16).int32(message.pageSize);
}
if (message.filters !== void 0) {
_chunkGUDKJDNBjs.Filters.encode(message.filters, writer.uint32(26).fork()).ldelim();
}
if (message.sort !== void 0) {
ListApplicationsRequest_Sort.encode(message.sort, writer.uint32(34).fork()).ldelim();
}
return writer;
},
decode(input, length) {
const reader = input instanceof _minimaljs2.default.Reader ? input : _minimaljs2.default.Reader.create(input);
let end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseListApplicationsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 8) {
break;
}
message.page = reader.int32();
continue;
case 2:
if (tag !== 16) {
break;
}
message.pageSize = reader.int32();
continue;
case 3:
if (tag !== 26) {
break;
}
message.filters = _chunkGUDKJDNBjs.Filters.decode(reader, reader.uint32());
continue;
case 4:
if (tag !== 34) {
break;
}
message.sort = ListApplicationsRequest_Sort.decode(reader, reader.uint32());
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
page: isSet(object.page) ? Number(object.page) : 0,
pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0,
filters: isSet(object.filters) ? _chunkGUDKJDNBjs.Filters.fromJSON(object.filters) : void 0,
sort: isSet(object.sort) ? ListApplicationsRequest_Sort.fromJSON(object.sort) : void 0
};
},
toJSON(message) {
const obj = {};
if (message.page !== 0) {
obj.page = Math.round(message.page);
}
if (message.pageSize !== 0) {
obj.pageSize = Math.round(message.pageSize);
}
if (message.filters !== void 0) {
obj.filters = _chunkGUDKJDNBjs.Filters.toJSON(message.filters);
}
if (message.sort !== void 0) {
obj.sort = ListApplicationsRequest_Sort.toJSON(message.sort);
}
return obj;
},
create(base) {
return ListApplicationsRequest.fromPartial(_nullishCoalesce(base, () => ( {})));
},
fromPartial(object) {
const message = createBaseListApplicationsRequest();
message.page = _nullishCoalesce(object.page, () => ( 0));
message.pageSize = _nullishCoalesce(object.pageSize, () => ( 0));
message.filters = object.filters !== void 0 && object.filters !== null ? _chunkGUDKJDNBjs.Filters.fromPartial(object.filters) : void 0;
message.sort = object.sort !== void 0 && object.sort !== null ? ListApplicationsRequest_Sort.fromPartial(object.sort) : void 0;
return message;
}
};
function createBaseListApplicationsRequest_Sort() {
return { fields: [], direction: 0 };
}
var ListApplicationsRequest_Sort = {
encode(message, writer = _minimaljs2.default.Writer.create()) {
for (const v of message.fields) {
_chunkOLWH3YHBjs.ApplicationField.encode(v, writer.uint32(10).fork()).ldelim();
}
if (message.direction !== 0) {
writer.uint32(16).int32(message.direction);
}
return writer;
},
decode(input, length) {
const reader = input instanceof _minimaljs2.default.Reader ? input : _minimaljs2.default.Reader.create(input);
let end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseListApplicationsRequest_Sort();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.fields.push(_chunkOLWH3YHBjs.ApplicationField.decode(reader, reader.uint32()));
continue;
case 2:
if (tag !== 16) {
break;
}
message.direction = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
fields: Array.isArray(object == null ? void 0 : object.fields) ? object.fields.map((e) => _chunkOLWH3YHBjs.ApplicationField.fromJSON(e)) : [],
direction: isSet(object.direction) ? _chunkHV32ZXSXjs.sortDirectionFromJSON.call(void 0, object.direction) : 0
};
},
toJSON(message) {
var _a;
const obj = {};
if ((_a = message.fields) == null ? void 0 : _a.length) {
obj.fields = message.fields.map((e) => _chunkOLWH3YHBjs.ApplicationField.toJSON(e));
}
if (message.direction !== 0) {
obj.direction = _chunkHV32ZXSXjs.sortDirectionToJSON.call(void 0, message.direction);
}
return obj;
},
create(base) {
return ListApplicationsRequest_Sort.fromPartial(_nullishCoalesce(base, () => ( {})));
},
fromPartial(object) {
var _a;
const message = createBaseListApplicationsRequest_Sort();
message.fields = ((_a = object.fields) == null ? void 0 : _a.map((e) => _chunkOLWH3YHBjs.ApplicationField.fromPartial(e))) || [];
message.direction = _nullishCoalesce(object.direction, () => ( 0));
return message;
}
};
function createBaseListApplicationsResponse() {
return { applications: [], page: 0, pageSize: 0, total: 0 };
}
var ListApplicationsResponse = {
encode(message, writer = _minimaljs2.default.Writer.create()) {
for (const v of message.applications) {
ApplicationRaw.encode(v, writer.uint32(10).fork()).ldelim();
}
if (message.page !== 0) {
writer.uint32(16).int32(message.page);
}
if (message.pageSize !== 0) {
writer.uint32(24).int32(message.pageSize);
}
if (message.total !== 0) {
writer.uint32(32).int32(message.total);
}
return writer;
},
decode(input, length) {
const reader = input instanceof _minimaljs2.default.Reader ? input : _minimaljs2.default.Reader.create(input);
let end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseListApplicationsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
if (tag !== 10) {
break;
}
message.applications.push(ApplicationRaw.decode(reader, reader.uint32()));
continue;
case 2:
if (tag !== 16) {
break;
}
message.page = reader.int32();
continue;
case 3:
if (tag !== 24) {
break;
}
message.pageSize = reader.int32();
continue;
case 4:
if (tag !== 32) {
break;
}
message.total = reader.int32();
continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skipType(tag & 7);
}
return message;
},
fromJSON(object) {
return {
applications: Array.isArray(object == null ? void 0 : object.applications) ? object.applications.map((e) => ApplicationRaw.fromJSON(e)) : [],
page: isSet(object.page) ? Number(object.page) : 0,
pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0,
total: isSet(object.total) ? Number(object.total) : 0
};
},
toJSON(message) {
var _a;
const obj = {};
if ((_a = message.applications) == null ? void 0 : _a.length) {
obj.applications = message.applications.map((e) => ApplicationRaw.toJSON(e));
}
if (message.page !== 0) {
obj.page = Math.round(message.page);
}
if (message.pageSize !== 0) {
obj.pageSize = Math.round(message.pageSize);
}
if (message.total !== 0) {
obj.total = Math.round(message.total);
}
return obj;
},
create(base) {
return ListApplicationsResponse.fromPartial(_nullishCoalesce(base, () => ( {})));
},
fromPartial(object) {
var _a;
const message = createBaseListApplicationsResponse();
message.applications = ((_a = object.applications) == null ? void 0 : _a.map((e) => ApplicationRaw.fromPartial(e))) || [];
message.page = _nullishCoalesce(object.page, () => ( 0));
message.pageSize = _nullishCoalesce(object.pageSize, () => ( 0));
message.total = _nullishCoalesce(object.total, () => ( 0));
return message;
}
};
function isSet(value) {
return value !== null && value !== void 0;
}
exports.protobufPackage = protobufPackage; exports.ApplicationRaw = ApplicationRaw; exports.ListApplicationsRequest = ListApplicationsRequest; exports.ListApplicationsRequest_Sort = ListApplicationsRequest_Sort; exports.ListApplicationsResponse = ListApplicationsResponse;