initial vitepress site with basic nav

This commit is contained in:
mrflos 2023-05-20 19:37:42 +03:00
parent a7df2e049d
commit 2029f16583
1900 changed files with 1014692 additions and 0 deletions

View file

@ -0,0 +1,69 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var clientCommon = require('@algolia/client-common');
var clientSearch = require('@algolia/client-search');
function createDestinationIndiceExistsError() {
return {
name: 'DestinationIndiceAlreadyExistsError',
message: 'Destination indice already exists.',
};
}
function createIndicesInSameAppError(appId) {
return {
name: 'IndicesInTheSameAppError',
message: 'Indices are in the same application. Use SearchClient.copyIndex instead.',
appId,
};
}
const accountCopyIndex = (source, destination, requestOptions) => {
// eslint-disable-next-line functional/prefer-readonly-type
const responses = [];
const promise = clientSearch.exists(destination)()
.then(res => {
if (source.appId === destination.appId) {
throw createIndicesInSameAppError(source.appId);
}
if (res) {
throw createDestinationIndiceExistsError();
}
})
.then(() => clientSearch.getSettings(source)())
.then(settings =>
// eslint-disable-next-line functional/immutable-data
responses.push(clientSearch.setSettings(destination)(settings, requestOptions)))
.then(() => clientSearch.browseRules(source)({
// eslint-disable-next-line functional/immutable-data
batch: rules => responses.push(clientSearch.saveRules(destination)(rules, requestOptions)),
}))
.then(() => clientSearch.browseSynonyms(source)({
// eslint-disable-next-line functional/immutable-data
batch: synonyms => responses.push(clientSearch.saveSynonyms(destination)(synonyms, requestOptions)),
}))
.then(() => clientSearch.browseObjects(source)({
// eslint-disable-next-line functional/immutable-data
batch: objects => responses.push(clientSearch.saveObjects(destination)(objects, requestOptions)),
}));
return clientCommon.createWaitablePromise(
/**
* The original promise will return an array of async responses, now
* we need to resolve that array of async responses using a
* `Promise.all`, and then resolve `void` for the end-user.
*/
promise.then(() => Promise.all(responses)).then(() => undefined),
/**
* Next, if the end-user calls the `wait` method, we need to also call
* the `wait` method on each element of of async responses.
*/
(_response, waitRequestOptions) => {
return Promise.all(responses.map(response => response.wait(waitRequestOptions)));
});
};
exports.accountCopyIndex = accountCopyIndex;
exports.createDestinationIndiceExistsError = createDestinationIndiceExistsError;
exports.createIndicesInSameAppError = createIndicesInSameAppError;

View file

@ -0,0 +1,18 @@
import { RequestOptions } from '@algolia/transporter';
import { SearchIndex } from '@algolia/client-search';
import { WaitablePromise } from '@algolia/client-common';
export declare const accountCopyIndex: (source: SearchIndex, destination: SearchIndex, requestOptions?: RequestOptions | undefined) => WaitablePromise<void>;
export declare function createDestinationIndiceExistsError(): Error;
export declare function createIndicesInSameAppError(appId: string): IndicesInSameAppError;
export declare type IndicesInSameAppError = Error & {
/**
* The app id.
*/
readonly appId: string;
};
export { }

View file

@ -0,0 +1,63 @@
import { createWaitablePromise } from '@algolia/client-common';
import { exists, getSettings, setSettings, browseRules, saveRules, browseSynonyms, saveSynonyms, browseObjects, saveObjects } from '@algolia/client-search';
function createDestinationIndiceExistsError() {
return {
name: 'DestinationIndiceAlreadyExistsError',
message: 'Destination indice already exists.',
};
}
function createIndicesInSameAppError(appId) {
return {
name: 'IndicesInTheSameAppError',
message: 'Indices are in the same application. Use SearchClient.copyIndex instead.',
appId,
};
}
const accountCopyIndex = (source, destination, requestOptions) => {
// eslint-disable-next-line functional/prefer-readonly-type
const responses = [];
const promise = exists(destination)()
.then(res => {
if (source.appId === destination.appId) {
throw createIndicesInSameAppError(source.appId);
}
if (res) {
throw createDestinationIndiceExistsError();
}
})
.then(() => getSettings(source)())
.then(settings =>
// eslint-disable-next-line functional/immutable-data
responses.push(setSettings(destination)(settings, requestOptions)))
.then(() => browseRules(source)({
// eslint-disable-next-line functional/immutable-data
batch: rules => responses.push(saveRules(destination)(rules, requestOptions)),
}))
.then(() => browseSynonyms(source)({
// eslint-disable-next-line functional/immutable-data
batch: synonyms => responses.push(saveSynonyms(destination)(synonyms, requestOptions)),
}))
.then(() => browseObjects(source)({
// eslint-disable-next-line functional/immutable-data
batch: objects => responses.push(saveObjects(destination)(objects, requestOptions)),
}));
return createWaitablePromise(
/**
* The original promise will return an array of async responses, now
* we need to resolve that array of async responses using a
* `Promise.all`, and then resolve `void` for the end-user.
*/
promise.then(() => Promise.all(responses)).then(() => undefined),
/**
* Next, if the end-user calls the `wait` method, we need to also call
* the `wait` method on each element of of async responses.
*/
(_response, waitRequestOptions) => {
return Promise.all(responses.map(response => response.wait(waitRequestOptions)));
});
};
export { accountCopyIndex, createDestinationIndiceExistsError, createIndicesInSameAppError };

2
node_modules/@algolia/client-account/index.js generated vendored Normal file
View file

@ -0,0 +1,2 @@
// eslint-disable-next-line functional/immutable-data, import/no-commonjs
module.exports = require('./dist/client-account.cjs.js');

23
node_modules/@algolia/client-account/package.json generated vendored Normal file
View file

@ -0,0 +1,23 @@
{
"name": "@algolia/client-account",
"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-account.esm.js",
"types": "dist/client-account.d.ts",
"files": [
"index.js",
"dist"
],
"dependencies": {
"@algolia/client-common": "4.17.0",
"@algolia/client-search": "4.17.0",
"@algolia/transporter": "4.17.0"
}
}