UNPKG

@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,940 lines 49.9 kB
"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 authorization_service_exports = {}; __export(authorization_service_exports, { ActivateAuthorizationRequest: () => ActivateAuthorizationRequest, ActivateAuthorizationResponse: () => ActivateAuthorizationResponse, AuthorizationServiceDefinition: () => AuthorizationServiceDefinition, CreateAuthorizationRequest: () => CreateAuthorizationRequest, CreateAuthorizationResponse: () => CreateAuthorizationResponse, DeactivateAuthorizationRequest: () => DeactivateAuthorizationRequest, DeactivateAuthorizationResponse: () => DeactivateAuthorizationResponse, DeleteAuthorizationRequest: () => DeleteAuthorizationRequest, DeleteAuthorizationResponse: () => DeleteAuthorizationResponse, ListAuthorizationsRequest: () => ListAuthorizationsRequest, ListAuthorizationsResponse: () => ListAuthorizationsResponse, UpdateAuthorizationRequest: () => UpdateAuthorizationRequest, UpdateAuthorizationResponse: () => UpdateAuthorizationResponse, protobufPackage: () => protobufPackage }); module.exports = __toCommonJS(authorization_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_authorization = require("./authorization.js"); const protobufPackage = "zitadel.authorization.v2beta"; function createBaseListAuthorizationsRequest() { return { pagination: void 0, sortingColumn: void 0, filters: [] }; } const ListAuthorizationsRequest = { encode(message, writer = new import_wire.BinaryWriter()) { if (message.pagination !== void 0) { import_filter.PaginationRequest.encode(message.pagination, writer.uint32(10).fork()).join(); } if (message.sortingColumn !== void 0) { writer.uint32(16).int32(message.sortingColumn); } for (const v of message.filters) { import_authorization.AuthorizationsSearchFilter.encode(v, writer.uint32(26).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 = createBaseListAuthorizationsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.pagination = import_filter.PaginationRequest.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 16) { break; } message.sortingColumn = reader.int32(); continue; } case 3: { if (tag !== 26) { break; } message.filters.push(import_authorization.AuthorizationsSearchFilter.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { pagination: isSet(object.pagination) ? import_filter.PaginationRequest.fromJSON(object.pagination) : void 0, sortingColumn: isSet(object.sortingColumn) ? (0, import_authorization.authorizationFieldNameFromJSON)(object.sortingColumn) : void 0, filters: globalThis.Array.isArray(object?.filters) ? object.filters.map((e) => import_authorization.AuthorizationsSearchFilter.fromJSON(e)) : [] }; }, toJSON(message) { const obj = {}; if (message.pagination !== void 0) { obj.pagination = import_filter.PaginationRequest.toJSON(message.pagination); } if (message.sortingColumn !== void 0) { obj.sortingColumn = (0, import_authorization.authorizationFieldNameToJSON)(message.sortingColumn); } if (message.filters?.length) { obj.filters = message.filters.map((e) => import_authorization.AuthorizationsSearchFilter.toJSON(e)); } return obj; }, create(base) { return ListAuthorizationsRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseListAuthorizationsRequest(); message.pagination = object.pagination !== void 0 && object.pagination !== null ? import_filter.PaginationRequest.fromPartial(object.pagination) : void 0; message.sortingColumn = object.sortingColumn ?? void 0; message.filters = object.filters?.map((e) => import_authorization.AuthorizationsSearchFilter.fromPartial(e)) || []; return message; } }; function createBaseListAuthorizationsResponse() { return { pagination: void 0, authorizations: [] }; } const ListAuthorizationsResponse = { encode(message, writer = new import_wire.BinaryWriter()) { if (message.pagination !== void 0) { import_filter.PaginationResponse.encode(message.pagination, writer.uint32(10).fork()).join(); } for (const v of message.authorizations) { import_authorization.Authorization.encode(v, 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 = createBaseListAuthorizationsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.pagination = import_filter.PaginationResponse.decode(reader, reader.uint32()); continue; } case 2: { if (tag !== 18) { break; } message.authorizations.push(import_authorization.Authorization.decode(reader, reader.uint32())); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { pagination: isSet(object.pagination) ? import_filter.PaginationResponse.fromJSON(object.pagination) : void 0, authorizations: globalThis.Array.isArray(object?.authorizations) ? object.authorizations.map((e) => import_authorization.Authorization.fromJSON(e)) : [] }; }, toJSON(message) { const obj = {}; if (message.pagination !== void 0) { obj.pagination = import_filter.PaginationResponse.toJSON(message.pagination); } if (message.authorizations?.length) { obj.authorizations = message.authorizations.map((e) => import_authorization.Authorization.toJSON(e)); } return obj; }, create(base) { return ListAuthorizationsResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseListAuthorizationsResponse(); message.pagination = object.pagination !== void 0 && object.pagination !== null ? import_filter.PaginationResponse.fromPartial(object.pagination) : void 0; message.authorizations = object.authorizations?.map((e) => import_authorization.Authorization.fromPartial(e)) || []; return message; } }; function createBaseCreateAuthorizationRequest() { return { userId: "", projectId: "", organizationId: void 0, roleKeys: [] }; } const CreateAuthorizationRequest = { encode(message, writer = new import_wire.BinaryWriter()) { if (message.userId !== "") { writer.uint32(10).string(message.userId); } if (message.projectId !== "") { writer.uint32(18).string(message.projectId); } if (message.organizationId !== void 0) { writer.uint32(26).string(message.organizationId); } for (const v of message.roleKeys) { writer.uint32(34).string(v); } 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 = createBaseCreateAuthorizationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.userId = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.projectId = reader.string(); continue; } case 3: { if (tag !== 26) { break; } message.organizationId = reader.string(); continue; } case 4: { if (tag !== 34) { break; } message.roleKeys.push(reader.string()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { userId: isSet(object.userId) ? globalThis.String(object.userId) : "", projectId: isSet(object.projectId) ? globalThis.String(object.projectId) : "", organizationId: isSet(object.organizationId) ? globalThis.String(object.organizationId) : void 0, roleKeys: globalThis.Array.isArray(object?.roleKeys) ? object.roleKeys.map((e) => globalThis.String(e)) : [] }; }, toJSON(message) { const obj = {}; if (message.userId !== "") { obj.userId = message.userId; } if (message.projectId !== "") { obj.projectId = message.projectId; } if (message.organizationId !== void 0) { obj.organizationId = message.organizationId; } if (message.roleKeys?.length) { obj.roleKeys = message.roleKeys; } return obj; }, create(base) { return CreateAuthorizationRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseCreateAuthorizationRequest(); message.userId = object.userId ?? ""; message.projectId = object.projectId ?? ""; message.organizationId = object.organizationId ?? void 0; message.roleKeys = object.roleKeys?.map((e) => e) || []; return message; } }; function createBaseCreateAuthorizationResponse() { return { id: "", creationDate: void 0 }; } const CreateAuthorizationResponse = { encode(message, writer = new import_wire.BinaryWriter()) { if (message.id !== "") { writer.uint32(10).string(message.id); } if (message.creationDate !== void 0) { import_timestamp.Timestamp.encode(toTimestamp(message.creationDate), 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 = createBaseCreateAuthorizationResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.id = reader.string(); continue; } case 2: { if (tag !== 18) { 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 { id: isSet(object.id) ? globalThis.String(object.id) : "", creationDate: isSet(object.creationDate) ? fromJsonTimestamp(object.creationDate) : void 0 }; }, toJSON(message) { const obj = {}; if (message.id !== "") { obj.id = message.id; } if (message.creationDate !== void 0) { obj.creationDate = message.creationDate.toISOString(); } return obj; }, create(base) { return CreateAuthorizationResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseCreateAuthorizationResponse(); message.id = object.id ?? ""; message.creationDate = object.creationDate ?? void 0; return message; } }; function createBaseUpdateAuthorizationRequest() { return { id: "", roleKeys: [] }; } const UpdateAuthorizationRequest = { encode(message, writer = new import_wire.BinaryWriter()) { if (message.id !== "") { writer.uint32(10).string(message.id); } for (const v of message.roleKeys) { writer.uint32(18).string(v); } 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 = createBaseUpdateAuthorizationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.id = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.roleKeys.push(reader.string()); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { id: isSet(object.id) ? globalThis.String(object.id) : "", roleKeys: globalThis.Array.isArray(object?.roleKeys) ? object.roleKeys.map((e) => globalThis.String(e)) : [] }; }, toJSON(message) { const obj = {}; if (message.id !== "") { obj.id = message.id; } if (message.roleKeys?.length) { obj.roleKeys = message.roleKeys; } return obj; }, create(base) { return UpdateAuthorizationRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseUpdateAuthorizationRequest(); message.id = object.id ?? ""; message.roleKeys = object.roleKeys?.map((e) => e) || []; return message; } }; function createBaseUpdateAuthorizationResponse() { return { changeDate: void 0 }; } const UpdateAuthorizationResponse = { 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 = createBaseUpdateAuthorizationResponse(); 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 UpdateAuthorizationResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseUpdateAuthorizationResponse(); message.changeDate = object.changeDate ?? void 0; return message; } }; function createBaseDeleteAuthorizationRequest() { return { id: "" }; } const DeleteAuthorizationRequest = { encode(message, writer = new import_wire.BinaryWriter()) { if (message.id !== "") { writer.uint32(10).string(message.id); } 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 = createBaseDeleteAuthorizationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.id = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; }, toJSON(message) { const obj = {}; if (message.id !== "") { obj.id = message.id; } return obj; }, create(base) { return DeleteAuthorizationRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseDeleteAuthorizationRequest(); message.id = object.id ?? ""; return message; } }; function createBaseDeleteAuthorizationResponse() { return { deletionDate: void 0 }; } const DeleteAuthorizationResponse = { 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 = createBaseDeleteAuthorizationResponse(); 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 DeleteAuthorizationResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseDeleteAuthorizationResponse(); message.deletionDate = object.deletionDate ?? void 0; return message; } }; function createBaseActivateAuthorizationRequest() { return { id: "" }; } const ActivateAuthorizationRequest = { encode(message, writer = new import_wire.BinaryWriter()) { if (message.id !== "") { writer.uint32(10).string(message.id); } 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 = createBaseActivateAuthorizationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.id = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; }, toJSON(message) { const obj = {}; if (message.id !== "") { obj.id = message.id; } return obj; }, create(base) { return ActivateAuthorizationRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseActivateAuthorizationRequest(); message.id = object.id ?? ""; return message; } }; function createBaseActivateAuthorizationResponse() { return { changeDate: void 0 }; } const ActivateAuthorizationResponse = { 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 = createBaseActivateAuthorizationResponse(); 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 ActivateAuthorizationResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseActivateAuthorizationResponse(); message.changeDate = object.changeDate ?? void 0; return message; } }; function createBaseDeactivateAuthorizationRequest() { return { id: "" }; } const DeactivateAuthorizationRequest = { encode(message, writer = new import_wire.BinaryWriter()) { if (message.id !== "") { writer.uint32(10).string(message.id); } 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 = createBaseDeactivateAuthorizationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.id = reader.string(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { id: isSet(object.id) ? globalThis.String(object.id) : "" }; }, toJSON(message) { const obj = {}; if (message.id !== "") { obj.id = message.id; } return obj; }, create(base) { return DeactivateAuthorizationRequest.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseDeactivateAuthorizationRequest(); message.id = object.id ?? ""; return message; } }; function createBaseDeactivateAuthorizationResponse() { return { changeDate: void 0 }; } const DeactivateAuthorizationResponse = { 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 = createBaseDeactivateAuthorizationResponse(); 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 DeactivateAuthorizationResponse.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseDeactivateAuthorizationResponse(); message.changeDate = object.changeDate ?? void 0; return message; } }; const AuthorizationServiceDefinition = { name: "AuthorizationService", fullName: "zitadel.authorization.v2beta.AuthorizationService", methods: { /** * List Authorizations * * ListAuthorizations returns all authorizations matching the request and necessary permissions. * * Required permissions: * - "user.grant.read" * - no permissions required for listing own authorizations */ listAuthorizations: { name: "ListAuthorizations", requestType: ListAuthorizationsRequest, requestStream: false, responseType: ListAuthorizationsResponse, responseStream: false, options: { _unknownFields: { 8338: [ Buffer.from([ 87, 74, 56, 10, 3, 50, 48, 48, 18, 49, 10, 47, 65, 32, 108, 105, 115, 116, 32, 111, 102, 32, 97, 108, 108, 32, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 115, 32, 109, 97, 116, 99, 104, 105, 110, 103, 32, 116, 104, 101, 32, 113, 117, 101, 114, 121, 74, 27, 10, 3, 52, 48, 48, 18, 20, 10, 18, 105, 110, 118, 97, 108, 105, 100, 32, 108, 105, 115, 116, 32, 113, 117, 101, 114, 121 ]) ], 400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])], 578365826: [ Buffer.from([ 34, 58, 1, 42, 34, 29, 47, 118, 50, 98, 101, 116, 97, 47, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 115, 47, 115, 101, 97, 114, 99, 104 ]) ] } } }, /** * Create Authorization * * CreateAuthorization creates a new authorization for a user in an owned or granted project. * * Required permissions: * - "user.grant.write" */ createAuthorization: { name: "CreateAuthorization", requestType: CreateAuthorizationRequest, requestStream: false, responseType: CreateAuthorizationResponse, responseStream: false, options: { _unknownFields: { 8338: [ Buffer.from([ 148, 1, 74, 40, 10, 3, 50, 48, 48, 18, 33, 10, 31, 84, 104, 101, 32, 110, 101, 119, 108, 121, 32, 99, 114, 101, 97, 116, 101, 100, 32, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 74, 31, 10, 3, 52, 48, 48, 18, 24, 10, 22, 105, 110, 118, 97, 108, 105, 100, 32, 99, 114, 101, 97, 116, 101, 32, 114, 101, 113, 117, 101, 115, 116, 74, 71, 10, 3, 52, 48, 57, 18, 64, 10, 33, 84, 104, 101, 32, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 32, 97, 108, 114, 101, 97, 100, 121, 32, 101, 120, 105, 115, 116, 115, 46, 18, 27, 10, 25, 26, 23, 35, 47, 100, 101, 102, 105, 110, 105, 116, 105, 111, 110, 115, 47, 114, 112, 99, 83, 116, 97, 116, 117, 115 ]) ], 400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])], 578365826: [ Buffer.from([ 27, 58, 1, 42, 34, 22, 47, 118, 50, 98, 101, 116, 97, 47, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 115 ]) ] } } }, /** * Update Authorization * * UpdateAuthorization updates the authorization. * * Note that any role keys previously granted to the user and not present in the request will be revoked. * * Required permissions: * - "user.grant.write" */ updateAuthorization: { name: "UpdateAuthorization", requestType: UpdateAuthorizationRequest, requestStream: false, responseType: UpdateAuthorizationResponse, responseStream: false, options: { _unknownFields: { 8338: [ Buffer.from([ 100, 74, 11, 10, 3, 50, 48, 48, 18, 4, 10, 2, 79, 75, 74, 85, 10, 3, 52, 48, 52, 18, 78, 10, 47, 65, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 32, 111, 114, 32, 111, 110, 101, 32, 111, 102, 32, 116, 104, 101, 32, 114, 111, 108, 101, 115, 32, 100, 111, 32, 110, 111, 116, 32, 101, 120, 105, 115, 116, 46, 18, 27, 10, 25, 26, 23, 35, 47, 100, 101, 102, 105, 110, 105, 116, 105, 111, 110, 115, 47, 114, 112, 99, 83, 116, 97, 116, 117, 115 ]) ], 400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])], 578365826: [ Buffer.from([ 32, 58, 1, 42, 50, 27, 47, 118, 50, 98, 101, 116, 97, 47, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 115, 47, 123, 105, 100, 125 ]) ] } } }, /** * Delete Authorization * * DeleteAuthorization deletes the authorization. * * In case the authorization is not found, the request will return a successful response as * the desired state is already achieved. * You can check the deletion date in the response to verify if the authorization was deleted by the request. * * Required permissions: * - "user.grant.delete" */ deleteAuthorization: { name: "DeleteAuthorization", requestType: DeleteAuthorizationRequest, requestStream: false, responseType: DeleteAuthorizationResponse, responseStream: false, options: { _unknownFields: { 8338: [ Buffer.from([ 118, 74, 52, 10, 3, 50, 48, 48, 18, 45, 10, 43, 84, 104, 101, 32, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 32, 119, 97, 115, 32, 100, 101, 108, 101, 116, 101, 100, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 108, 121, 46, 74, 62, 10, 3, 52, 48, 52, 18, 55, 10, 24, 65, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 46, 18, 27, 10, 25, 26, 23, 35, 47, 100, 101, 102, 105, 110, 105, 116, 105, 111, 110, 115, 47, 114, 112, 99, 83, 116, 97, 116, 117, 115 ]) ], 400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])], 578365826: [ Buffer.from([ 29, 42, 27, 47, 118, 50, 98, 101, 116, 97, 47, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 115, 47, 123, 105, 100, 125 ]) ] } } }, /** * Activate Authorization * * ActivateAuthorization activates an existing but inactive authorization. * * In case the authorization is already active, the request will return a successful response as * the desired state is already achieved. * You can check the change date in the response to verify if the authorization was activated by the request. * * Required permissions: * - "user.grant.write" */ activateAuthorization: { name: "ActivateAuthorization", requestType: ActivateAuthorizationRequest, requestStream: false, responseType: ActivateAuthorizationResponse, responseStream: false, options: { _unknownFields: { 8338: [ Buffer.from([ 120, 74, 54, 10, 3, 50, 48, 48, 18, 47, 10, 45, 84, 104, 101, 32, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 32, 119, 97, 115, 32, 97, 99, 116, 105, 118, 97, 116, 101, 100, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 108, 121, 46, 74, 62, 10, 3, 52, 48, 52, 18, 55, 10, 24, 65, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 46, 18, 27, 10, 25, 26, 23, 35, 47, 100, 101, 102, 105, 110, 105, 116, 105, 111, 110, 115, 47, 114, 112, 99, 83, 116, 97, 116, 117, 115 ]) ], 400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])], 578365826: [ Buffer.from([ 41, 58, 1, 42, 34, 36, 47, 118, 50, 98, 101, 116, 97, 47, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 115, 47, 123, 105, 100, 125, 47, 97, 99, 116, 105, 118, 97, 116, 101 ]) ] } } }, /** * Deactivate Authorization * * DeactivateAuthorization deactivates an existing and active authorization. * * In case the authorization is already inactive, the request will return a successful response as * the desired state is already achieved. * You can check the change date in the response to verify if the authorization was deactivated by the request. * * Required permissions: * - "user.grant.write" */ deactivateAuthorization: { name: "DeactivateAuthorization", requestType: DeactivateAuthorizationRequest, requestStream: false, responseType: DeactivateAuthorizationResponse, responseStream: false, options: { _unknownFields: { 8338: [ Buffer.from([ 122, 74, 56, 10, 3, 50, 48, 48, 18, 49, 10, 47, 84, 104, 101, 32, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 32, 119, 97, 115, 32, 100, 101, 97, 99, 116, 105, 118, 97, 116, 101, 100, 32, 115, 117, 99, 99, 101, 115, 115, 102, 117, 108, 108, 121, 46, 74, 62, 10, 3, 52, 48, 52, 18, 55, 10, 24, 65, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 32, 110, 111, 116, 32, 102, 111, 117, 110, 100, 46, 18, 27, 10, 25, 26, 23, 35, 47, 100, 101, 102, 105, 110, 105, 116, 105, 111, 110, 115, 47, 114, 112, 99, 83, 116, 97, 116, 117, 115 ]) ], 400010: [Buffer.from([17, 10, 15, 10, 13, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 100])], 578365826: [ Buffer.from([ 43, 58, 1, 42, 34, 38, 47, 118, 50, 98, 101, 116, 97, 47, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 115, 47, 123, 105, 100, 125, 47, 100, 101, 97, 99, 116, 105, 118, 97, 116, 101 ]) ] } } } } }; function toTimestamp(date) { const seconds = numberToLong(Math.trunc(date.getTime() / 1e3)); const nanos = date.getTime() % 1e3 * 1e6; return { seconds, nanos }; } function fromTimestamp(t) { let millis = (t.seconds.toNumber() || 0) * 1e3; millis += (t.nanos || 0) / 1e6; return new globalThis.Date(millis); } function fromJsonTimestamp(o) { if (o instanceof globalThis.Date) { return o; } else if (typeof o === "string") { return new globalThis.Date(o); } else { return fromTimestamp(import_timestamp.Timestamp.fromJSON(o)); } } function numberToLong(number) { return import_long.default.fromNumber(number); } function isSet(value) { return value !== null && value !== void 0; } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { ActivateAuthorizationRequest, ActivateAuthorizationResponse, AuthorizationServiceDefinition, CreateAuthorizationRequest, CreateAuthorizationResponse, DeactivateAuthorizationRequest, DeactivateAuthorizationResponse, DeleteAuthorizationRequest, DeleteAuthorizationResponse, ListAuthorizationsRequest, ListAuthorizationsResponse, UpdateAuthorizationRequest, UpdateAuthorizationResponse, protobufPackage }); //# sourceMappingURL=authorization_service.js.map