@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()!
161 lines • 4.91 kB
JavaScript
;
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 quota_exports = {};
__export(quota_exports, {
Notification: () => Notification,
Unit: () => Unit,
protobufPackage: () => protobufPackage,
unitFromJSON: () => unitFromJSON,
unitToJSON: () => unitToJSON
});
module.exports = __toCommonJS(quota_exports);
var import_wire = require("@bufbuild/protobuf/wire");
const protobufPackage = "zitadel.quota.v1";
var Unit = /* @__PURE__ */ ((Unit2) => {
Unit2[Unit2["UNIT_UNIMPLEMENTED"] = 0] = "UNIT_UNIMPLEMENTED";
Unit2[Unit2["UNIT_REQUESTS_ALL_AUTHENTICATED"] = 1] = "UNIT_REQUESTS_ALL_AUTHENTICATED";
Unit2[Unit2["UNIT_ACTIONS_ALL_RUN_SECONDS"] = 2] = "UNIT_ACTIONS_ALL_RUN_SECONDS";
Unit2[Unit2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
return Unit2;
})(Unit || {});
function unitFromJSON(object) {
switch (object) {
case 0:
case "UNIT_UNIMPLEMENTED":
return 0 /* UNIT_UNIMPLEMENTED */;
case 1:
case "UNIT_REQUESTS_ALL_AUTHENTICATED":
return 1 /* UNIT_REQUESTS_ALL_AUTHENTICATED */;
case 2:
case "UNIT_ACTIONS_ALL_RUN_SECONDS":
return 2 /* UNIT_ACTIONS_ALL_RUN_SECONDS */;
case -1:
case "UNRECOGNIZED":
default:
return -1 /* UNRECOGNIZED */;
}
}
function unitToJSON(object) {
switch (object) {
case 0 /* UNIT_UNIMPLEMENTED */:
return "UNIT_UNIMPLEMENTED";
case 1 /* UNIT_REQUESTS_ALL_AUTHENTICATED */:
return "UNIT_REQUESTS_ALL_AUTHENTICATED";
case 2 /* UNIT_ACTIONS_ALL_RUN_SECONDS */:
return "UNIT_ACTIONS_ALL_RUN_SECONDS";
case -1 /* UNRECOGNIZED */:
default:
return "UNRECOGNIZED";
}
}
function createBaseNotification() {
return { percent: 0, repeat: false, callUrl: "" };
}
const Notification = {
encode(message, writer = new import_wire.BinaryWriter()) {
if (message.percent !== 0) {
writer.uint32(8).uint32(message.percent);
}
if (message.repeat !== false) {
writer.uint32(16).bool(message.repeat);
}
if (message.callUrl !== "") {
writer.uint32(26).string(message.callUrl);
}
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 = createBaseNotification();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (tag !== 8) {
break;
}
message.percent = reader.uint32();
continue;
}
case 2: {
if (tag !== 16) {
break;
}
message.repeat = reader.bool();
continue;
}
case 3: {
if (tag !== 26) {
break;
}
message.callUrl = reader.string();
continue;
}
}
if ((tag & 7) === 4 || tag === 0) {
break;
}
reader.skip(tag & 7);
}
return message;
},
fromJSON(object) {
return {
percent: isSet(object.percent) ? globalThis.Number(object.percent) : 0,
repeat: isSet(object.repeat) ? globalThis.Boolean(object.repeat) : false,
callUrl: isSet(object.callUrl) ? globalThis.String(object.callUrl) : ""
};
},
toJSON(message) {
const obj = {};
if (message.percent !== 0) {
obj.percent = Math.round(message.percent);
}
if (message.repeat !== false) {
obj.repeat = message.repeat;
}
if (message.callUrl !== "") {
obj.callUrl = message.callUrl;
}
return obj;
},
create(base) {
return Notification.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseNotification();
message.percent = object.percent ?? 0;
message.repeat = object.repeat ?? false;
message.callUrl = object.callUrl ?? "";
return message;
}
};
function isSet(value) {
return value !== null && value !== void 0;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Notification,
Unit,
protobufPackage,
unitFromJSON,
unitToJSON
});
//# sourceMappingURL=quota.js.map