initial vitepress site with basic nav
This commit is contained in:
parent
a7df2e049d
commit
2029f16583
1900 changed files with 1014692 additions and 0 deletions
101
node_modules/@algolia/client-common/dist/client-common.cjs.js
generated
vendored
Normal file
101
node_modules/@algolia/client-common/dist/client-common.cjs.js
generated
vendored
Normal file
|
@ -0,0 +1,101 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function createAuth(authMode, appId, apiKey) {
|
||||
const credentials = {
|
||||
'x-algolia-api-key': apiKey,
|
||||
'x-algolia-application-id': appId,
|
||||
};
|
||||
return {
|
||||
headers() {
|
||||
return authMode === AuthMode.WithinHeaders ? credentials : {};
|
||||
},
|
||||
queryParameters() {
|
||||
return authMode === AuthMode.WithinQueryParameters ? credentials : {};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function createRetryablePromise(callback) {
|
||||
let retriesCount = 0; // eslint-disable-line functional/no-let
|
||||
const retry = () => {
|
||||
retriesCount++;
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve(callback(retry));
|
||||
}, Math.min(100 * retriesCount, 1000));
|
||||
});
|
||||
};
|
||||
return callback(retry);
|
||||
}
|
||||
|
||||
function createWaitablePromise(promise, wait = (_response, _requestOptions) => {
|
||||
return Promise.resolve();
|
||||
}) {
|
||||
// eslint-disable-next-line functional/immutable-data
|
||||
return Object.assign(promise, {
|
||||
wait(requestOptions) {
|
||||
return createWaitablePromise(promise
|
||||
.then(response => Promise.all([wait(response, requestOptions), response]))
|
||||
.then(promiseResults => promiseResults[1]));
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line functional/prefer-readonly-type
|
||||
function shuffle(array) {
|
||||
let c = array.length - 1; // eslint-disable-line functional/no-let
|
||||
// eslint-disable-next-line functional/no-loop-statement
|
||||
for (c; c > 0; c--) {
|
||||
const b = Math.floor(Math.random() * (c + 1));
|
||||
const a = array[c];
|
||||
array[c] = array[b]; // eslint-disable-line functional/immutable-data, no-param-reassign
|
||||
array[b] = a; // eslint-disable-line functional/immutable-data, no-param-reassign
|
||||
}
|
||||
return array;
|
||||
}
|
||||
function addMethods(base, methods) {
|
||||
if (!methods) {
|
||||
return base;
|
||||
}
|
||||
Object.keys(methods).forEach(key => {
|
||||
// eslint-disable-next-line functional/immutable-data, no-param-reassign
|
||||
base[key] = methods[key](base);
|
||||
});
|
||||
return base;
|
||||
}
|
||||
function encode(format, ...args) {
|
||||
// eslint-disable-next-line functional/no-let
|
||||
let i = 0;
|
||||
return format.replace(/%s/g, () => encodeURIComponent(args[i++]));
|
||||
}
|
||||
|
||||
const version = '4.17.0';
|
||||
|
||||
const destroy = (base) => {
|
||||
return () => {
|
||||
return base.transporter.requester.destroy();
|
||||
};
|
||||
};
|
||||
|
||||
const AuthMode = {
|
||||
/**
|
||||
* If auth credentials should be in query parameters.
|
||||
*/
|
||||
WithinQueryParameters: 0,
|
||||
/**
|
||||
* If auth credentials should be in headers.
|
||||
*/
|
||||
WithinHeaders: 1,
|
||||
};
|
||||
|
||||
exports.AuthMode = AuthMode;
|
||||
exports.addMethods = addMethods;
|
||||
exports.createAuth = createAuth;
|
||||
exports.createRetryablePromise = createRetryablePromise;
|
||||
exports.createWaitablePromise = createWaitablePromise;
|
||||
exports.destroy = destroy;
|
||||
exports.encode = encode;
|
||||
exports.shuffle = shuffle;
|
||||
exports.version = version;
|
102
node_modules/@algolia/client-common/dist/client-common.d.ts
generated
vendored
Normal file
102
node_modules/@algolia/client-common/dist/client-common.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,102 @@
|
|||
import { Headers } from '@algolia/transporter';
|
||||
import { HostOptions } from '@algolia/transporter';
|
||||
import { QueryParameters } from '@algolia/transporter';
|
||||
import { RequestOptions } from '@algolia/transporter';
|
||||
import { Transporter } from '@algolia/transporter';
|
||||
import { TransporterOptions } from '@algolia/transporter';
|
||||
|
||||
declare type AddedMethods<TBase, TMethods extends Methods<TBase>> = TBase & {
|
||||
[TKey in keyof TMethods extends string ? keyof TMethods : never]: ReturnType<TMethods[TKey]>;
|
||||
};
|
||||
|
||||
export declare function addMethods<TBase extends {}, TMethods extends Methods<TBase>>(base: TBase, methods?: TMethods): AddedMethods<TBase, TMethods>;
|
||||
|
||||
export declare type Auth = {
|
||||
/**
|
||||
* Returns the headers related to auth. Should be
|
||||
* merged to the transporter headers.
|
||||
*/
|
||||
readonly headers: () => Readonly<Record<string, string>>;
|
||||
/**
|
||||
* Returns the query parameters related to auth. Should be
|
||||
* merged to the query parameters headers.
|
||||
*/
|
||||
readonly queryParameters: () => Readonly<Record<string, string>>;
|
||||
};
|
||||
|
||||
export declare const AuthMode: Readonly<Record<string, AuthModeType>>;
|
||||
|
||||
export declare type AuthModeType = 0 | 1;
|
||||
|
||||
export declare type ClientTransporterOptions = Pick<TransporterOptions, Exclude<keyof TransporterOptions, 'headers'> & Exclude<keyof TransporterOptions, 'queryParameters'> & Exclude<keyof TransporterOptions, 'hosts'>> & {
|
||||
/**
|
||||
* The hosts used by the requester.
|
||||
*/
|
||||
readonly hosts?: readonly HostOptions[];
|
||||
/**
|
||||
* The headers used by the requester. The transporter
|
||||
* layer may add some extra headers during the request
|
||||
* for the user agent, and others.
|
||||
*/
|
||||
readonly headers?: Headers;
|
||||
/**
|
||||
* The query parameters used by the requester. The transporter
|
||||
* layer may add some extra headers during the request
|
||||
* for the user agent, and others.
|
||||
*/
|
||||
readonly queryParameters?: QueryParameters;
|
||||
};
|
||||
|
||||
export declare function createAuth(authMode: AuthModeType, appId: string, apiKey: string): Auth;
|
||||
|
||||
export declare type CreateClient<TClient, TOptions> = <TMethods extends {
|
||||
readonly [key: string]: (base: TClient) => (...args: any) => any;
|
||||
}>(options: TOptions & {
|
||||
readonly methods?: TMethods;
|
||||
}) => TClient & {
|
||||
[key in keyof TMethods extends string ? keyof TMethods : never]: ReturnType<TMethods[key]>;
|
||||
};
|
||||
|
||||
export declare function createRetryablePromise<TResponse>(callback: (retry: () => Promise<TResponse>) => Promise<TResponse>): Promise<TResponse>;
|
||||
|
||||
export declare function createWaitablePromise<TResponse>(promise: Readonly<Promise<TResponse>>, wait?: Wait<TResponse>): Readonly<WaitablePromise<TResponse>>;
|
||||
|
||||
export declare const destroy: (base: {
|
||||
readonly transporter: Transporter;
|
||||
}) => () => Readonly<Promise<void>>;
|
||||
|
||||
export declare function encode(format: string, ...args: readonly any[]): string;
|
||||
|
||||
declare type Methods<TBase> = {
|
||||
readonly [key: string]: (base: TBase) => (...args: any[]) => any;
|
||||
};
|
||||
|
||||
export declare function shuffle<TData>(array: TData[]): TData[];
|
||||
|
||||
export declare const version = "4.17.0";
|
||||
|
||||
export declare type Wait<TResponse> = (
|
||||
/**
|
||||
* The original response.
|
||||
*/
|
||||
response: TResponse,
|
||||
/**
|
||||
* The custom request options.
|
||||
*/
|
||||
requestOptions?: RequestOptions) => Readonly<Promise<any>>;
|
||||
|
||||
export declare type WaitablePromise<TResponse> = Readonly<Promise<TResponse>> & {
|
||||
/**
|
||||
* Wait for a task to complete before executing the next line of code, to synchronize index updates.
|
||||
*
|
||||
* All write operations in Algolia are asynchronous by design. It means that when you add or
|
||||
* update an object to your index, our servers will reply to your request with a taskID as
|
||||
* soon as they understood the write operation. The actual insert and indexing will be
|
||||
* done after replying to your code.
|
||||
*
|
||||
* You can wait for a task to complete by using this method.
|
||||
*/
|
||||
readonly wait: (requestOptions?: RequestOptions) => Readonly<WaitablePromise<TResponse>>;
|
||||
};
|
||||
|
||||
export { }
|
89
node_modules/@algolia/client-common/dist/client-common.esm.js
generated
vendored
Normal file
89
node_modules/@algolia/client-common/dist/client-common.esm.js
generated
vendored
Normal file
|
@ -0,0 +1,89 @@
|
|||
function createAuth(authMode, appId, apiKey) {
|
||||
const credentials = {
|
||||
'x-algolia-api-key': apiKey,
|
||||
'x-algolia-application-id': appId,
|
||||
};
|
||||
return {
|
||||
headers() {
|
||||
return authMode === AuthMode.WithinHeaders ? credentials : {};
|
||||
},
|
||||
queryParameters() {
|
||||
return authMode === AuthMode.WithinQueryParameters ? credentials : {};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function createRetryablePromise(callback) {
|
||||
let retriesCount = 0; // eslint-disable-line functional/no-let
|
||||
const retry = () => {
|
||||
retriesCount++;
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
resolve(callback(retry));
|
||||
}, Math.min(100 * retriesCount, 1000));
|
||||
});
|
||||
};
|
||||
return callback(retry);
|
||||
}
|
||||
|
||||
function createWaitablePromise(promise, wait = (_response, _requestOptions) => {
|
||||
return Promise.resolve();
|
||||
}) {
|
||||
// eslint-disable-next-line functional/immutable-data
|
||||
return Object.assign(promise, {
|
||||
wait(requestOptions) {
|
||||
return createWaitablePromise(promise
|
||||
.then(response => Promise.all([wait(response, requestOptions), response]))
|
||||
.then(promiseResults => promiseResults[1]));
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line functional/prefer-readonly-type
|
||||
function shuffle(array) {
|
||||
let c = array.length - 1; // eslint-disable-line functional/no-let
|
||||
// eslint-disable-next-line functional/no-loop-statement
|
||||
for (c; c > 0; c--) {
|
||||
const b = Math.floor(Math.random() * (c + 1));
|
||||
const a = array[c];
|
||||
array[c] = array[b]; // eslint-disable-line functional/immutable-data, no-param-reassign
|
||||
array[b] = a; // eslint-disable-line functional/immutable-data, no-param-reassign
|
||||
}
|
||||
return array;
|
||||
}
|
||||
function addMethods(base, methods) {
|
||||
if (!methods) {
|
||||
return base;
|
||||
}
|
||||
Object.keys(methods).forEach(key => {
|
||||
// eslint-disable-next-line functional/immutable-data, no-param-reassign
|
||||
base[key] = methods[key](base);
|
||||
});
|
||||
return base;
|
||||
}
|
||||
function encode(format, ...args) {
|
||||
// eslint-disable-next-line functional/no-let
|
||||
let i = 0;
|
||||
return format.replace(/%s/g, () => encodeURIComponent(args[i++]));
|
||||
}
|
||||
|
||||
const version = '4.17.0';
|
||||
|
||||
const destroy = (base) => {
|
||||
return () => {
|
||||
return base.transporter.requester.destroy();
|
||||
};
|
||||
};
|
||||
|
||||
const AuthMode = {
|
||||
/**
|
||||
* If auth credentials should be in query parameters.
|
||||
*/
|
||||
WithinQueryParameters: 0,
|
||||
/**
|
||||
* If auth credentials should be in headers.
|
||||
*/
|
||||
WithinHeaders: 1,
|
||||
};
|
||||
|
||||
export { AuthMode, addMethods, createAuth, createRetryablePromise, createWaitablePromise, destroy, encode, shuffle, version };
|
2
node_modules/@algolia/client-common/index.js
generated
vendored
Normal file
2
node_modules/@algolia/client-common/index.js
generated
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
// eslint-disable-next-line functional/immutable-data, import/no-commonjs
|
||||
module.exports = require('./dist/client-common.cjs.js');
|
22
node_modules/@algolia/client-common/package.json
generated
vendored
Normal file
22
node_modules/@algolia/client-common/package.json
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "@algolia/client-common",
|
||||
"version": "4.17.0",
|
||||
"private": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/algolia/algoliasearch-client-javascript.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"main": "index.js",
|
||||
"module": "dist/client-common.esm.js",
|
||||
"types": "dist/client-common.d.ts",
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@algolia/requester-common": "4.17.0",
|
||||
"@algolia/transporter": "4.17.0"
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue