@drmhse/authos-vue 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ import 'module';
2
+
3
+ // ../../node_modules/giget/dist/_chunks/rolldown-runtime.mjs
4
+ var __defProp = Object.defineProperty;
5
+ var __exportAll = (all, no_symbols) => {
6
+ let target = {};
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
11
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
12
+ return target;
13
+ };
14
+
15
+ export { __exportAll };
@@ -0,0 +1,505 @@
1
+ import { y, S, C, ne } from './chunk-IUIUWQYL.mjs';
2
+ import './chunk-VVJVQ4JO.mjs';
3
+ import './chunk-6DZX6EAA.mjs';
4
+ import { existsSync, createWriteStream, readdirSync, renameSync } from 'fs';
5
+ import { mkdir, rm, readFile, writeFile, mkdtemp } from 'fs/promises';
6
+ import { Readable, pipeline as pipeline$1, PassThrough } from 'stream';
7
+ import { pipeline } from 'stream/promises';
8
+ import { spawnSync, spawn } from 'child_process';
9
+ import { homedir, tmpdir } from 'os';
10
+ import { promisify } from 'util';
11
+ import { join } from 'path';
12
+
13
+ async function download(url, filePath, options = {}) {
14
+ const infoPath = filePath + ".json";
15
+ const info = JSON.parse(await readFile(infoPath, "utf8").catch(() => "{}"));
16
+ const etag = (await sendFetch(url, {
17
+ method: "HEAD",
18
+ headers: options.headers
19
+ }).catch(() => void 0))?.headers.get("etag");
20
+ if (info.etag === etag && existsSync(filePath)) return;
21
+ if (typeof etag === "string") info.etag = etag;
22
+ const response = await sendFetch(url, { headers: options.headers });
23
+ if (response.status >= 400) throw new Error(`Failed to download ${url}: ${response.status} ${response.statusText}`);
24
+ const stream = createWriteStream(filePath);
25
+ await promisify(pipeline$1)(response.body, stream);
26
+ await writeFile(infoPath, JSON.stringify(info), "utf8");
27
+ }
28
+ var inputRegex = /^(?<repo>[-\w.]+\/[-\w.]+)(?<subdir>[^#]+)?(?<ref>#[-\w./@]+)?/;
29
+ var expandedInputRegex = /^(?<repo>[-\w.]+(?:\/[-\w.]+)+?)(?:::(?<subdir>[^#]*))?(?<ref>#[-\w./@]+)?$/;
30
+ function parseGitURI(input, options) {
31
+ const useExpanded = options?.expandRepo || input.includes("::");
32
+ const m = input.match(useExpanded ? expandedInputRegex : inputRegex)?.groups || {};
33
+ const subdir = useExpanded ? m.subdir ? "/" + m.subdir : "/" : m.subdir || "/";
34
+ return {
35
+ repo: m.repo || "",
36
+ subdir,
37
+ ref: m.ref ? m.ref.slice(1) : "main"
38
+ };
39
+ }
40
+ function debug(...args) {
41
+ if (process.env.DEBUG) console.debug("[giget]", ...args);
42
+ }
43
+ async function sendFetch(url, options = {}) {
44
+ if (options.headers?.["sec-fetch-mode"]) options.mode = options.headers["sec-fetch-mode"];
45
+ const res = await fetch(url, {
46
+ ...options,
47
+ headers: normalizeHeaders(options.headers)
48
+ }).catch((error) => {
49
+ throw new Error(`Failed to download ${url}: ${error}`, { cause: error });
50
+ });
51
+ if (options.validateStatus && res.status >= 400) throw new Error(`Failed to fetch ${url}: ${res.status} ${res.statusText}`);
52
+ return res;
53
+ }
54
+ function cacheDirectory() {
55
+ const cacheDir = process.env.XDG_CACHE_HOME ? y(process.env.XDG_CACHE_HOME, "giget") : y(homedir(), ".cache/giget");
56
+ if (process.platform === "win32") {
57
+ const windowsCacheDir = y(tmpdir(), "giget");
58
+ if (!existsSync(windowsCacheDir) && existsSync(cacheDir)) try {
59
+ renameSync(cacheDir, windowsCacheDir);
60
+ } catch {
61
+ }
62
+ return windowsCacheDir;
63
+ }
64
+ return cacheDir;
65
+ }
66
+ function normalizeHeaders(headers = {}) {
67
+ const normalized = {};
68
+ for (const [key, value] of Object.entries(headers)) {
69
+ if (!value) continue;
70
+ normalized[key.toLowerCase()] = value;
71
+ }
72
+ return normalized;
73
+ }
74
+ function currentShell() {
75
+ if (process.env.SHELL) return process.env.SHELL;
76
+ if (process.platform === "win32") return "cmd.exe";
77
+ return "/bin/bash";
78
+ }
79
+ function startShell(cwd) {
80
+ cwd = y(cwd);
81
+ const shell = currentShell();
82
+ console.info(`(experimental) Opening shell in ${S(process.cwd(), cwd)}...`);
83
+ spawnSync(shell, [], {
84
+ cwd,
85
+ shell: true,
86
+ stdio: "inherit"
87
+ });
88
+ }
89
+ var git = (input, options) => {
90
+ const parsed = parseGitCloneURI(input);
91
+ return {
92
+ name: parsed.name,
93
+ version: parsed.subdir ? `${parsed.version || "default"}-${parsed.subdir.replaceAll("/", "-")}` : parsed.version,
94
+ tar: ({ auth } = {}) => _cloneAndTar(parsed, auth ?? options.auth)
95
+ };
96
+ };
97
+ function parseGitCloneURI(input, opts = {}) {
98
+ const cwd = opts.cwd ?? process.cwd();
99
+ let uri = input.replace(/#.*$/, "");
100
+ let pathSubdir;
101
+ if (/^[./]/.test(input)) uri = y(cwd, uri);
102
+ else if (/^https?:\/\//.test(uri)) {
103
+ const httpMatch = /^(https?:\/\/[^/]+)\/([\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(uri);
104
+ if (httpMatch) {
105
+ const [, origin, repo, rest] = httpMatch;
106
+ uri = `${origin}/${repo}`;
107
+ if (rest) pathSubdir = rest;
108
+ }
109
+ } else if (uri.includes("@")) {
110
+ const sshMatch = /^(.*?:[\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(uri);
111
+ if (sshMatch) {
112
+ const [, repoUri, rest] = sshMatch;
113
+ uri = repoUri;
114
+ if (rest) pathSubdir = rest;
115
+ }
116
+ } else {
117
+ const hostMap = {
118
+ "github:": "https://github.com/",
119
+ "gh:": "https://github.com/",
120
+ "gitlab:": "https://gitlab.com/",
121
+ "bitbucket:": "https://bitbucket.org/",
122
+ "sourcehut:": "https://git.sr.ht/~"
123
+ };
124
+ const host = /^(.+?:)/.exec(uri)?.at(1);
125
+ if (host && hostMap[host]) uri = uri.replace(host, hostMap[host]);
126
+ else if (!host) uri = `${(process.env.GIGET_GIT_HOST || "https://github.com/").replace(/\/$/, "")}/${uri}`;
127
+ const httpMatch = /^(https?:\/\/[^/]+\/~?[\w.-]+\/[\w.-]+?)(?:\.git)?(?:\/(.+))?$/.exec(uri);
128
+ if (httpMatch) {
129
+ const [, repoUri, rest] = httpMatch;
130
+ uri = repoUri;
131
+ if (rest) pathSubdir = rest;
132
+ }
133
+ }
134
+ const name = uri.replace(/^https?:\/\//, "").replace(/^.+@/, "").replace(/(\.git)?(#.*)?$/, "").replace(/^\W+/, "").replaceAll(/[:/]/g, "-");
135
+ const [version, hashSubdir] = /#(.+)$/.exec(input)?.at(1)?.split(":") ?? [];
136
+ const resolvedVersion = version || void 0;
137
+ const subdir = hashSubdir || pathSubdir;
138
+ return {
139
+ uri,
140
+ name,
141
+ ...resolvedVersion && { version: resolvedVersion },
142
+ ...subdir && { subdir }
143
+ };
144
+ }
145
+ async function _cloneAndTar(parsed, token) {
146
+ const tmpDir = await mkdtemp(join(tmpdir(), "giget-git-"));
147
+ if (token && /[\r\n]/.test(token)) throw new Error("Auth token must not contain newline characters");
148
+ const execEnv = {
149
+ ...process.env,
150
+ GIT_TERMINAL_PROMPT: "0"
151
+ };
152
+ if (token) {
153
+ execEnv.GIT_CONFIG_COUNT = "1";
154
+ execEnv.GIT_CONFIG_KEY_0 = "http.extraHeader";
155
+ execEnv.GIT_CONFIG_VALUE_0 = `Authorization: Bearer ${token}`;
156
+ }
157
+ const execOpts = {
158
+ env: execEnv,
159
+ timeout: 6e4
160
+ };
161
+ const status = _createStatus();
162
+ const gitExec = (args) => _gitSpawn(args, execOpts, status);
163
+ const gitExecIn = (args) => _gitSpawn(args, {
164
+ ...execOpts,
165
+ cwd: tmpDir
166
+ }, status);
167
+ try {
168
+ const cloneArgs = [
169
+ "clone",
170
+ "--progress",
171
+ "--depth",
172
+ "1"
173
+ ];
174
+ if (parsed.subdir) cloneArgs.push("--filter=blob:none", "--sparse", "--no-checkout");
175
+ if (parsed.version) cloneArgs.push("--branch", parsed.version);
176
+ cloneArgs.push("--", parsed.uri, tmpDir);
177
+ try {
178
+ status.update("Cloning...");
179
+ await gitExec(cloneArgs);
180
+ status.update("Cloned.");
181
+ } catch (cloneError) {
182
+ if (!parsed.version) throw cloneError;
183
+ debug("Shallow clone failed, falling back to full clone:", cloneError);
184
+ status.update("Shallow clone failed, cloning...");
185
+ await rm(tmpDir, {
186
+ recursive: true,
187
+ force: true
188
+ });
189
+ await mkdir(tmpDir, { recursive: true });
190
+ await gitExecIn(["init"]);
191
+ await gitExecIn([
192
+ "remote",
193
+ "add",
194
+ "origin",
195
+ parsed.uri
196
+ ]);
197
+ await gitExecIn(["fetch", "origin"]);
198
+ await gitExecIn(["checkout", parsed.version]);
199
+ status.update("Fetched.");
200
+ }
201
+ if (parsed.subdir) {
202
+ status.update(`Sparse checkout ${parsed.subdir}...`);
203
+ await gitExecIn([
204
+ "sparse-checkout",
205
+ "set",
206
+ parsed.subdir
207
+ ]);
208
+ await gitExecIn(["checkout"]);
209
+ }
210
+ status.update("Packing...");
211
+ const tarDir = parsed.subdir ? join(tmpDir, parsed.subdir) : tmpDir;
212
+ const { create } = await import('./tar-A5SPYDDD.mjs').then((n) => n.t);
213
+ status.done();
214
+ const stream = create({
215
+ gzip: true,
216
+ cwd: tarDir,
217
+ filter: (path) => !path.startsWith(".git/") && path !== ".git" && !path.startsWith("./.git/") && path !== "./.git"
218
+ }, ["."]).pipe(new PassThrough());
219
+ let cleaned = false;
220
+ const cleanup = () => {
221
+ if (cleaned) return;
222
+ cleaned = true;
223
+ rm(tmpDir, {
224
+ recursive: true,
225
+ force: true
226
+ });
227
+ };
228
+ stream.on("end", cleanup);
229
+ stream.on("error", cleanup);
230
+ stream.on("close", cleanup);
231
+ return stream;
232
+ } catch (error) {
233
+ status.done();
234
+ await rm(tmpDir, {
235
+ recursive: true,
236
+ force: true
237
+ });
238
+ throw error;
239
+ }
240
+ }
241
+ var _spinnerFrames = [
242
+ "\u280B",
243
+ "\u2819",
244
+ "\u2839",
245
+ "\u2838",
246
+ "\u283C",
247
+ "\u2834",
248
+ "\u2826",
249
+ "\u2827",
250
+ "\u2807",
251
+ "\u280F"
252
+ ];
253
+ function _gitSpawn(args, opts, status) {
254
+ return new Promise((resolve, reject) => {
255
+ const proc = spawn("git", args, {
256
+ ...opts,
257
+ stdio: [
258
+ "ignore",
259
+ "pipe",
260
+ "pipe"
261
+ ]
262
+ });
263
+ proc.stdout.resume();
264
+ let lastLine = "";
265
+ proc.stderr?.on("data", (chunk) => {
266
+ const str = chunk.toString();
267
+ for (const line of str.split(/[\r\n]/)) {
268
+ const clean = line.trim();
269
+ if (clean) lastLine = clean;
270
+ }
271
+ if (status) status.update(lastLine);
272
+ });
273
+ proc.on("close", (code) => {
274
+ if (code === 0) resolve(lastLine);
275
+ else reject(/* @__PURE__ */ new Error(`git ${args[0]} exited with code ${code}. Is git installed?`));
276
+ });
277
+ proc.on("error", (err) => {
278
+ if (err.code === "ENOENT") reject(/* @__PURE__ */ new Error("git is not installed or not found in PATH"));
279
+ else reject(err);
280
+ });
281
+ });
282
+ }
283
+ function _createStatus() {
284
+ if (!process.stderr.isTTY) return {
285
+ update(_text) {
286
+ },
287
+ done() {
288
+ }
289
+ };
290
+ let msg = "";
291
+ let frame = 0;
292
+ const render = () => {
293
+ const spinner = _spinnerFrames[frame % _spinnerFrames.length];
294
+ frame++;
295
+ process.stderr.write(`\x1B[2K\r\x1B[2m${spinner} ${msg}\x1B[0m`);
296
+ };
297
+ const interval = setInterval(render, 80);
298
+ return {
299
+ update(text) {
300
+ msg = text;
301
+ render();
302
+ },
303
+ done() {
304
+ clearInterval(interval);
305
+ process.stderr.write("\x1B[2K\r");
306
+ }
307
+ };
308
+ }
309
+ var http = async (input, options) => {
310
+ if (input.endsWith(".json")) return await _httpJSON(input, options);
311
+ const url = new URL(input);
312
+ let name = ne(url.pathname);
313
+ try {
314
+ const head = await sendFetch(url.href, {
315
+ method: "HEAD",
316
+ validateStatus: true,
317
+ headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 }
318
+ });
319
+ if ((head.headers.get("content-type") || "").includes("application/json")) return await _httpJSON(input, options);
320
+ const filename = head.headers.get("content-disposition")?.match(/filename="?(.+)"?/)?.[1];
321
+ if (filename) name = filename.split(".")[0];
322
+ } catch (error) {
323
+ debug(`Failed to fetch HEAD for ${url.href}:`, error);
324
+ }
325
+ return {
326
+ name: `${name}-${url.href.slice(0, 8)}`,
327
+ version: "",
328
+ subdir: "",
329
+ tar: url.href,
330
+ defaultDir: name,
331
+ headers: { Authorization: options.auth ? `Bearer ${options.auth}` : void 0 }
332
+ };
333
+ };
334
+ var _httpJSON = async (input, options) => {
335
+ const info = await (await sendFetch(input, {
336
+ validateStatus: true,
337
+ headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 }
338
+ })).json();
339
+ if (!info.tar || !info.name) throw new Error(`Invalid template info from ${input}. name or tar fields are missing!`);
340
+ return info;
341
+ };
342
+ var github = (input, options) => {
343
+ const parsed = parseGitURI(input);
344
+ const githubAPIURL = process.env.GIGET_GITHUB_URL || "https://api.github.com";
345
+ return {
346
+ name: parsed.repo.replace("/", "-"),
347
+ version: parsed.ref,
348
+ subdir: parsed.subdir,
349
+ headers: {
350
+ Authorization: options.auth ? `Bearer ${options.auth}` : void 0,
351
+ Accept: "application/vnd.github+json",
352
+ "X-GitHub-Api-Version": "2022-11-28"
353
+ },
354
+ url: `${githubAPIURL.replace("api.github.com", "github.com")}/${parsed.repo}/tree/${parsed.ref}${parsed.subdir}`,
355
+ tar: `${githubAPIURL}/repos/${parsed.repo}/tarball/${parsed.ref}`
356
+ };
357
+ };
358
+ var gitlab = (input, options) => {
359
+ const parsed = parseGitURI(input, { expandRepo: true });
360
+ const gitlab2 = process.env.GIGET_GITLAB_URL || "https://gitlab.com";
361
+ return {
362
+ name: parsed.repo.replace("/", "-"),
363
+ version: parsed.ref,
364
+ subdir: parsed.subdir,
365
+ headers: {
366
+ authorization: options.auth ? `Bearer ${options.auth}` : void 0,
367
+ "sec-fetch-mode": "same-origin"
368
+ },
369
+ url: `${gitlab2}/${parsed.repo}/tree/${parsed.ref}${parsed.subdir}`,
370
+ tar: `${gitlab2}/${parsed.repo}/-/archive/${parsed.ref}.tar.gz`
371
+ };
372
+ };
373
+ var bitbucket = (input, options) => {
374
+ const parsed = parseGitURI(input);
375
+ return {
376
+ name: parsed.repo.replace("/", "-"),
377
+ version: parsed.ref,
378
+ subdir: parsed.subdir,
379
+ headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 },
380
+ url: `https://bitbucket.com/${parsed.repo}/src/${parsed.ref}${parsed.subdir}`,
381
+ tar: `https://bitbucket.org/${parsed.repo}/get/${parsed.ref}.tar.gz`
382
+ };
383
+ };
384
+ var sourcehut = (input, options) => {
385
+ const parsed = parseGitURI(input);
386
+ return {
387
+ name: parsed.repo.replace("/", "-"),
388
+ version: parsed.ref,
389
+ subdir: parsed.subdir,
390
+ headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 },
391
+ url: `https://git.sr.ht/~${parsed.repo}/tree/${parsed.ref}/item${parsed.subdir}`,
392
+ tar: `https://git.sr.ht/~${parsed.repo}/archive/${parsed.ref}.tar.gz`
393
+ };
394
+ };
395
+ var providers = {
396
+ http,
397
+ https: http,
398
+ git,
399
+ github,
400
+ gh: github,
401
+ gitlab,
402
+ bitbucket,
403
+ sourcehut
404
+ };
405
+ var DEFAULT_REGISTRY = "https://raw.githubusercontent.com/unjs/giget/main/templates";
406
+ var registryProvider = (registryEndpoint = DEFAULT_REGISTRY, options = {}) => {
407
+ return (async (input) => {
408
+ const start = Date.now();
409
+ const registryURL = `${registryEndpoint}/${input}.json`;
410
+ const result = await sendFetch(registryURL, { headers: { authorization: options.auth ? `Bearer ${options.auth}` : void 0 } });
411
+ if (result.status >= 400) throw new Error(`Failed to download ${input} template info from ${registryURL}: ${result.status} ${result.statusText}`);
412
+ const info = await result.json();
413
+ if (!info.tar || !info.name) throw new Error(`Invalid template info from ${registryURL}. name or tar fields are missing!`);
414
+ debug(`Fetched ${input} template info from ${registryURL} in ${Date.now() - start}ms`);
415
+ return info;
416
+ });
417
+ };
418
+ var sourceProtoRe = /^([\w+-.]+):/;
419
+ async function downloadTemplate(input, options = {}) {
420
+ options.registry = process.env.GIGET_REGISTRY ?? options.registry;
421
+ options.auth = process.env.GIGET_AUTH ?? options.auth;
422
+ const registry = options.registry === false ? void 0 : registryProvider(options.registry, { auth: options.auth });
423
+ let providerName = options.provider || (registry ? "registry" : "github");
424
+ let source = input;
425
+ const sourceProviderMatch = input.match(sourceProtoRe);
426
+ if (sourceProviderMatch) {
427
+ providerName = sourceProviderMatch[1];
428
+ source = input.slice(sourceProviderMatch[0].length);
429
+ if (providerName === "http" || providerName === "https") source = input;
430
+ }
431
+ if (providerName.endsWith("+git")) {
432
+ source = `${providerName.slice(0, -4)}:${source}`;
433
+ providerName = "git";
434
+ }
435
+ const provider = options.providers?.[providerName] || providers[providerName] || registry;
436
+ if (!provider) throw new Error(`Unsupported provider: ${providerName}`);
437
+ const template = await Promise.resolve().then(() => provider(source, { auth: options.auth })).catch((error) => {
438
+ throw new Error(`Failed to download template from ${providerName}: ${error.message}`);
439
+ });
440
+ if (!template) throw new Error(`Failed to resolve template from ${providerName}`);
441
+ template.name = (template.name || "template").replace(/[^\da-z-]/gi, "-");
442
+ template.defaultDir = (template.defaultDir || template.name).replace(/[^\da-z-]/gi, "-");
443
+ const tarPath = y(y(cacheDirectory(), providerName, template.name), (template.version || template.name) + ".tar.gz");
444
+ if (options.preferOffline && existsSync(tarPath)) options.offline = true;
445
+ if (!options.offline) {
446
+ await mkdir(C(tarPath), { recursive: true });
447
+ const s2 = Date.now();
448
+ if (typeof template.tar === "function") {
449
+ const tarFn = template.tar;
450
+ await (async () => {
451
+ const stream = await tarFn({ auth: options.auth });
452
+ await pipeline(stream instanceof Readable ? stream : Readable.fromWeb(stream), createWriteStream(tarPath));
453
+ })().catch((error) => {
454
+ if (!existsSync(tarPath)) throw error;
455
+ debug("Download error. Using cached version:", error);
456
+ options.offline = true;
457
+ });
458
+ } else await download(template.tar, tarPath, { headers: {
459
+ Authorization: options.auth ? `Bearer ${options.auth}` : void 0,
460
+ ...normalizeHeaders(template.headers)
461
+ } }).catch((error) => {
462
+ if (!existsSync(tarPath)) throw error;
463
+ debug("Download error. Using cached version:", error);
464
+ options.offline = true;
465
+ });
466
+ debug(`Downloaded to ${tarPath} in ${Date.now() - s2}ms`);
467
+ }
468
+ if (!existsSync(tarPath)) throw new Error(`Tarball not found: ${tarPath} (offline: ${options.offline})`);
469
+ const extractPath = y(y(options.cwd || "."), options.dir || template.defaultDir);
470
+ if (options.forceClean) await rm(extractPath, {
471
+ recursive: true,
472
+ force: true
473
+ });
474
+ if (!options.force && existsSync(extractPath) && readdirSync(extractPath).length > 0) throw new Error(`Destination ${extractPath} already exists.`);
475
+ await mkdir(extractPath, { recursive: true });
476
+ const s = Date.now();
477
+ const subdir = template.subdir?.replace(/^\//, "") || "";
478
+ const { extract } = await import('./tar-A5SPYDDD.mjs').then((n) => n.t);
479
+ await extract({
480
+ file: tarPath,
481
+ cwd: extractPath,
482
+ onReadEntry(entry) {
483
+ entry.path = entry.path.split("/").splice(1).join("/");
484
+ if (subdir) if (entry.path.startsWith(subdir + "/")) entry.path = entry.path.slice(subdir.length);
485
+ else entry.path = "";
486
+ }
487
+ });
488
+ debug(`Extracted to ${extractPath} in ${Date.now() - s}ms`);
489
+ if (options.install) {
490
+ debug("Installing dependencies...");
491
+ const { installDependencies } = await import('./nypm-5BYDGLH7.mjs').then((n) => n.t);
492
+ await installDependencies({
493
+ cwd: extractPath,
494
+ silent: options.silent,
495
+ ...typeof options.install === "object" ? options.install : {}
496
+ });
497
+ }
498
+ return {
499
+ ...template,
500
+ source,
501
+ dir: extractPath
502
+ };
503
+ }
504
+
505
+ export { downloadTemplate, registryProvider, startShell };
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as vue from 'vue';
2
2
  import { App, ComputedRef, PropType, VNode } from 'vue';
3
3
  import * as _drmhse_sso_sdk from '@drmhse/sso-sdk';
4
- import { TokenStorage, UserProfile, OrganizationResponse, SsoClient } from '@drmhse/sso-sdk';
4
+ import { SsoClient, UserProfile, OrganizationResponse, TokenStorage } from '@drmhse/sso-sdk';
5
5
  export { AuthErrorCodes, BrowserStorage, MemoryStorage, OrganizationResponse, SsoApiError, SsoClient, TokenStorage, UserProfile } from '@drmhse/sso-sdk';
6
6
 
7
7
  interface AuthOSState {
@@ -755,4 +755,37 @@ declare const PasskeySignIn: vue.DefineComponent<vue.ExtractPropTypes<{
755
755
  showPasswordSignIn: boolean;
756
756
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
757
757
 
758
- export { AUTH_OS_INJECTION_KEY, type AppearanceOptions, type AppearanceVariables, type AuthOSContext, type AuthOSPluginOptions, AuthOSProvider, type AuthOSState, MagicLinkSignIn, OAuthButton, type OAuthButtonSlotProps, OrganizationSwitcher, type OrganizationSwitcherSlotProps, PasskeySignIn, Protect, SignIn, type SignInSlotProps, SignUp, type SignUpSlotProps, SignedIn, SignedOut, type SupportedOAuthProvider$1 as SupportedOAuthProvider, UserButton, type UserButtonSlotProps, createAuthOS, useAllPermissions, useAnyPermission, useAuthOS, useOrganization, usePermission, useUser };
758
+ interface CallbackSlotProps {
759
+ error: string | null;
760
+ }
761
+ declare const Callback: vue.DefineComponent<vue.ExtractPropTypes<{
762
+ onSuccess: {
763
+ type: PropType<() => void>;
764
+ default: undefined;
765
+ };
766
+ onError: {
767
+ type: PropType<(error: Error) => void>;
768
+ default: undefined;
769
+ };
770
+ }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
771
+ [key: string]: any;
772
+ }> | vue.VNode<vue.RendererNode, vue.RendererElement, {
773
+ [key: string]: any;
774
+ }>[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("success" | "error")[], "success" | "error", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
775
+ onSuccess: {
776
+ type: PropType<() => void>;
777
+ default: undefined;
778
+ };
779
+ onError: {
780
+ type: PropType<(error: Error) => void>;
781
+ default: undefined;
782
+ };
783
+ }>> & Readonly<{
784
+ onSuccess?: ((...args: any[]) => any) | undefined;
785
+ onError?: ((...args: any[]) => any) | undefined;
786
+ }>, {
787
+ onSuccess: () => void;
788
+ onError: (error: Error) => void;
789
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
790
+
791
+ export { AUTH_OS_INJECTION_KEY, type AppearanceOptions, type AppearanceVariables, type AuthOSContext, type AuthOSPluginOptions, AuthOSProvider, type AuthOSState, Callback, type CallbackSlotProps, MagicLinkSignIn, OAuthButton, type OAuthButtonSlotProps, OrganizationSwitcher, type OrganizationSwitcherSlotProps, PasskeySignIn, Protect, SignIn, type SignInSlotProps, SignUp, type SignUpSlotProps, SignedIn, SignedOut, type SupportedOAuthProvider$1 as SupportedOAuthProvider, UserButton, type UserButtonSlotProps, createAuthOS, useAllPermissions, useAnyPermission, useAuthOS, useOrganization, usePermission, useUser };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as vue from 'vue';
2
2
  import { App, ComputedRef, PropType, VNode } from 'vue';
3
3
  import * as _drmhse_sso_sdk from '@drmhse/sso-sdk';
4
- import { TokenStorage, UserProfile, OrganizationResponse, SsoClient } from '@drmhse/sso-sdk';
4
+ import { SsoClient, UserProfile, OrganizationResponse, TokenStorage } from '@drmhse/sso-sdk';
5
5
  export { AuthErrorCodes, BrowserStorage, MemoryStorage, OrganizationResponse, SsoApiError, SsoClient, TokenStorage, UserProfile } from '@drmhse/sso-sdk';
6
6
 
7
7
  interface AuthOSState {
@@ -755,4 +755,37 @@ declare const PasskeySignIn: vue.DefineComponent<vue.ExtractPropTypes<{
755
755
  showPasswordSignIn: boolean;
756
756
  }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
757
757
 
758
- export { AUTH_OS_INJECTION_KEY, type AppearanceOptions, type AppearanceVariables, type AuthOSContext, type AuthOSPluginOptions, AuthOSProvider, type AuthOSState, MagicLinkSignIn, OAuthButton, type OAuthButtonSlotProps, OrganizationSwitcher, type OrganizationSwitcherSlotProps, PasskeySignIn, Protect, SignIn, type SignInSlotProps, SignUp, type SignUpSlotProps, SignedIn, SignedOut, type SupportedOAuthProvider$1 as SupportedOAuthProvider, UserButton, type UserButtonSlotProps, createAuthOS, useAllPermissions, useAnyPermission, useAuthOS, useOrganization, usePermission, useUser };
758
+ interface CallbackSlotProps {
759
+ error: string | null;
760
+ }
761
+ declare const Callback: vue.DefineComponent<vue.ExtractPropTypes<{
762
+ onSuccess: {
763
+ type: PropType<() => void>;
764
+ default: undefined;
765
+ };
766
+ onError: {
767
+ type: PropType<(error: Error) => void>;
768
+ default: undefined;
769
+ };
770
+ }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
771
+ [key: string]: any;
772
+ }> | vue.VNode<vue.RendererNode, vue.RendererElement, {
773
+ [key: string]: any;
774
+ }>[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, ("success" | "error")[], "success" | "error", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
775
+ onSuccess: {
776
+ type: PropType<() => void>;
777
+ default: undefined;
778
+ };
779
+ onError: {
780
+ type: PropType<(error: Error) => void>;
781
+ default: undefined;
782
+ };
783
+ }>> & Readonly<{
784
+ onSuccess?: ((...args: any[]) => any) | undefined;
785
+ onError?: ((...args: any[]) => any) | undefined;
786
+ }>, {
787
+ onSuccess: () => void;
788
+ onError: (error: Error) => void;
789
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
790
+
791
+ export { AUTH_OS_INJECTION_KEY, type AppearanceOptions, type AppearanceVariables, type AuthOSContext, type AuthOSPluginOptions, AuthOSProvider, type AuthOSState, Callback, type CallbackSlotProps, MagicLinkSignIn, OAuthButton, type OAuthButtonSlotProps, OrganizationSwitcher, type OrganizationSwitcherSlotProps, PasskeySignIn, Protect, SignIn, type SignInSlotProps, SignUp, type SignUpSlotProps, SignedIn, SignedOut, type SupportedOAuthProvider$1 as SupportedOAuthProvider, UserButton, type UserButtonSlotProps, createAuthOS, useAllPermissions, useAnyPermission, useAuthOS, useOrganization, usePermission, useUser };