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

114 lines 4.04 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 timestamp_exports = {}; __export(timestamp_exports, { Timestamp: () => Timestamp, protobufPackage: () => protobufPackage }); module.exports = __toCommonJS(timestamp_exports); var import_wire = require("@bufbuild/protobuf/wire"); var import_long = __toESM(require("long")); const protobufPackage = "google.protobuf"; function createBaseTimestamp() { return { seconds: import_long.default.ZERO, nanos: 0 }; } const Timestamp = { encode(message, writer = new import_wire.BinaryWriter()) { if (!message.seconds.equals(import_long.default.ZERO)) { writer.uint32(8).int64(message.seconds.toString()); } if (message.nanos !== 0) { writer.uint32(16).int32(message.nanos); } 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 = createBaseTimestamp(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 8) { break; } message.seconds = import_long.default.fromString(reader.int64().toString()); continue; } case 2: { if (tag !== 16) { break; } message.nanos = reader.int32(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { seconds: isSet(object.seconds) ? import_long.default.fromValue(object.seconds) : import_long.default.ZERO, nanos: isSet(object.nanos) ? globalThis.Number(object.nanos) : 0 }; }, toJSON(message) { const obj = {}; if (!message.seconds.equals(import_long.default.ZERO)) { obj.seconds = (message.seconds || import_long.default.ZERO).toString(); } if (message.nanos !== 0) { obj.nanos = Math.round(message.nanos); } return obj; }, create(base) { return Timestamp.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseTimestamp(); message.seconds = object.seconds !== void 0 && object.seconds !== null ? import_long.default.fromValue(object.seconds) : import_long.default.ZERO; message.nanos = object.nanos ?? 0; return message; } }; function isSet(value) { return value !== null && value !== void 0; } // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { Timestamp, protobufPackage }); //# sourceMappingURL=timestamp.js.map