@ragnaraven/zitadel-node-dual
Version:
Library for API access to ZITADEL with modern ES import syntax. Works everywhere - NestJS, Node.js, any TypeScript environment. No more require()!
1,622 lines (1,621 loc) • 71.2 kB
JavaScript
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var instance_service_exports = {};
__export(instance_service_exports, {
AddCustomDomainRequest: () => AddCustomDomainRequest,
AddCustomDomainResponse: () => AddCustomDomainResponse,
AddTrustedDomainRequest: () => AddTrustedDomainRequest,
AddTrustedDomainResponse: () => AddTrustedDomainResponse,
DeleteInstanceRequest: () => DeleteInstanceRequest,
DeleteInstanceResponse: () => DeleteInstanceResponse,
GetInstanceRequest: () => GetInstanceRequest,
GetInstanceResponse: () => GetInstanceResponse,
InstanceServiceDefinition: () => InstanceServiceDefinition,
ListCustomDomainsRequest: () => ListCustomDomainsRequest,
ListCustomDomainsResponse: () => ListCustomDomainsResponse,
ListInstancesRequest: () => ListInstancesRequest,
ListInstancesResponse: () => ListInstancesResponse,
ListTrustedDomainsRequest: () => ListTrustedDomainsRequest,
ListTrustedDomainsResponse: () => ListTrustedDomainsResponse,
RemoveCustomDomainRequest: () => RemoveCustomDomainRequest,
RemoveCustomDomainResponse: () => RemoveCustomDomainResponse,
RemoveTrustedDomainRequest: () => RemoveTrustedDomainRequest,
RemoveTrustedDomainResponse: () => RemoveTrustedDomainResponse,
UpdateInstanceRequest: () => UpdateInstanceRequest,
UpdateInstanceResponse: () => UpdateInstanceResponse,
protobufPackage: () => protobufPackage
});
module.exports = __toCommonJS(instance_service_exports);
var import_wire = require("@bufbuild/protobuf/wire");
var import_long = __toESM(require("long"));
var import_timestamp = require("../../../google/protobuf/timestamp.js");
var import_filter = require("../../filter/v2beta/filter.js");
var import_instance = require("./instance.js");
const protobufPackage = "zitadel.instance.v2beta";
function createBaseDeleteInstanceRequest() {
return { instanceId: "" };
}
const DeleteInstanceRequest = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseDeleteInstanceRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "" };
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
return obj;
},
create(base) {
return DeleteInstanceRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeleteInstanceRequest();
message.instanceId = object.instanceId ?? "";
return message;
}
};
function createBaseDeleteInstanceResponse() {
return { deletionDate: void 0 };
}
const DeleteInstanceResponse = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.deletionDate !== void 0) {
import_timestamp.Timestamp.encode(toTimestamp(message.deletionDate), writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseDeleteInstanceResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.deletionDate = fromTimestamp(import_timestamp.Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { deletionDate: isSet(object.deletionDate) ? fromJsonTimestamp(object.deletionDate) : void 0 };
},
toJSON(message) {
const obj = {};
if (message.deletionDate !== void 0) {
obj.deletionDate = message.deletionDate.toISOString();
}
return obj;
},
create(base) {
return DeleteInstanceResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseDeleteInstanceResponse();
message.deletionDate = object.deletionDate ?? void 0;
return message;
}
};
function createBaseGetInstanceRequest() {
return { instanceId: "" };
}
const GetInstanceRequest = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseGetInstanceRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "" };
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
return obj;
},
create(base) {
return GetInstanceRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseGetInstanceRequest();
message.instanceId = object.instanceId ?? "";
return message;
}
};
function createBaseGetInstanceResponse() {
return { instance: void 0 };
}
const GetInstanceResponse = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.instance !== void 0) {
import_instance.Instance.encode(message.instance, writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseGetInstanceResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instance = import_instance.Instance.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { instance: isSet(object.instance) ? import_instance.Instance.fromJSON(object.instance) : void 0 };
},
toJSON(message) {
const obj = {};
if (message.instance !== void 0) {
obj.instance = import_instance.Instance.toJSON(message.instance);
}
return obj;
},
create(base) {
return GetInstanceResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseGetInstanceResponse();
message.instance = object.instance !== void 0 && object.instance !== null ? import_instance.Instance.fromPartial(object.instance) : void 0;
return message;
}
};
function createBaseUpdateInstanceRequest() {
return { instanceId: "", instanceName: "" };
}
const UpdateInstanceRequest = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.instanceName !== "") {
writer.uint32(18).string(message.instanceName);
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseUpdateInstanceRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.instanceName = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
instanceName: isSet(object.instanceName) ? globalThis.String(object.instanceName) : ""
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.instanceName !== "") {
obj.instanceName = message.instanceName;
}
return obj;
},
create(base) {
return UpdateInstanceRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseUpdateInstanceRequest();
message.instanceId = object.instanceId ?? "";
message.instanceName = object.instanceName ?? "";
return message;
}
};
function createBaseUpdateInstanceResponse() {
return { changeDate: void 0 };
}
const UpdateInstanceResponse = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.changeDate !== void 0) {
import_timestamp.Timestamp.encode(toTimestamp(message.changeDate), writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseUpdateInstanceResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.changeDate = fromTimestamp(import_timestamp.Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { changeDate: isSet(object.changeDate) ? fromJsonTimestamp(object.changeDate) : void 0 };
},
toJSON(message) {
const obj = {};
if (message.changeDate !== void 0) {
obj.changeDate = message.changeDate.toISOString();
}
return obj;
},
create(base) {
return UpdateInstanceResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseUpdateInstanceResponse();
message.changeDate = object.changeDate ?? void 0;
return message;
}
};
function createBaseListInstancesRequest() {
return { queries: [], pagination: void 0, sortingColumn: void 0 };
}
const ListInstancesRequest = {
encode(message, writer = new import_wire.BinaryWriter()) {
for (const v of message.queries) {
import_instance.Query.encode(v, writer.uint32(10).fork()).join();
}
if (message.pagination !== void 0) {
import_filter.PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
}
if (message.sortingColumn !== void 0) {
writer.uint32(24).int32(message.sortingColumn);
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseListInstancesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.queries.push(import_instance.Query.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = import_filter.PaginationRequest.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.sortingColumn = reader.int32();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
queries: globalThis.Array.isArray(object?.queries) ? object.queries.map((e) => import_instance.Query.fromJSON(e)) : [],
pagination: isSet(object.pagination) ? import_filter.PaginationRequest.fromJSON(object.pagination) : void 0,
sortingColumn: isSet(object.sortingColumn) ? (0, import_instance.fieldNameFromJSON)(object.sortingColumn) : void 0
};
},
toJSON(message) {
const obj = {};
if (message.queries?.length) {
obj.queries = message.queries.map((e) => import_instance.Query.toJSON(e));
}
if (message.pagination !== void 0) {
obj.pagination = import_filter.PaginationRequest.toJSON(message.pagination);
}
if (message.sortingColumn !== void 0) {
obj.sortingColumn = (0, import_instance.fieldNameToJSON)(message.sortingColumn);
}
return obj;
},
create(base) {
return ListInstancesRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListInstancesRequest();
message.queries = object.queries?.map((e) => import_instance.Query.fromPartial(e)) || [];
message.pagination = object.pagination !== void 0 && object.pagination !== null ? import_filter.PaginationRequest.fromPartial(object.pagination) : void 0;
message.sortingColumn = object.sortingColumn ?? void 0;
return message;
}
};
function createBaseListInstancesResponse() {
return { instances: [], pagination: void 0 };
}
const ListInstancesResponse = {
encode(message, writer = new import_wire.BinaryWriter()) {
for (const v of message.instances) {
import_instance.Instance.encode(v, writer.uint32(10).fork()).join();
}
if (message.pagination !== void 0) {
import_filter.PaginationResponse.encode(message.pagination, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseListInstancesResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instances.push(import_instance.Instance.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = import_filter.PaginationResponse.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instances: globalThis.Array.isArray(object?.instances) ? object.instances.map((e) => import_instance.Instance.fromJSON(e)) : [],
pagination: isSet(object.pagination) ? import_filter.PaginationResponse.fromJSON(object.pagination) : void 0
};
},
toJSON(message) {
const obj = {};
if (message.instances?.length) {
obj.instances = message.instances.map((e) => import_instance.Instance.toJSON(e));
}
if (message.pagination !== void 0) {
obj.pagination = import_filter.PaginationResponse.toJSON(message.pagination);
}
return obj;
},
create(base) {
return ListInstancesResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListInstancesResponse();
message.instances = object.instances?.map((e) => import_instance.Instance.fromPartial(e)) || [];
message.pagination = object.pagination !== void 0 && object.pagination !== null ? import_filter.PaginationResponse.fromPartial(object.pagination) : void 0;
return message;
}
};
function createBaseAddCustomDomainRequest() {
return { instanceId: "", domain: "" };
}
const AddCustomDomainRequest = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.domain !== "") {
writer.uint32(18).string(message.domain);
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseAddCustomDomainRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.domain = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
domain: isSet(object.domain) ? globalThis.String(object.domain) : ""
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.domain !== "") {
obj.domain = message.domain;
}
return obj;
},
create(base) {
return AddCustomDomainRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddCustomDomainRequest();
message.instanceId = object.instanceId ?? "";
message.domain = object.domain ?? "";
return message;
}
};
function createBaseAddCustomDomainResponse() {
return { creationDate: void 0 };
}
const AddCustomDomainResponse = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.creationDate !== void 0) {
import_timestamp.Timestamp.encode(toTimestamp(message.creationDate), writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseAddCustomDomainResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.creationDate = fromTimestamp(import_timestamp.Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { creationDate: isSet(object.creationDate) ? fromJsonTimestamp(object.creationDate) : void 0 };
},
toJSON(message) {
const obj = {};
if (message.creationDate !== void 0) {
obj.creationDate = message.creationDate.toISOString();
}
return obj;
},
create(base) {
return AddCustomDomainResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddCustomDomainResponse();
message.creationDate = object.creationDate ?? void 0;
return message;
}
};
function createBaseRemoveCustomDomainRequest() {
return { instanceId: "", domain: "" };
}
const RemoveCustomDomainRequest = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.domain !== "") {
writer.uint32(18).string(message.domain);
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseRemoveCustomDomainRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.domain = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
domain: isSet(object.domain) ? globalThis.String(object.domain) : ""
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.domain !== "") {
obj.domain = message.domain;
}
return obj;
},
create(base) {
return RemoveCustomDomainRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveCustomDomainRequest();
message.instanceId = object.instanceId ?? "";
message.domain = object.domain ?? "";
return message;
}
};
function createBaseRemoveCustomDomainResponse() {
return { deletionDate: void 0 };
}
const RemoveCustomDomainResponse = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.deletionDate !== void 0) {
import_timestamp.Timestamp.encode(toTimestamp(message.deletionDate), writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseRemoveCustomDomainResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.deletionDate = fromTimestamp(import_timestamp.Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { deletionDate: isSet(object.deletionDate) ? fromJsonTimestamp(object.deletionDate) : void 0 };
},
toJSON(message) {
const obj = {};
if (message.deletionDate !== void 0) {
obj.deletionDate = message.deletionDate.toISOString();
}
return obj;
},
create(base) {
return RemoveCustomDomainResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveCustomDomainResponse();
message.deletionDate = object.deletionDate ?? void 0;
return message;
}
};
function createBaseListCustomDomainsRequest() {
return { instanceId: "", pagination: void 0, sortingColumn: 0, queries: [] };
}
const ListCustomDomainsRequest = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.pagination !== void 0) {
import_filter.PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
}
if (message.sortingColumn !== 0) {
writer.uint32(24).int32(message.sortingColumn);
}
for (const v of message.queries) {
import_instance.DomainSearchQuery.encode(v, writer.uint32(34).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseListCustomDomainsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = import_filter.PaginationRequest.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.sortingColumn = reader.int32();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.queries.push(import_instance.DomainSearchQuery.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
pagination: isSet(object.pagination) ? import_filter.PaginationRequest.fromJSON(object.pagination) : void 0,
sortingColumn: isSet(object.sortingColumn) ? (0, import_instance.domainFieldNameFromJSON)(object.sortingColumn) : 0,
queries: globalThis.Array.isArray(object?.queries) ? object.queries.map((e) => import_instance.DomainSearchQuery.fromJSON(e)) : []
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.pagination !== void 0) {
obj.pagination = import_filter.PaginationRequest.toJSON(message.pagination);
}
if (message.sortingColumn !== 0) {
obj.sortingColumn = (0, import_instance.domainFieldNameToJSON)(message.sortingColumn);
}
if (message.queries?.length) {
obj.queries = message.queries.map((e) => import_instance.DomainSearchQuery.toJSON(e));
}
return obj;
},
create(base) {
return ListCustomDomainsRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListCustomDomainsRequest();
message.instanceId = object.instanceId ?? "";
message.pagination = object.pagination !== void 0 && object.pagination !== null ? import_filter.PaginationRequest.fromPartial(object.pagination) : void 0;
message.sortingColumn = object.sortingColumn ?? 0;
message.queries = object.queries?.map((e) => import_instance.DomainSearchQuery.fromPartial(e)) || [];
return message;
}
};
function createBaseListCustomDomainsResponse() {
return { domains: [], pagination: void 0 };
}
const ListCustomDomainsResponse = {
encode(message, writer = new import_wire.BinaryWriter()) {
for (const v of message.domains) {
import_instance.Domain.encode(v, writer.uint32(10).fork()).join();
}
if (message.pagination !== void 0) {
import_filter.PaginationResponse.encode(message.pagination, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseListCustomDomainsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.domains.push(import_instance.Domain.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = import_filter.PaginationResponse.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
domains: globalThis.Array.isArray(object?.domains) ? object.domains.map((e) => import_instance.Domain.fromJSON(e)) : [],
pagination: isSet(object.pagination) ? import_filter.PaginationResponse.fromJSON(object.pagination) : void 0
};
},
toJSON(message) {
const obj = {};
if (message.domains?.length) {
obj.domains = message.domains.map((e) => import_instance.Domain.toJSON(e));
}
if (message.pagination !== void 0) {
obj.pagination = import_filter.PaginationResponse.toJSON(message.pagination);
}
return obj;
},
create(base) {
return ListCustomDomainsResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListCustomDomainsResponse();
message.domains = object.domains?.map((e) => import_instance.Domain.fromPartial(e)) || [];
message.pagination = object.pagination !== void 0 && object.pagination !== null ? import_filter.PaginationResponse.fromPartial(object.pagination) : void 0;
return message;
}
};
function createBaseAddTrustedDomainRequest() {
return { instanceId: "", domain: "" };
}
const AddTrustedDomainRequest = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.domain !== "") {
writer.uint32(18).string(message.domain);
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseAddTrustedDomainRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.domain = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
domain: isSet(object.domain) ? globalThis.String(object.domain) : ""
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.domain !== "") {
obj.domain = message.domain;
}
return obj;
},
create(base) {
return AddTrustedDomainRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddTrustedDomainRequest();
message.instanceId = object.instanceId ?? "";
message.domain = object.domain ?? "";
return message;
}
};
function createBaseAddTrustedDomainResponse() {
return { creationDate: void 0 };
}
const AddTrustedDomainResponse = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.creationDate !== void 0) {
import_timestamp.Timestamp.encode(toTimestamp(message.creationDate), writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseAddTrustedDomainResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.creationDate = fromTimestamp(import_timestamp.Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { creationDate: isSet(object.creationDate) ? fromJsonTimestamp(object.creationDate) : void 0 };
},
toJSON(message) {
const obj = {};
if (message.creationDate !== void 0) {
obj.creationDate = message.creationDate.toISOString();
}
return obj;
},
create(base) {
return AddTrustedDomainResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseAddTrustedDomainResponse();
message.creationDate = object.creationDate ?? void 0;
return message;
}
};
function createBaseRemoveTrustedDomainRequest() {
return { instanceId: "", domain: "" };
}
const RemoveTrustedDomainRequest = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.domain !== "") {
writer.uint32(18).string(message.domain);
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseRemoveTrustedDomainRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.domain = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
domain: isSet(object.domain) ? globalThis.String(object.domain) : ""
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.domain !== "") {
obj.domain = message.domain;
}
return obj;
},
create(base) {
return RemoveTrustedDomainRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveTrustedDomainRequest();
message.instanceId = object.instanceId ?? "";
message.domain = object.domain ?? "";
return message;
}
};
function createBaseRemoveTrustedDomainResponse() {
return { deletionDate: void 0 };
}
const RemoveTrustedDomainResponse = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.deletionDate !== void 0) {
import_timestamp.Timestamp.encode(toTimestamp(message.deletionDate), writer.uint32(10).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseRemoveTrustedDomainResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.deletionDate = fromTimestamp(import_timestamp.Timestamp.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return { deletionDate: isSet(object.deletionDate) ? fromJsonTimestamp(object.deletionDate) : void 0 };
},
toJSON(message) {
const obj = {};
if (message.deletionDate !== void 0) {
obj.deletionDate = message.deletionDate.toISOString();
}
return obj;
},
create(base) {
return RemoveTrustedDomainResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseRemoveTrustedDomainResponse();
message.deletionDate = object.deletionDate ?? void 0;
return message;
}
};
function createBaseListTrustedDomainsRequest() {
return { instanceId: "", pagination: void 0, sortingColumn: 0, queries: [] };
}
const ListTrustedDomainsRequest = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.instanceId !== "") {
writer.uint32(10).string(message.instanceId);
}
if (message.pagination !== void 0) {
import_filter.PaginationRequest.encode(message.pagination, writer.uint32(18).fork()).join();
}
if (message.sortingColumn !== 0) {
writer.uint32(24).int32(message.sortingColumn);
}
for (const v of message.queries) {
import_instance.TrustedDomainSearchQuery.encode(v, writer.uint32(34).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseListTrustedDomainsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.instanceId = reader.string();
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = import_filter.PaginationRequest.decode(reader, reader.uint32());
continue;
}
case 3: {
if (tag !== 24) {
break;
}
message.sortingColumn = reader.int32();
continue;
}
case 4: {
if (tag !== 34) {
break;
}
message.queries.push(import_instance.TrustedDomainSearchQuery.decode(reader, reader.uint32()));
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
instanceId: isSet(object.instanceId) ? globalThis.String(object.instanceId) : "",
pagination: isSet(object.pagination) ? import_filter.PaginationRequest.fromJSON(object.pagination) : void 0,
sortingColumn: isSet(object.sortingColumn) ? (0, import_instance.trustedDomainFieldNameFromJSON)(object.sortingColumn) : 0,
queries: globalThis.Array.isArray(object?.queries) ? object.queries.map((e) => import_instance.TrustedDomainSearchQuery.fromJSON(e)) : []
};
},
toJSON(message) {
const obj = {};
if (message.instanceId !== "") {
obj.instanceId = message.instanceId;
}
if (message.pagination !== void 0) {
obj.pagination = import_filter.PaginationRequest.toJSON(message.pagination);
}
if (message.sortingColumn !== 0) {
obj.sortingColumn = (0, import_instance.trustedDomainFieldNameToJSON)(message.sortingColumn);
}
if (message.queries?.length) {
obj.queries = message.queries.map((e) => import_instance.TrustedDomainSearchQuery.toJSON(e));
}
return obj;
},
create(base) {
return ListTrustedDomainsRequest.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListTrustedDomainsRequest();
message.instanceId = object.instanceId ?? "";
message.pagination = object.pagination !== void 0 && object.pagination !== null ? import_filter.PaginationRequest.fromPartial(object.pagination) : void 0;
message.sortingColumn = object.sortingColumn ?? 0;
message.queries = object.queries?.map((e) => import_instance.TrustedDomainSearchQuery.fromPartial(e)) || [];
return message;
}
};
function createBaseListTrustedDomainsResponse() {
return { trustedDomain: [], pagination: void 0 };
}
const ListTrustedDomainsResponse = {
encode(message, writer = new import_wire.BinaryWriter()) {
for (const v of message.trustedDomain) {
import_instance.TrustedDomain.encode(v, writer.uint32(10).fork()).join();
}
if (message.pagination !== void 0) {
import_filter.PaginationResponse.encode(message.pagination, writer.uint32(18).fork()).join();
}
return writer;
},
decode(input, length) {
const reader = input instanceof import_wire.BinaryReader ? input : new import_wire.BinaryReader(input);
const end = length === void 0 ? reader.len : reader.pos + length;
const message = createBaseListTrustedDomainsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 10) {
break;
}
message.trustedDomain.push(import_instance.TrustedDomain.decode(reader, reader.uint32()));
continue;
}
case 2: {
if (tag !== 18) {
break;
}
message.pagination = import_filter.PaginationResponse.decode(reader, reader.uint32());
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
trustedDomain: globalThis.Array.isArray(object?.trustedDomain) ? object.trustedDomain.map((e) => import_instance.TrustedDomain.fromJSON(e)) : [],
pagination: isSet(object.pagination) ? import_filter.PaginationResponse.fromJSON(object.pagination) : void 0
};
},
toJSON(message) {
const obj = {};
if (message.trustedDomain?.length) {
obj.trustedDomain = message.trustedDomain.map((e) => import_instance.TrustedDomain.toJSON(e));
}
if (message.pagination !== void 0) {
obj.pagination = import_filter.PaginationResponse.toJSON(message.pagination);
}
return obj;
},
create(base) {
return ListTrustedDomainsResponse.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseListTrustedDomainsResponse();
message.trustedDomain = object.trustedDomain?.map((e) => import_instance.TrustedDomain.fromPartial(e)) || [];
message.pagination = object.pagination !== void 0 && object.pagination !== null ? import_filter.PaginationResponse.fromPartial(object.pagination) : void 0;
return message;
}
};
const InstanceServiceDefinition = {
name: "InstanceService",
fullName: "zitadel.instance.v2beta.InstanceService",
methods: {
/**
* Delete Instance
*
* Deletes an instance with the given ID.
*
* Required permissions:
* - `system.instance.delete`
*/
deleteInstance: {
name: "DeleteInstance",
requestType: DeleteInstanceRequest,
requestStream: false,
responseType: DeleteInstanceResponse,
responseStream: false,
options: {
_unknownFields: {
8338: [
Buffer.from([
32,
74,
30,
10,
3,
50,
48,
48,
18,
23,
10,
21,
84,
104,
101,
32,
100,
101,
108,
101,
116,
101,
100,
32,
105,
110,
115,
116,
97,
110,
99,
101,
46
])
],
400010: [
Buffer.from([
26,
10,
24,
10,
22,
115,
121,
115,
116,
101,
109,
46,
105,
110,
115,
116,
97,
110,
99,
101,
46,
100,
101,
108,
101,
116,
101
])
],
578365826: [
Buffer.from([
33,
42,
31,
47,
118,
50,
98,
101,
116,
97,
47,
105,
110,
115,
116,
97,
110,
99,
101,
115,
47,
123,
105,
110,
115,
116,
97,
110,
99,
101,
95,
105,
100,
125
])
]
}
}
},
/**
* Get Instance
*
* Returns the instance in the current context.
*
* The instace_id in the input message will be used in the future.
*
* Required permissions:
* - `iam.read`
*/
getInstance: {
name: "GetInstance",
requestType: GetInstanceRequest,
requestStream: false,
responseType: GetInstanceResponse,
responseStream: false,
options: {
_unknownFields: {
8338: [
Buffer.from([
39,
74,
37,
10,
3,
50,
48,
48,
18,
30,
10,
28,
84,
104,
101,
32,
105,
110,
115,
116,
97,
110,
99,
101,
32,
111,
102,
32,
116,
104,
101,
32,
99,
111,
110,
116,
101,
120,
116,
46
])
],
400010: [Buffer.from([12, 10, 10, 10, 8, 105, 97, 109, 46, 114, 101, 97, 100])],
578365826: [
Buffer.from([
33,
18,
31,
47,
118,
50,
98,
101,
116,
97,
47,
105,
110,
115,
116,
97,
110,
99,
101,
115,
47,
123,
105,
110,
115,
116,
97,
110,
99,
101,
95,
105,
100,
125
])
]
}
}
},
/**
* Update Instance
*
* Updates instance in context with the given name.
*
* The instance_id in the input message will be used in the future.
*
* Required permissions:
* - `iam.write`
*/
updateInstance: {
name: "UpdateInstance",
requestType: UpdateInstanceRequest,
requestStream: false,
responseType: UpdateInstanceResponse,
responseStream: false,
options: {
_unknownFields: {
8338: [
Buffer.from([
49,
74,
47,
10,
3,
50,
48,
48,
18,
40,
10,
38,
84,
104,
101,
32,
105,
110,
115,
116,
97,
110,
99,
101,
32,
119,