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()!

130 lines 5.44 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 lockout_settings_exports = {}; __export(lockout_settings_exports, { LockoutSettings: () => LockoutSettings, protobufPackage: () => protobufPackage }); module.exports = __toCommonJS(lockout_settings_exports); var import_wire = require("@bufbuild/protobuf/wire"); var import_long = __toESM(require("long")); var import_settings = require("./settings.js"); const protobufPackage = "zitadel.settings.v2beta"; function createBaseLockoutSettings() { return { maxPasswordAttempts: import_long.default.UZERO, resourceOwnerType: 0, maxOtpAttempts: import_long.default.UZERO }; } const LockoutSettings = { encode(message, writer = new import_wire.BinaryWriter()) { if (!message.maxPasswordAttempts.equals(import_long.default.UZERO)) { writer.uint32(8).uint64(message.maxPasswordAttempts.toString()); } if (message.resourceOwnerType !== 0) { writer.uint32(16).int32(message.resourceOwnerType); } if (!message.maxOtpAttempts.equals(import_long.default.UZERO)) { writer.uint32(24).uint64(message.maxOtpAttempts.toString()); } 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 = createBaseLockoutSettings(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.maxPasswordAttempts = import_long.default.fromString(reader.uint64().toString(), true); continue; } case 2: { if (tag !== 16) { break; } message.resourceOwnerType = reader.int32(); continue; } case 3: { if (tag !== 24) { break; } message.maxOtpAttempts = import_long.default.fromString(reader.uint64().toString(), true); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { maxPasswordAttempts: isSet(object.maxPasswordAttempts) ? import_long.default.fromValue(object.maxPasswordAttempts) : import_long.default.UZERO, resourceOwnerType: isSet(object.resourceOwnerType) ? (0, import_settings.resourceOwnerTypeFromJSON)(object.resourceOwnerType) : 0, maxOtpAttempts: isSet(object.maxOtpAttempts) ? import_long.default.fromValue(object.maxOtpAttempts) : import_long.default.UZERO }; }, toJSON(message) { const obj = {}; if (!message.maxPasswordAttempts.equals(import_long.default.UZERO)) { obj.maxPasswordAttempts = (message.maxPasswordAttempts || import_long.default.UZERO).toString(); } if (message.resourceOwnerType !== 0) { obj.resourceOwnerType = (0, import_settings.resourceOwnerTypeToJSON)(message.resourceOwnerType); } if (!message.maxOtpAttempts.equals(import_long.default.UZERO)) { obj.maxOtpAttempts = (message.maxOtpAttempts || import_long.default.UZERO).toString(); } return obj; }, create(base) { return LockoutSettings.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseLockoutSettings(); message.maxPasswordAttempts = object.maxPasswordAttempts !== void 0 && object.maxPasswordAttempts !== null ? import_long.default.fromValue(object.maxPasswordAttempts) : import_long.default.UZERO; message.resourceOwnerType = object.resourceOwnerType ?? 0; message.maxOtpAttempts = object.maxOtpAttempts !== void 0 && object.maxOtpAttempts !== null ? import_long.default.fromValue(object.maxOtpAttempts) : import_long.default.UZERO; return message; } }; function isSet(value) { return value !== null && value !== void 0; } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { LockoutSettings, protobufPackage }); //# sourceMappingURL=lockout_settings.js.map