@lustre/sdk 2.0.5-dev.3 → 2.0.5-dev.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.
- package/dist/api/FetchOptions.js +2 -2
- package/dist/api/QueryError.js +54 -54
- package/dist/api/QueryResolver.js +98 -98
- package/dist/api/WrappedQuery.js +2 -2
- package/dist/api/fast1a64utf.js +135 -135
- package/dist/api/fetchEntity.js +41 -41
- package/dist/api/fetchQuery.js +31 -31
- package/dist/api/getHash.js +27 -27
- package/dist/api/getQueryHash.js +9 -9
- package/dist/index.js +39 -39
- package/dist/schema/builtins.js +433 -433
- package/dist/schema/entities/alias.js +2 -2
- package/dist/schema/entities/brand.js +2 -2
- package/dist/schema/entities/category.js +2 -2
- package/dist/schema/entities/crawl.js +2 -2
- package/dist/schema/entities/index.js +29 -29
- package/dist/schema/entities/media.js +2 -2
- package/dist/schema/entities/offer.js +2 -2
- package/dist/schema/entities/productConfiguration.js +2 -2
- package/dist/schema/entities/productFamily.js +2 -2
- package/dist/schema/entities/productGeneration.js +2 -2
- package/dist/schema/entities/productType.js +2 -2
- package/dist/schema/entities/rating.js +2 -2
- package/dist/schema/entities/source.js +2 -2
- package/dist/schema/entities/spec.js +2 -2
- package/dist/schema/entities/specType.js +2 -2
- package/dist/schema/entities/specTypeChoice.js +2 -2
- package/dist/schema/entities/storePage.js +2 -2
- package/dist/schema/entities/storePageQueueGroup.js +2 -2
- package/dist/schema/entities/user.js +2 -2
- package/dist/schema/index.js +29 -29
- package/dist/schema/mutations/createBrand.js +2 -2
- package/dist/schema/mutations/createCategory.js +2 -2
- package/dist/schema/mutations/createProductConfiguration.js +2 -2
- package/dist/schema/mutations/createProductFamily.js +2 -2
- package/dist/schema/mutations/createProductGeneration.js +2 -2
- package/dist/schema/mutations/createProductType.js +2 -2
- package/dist/schema/mutations/createUser.js +2 -2
- package/dist/schema/mutations/storePageQueueClaimById.js +2 -2
- package/dist/schema/mutations/storePageQueueClaimNext.js +2 -2
- package/dist/schema/mutations/storePageQueueHandle.js +2 -2
- package/dist/schema/mutations/storePageQueueHandleStorePageIdSet.js +2 -2
- package/dist/schema/mutations/updateAlias.js +2 -2
- package/dist/schema/mutations/updateBrand.js +2 -2
- package/dist/schema/mutations/updateCategory.js +2 -2
- package/dist/schema/mutations/updateOffer.js +2 -2
- package/dist/schema/mutations/updateProductConfiguration.js +2 -2
- package/dist/schema/mutations/updateProductConfigurationProductType.js +2 -2
- package/dist/schema/mutations/updateProductFamily.js +2 -2
- package/dist/schema/mutations/updateProductFamilyBrand.js +2 -2
- package/dist/schema/mutations/updateProductGeneration.js +2 -2
- package/dist/schema/mutations/updateProductGenerationProductFamily.js +2 -2
- package/dist/schema/mutations/updateProductType.js +2 -2
- package/dist/schema/mutations/updateProductTypeProductGeneration.js +2 -2
- package/dist/schema/mutations/updateSource.js +2 -2
- package/dist/schema/mutations/updateStorePage.js +2 -2
- package/dist/schema/queries/affiliateLink.js +2 -2
- package/dist/schema/queries/affiliateUrl.js +2 -2
- package/dist/schema/queries/aliasIdListBySomeId.js +2 -2
- package/dist/schema/queries/analyticsTrack.js +2 -2
- package/dist/schema/queries/appliedCategoryIdListBySomeId.js +2 -2
- package/dist/schema/queries/baseScore.js +2 -2
- package/dist/schema/queries/baseScoreRatingIdList.js +2 -2
- package/dist/schema/queries/baseScoresByCategoryId.js +2 -2
- package/dist/schema/queries/bestInClass.js +2 -2
- package/dist/schema/queries/brandAliasResolution.js +2 -2
- package/dist/schema/queries/brandCategoryRankings.js +2 -2
- package/dist/schema/queries/brandIdBySomeId.js +2 -2
- package/dist/schema/queries/brandIdList.js +2 -2
- package/dist/schema/queries/brandIdListBySearch.js +2 -2
- package/dist/schema/queries/brandSocialMediaPostList.js +2 -2
- package/dist/schema/queries/categoryAliasResolution.js +2 -2
- package/dist/schema/queries/categoryDisplayMode.js +2 -2
- package/dist/schema/queries/categoryIdByUrlSlug.js +2 -2
- package/dist/schema/queries/categoryIdList.js +2 -2
- package/dist/schema/queries/categoryIdListBySomeId.js +2 -2
- package/dist/schema/queries/categoryIdListBySourceId.js +2 -2
- package/dist/schema/queries/categoryModifierSearchList.js +2 -2
- package/dist/schema/queries/categoryRankings.js +2 -2
- package/dist/schema/queries/categorySearchList.js +2 -2
- package/dist/schema/queries/categoryStatusList.js +2 -2
- package/dist/schema/queries/competitorsAnalysis.js +2 -2
- package/dist/schema/queries/crawlIdList.js +2 -2
- package/dist/schema/queries/crawlIdListByUrl.js +2 -2
- package/dist/schema/queries/descriptionMarkdown.js +2 -2
- package/dist/schema/queries/domainAnalysis.js +2 -2
- package/dist/schema/queries/domainSupport.js +3 -0
- package/dist/schema/queries/domainSupport.js.map +1 -0
- package/dist/schema/queries/entityType.js +2 -2
- package/dist/schema/queries/fallbackPriceByProductTypeId.js +2 -2
- package/dist/schema/queries/inputLayerVersion.js +2 -2
- package/dist/schema/queries/latestRatingIdList.js +2 -2
- package/dist/schema/queries/latestRatingIdListBySomeId.js +2 -2
- package/dist/schema/queries/mediaIdListBySomeId.js +2 -2
- package/dist/schema/queries/mlCategoryDisplayMode.js +2 -2
- package/dist/schema/queries/noteMarkdown.js +2 -2
- package/dist/schema/queries/offerIdListByStorePageId.js +2 -2
- package/dist/schema/queries/possibleAliasIdListBySomeId.js +2 -2
- package/dist/schema/queries/possibleStorePageIdListBySomeId.js +2 -2
- package/dist/schema/queries/preferredCategoryIdListByProductId.js +2 -2
- package/dist/schema/queries/preferredLatestRatingIdListBySomeId.js +2 -2
- package/dist/schema/queries/preferredStorePageList.js +2 -2
- package/dist/schema/queries/priceHistoryLookup.js +2 -2
- package/dist/schema/queries/pricePointCompetitors.js +2 -2
- package/dist/schema/queries/priceRangeByCategoryId.js +2 -2
- package/dist/schema/queries/productConfigurationIdListBySomeId.js +2 -2
- package/dist/schema/queries/productDealList.js +2 -2
- package/dist/schema/queries/productDocumentByStoreUrl.js +2 -2
- package/dist/schema/queries/productDocumentsByProductIds.js +2 -2
- package/dist/schema/queries/productFamilyIdBySomeId.js +2 -2
- package/dist/schema/queries/productFamilyIdListBySomeId.js +2 -2
- package/dist/schema/queries/productGenerationIdBySomeId.js +2 -2
- package/dist/schema/queries/productGenerationIdListBySomeId.js +2 -2
- package/dist/schema/queries/productListSort.js +2 -2
- package/dist/schema/queries/productPricePointList.js +2 -2
- package/dist/schema/queries/productSearchList.js +2 -2
- package/dist/schema/queries/productTypeIdBySomeId.js +2 -2
- package/dist/schema/queries/productTypeIdByStoreUrl.js +2 -2
- package/dist/schema/queries/productTypeIdListByCategoryId.js +2 -2
- package/dist/schema/queries/productTypeIdListByModifiers.js +2 -2
- package/dist/schema/queries/productTypeIdListBySomeId.js +2 -2
- package/dist/schema/queries/saleMetrics.js +2 -2
- package/dist/schema/queries/searchSuggestionList.js +2 -2
- package/dist/schema/queries/sectionDataByCrawlId.js +2 -2
- package/dist/schema/queries/sourceIdList.js +2 -2
- package/dist/schema/queries/specIdListBySomeId.js +2 -2
- package/dist/schema/queries/specTypeIdList.js +2 -2
- package/dist/schema/queries/specTypeValidValues.js +2 -2
- package/dist/schema/queries/specValueRangeListByCategoryId.js +2 -2
- package/dist/schema/queries/stablePriceByProductId.js +2 -2
- package/dist/schema/queries/stablePriceByProductIdAndStoreName.js +2 -2
- package/dist/schema/queries/stablePriceByStorePageId.js +2 -2
- package/dist/schema/queries/storePageFetchData.js +2 -2
- package/dist/schema/queries/storePageIdByUrl.js +2 -2
- package/dist/schema/queries/storePageIdListBySomeId.js +2 -2
- package/dist/schema/queries/storePageInfo.js +2 -2
- package/dist/schema/queries/storePageInfoBySku.js +2 -2
- package/dist/schema/queries/storePageScrapeData.js +2 -2
- package/dist/schema/queries/subCategoryIdListByCategoryId.js +2 -2
- package/dist/schema/queries/subsetModifierDataByModifiers.js +2 -2
- package/dist/schema/queries/topProductDocumentList.js +2 -2
- package/dist/schema/queries/unstableMediaIdListByCategoryId.js +2 -2
- package/dist/schema/queries/unstableSourceTrust.js +2 -2
- package/dist/schema/queries/userIdList.js +2 -2
- package/dist/schema/queries/userPermissionsByUserId.js +2 -2
- package/dist/schema/queries/userRestictedData.js +2 -2
- package/dist/schema/queries/userReviewAnalysis.js +2 -2
- package/dist/schema/queries/whoAmI.js +2 -2
- package/dist/schema/queries.js +2 -2
- package/dist/schema/responses.js +2 -2
- package/package.json +1 -1
- package/types/api/FetchOptions.d.ts +5 -5
- package/types/api/QueryError.d.ts +29 -29
- package/types/api/QueryResolver.d.ts +31 -31
- package/types/api/WrappedQuery.d.ts +8 -8
- package/types/api/fast1a64utf.d.ts +2 -2
- package/types/api/fetchEntity.d.ts +6 -6
- package/types/api/fetchQuery.d.ts +6 -6
- package/types/api/getHash.d.ts +6 -6
- package/types/api/getQueryHash.d.ts +2 -2
- package/types/index.d.ts +10 -10
- package/types/schema/builtins.d.ts +123 -123
- package/types/schema/entities/alias.d.ts +5 -5
- package/types/schema/entities/brand.d.ts +4 -4
- package/types/schema/entities/category.d.ts +6 -6
- package/types/schema/entities/crawl.d.ts +11 -11
- package/types/schema/entities/index.d.ts +17 -17
- package/types/schema/entities/media.d.ts +5 -5
- package/types/schema/entities/offer.d.ts +10 -10
- package/types/schema/entities/productConfiguration.d.ts +4 -4
- package/types/schema/entities/productFamily.d.ts +4 -4
- package/types/schema/entities/productGeneration.d.ts +4 -4
- package/types/schema/entities/productType.d.ts +4 -4
- package/types/schema/entities/rating.d.ts +52 -52
- package/types/schema/entities/source.d.ts +7 -7
- package/types/schema/entities/spec.d.ts +21 -21
- package/types/schema/entities/specType.d.ts +5 -5
- package/types/schema/entities/specTypeChoice.d.ts +6 -6
- package/types/schema/entities/storePage.d.ts +7 -7
- package/types/schema/entities/storePageQueueGroup.d.ts +5 -5
- package/types/schema/entities/user.d.ts +4 -4
- package/types/schema/index.d.ts +267 -265
- package/types/schema/index.d.ts.map +1 -1
- package/types/schema/mutations/createBrand.d.ts +8 -8
- package/types/schema/mutations/createCategory.d.ts +8 -8
- package/types/schema/mutations/createProductConfiguration.d.ts +9 -9
- package/types/schema/mutations/createProductFamily.d.ts +9 -9
- package/types/schema/mutations/createProductGeneration.d.ts +9 -9
- package/types/schema/mutations/createProductType.d.ts +9 -9
- package/types/schema/mutations/createUser.d.ts +9 -9
- package/types/schema/mutations/storePageQueueClaimById.d.ts +16 -16
- package/types/schema/mutations/storePageQueueClaimNext.d.ts +14 -14
- package/types/schema/mutations/storePageQueueHandle.d.ts +14 -14
- package/types/schema/mutations/storePageQueueHandleStorePageIdSet.d.ts +14 -14
- package/types/schema/mutations/updateAlias.d.ts +7 -7
- package/types/schema/mutations/updateBrand.d.ts +7 -7
- package/types/schema/mutations/updateCategory.d.ts +9 -9
- package/types/schema/mutations/updateOffer.d.ts +7 -7
- package/types/schema/mutations/updateProductConfiguration.d.ts +7 -7
- package/types/schema/mutations/updateProductConfigurationProductType.d.ts +7 -7
- package/types/schema/mutations/updateProductFamily.d.ts +7 -7
- package/types/schema/mutations/updateProductFamilyBrand.d.ts +7 -7
- package/types/schema/mutations/updateProductGeneration.d.ts +7 -7
- package/types/schema/mutations/updateProductGenerationProductFamily.d.ts +7 -7
- package/types/schema/mutations/updateProductType.d.ts +7 -7
- package/types/schema/mutations/updateProductTypeProductGeneration.d.ts +7 -7
- package/types/schema/mutations/updateSource.d.ts +9 -9
- package/types/schema/mutations/updateStorePage.d.ts +7 -7
- package/types/schema/queries/affiliateLink.d.ts +11 -11
- package/types/schema/queries/affiliateUrl.d.ts +11 -11
- package/types/schema/queries/aliasIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/analyticsTrack.d.ts +5 -5
- package/types/schema/queries/appliedCategoryIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/baseScore.d.ts +8 -8
- package/types/schema/queries/baseScoreRatingIdList.d.ts +7 -7
- package/types/schema/queries/baseScoresByCategoryId.d.ts +11 -11
- package/types/schema/queries/bestInClass.d.ts +19 -19
- package/types/schema/queries/brandAliasResolution.d.ts +10 -10
- package/types/schema/queries/brandCategoryRankings.d.ts +36 -36
- package/types/schema/queries/brandIdBySomeId.d.ts +5 -5
- package/types/schema/queries/brandIdList.d.ts +8 -8
- package/types/schema/queries/brandIdListBySearch.d.ts +6 -6
- package/types/schema/queries/brandSocialMediaPostList.d.ts +21 -21
- package/types/schema/queries/categoryAliasResolution.d.ts +12 -12
- package/types/schema/queries/categoryDisplayMode.d.ts +10 -10
- package/types/schema/queries/categoryIdByUrlSlug.d.ts +5 -5
- package/types/schema/queries/categoryIdList.d.ts +8 -8
- package/types/schema/queries/categoryIdListBySomeId.d.ts +10 -10
- package/types/schema/queries/categoryIdListBySourceId.d.ts +6 -6
- package/types/schema/queries/categoryModifierSearchList.d.ts +21 -21
- package/types/schema/queries/categoryRankings.d.ts +13 -13
- package/types/schema/queries/categorySearchList.d.ts +16 -16
- package/types/schema/queries/categoryStatusList.d.ts +9 -9
- package/types/schema/queries/competitorsAnalysis.d.ts +36 -36
- package/types/schema/queries/crawlIdList.d.ts +11 -11
- package/types/schema/queries/crawlIdListByUrl.d.ts +6 -6
- package/types/schema/queries/descriptionMarkdown.d.ts +5 -5
- package/types/schema/queries/domainAnalysis.d.ts +18 -18
- package/types/schema/queries/domainSupport.d.ts +4 -0
- package/types/schema/queries/domainSupport.d.ts.map +1 -0
- package/types/schema/queries/entityType.d.ts +54 -54
- package/types/schema/queries/fallbackPriceByProductTypeId.d.ts +6 -6
- package/types/schema/queries/inputLayerVersion.d.ts +5 -5
- package/types/schema/queries/latestRatingIdList.d.ts +6 -6
- package/types/schema/queries/latestRatingIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/mediaIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/mlCategoryDisplayMode.d.ts +8 -8
- package/types/schema/queries/noteMarkdown.d.ts +5 -5
- package/types/schema/queries/offerIdListByStorePageId.d.ts +12 -12
- package/types/schema/queries/possibleAliasIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/possibleStorePageIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/preferredCategoryIdListByProductId.d.ts +6 -6
- package/types/schema/queries/preferredLatestRatingIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/preferredStorePageList.d.ts +11 -11
- package/types/schema/queries/priceHistoryLookup.d.ts +16 -16
- package/types/schema/queries/pricePointCompetitors.d.ts +16 -16
- package/types/schema/queries/priceRangeByCategoryId.d.ts +10 -10
- package/types/schema/queries/productConfigurationIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/productDealList.d.ts +13 -13
- package/types/schema/queries/productDocumentByStoreUrl.d.ts +7 -7
- package/types/schema/queries/productDocumentsByProductIds.d.ts +6 -6
- package/types/schema/queries/productFamilyIdBySomeId.d.ts +5 -5
- package/types/schema/queries/productFamilyIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/productGenerationIdBySomeId.d.ts +5 -5
- package/types/schema/queries/productGenerationIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/productListSort.d.ts +9 -9
- package/types/schema/queries/productPricePointList.d.ts +13 -13
- package/types/schema/queries/productSearchList.d.ts +39 -39
- package/types/schema/queries/productTypeIdBySomeId.d.ts +5 -5
- package/types/schema/queries/productTypeIdByStoreUrl.d.ts +6 -6
- package/types/schema/queries/productTypeIdListByCategoryId.d.ts +10 -10
- package/types/schema/queries/productTypeIdListByModifiers.d.ts +7 -7
- package/types/schema/queries/productTypeIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/saleMetrics.d.ts +8 -8
- package/types/schema/queries/searchSuggestionList.d.ts +9 -9
- package/types/schema/queries/sectionDataByCrawlId.d.ts +19 -19
- package/types/schema/queries/sourceIdList.d.ts +4 -4
- package/types/schema/queries/specIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/specTypeIdList.d.ts +12 -12
- package/types/schema/queries/specTypeValidValues.d.ts +15 -15
- package/types/schema/queries/specValueRangeListByCategoryId.d.ts +36 -36
- package/types/schema/queries/stablePriceByProductId.d.ts +6 -6
- package/types/schema/queries/stablePriceByProductIdAndStoreName.d.ts +7 -7
- package/types/schema/queries/stablePriceByStorePageId.d.ts +6 -6
- package/types/schema/queries/storePageFetchData.d.ts +12 -12
- package/types/schema/queries/storePageIdByUrl.d.ts +6 -6
- package/types/schema/queries/storePageIdListBySomeId.d.ts +6 -6
- package/types/schema/queries/storePageInfo.d.ts +13 -13
- package/types/schema/queries/storePageInfoBySku.d.ts +20 -20
- package/types/schema/queries/storePageScrapeData.d.ts +9 -9
- package/types/schema/queries/subCategoryIdListByCategoryId.d.ts +6 -6
- package/types/schema/queries/subsetModifierDataByModifiers.d.ts +12 -12
- package/types/schema/queries/topProductDocumentList.d.ts +8 -8
- package/types/schema/queries/unstableMediaIdListByCategoryId.d.ts +6 -6
- package/types/schema/queries/unstableSourceTrust.d.ts +9 -9
- package/types/schema/queries/userIdList.d.ts +4 -4
- package/types/schema/queries/userPermissionsByUserId.d.ts +7 -7
- package/types/schema/queries/userRestictedData.d.ts +10 -10
- package/types/schema/queries/userReviewAnalysis.d.ts +39 -37
- package/types/schema/queries/userReviewAnalysis.d.ts.map +1 -1
- package/types/schema/queries/whoAmI.d.ts +5 -5
- package/types/schema/queries.d.ts +86 -85
- package/types/schema/queries.d.ts.map +1 -1
- package/types/schema/responses.d.ts +86 -85
- package/types/schema/responses.d.ts.map +1 -1
package/dist/api/FetchOptions.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=FetchOptions.js.map
|
package/dist/api/QueryError.js
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QueryHttpError = exports.QueryResponseError = exports.QueryValidationError = exports.QueryReferenceError = exports.QueryFetchError = exports.QueryError = void 0;
|
|
4
|
-
class QueryError extends Error {
|
|
5
|
-
constructor(query, message = "") {
|
|
6
|
-
super(message);
|
|
7
|
-
this.query = query;
|
|
8
|
-
Object.setPrototypeOf(this, QueryError.prototype);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.QueryError = QueryError;
|
|
12
|
-
class QueryFetchError extends QueryError {
|
|
13
|
-
constructor(query, message = "") {
|
|
14
|
-
super(query, message);
|
|
15
|
-
this.name = "QueryFetchError";
|
|
16
|
-
Object.setPrototypeOf(this, QueryFetchError.prototype);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.QueryFetchError = QueryFetchError;
|
|
20
|
-
class QueryReferenceError extends QueryError {
|
|
21
|
-
constructor(query, message = "") {
|
|
22
|
-
super(query, message);
|
|
23
|
-
this.name = "QueryReferenceError";
|
|
24
|
-
Object.setPrototypeOf(this, QueryReferenceError.prototype);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
exports.QueryReferenceError = QueryReferenceError;
|
|
28
|
-
class QueryValidationError extends QueryError {
|
|
29
|
-
constructor(query, message = "") {
|
|
30
|
-
super(query, message);
|
|
31
|
-
this.name = "QueryValidationError";
|
|
32
|
-
Object.setPrototypeOf(this, QueryReferenceError.prototype);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.QueryValidationError = QueryValidationError;
|
|
36
|
-
class QueryResponseError extends QueryError {
|
|
37
|
-
constructor(query, errors, message = "") {
|
|
38
|
-
super(query, message);
|
|
39
|
-
this.name = "QueryResponseError";
|
|
40
|
-
this.errors = errors;
|
|
41
|
-
Object.setPrototypeOf(this, QueryResponseError.prototype);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.QueryResponseError = QueryResponseError;
|
|
45
|
-
class QueryHttpError extends QueryError {
|
|
46
|
-
constructor(query, status, body, message = "") {
|
|
47
|
-
super(query, message);
|
|
48
|
-
this.name = "QueryHttpError";
|
|
49
|
-
this.status = status;
|
|
50
|
-
this.body = body;
|
|
51
|
-
Object.setPrototypeOf(this, QueryHttpError.prototype);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.QueryHttpError = QueryHttpError;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.QueryHttpError = exports.QueryResponseError = exports.QueryValidationError = exports.QueryReferenceError = exports.QueryFetchError = exports.QueryError = void 0;
|
|
4
|
+
class QueryError extends Error {
|
|
5
|
+
constructor(query, message = "") {
|
|
6
|
+
super(message);
|
|
7
|
+
this.query = query;
|
|
8
|
+
Object.setPrototypeOf(this, QueryError.prototype);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.QueryError = QueryError;
|
|
12
|
+
class QueryFetchError extends QueryError {
|
|
13
|
+
constructor(query, message = "") {
|
|
14
|
+
super(query, message);
|
|
15
|
+
this.name = "QueryFetchError";
|
|
16
|
+
Object.setPrototypeOf(this, QueryFetchError.prototype);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.QueryFetchError = QueryFetchError;
|
|
20
|
+
class QueryReferenceError extends QueryError {
|
|
21
|
+
constructor(query, message = "") {
|
|
22
|
+
super(query, message);
|
|
23
|
+
this.name = "QueryReferenceError";
|
|
24
|
+
Object.setPrototypeOf(this, QueryReferenceError.prototype);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.QueryReferenceError = QueryReferenceError;
|
|
28
|
+
class QueryValidationError extends QueryError {
|
|
29
|
+
constructor(query, message = "") {
|
|
30
|
+
super(query, message);
|
|
31
|
+
this.name = "QueryValidationError";
|
|
32
|
+
Object.setPrototypeOf(this, QueryReferenceError.prototype);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.QueryValidationError = QueryValidationError;
|
|
36
|
+
class QueryResponseError extends QueryError {
|
|
37
|
+
constructor(query, errors, message = "") {
|
|
38
|
+
super(query, message);
|
|
39
|
+
this.name = "QueryResponseError";
|
|
40
|
+
this.errors = errors;
|
|
41
|
+
Object.setPrototypeOf(this, QueryResponseError.prototype);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.QueryResponseError = QueryResponseError;
|
|
45
|
+
class QueryHttpError extends QueryError {
|
|
46
|
+
constructor(query, status, body, message = "") {
|
|
47
|
+
super(query, message);
|
|
48
|
+
this.name = "QueryHttpError";
|
|
49
|
+
this.status = status;
|
|
50
|
+
this.body = body;
|
|
51
|
+
Object.setPrototypeOf(this, QueryHttpError.prototype);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.QueryHttpError = QueryHttpError;
|
|
55
55
|
//# sourceMappingURL=QueryError.js.map
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports._setDefaultQueryResolver = exports._getDefaultQueryResolver = exports._defaultBatchKey = void 0;
|
|
13
|
-
require("cross-fetch/polyfill");
|
|
14
|
-
const getQueryHash_1 = require("./getQueryHash");
|
|
15
|
-
const QueryError_1 = require("./QueryError");
|
|
16
|
-
exports._defaultBatchKey = "__DEFAULT_BATCH_KEY__";
|
|
17
|
-
class QueryResolver {
|
|
18
|
-
constructor(options = {}) {
|
|
19
|
-
const { apiHost, apiKey, apiPath } = options;
|
|
20
|
-
this.apiHost = apiHost !== null && apiHost !== void 0 ? apiHost : "https://lustre-api.com";
|
|
21
|
-
this.apiKey = apiKey;
|
|
22
|
-
this.apiPath = apiPath;
|
|
23
|
-
this.resolverQueues = {};
|
|
24
|
-
}
|
|
25
|
-
addQueryToQueue(query, options = {}) {
|
|
26
|
-
const { batchKey = exports._defaultBatchKey } = options;
|
|
27
|
-
const promise = new Promise((resolve, reject) => {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
var _c;
|
|
30
|
-
const queryResolver = { query, resolve, reject };
|
|
31
|
-
const queue = (_a = this.resolverQueues[batchKey]) !== null && _a !== void 0 ? _a : [];
|
|
32
|
-
queue.push(queryResolver);
|
|
33
|
-
(_b = (_c = this.resolverQueues)[batchKey]) !== null && _b !== void 0 ? _b : (_c[batchKey] = queue);
|
|
34
|
-
});
|
|
35
|
-
setTimeout(() => this.performQueryRequest(), 1);
|
|
36
|
-
return promise;
|
|
37
|
-
}
|
|
38
|
-
performQueryRequest() {
|
|
39
|
-
const resolverValues = Object.values(this.resolverQueues);
|
|
40
|
-
this.resolverQueues = {};
|
|
41
|
-
resolverValues.forEach((resolverQueue) => {
|
|
42
|
-
var _a;
|
|
43
|
-
if (resolverQueue.length === 0) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const queries = resolverQueue.reduce((output, resolver) => {
|
|
47
|
-
var _a;
|
|
48
|
-
var _b;
|
|
49
|
-
const query = resolver.query;
|
|
50
|
-
const queryHash = getQueryHash_1.getQueryHash(query);
|
|
51
|
-
(_a = output[_b = query.name]) !== null && _a !== void 0 ? _a : (output[_b] = {});
|
|
52
|
-
const dict = output[query.name];
|
|
53
|
-
dict[queryHash] = query.body;
|
|
54
|
-
return output;
|
|
55
|
-
}, {});
|
|
56
|
-
const headers = new Headers({
|
|
57
|
-
"Content-type": "application/json",
|
|
58
|
-
});
|
|
59
|
-
if (this.apiKey) {
|
|
60
|
-
headers.append("Authorization", `Bearer ${this.apiKey}`);
|
|
61
|
-
}
|
|
62
|
-
const endpointUrl = `${this.apiHost}${(_a = this.apiPath) !== null && _a !== void 0 ? _a : "/queries"}`;
|
|
63
|
-
const request = new Request(endpointUrl, {
|
|
64
|
-
body: JSON.stringify({ queries }),
|
|
65
|
-
method: "POST",
|
|
66
|
-
headers,
|
|
67
|
-
});
|
|
68
|
-
fetch(request)
|
|
69
|
-
.then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
if (response.ok) {
|
|
71
|
-
const json = yield response.json();
|
|
72
|
-
resolverQueue.forEach((resolver) => {
|
|
73
|
-
resolver.resolve(json);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
const body = yield response.text();
|
|
78
|
-
resolverQueue.forEach((resolver) => {
|
|
79
|
-
resolver.reject(new QueryError_1.QueryHttpError(resolver.query, response.status, body));
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}))
|
|
83
|
-
.catch((error) => {
|
|
84
|
-
resolverQueue.forEach((resolver) => {
|
|
85
|
-
resolver.reject(new QueryError_1.QueryFetchError(resolver.query, error.message));
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
let defaultQueryResolver = new QueryResolver();
|
|
92
|
-
const _getDefaultQueryResolver = () => defaultQueryResolver;
|
|
93
|
-
exports._getDefaultQueryResolver = _getDefaultQueryResolver;
|
|
94
|
-
const _setDefaultQueryResolver = (queryResolver) => {
|
|
95
|
-
defaultQueryResolver = queryResolver;
|
|
96
|
-
};
|
|
97
|
-
exports._setDefaultQueryResolver = _setDefaultQueryResolver;
|
|
98
|
-
exports.default = QueryResolver;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports._setDefaultQueryResolver = exports._getDefaultQueryResolver = exports._defaultBatchKey = void 0;
|
|
13
|
+
require("cross-fetch/polyfill");
|
|
14
|
+
const getQueryHash_1 = require("./getQueryHash");
|
|
15
|
+
const QueryError_1 = require("./QueryError");
|
|
16
|
+
exports._defaultBatchKey = "__DEFAULT_BATCH_KEY__";
|
|
17
|
+
class QueryResolver {
|
|
18
|
+
constructor(options = {}) {
|
|
19
|
+
const { apiHost, apiKey, apiPath } = options;
|
|
20
|
+
this.apiHost = apiHost !== null && apiHost !== void 0 ? apiHost : "https://lustre-api.com";
|
|
21
|
+
this.apiKey = apiKey;
|
|
22
|
+
this.apiPath = apiPath;
|
|
23
|
+
this.resolverQueues = {};
|
|
24
|
+
}
|
|
25
|
+
addQueryToQueue(query, options = {}) {
|
|
26
|
+
const { batchKey = exports._defaultBatchKey } = options;
|
|
27
|
+
const promise = new Promise((resolve, reject) => {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
var _c;
|
|
30
|
+
const queryResolver = { query, resolve, reject };
|
|
31
|
+
const queue = (_a = this.resolverQueues[batchKey]) !== null && _a !== void 0 ? _a : [];
|
|
32
|
+
queue.push(queryResolver);
|
|
33
|
+
(_b = (_c = this.resolverQueues)[batchKey]) !== null && _b !== void 0 ? _b : (_c[batchKey] = queue);
|
|
34
|
+
});
|
|
35
|
+
setTimeout(() => this.performQueryRequest(), 1);
|
|
36
|
+
return promise;
|
|
37
|
+
}
|
|
38
|
+
performQueryRequest() {
|
|
39
|
+
const resolverValues = Object.values(this.resolverQueues);
|
|
40
|
+
this.resolverQueues = {};
|
|
41
|
+
resolverValues.forEach((resolverQueue) => {
|
|
42
|
+
var _a;
|
|
43
|
+
if (resolverQueue.length === 0) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const queries = resolverQueue.reduce((output, resolver) => {
|
|
47
|
+
var _a;
|
|
48
|
+
var _b;
|
|
49
|
+
const query = resolver.query;
|
|
50
|
+
const queryHash = getQueryHash_1.getQueryHash(query);
|
|
51
|
+
(_a = output[_b = query.name]) !== null && _a !== void 0 ? _a : (output[_b] = {});
|
|
52
|
+
const dict = output[query.name];
|
|
53
|
+
dict[queryHash] = query.body;
|
|
54
|
+
return output;
|
|
55
|
+
}, {});
|
|
56
|
+
const headers = new Headers({
|
|
57
|
+
"Content-type": "application/json",
|
|
58
|
+
});
|
|
59
|
+
if (this.apiKey) {
|
|
60
|
+
headers.append("Authorization", `Bearer ${this.apiKey}`);
|
|
61
|
+
}
|
|
62
|
+
const endpointUrl = `${this.apiHost}${(_a = this.apiPath) !== null && _a !== void 0 ? _a : "/queries"}`;
|
|
63
|
+
const request = new Request(endpointUrl, {
|
|
64
|
+
body: JSON.stringify({ queries }),
|
|
65
|
+
method: "POST",
|
|
66
|
+
headers,
|
|
67
|
+
});
|
|
68
|
+
fetch(request)
|
|
69
|
+
.then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
if (response.ok) {
|
|
71
|
+
const json = yield response.json();
|
|
72
|
+
resolverQueue.forEach((resolver) => {
|
|
73
|
+
resolver.resolve(json);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
const body = yield response.text();
|
|
78
|
+
resolverQueue.forEach((resolver) => {
|
|
79
|
+
resolver.reject(new QueryError_1.QueryHttpError(resolver.query, response.status, body));
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}))
|
|
83
|
+
.catch((error) => {
|
|
84
|
+
resolverQueue.forEach((resolver) => {
|
|
85
|
+
resolver.reject(new QueryError_1.QueryFetchError(resolver.query, error.message));
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
let defaultQueryResolver = new QueryResolver();
|
|
92
|
+
const _getDefaultQueryResolver = () => defaultQueryResolver;
|
|
93
|
+
exports._getDefaultQueryResolver = _getDefaultQueryResolver;
|
|
94
|
+
const _setDefaultQueryResolver = (queryResolver) => {
|
|
95
|
+
defaultQueryResolver = queryResolver;
|
|
96
|
+
};
|
|
97
|
+
exports._setDefaultQueryResolver = _setDefaultQueryResolver;
|
|
98
|
+
exports.default = QueryResolver;
|
|
99
99
|
//# sourceMappingURL=QueryResolver.js.map
|
package/dist/api/WrappedQuery.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=WrappedQuery.js.map
|
package/dist/api/fast1a64utf.js
CHANGED
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const hl = [];
|
|
4
|
-
for (let i = 0; i < 256; i++) {
|
|
5
|
-
hl[i] = ((i >> 4) & 15).toString(16) + (i & 15).toString(16);
|
|
6
|
-
}
|
|
7
|
-
function fast1a64utf(str) {
|
|
8
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9
|
-
const l = str.length;
|
|
10
|
-
let c;
|
|
11
|
-
let i;
|
|
12
|
-
let t0 = 0;
|
|
13
|
-
let v0 = 0x2325;
|
|
14
|
-
let t1 = 0;
|
|
15
|
-
let v1 = 0x8422;
|
|
16
|
-
let t2 = 0;
|
|
17
|
-
let v2 = 0x9ce4;
|
|
18
|
-
let t3 = 0;
|
|
19
|
-
let v3 = 0xcbf2;
|
|
20
|
-
for (i = 0; i < l; i++) {
|
|
21
|
-
c = str.charCodeAt(i);
|
|
22
|
-
if (c < 128) {
|
|
23
|
-
v0 ^= c;
|
|
24
|
-
}
|
|
25
|
-
else if (c < 2048) {
|
|
26
|
-
v0 ^= (c >> 6) | 192;
|
|
27
|
-
t0 = v0 * 435;
|
|
28
|
-
t1 = v1 * 435;
|
|
29
|
-
t2 = v2 * 435;
|
|
30
|
-
t3 = v3 * 435;
|
|
31
|
-
t2 += v0 << 8;
|
|
32
|
-
t3 += v1 << 8;
|
|
33
|
-
t1 += t0 >>> 16;
|
|
34
|
-
v0 = t0 & 65535;
|
|
35
|
-
t2 += t1 >>> 16;
|
|
36
|
-
v1 = t1 & 65535;
|
|
37
|
-
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
38
|
-
v2 = t2 & 65535;
|
|
39
|
-
v0 ^= (c & 63) | 128;
|
|
40
|
-
}
|
|
41
|
-
else if ((c & 64512) === 55296 && i + 1 < l && (str.charCodeAt(i + 1) & 64512) === 56320) {
|
|
42
|
-
c = 65536 + ((c & 1023) << 10) + (str.charCodeAt(++i) & 1023);
|
|
43
|
-
v0 ^= (c >> 18) | 240;
|
|
44
|
-
t0 = v0 * 435;
|
|
45
|
-
t1 = v1 * 435;
|
|
46
|
-
t2 = v2 * 435;
|
|
47
|
-
t3 = v3 * 435;
|
|
48
|
-
t2 += v0 << 8;
|
|
49
|
-
t3 += v1 << 8;
|
|
50
|
-
t1 += t0 >>> 16;
|
|
51
|
-
v0 = t0 & 65535;
|
|
52
|
-
t2 += t1 >>> 16;
|
|
53
|
-
v1 = t1 & 65535;
|
|
54
|
-
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
55
|
-
v2 = t2 & 65535;
|
|
56
|
-
v0 ^= ((c >> 12) & 63) | 128;
|
|
57
|
-
t0 = v0 * 435;
|
|
58
|
-
t1 = v1 * 435;
|
|
59
|
-
t2 = v2 * 435;
|
|
60
|
-
t3 = v3 * 435;
|
|
61
|
-
t2 += v0 << 8;
|
|
62
|
-
t3 += v1 << 8;
|
|
63
|
-
t1 += t0 >>> 16;
|
|
64
|
-
v0 = t0 & 65535;
|
|
65
|
-
t2 += t1 >>> 16;
|
|
66
|
-
v1 = t1 & 65535;
|
|
67
|
-
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
68
|
-
v2 = t2 & 65535;
|
|
69
|
-
v0 ^= ((c >> 6) & 63) | 128;
|
|
70
|
-
t0 = v0 * 435;
|
|
71
|
-
t1 = v1 * 435;
|
|
72
|
-
t2 = v2 * 435;
|
|
73
|
-
t3 = v3 * 435;
|
|
74
|
-
t2 += v0 << 8;
|
|
75
|
-
t3 += v1 << 8;
|
|
76
|
-
t1 += t0 >>> 16;
|
|
77
|
-
v0 = t0 & 65535;
|
|
78
|
-
t2 += t1 >>> 16;
|
|
79
|
-
v1 = t1 & 65535;
|
|
80
|
-
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
81
|
-
v2 = t2 & 65535;
|
|
82
|
-
v0 ^= (c & 63) | 128;
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
v0 ^= (c >> 12) | 224;
|
|
86
|
-
t0 = v0 * 435;
|
|
87
|
-
t1 = v1 * 435;
|
|
88
|
-
t2 = v2 * 435;
|
|
89
|
-
t3 = v3 * 435;
|
|
90
|
-
t2 += v0 << 8;
|
|
91
|
-
t3 += v1 << 8;
|
|
92
|
-
t1 += t0 >>> 16;
|
|
93
|
-
v0 = t0 & 65535;
|
|
94
|
-
t2 += t1 >>> 16;
|
|
95
|
-
v1 = t1 & 65535;
|
|
96
|
-
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
97
|
-
v2 = t2 & 65535;
|
|
98
|
-
v0 ^= ((c >> 6) & 63) | 128;
|
|
99
|
-
t0 = v0 * 435;
|
|
100
|
-
t1 = v1 * 435;
|
|
101
|
-
t2 = v2 * 435;
|
|
102
|
-
t3 = v3 * 435;
|
|
103
|
-
t2 += v0 << 8;
|
|
104
|
-
t3 += v1 << 8;
|
|
105
|
-
t1 += t0 >>> 16;
|
|
106
|
-
v0 = t0 & 65535;
|
|
107
|
-
t2 += t1 >>> 16;
|
|
108
|
-
v1 = t1 & 65535;
|
|
109
|
-
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
110
|
-
v2 = t2 & 65535;
|
|
111
|
-
v0 ^= (c & 63) | 128;
|
|
112
|
-
}
|
|
113
|
-
t0 = v0 * 435;
|
|
114
|
-
t1 = v1 * 435;
|
|
115
|
-
t2 = v2 * 435;
|
|
116
|
-
t3 = v3 * 435;
|
|
117
|
-
t2 += v0 << 8;
|
|
118
|
-
t3 += v1 << 8;
|
|
119
|
-
t1 += t0 >>> 16;
|
|
120
|
-
v0 = t0 & 65535;
|
|
121
|
-
t2 += t1 >>> 16;
|
|
122
|
-
v1 = t1 & 65535;
|
|
123
|
-
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
124
|
-
v2 = t2 & 65535;
|
|
125
|
-
}
|
|
126
|
-
return (((_a = hl[v3 >> 8]) !== null && _a !== void 0 ? _a : "") +
|
|
127
|
-
((_b = hl[v3 & 255]) !== null && _b !== void 0 ? _b : "") +
|
|
128
|
-
((_c = hl[v2 >> 8]) !== null && _c !== void 0 ? _c : "") +
|
|
129
|
-
((_d = hl[v2 & 255]) !== null && _d !== void 0 ? _d : "") +
|
|
130
|
-
((_e = hl[v1 >> 8]) !== null && _e !== void 0 ? _e : "") +
|
|
131
|
-
((_f = hl[v1 & 255]) !== null && _f !== void 0 ? _f : "") +
|
|
132
|
-
((_g = hl[v0 >> 8]) !== null && _g !== void 0 ? _g : "") +
|
|
133
|
-
((_h = hl[v0 & 255]) !== null && _h !== void 0 ? _h : ""));
|
|
134
|
-
}
|
|
135
|
-
exports.default = fast1a64utf;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const hl = [];
|
|
4
|
+
for (let i = 0; i < 256; i++) {
|
|
5
|
+
hl[i] = ((i >> 4) & 15).toString(16) + (i & 15).toString(16);
|
|
6
|
+
}
|
|
7
|
+
function fast1a64utf(str) {
|
|
8
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
9
|
+
const l = str.length;
|
|
10
|
+
let c;
|
|
11
|
+
let i;
|
|
12
|
+
let t0 = 0;
|
|
13
|
+
let v0 = 0x2325;
|
|
14
|
+
let t1 = 0;
|
|
15
|
+
let v1 = 0x8422;
|
|
16
|
+
let t2 = 0;
|
|
17
|
+
let v2 = 0x9ce4;
|
|
18
|
+
let t3 = 0;
|
|
19
|
+
let v3 = 0xcbf2;
|
|
20
|
+
for (i = 0; i < l; i++) {
|
|
21
|
+
c = str.charCodeAt(i);
|
|
22
|
+
if (c < 128) {
|
|
23
|
+
v0 ^= c;
|
|
24
|
+
}
|
|
25
|
+
else if (c < 2048) {
|
|
26
|
+
v0 ^= (c >> 6) | 192;
|
|
27
|
+
t0 = v0 * 435;
|
|
28
|
+
t1 = v1 * 435;
|
|
29
|
+
t2 = v2 * 435;
|
|
30
|
+
t3 = v3 * 435;
|
|
31
|
+
t2 += v0 << 8;
|
|
32
|
+
t3 += v1 << 8;
|
|
33
|
+
t1 += t0 >>> 16;
|
|
34
|
+
v0 = t0 & 65535;
|
|
35
|
+
t2 += t1 >>> 16;
|
|
36
|
+
v1 = t1 & 65535;
|
|
37
|
+
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
38
|
+
v2 = t2 & 65535;
|
|
39
|
+
v0 ^= (c & 63) | 128;
|
|
40
|
+
}
|
|
41
|
+
else if ((c & 64512) === 55296 && i + 1 < l && (str.charCodeAt(i + 1) & 64512) === 56320) {
|
|
42
|
+
c = 65536 + ((c & 1023) << 10) + (str.charCodeAt(++i) & 1023);
|
|
43
|
+
v0 ^= (c >> 18) | 240;
|
|
44
|
+
t0 = v0 * 435;
|
|
45
|
+
t1 = v1 * 435;
|
|
46
|
+
t2 = v2 * 435;
|
|
47
|
+
t3 = v3 * 435;
|
|
48
|
+
t2 += v0 << 8;
|
|
49
|
+
t3 += v1 << 8;
|
|
50
|
+
t1 += t0 >>> 16;
|
|
51
|
+
v0 = t0 & 65535;
|
|
52
|
+
t2 += t1 >>> 16;
|
|
53
|
+
v1 = t1 & 65535;
|
|
54
|
+
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
55
|
+
v2 = t2 & 65535;
|
|
56
|
+
v0 ^= ((c >> 12) & 63) | 128;
|
|
57
|
+
t0 = v0 * 435;
|
|
58
|
+
t1 = v1 * 435;
|
|
59
|
+
t2 = v2 * 435;
|
|
60
|
+
t3 = v3 * 435;
|
|
61
|
+
t2 += v0 << 8;
|
|
62
|
+
t3 += v1 << 8;
|
|
63
|
+
t1 += t0 >>> 16;
|
|
64
|
+
v0 = t0 & 65535;
|
|
65
|
+
t2 += t1 >>> 16;
|
|
66
|
+
v1 = t1 & 65535;
|
|
67
|
+
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
68
|
+
v2 = t2 & 65535;
|
|
69
|
+
v0 ^= ((c >> 6) & 63) | 128;
|
|
70
|
+
t0 = v0 * 435;
|
|
71
|
+
t1 = v1 * 435;
|
|
72
|
+
t2 = v2 * 435;
|
|
73
|
+
t3 = v3 * 435;
|
|
74
|
+
t2 += v0 << 8;
|
|
75
|
+
t3 += v1 << 8;
|
|
76
|
+
t1 += t0 >>> 16;
|
|
77
|
+
v0 = t0 & 65535;
|
|
78
|
+
t2 += t1 >>> 16;
|
|
79
|
+
v1 = t1 & 65535;
|
|
80
|
+
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
81
|
+
v2 = t2 & 65535;
|
|
82
|
+
v0 ^= (c & 63) | 128;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
v0 ^= (c >> 12) | 224;
|
|
86
|
+
t0 = v0 * 435;
|
|
87
|
+
t1 = v1 * 435;
|
|
88
|
+
t2 = v2 * 435;
|
|
89
|
+
t3 = v3 * 435;
|
|
90
|
+
t2 += v0 << 8;
|
|
91
|
+
t3 += v1 << 8;
|
|
92
|
+
t1 += t0 >>> 16;
|
|
93
|
+
v0 = t0 & 65535;
|
|
94
|
+
t2 += t1 >>> 16;
|
|
95
|
+
v1 = t1 & 65535;
|
|
96
|
+
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
97
|
+
v2 = t2 & 65535;
|
|
98
|
+
v0 ^= ((c >> 6) & 63) | 128;
|
|
99
|
+
t0 = v0 * 435;
|
|
100
|
+
t1 = v1 * 435;
|
|
101
|
+
t2 = v2 * 435;
|
|
102
|
+
t3 = v3 * 435;
|
|
103
|
+
t2 += v0 << 8;
|
|
104
|
+
t3 += v1 << 8;
|
|
105
|
+
t1 += t0 >>> 16;
|
|
106
|
+
v0 = t0 & 65535;
|
|
107
|
+
t2 += t1 >>> 16;
|
|
108
|
+
v1 = t1 & 65535;
|
|
109
|
+
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
110
|
+
v2 = t2 & 65535;
|
|
111
|
+
v0 ^= (c & 63) | 128;
|
|
112
|
+
}
|
|
113
|
+
t0 = v0 * 435;
|
|
114
|
+
t1 = v1 * 435;
|
|
115
|
+
t2 = v2 * 435;
|
|
116
|
+
t3 = v3 * 435;
|
|
117
|
+
t2 += v0 << 8;
|
|
118
|
+
t3 += v1 << 8;
|
|
119
|
+
t1 += t0 >>> 16;
|
|
120
|
+
v0 = t0 & 65535;
|
|
121
|
+
t2 += t1 >>> 16;
|
|
122
|
+
v1 = t1 & 65535;
|
|
123
|
+
v3 = (t3 + (t2 >>> 16)) & 65535;
|
|
124
|
+
v2 = t2 & 65535;
|
|
125
|
+
}
|
|
126
|
+
return (((_a = hl[v3 >> 8]) !== null && _a !== void 0 ? _a : "") +
|
|
127
|
+
((_b = hl[v3 & 255]) !== null && _b !== void 0 ? _b : "") +
|
|
128
|
+
((_c = hl[v2 >> 8]) !== null && _c !== void 0 ? _c : "") +
|
|
129
|
+
((_d = hl[v2 & 255]) !== null && _d !== void 0 ? _d : "") +
|
|
130
|
+
((_e = hl[v1 >> 8]) !== null && _e !== void 0 ? _e : "") +
|
|
131
|
+
((_f = hl[v1 & 255]) !== null && _f !== void 0 ? _f : "") +
|
|
132
|
+
((_g = hl[v0 >> 8]) !== null && _g !== void 0 ? _g : "") +
|
|
133
|
+
((_h = hl[v0 & 255]) !== null && _h !== void 0 ? _h : ""));
|
|
134
|
+
}
|
|
135
|
+
exports.default = fast1a64utf;
|
|
136
136
|
//# sourceMappingURL=fast1a64utf.js.map
|