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

140 lines 4.61 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 api_exports = {}; __export(api_exports, { APIAuthMethodType: () => APIAuthMethodType, APIConfig: () => APIConfig, aPIAuthMethodTypeFromJSON: () => aPIAuthMethodTypeFromJSON, aPIAuthMethodTypeToJSON: () => aPIAuthMethodTypeToJSON, protobufPackage: () => protobufPackage }); module.exports = __toCommonJS(api_exports); var import_wire = require("@bufbuild/protobuf/wire"); const protobufPackage = "zitadel.app.v2beta"; var APIAuthMethodType = /* @__PURE__ */ ((APIAuthMethodType2) => { APIAuthMethodType2[APIAuthMethodType2["API_AUTH_METHOD_TYPE_BASIC"] = 0] = "API_AUTH_METHOD_TYPE_BASIC"; APIAuthMethodType2[APIAuthMethodType2["API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT"] = 1] = "API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT"; APIAuthMethodType2[APIAuthMethodType2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED"; return APIAuthMethodType2; })(APIAuthMethodType || {}); function aPIAuthMethodTypeFromJSON(object) { switch (object) { case 0: case "API_AUTH_METHOD_TYPE_BASIC": return 0 /* API_AUTH_METHOD_TYPE_BASIC */; case 1: case "API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT": return 1 /* API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT */; case -1: case "UNRECOGNIZED": default: return -1 /* UNRECOGNIZED */; } } function aPIAuthMethodTypeToJSON(object) { switch (object) { case 0 /* API_AUTH_METHOD_TYPE_BASIC */: return "API_AUTH_METHOD_TYPE_BASIC"; case 1 /* API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT */: return "API_AUTH_METHOD_TYPE_PRIVATE_KEY_JWT"; case -1 /* UNRECOGNIZED */: default: return "UNRECOGNIZED"; } } function createBaseAPIConfig() { return { clientId: "", authMethodType: 0 }; } const APIConfig = { encode(message, writer = new import_wire.BinaryWriter()) { if (message.clientId !== "") { writer.uint32(10).string(message.clientId); } if (message.authMethodType !== 0) { writer.uint32(16).int32(message.authMethodType); } 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 = createBaseAPIConfig(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { if (tag !== 10) { break; } message.clientId = reader.string(); continue; } case 2: { if (tag !== 16) { break; } message.authMethodType = reader.int32(); continue; } } if ((tag & 7) === 4 || tag === 0) { break; } reader.skip(tag & 7); } return message; }, fromJSON(object) { return { clientId: isSet(object.clientId) ? globalThis.String(object.clientId) : "", authMethodType: isSet(object.authMethodType) ? aPIAuthMethodTypeFromJSON(object.authMethodType) : 0 }; }, toJSON(message) { const obj = {}; if (message.clientId !== "") { obj.clientId = message.clientId; } if (message.authMethodType !== 0) { obj.authMethodType = aPIAuthMethodTypeToJSON(message.authMethodType); } return obj; }, create(base) { return APIConfig.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseAPIConfig(); message.clientId = object.clientId ?? ""; message.authMethodType = object.authMethodType ?? 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 = { APIAuthMethodType, APIConfig, aPIAuthMethodTypeFromJSON, aPIAuthMethodTypeToJSON, protobufPackage }); //# sourceMappingURL=api.js.map