refactor: fixed types

This commit is contained in:
Konrad Geletey 2024-08-22 16:00:22 +03:00
parent 6a24c8d390
commit eb17729825
No known key found for this signature in database
GPG key ID: 862B98E2204889CE

View file

@ -1,15 +1,15 @@
const std = @import("std");
const OauthFlows = struct { implict: struct { authrizationUrl: []const u8, scopes: std.StringHashMap([]const u8) } };
const OauthFlows = struct { implict: struct { authrizationUrl: []const u8, scopes: std.json.ArrayHashMap([]const u8) } };
const WellKnownSettings = struct {
contentType: []const u8 = "application/json",
headers: ?[]const ([]const u8),
aliases: ?[]const struct { aliases: union { string: []const u8, array: []const []const u8 }, type: enum { path, method, bin, uri }, description: ?[]const u16, content: ?[]const u8 },
auth: ?struct { scheme: enum { basic, bearer, oauth2 }, tokenName: ?[]const u8, flows: ?OauthFlows },
headers: ?[]const ([]const u8) = null,
aliases: ?[]const struct { aliases: union { string: []const u8, array: []const []const u8 }, type: enum { path, method, bin, uri }, description: ?[]const u8 = null, content: []const u8 } = null,
auth: ?struct { scheme: enum { basic, bearer, oauth2 }, tokenName: ?[]const u8 = null, flows: ?OauthFlows = null } = null,
};
const WellKnownSchema = struct { api: ?[]const u8, registry: bool = false, manifests: ?std.StringHashMap(struct { path: []const u8 }), bin: ?[]const std.StringHashMap([]const u8), settings: WellKnownSettings };
const WellKnownSchema = struct { api: ?[]const u8 = null, registry: bool = false, manifests: ?std.json.ArrayHashMap(struct { path: []const u8 }) = null, bin: ?[]const std.json.ArrayHashMap([]const u8) = null, settings: WellKnownSettings };
const UserSettings = struct { db_path: []const u8 = "$HOME/.cache/wacrd.db", install_dir: []const u8 = "$HOME/.local/bin", uri_schemes: ?std.json.ArrayHashMap([]const u8) = null };