@jam-comments/server-utilities 5.10.0 → 5.10.1
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/cjs/index.js +1 -4
- package/dist/cjs/markupFetcher.js +3 -6
- package/dist/cjs/store.js +2 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/markupFetcher.js +1 -1
- package/dist/esm/store.js +1 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/markupFetcher.d.ts +1 -1
- package/dist/types/store.d.ts +1 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.Store = exports.logError = exports.log = exports.removeFalseyValues = exports.fetchAll = exports.markupFetcher = void 0;
|
|
7
4
|
var markupFetcher_1 = require("./markupFetcher");
|
|
@@ -13,4 +10,4 @@ var log_1 = require("./log");
|
|
|
13
10
|
Object.defineProperty(exports, "log", { enumerable: true, get: function () { return log_1.log; } });
|
|
14
11
|
Object.defineProperty(exports, "logError", { enumerable: true, get: function () { return log_1.logError; } });
|
|
15
12
|
var store_1 = require("./store");
|
|
16
|
-
Object.defineProperty(exports, "Store", { enumerable: true, get: function () { return
|
|
13
|
+
Object.defineProperty(exports, "Store", { enumerable: true, get: function () { return store_1.Store; } });
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.fetchAll = fetchAll;
|
|
7
4
|
exports.batchMarkupFetcher = batchMarkupFetcher;
|
|
@@ -10,9 +7,9 @@ exports.makeMarkupRequest = makeMarkupRequest;
|
|
|
10
7
|
exports.markupFetcher = markupFetcher;
|
|
11
8
|
const injectSchema_1 = require("./injectSchema");
|
|
12
9
|
const utils_1 = require("./utils");
|
|
13
|
-
const store_1 =
|
|
10
|
+
const store_1 = require("./store");
|
|
14
11
|
const BASE_URL = "https://go.jamcomments.com";
|
|
15
|
-
async function fetchAll({ tz = undefined, dateFormat = undefined, domain, apiKey, baseUrl = BASE_URL, environment = (0, utils_1.getEnvironment)(), copy = {}, }, platform, fetchImplementation = fetch, batchMarkupFetcherImpl = batchMarkupFetcher, store = new store_1.
|
|
12
|
+
async function fetchAll({ tz = undefined, dateFormat = undefined, domain, apiKey, baseUrl = BASE_URL, environment = (0, utils_1.getEnvironment)(), copy = {}, }, platform, fetchImplementation = fetch, batchMarkupFetcherImpl = batchMarkupFetcher, store = new store_1.Store()) {
|
|
16
13
|
const fetchBatchMarkup = batchMarkupFetcherImpl(platform, fetchImplementation);
|
|
17
14
|
let shouldKeepFetching = true;
|
|
18
15
|
let page = 1;
|
|
@@ -100,7 +97,7 @@ async function makeMarkupRequest({ tz, path, page, domain, apiKey, dateFormat, c
|
|
|
100
97
|
}
|
|
101
98
|
return response;
|
|
102
99
|
}
|
|
103
|
-
function markupFetcher(platform, fetchImplementation = fetch, store = new store_1.
|
|
100
|
+
function markupFetcher(platform, fetchImplementation = fetch, store = new store_1.Store()) {
|
|
104
101
|
return async ({ tz = undefined, path, domain, apiKey, schema, dateFormat, baseUrl = BASE_URL, environment = (0, utils_1.getEnvironment)(), copy = {}, }) => {
|
|
105
102
|
path = path || "/";
|
|
106
103
|
const cachedMarkup = (() => {
|
package/dist/cjs/store.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Store = void 0;
|
|
3
4
|
class Store {
|
|
4
5
|
store;
|
|
5
6
|
constructor() {
|
|
@@ -23,4 +24,4 @@ class Store {
|
|
|
23
24
|
return this.store.get("EMPTY") || null;
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
exports.
|
|
27
|
+
exports.Store = Store;
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { injectSchema } from "./injectSchema";
|
|
2
2
|
import { getEnvironment, isValidTimezone, parseJson } from "./utils";
|
|
3
|
-
import Store from "./store";
|
|
3
|
+
import { Store } from "./store";
|
|
4
4
|
const BASE_URL = "https://go.jamcomments.com";
|
|
5
5
|
export async function fetchAll({ tz = undefined, dateFormat = undefined, domain, apiKey, baseUrl = BASE_URL, environment = getEnvironment(), copy = {}, }, platform, fetchImplementation = fetch, batchMarkupFetcherImpl = batchMarkupFetcher, store = new Store()) {
|
|
6
6
|
const fetchBatchMarkup = batchMarkupFetcherImpl(platform, fetchImplementation);
|
package/dist/esm/store.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export type { CustomCopy } from "./markupFetcher";
|
|
|
2
2
|
export { markupFetcher, fetchAll } from "./markupFetcher";
|
|
3
3
|
export { removeFalseyValues } from "./utils";
|
|
4
4
|
export { log, logError } from "./log";
|
|
5
|
-
export {
|
|
5
|
+
export { Store } from "./store";
|
package/dist/types/store.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare class Store {
|
|
1
|
+
export declare class Store {
|
|
2
2
|
store: Map<string, string>;
|
|
3
3
|
constructor();
|
|
4
4
|
set(path: string, markup: string): void;
|
|
@@ -7,4 +7,3 @@ declare class Store {
|
|
|
7
7
|
get hasData(): boolean;
|
|
8
8
|
get emptyMarkup(): string | null;
|
|
9
9
|
}
|
|
10
|
-
export default Store;
|