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

281 lines 8.59 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; 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 __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var phone_exports = {}; __export(phone_exports, { HumanPhone: () => HumanPhone, ReturnPhoneVerificationCode: () => ReturnPhoneVerificationCode, SendPhoneVerificationCode: () => SendPhoneVerificationCode, SetHumanPhone: () => SetHumanPhone, protobufPackage: () => protobufPackage }); module.exports = __toCommonJS(phone_exports); var import_wire = require("@bufbuild/protobuf/wire"); const protobufPackage = "zitadel.user.v2"; function createBaseSetHumanPhone() { return { phone: "", sendCode: void 0, returnCode: void 0, isVerified: void 0 }; } const SetHumanPhone = { encode(message, writer = new import_wire.BinaryWriter()) { if (message.phone !== "") { writer.uint32(10).string(message.phone); } if (message.sendCode !== void 0) { SendPhoneVerificationCode.encode(message.sendCode, writer.uint32(18).fork()).join(); } if (message.returnCode !== void 0) { ReturnPhoneVerificationCode.encode(message.returnCode, writer.uint32(26).fork()).join(); } if (message.isVerified !== void 0) { writer.uint32(32).bool(message.isVerified); } 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 = createBaseSetHumanPhone(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.phone = reader.string(); continue; } case 2: { if (tag !== 18) { break; } message.sendCode = SendPhoneVerificationCode.decode(reader, reader.uint32()); continue; } case 3: { if (tag !== 26) { break; } message.returnCode = ReturnPhoneVerificationCode.decode(reader, reader.uint32()); continue; } case 4: { if (tag !== 32) { break; } message.isVerified = reader.bool(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { phone: isSet(object.phone) ? globalThis.String(object.phone) : "", sendCode: isSet(object.sendCode) ? SendPhoneVerificationCode.fromJSON(object.sendCode) : void 0, returnCode: isSet(object.returnCode) ? ReturnPhoneVerificationCode.fromJSON(object.returnCode) : void 0, isVerified: isSet(object.isVerified) ? globalThis.Boolean(object.isVerified) : void 0 }; }, toJSON(message) { const obj = {}; if (message.phone !== "") { obj.phone = message.phone; } if (message.sendCode !== void 0) { obj.sendCode = SendPhoneVerificationCode.toJSON(message.sendCode); } if (message.returnCode !== void 0) { obj.returnCode = ReturnPhoneVerificationCode.toJSON(message.returnCode); } if (message.isVerified !== void 0) { obj.isVerified = message.isVerified; } return obj; }, create(base) { return SetHumanPhone.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseSetHumanPhone(); message.phone = object.phone ?? ""; message.sendCode = object.sendCode !== void 0 && object.sendCode !== null ? SendPhoneVerificationCode.fromPartial(object.sendCode) : void 0; message.returnCode = object.returnCode !== void 0 && object.returnCode !== null ? ReturnPhoneVerificationCode.fromPartial(object.returnCode) : void 0; message.isVerified = object.isVerified ?? void 0; return message; } }; function createBaseHumanPhone() { return { phone: "", isVerified: false }; } const HumanPhone = { encode(message, writer = new import_wire.BinaryWriter()) { if (message.phone !== "") { writer.uint32(10).string(message.phone); } if (message.isVerified !== false) { writer.uint32(16).bool(message.isVerified); } 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 = createBaseHumanPhone(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.phone = reader.string(); continue; } case 2: { if (tag !== 16) { break; } message.isVerified = reader.bool(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { phone: isSet(object.phone) ? globalThis.String(object.phone) : "", isVerified: isSet(object.isVerified) ? globalThis.Boolean(object.isVerified) : false }; }, toJSON(message) { const obj = {}; if (message.phone !== "") { obj.phone = message.phone; } if (message.isVerified !== false) { obj.isVerified = message.isVerified; } return obj; }, create(base) { return HumanPhone.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseHumanPhone(); message.phone = object.phone ?? ""; message.isVerified = object.isVerified ?? false; return message; } }; function createBaseSendPhoneVerificationCode() { return {}; } const SendPhoneVerificationCode = { encode(_, writer = new import_wire.BinaryWriter()) { 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 = createBaseSendPhoneVerificationCode(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(_) { return {}; }, toJSON(_) { const obj = {}; return obj; }, create(base) { return SendPhoneVerificationCode.fromPartial(base ?? {}); }, fromPartial(_) { const message = createBaseSendPhoneVerificationCode(); return message; } }; function createBaseReturnPhoneVerificationCode() { return {}; } const ReturnPhoneVerificationCode = { encode(_, writer = new import_wire.BinaryWriter()) { 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 = createBaseReturnPhoneVerificationCode(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(_) { return {}; }, toJSON(_) { const obj = {}; return obj; }, create(base) { return ReturnPhoneVerificationCode.fromPartial(base ?? {}); }, fromPartial(_) { const message = createBaseReturnPhoneVerificationCode(); return message; } }; function isSet(value) { return value !== null && value !== void 0; } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { HumanPhone, ReturnPhoneVerificationCode, SendPhoneVerificationCode, SetHumanPhone, protobufPackage }); //# sourceMappingURL=phone.js.map