canopycms-cdk 0.8.0 → 0.8.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/package.json +4 -4
- package/worker/dist/index.js +75 -30
- package/worker/dist/index.js.sha256 +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "canopycms-cdk",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "AWS CDK constructs and EC2 worker for CanopyCMS deployment",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"aws-cdk-lib": "^2.260.0",
|
|
36
36
|
"constructs": "^10.0.0",
|
|
37
|
-
"canopycms": "0.8.
|
|
37
|
+
"canopycms": "0.8.1"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
40
40
|
"aws-cdk-lib": {
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"tsx": "^4.19.0",
|
|
61
61
|
"typescript": "^5.6.3",
|
|
62
62
|
"vitest": "^4.1.0",
|
|
63
|
-
"canopycms": "0.8.
|
|
64
|
-
"canopycms-auth-clerk": "0.8.
|
|
63
|
+
"canopycms": "0.8.1",
|
|
64
|
+
"canopycms-auth-clerk": "0.8.1"
|
|
65
65
|
},
|
|
66
66
|
"scripts": {
|
|
67
67
|
"build": "rm -rf dist && tsc && node ../../scripts/add-js-extensions.mjs dist",
|
package/worker/dist/index.js
CHANGED
|
@@ -69368,7 +69368,7 @@ var require_truncate = __commonJS({
|
|
|
69368
69368
|
var require_lrucache = __commonJS({
|
|
69369
69369
|
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
69370
69370
|
"use strict";
|
|
69371
|
-
var
|
|
69371
|
+
var LRUCache2 = class {
|
|
69372
69372
|
constructor() {
|
|
69373
69373
|
this.max = 1e3;
|
|
69374
69374
|
this.map = /* @__PURE__ */ new Map();
|
|
@@ -69398,7 +69398,7 @@ var require_lrucache = __commonJS({
|
|
|
69398
69398
|
return this;
|
|
69399
69399
|
}
|
|
69400
69400
|
};
|
|
69401
|
-
module.exports =
|
|
69401
|
+
module.exports = LRUCache2;
|
|
69402
69402
|
}
|
|
69403
69403
|
});
|
|
69404
69404
|
|
|
@@ -71474,16 +71474,16 @@ var require_commonjs = __commonJS({
|
|
|
71474
71474
|
"use strict";
|
|
71475
71475
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
71476
71476
|
exports.LRUCache = void 0;
|
|
71477
|
-
var
|
|
71477
|
+
var perf2 = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
71478
71478
|
var warned3 = /* @__PURE__ */ new Set();
|
|
71479
|
-
var
|
|
71480
|
-
var
|
|
71481
|
-
typeof
|
|
71482
|
-
};
|
|
71483
|
-
var
|
|
71484
|
-
var
|
|
71485
|
-
if (typeof
|
|
71486
|
-
|
|
71479
|
+
var PROCESS2 = typeof process === "object" && !!process ? process : {};
|
|
71480
|
+
var emitWarning2 = (msg, type, code, fn) => {
|
|
71481
|
+
typeof PROCESS2.emitWarning === "function" ? PROCESS2.emitWarning(msg, type, code, fn) : console.error(`[${code}] ${type}: ${msg}`);
|
|
71482
|
+
};
|
|
71483
|
+
var AC2 = globalThis.AbortController;
|
|
71484
|
+
var AS2 = globalThis.AbortSignal;
|
|
71485
|
+
if (typeof AC2 === "undefined") {
|
|
71486
|
+
AS2 = class AbortSignal {
|
|
71487
71487
|
onabort;
|
|
71488
71488
|
_onabort = [];
|
|
71489
71489
|
reason;
|
|
@@ -71492,11 +71492,11 @@ var require_commonjs = __commonJS({
|
|
|
71492
71492
|
this._onabort.push(fn);
|
|
71493
71493
|
}
|
|
71494
71494
|
};
|
|
71495
|
-
|
|
71495
|
+
AC2 = class AbortController {
|
|
71496
71496
|
constructor() {
|
|
71497
71497
|
warnACPolyfill();
|
|
71498
71498
|
}
|
|
71499
|
-
signal = new
|
|
71499
|
+
signal = new AS2();
|
|
71500
71500
|
abort(reason) {
|
|
71501
71501
|
if (this.signal.aborted)
|
|
71502
71502
|
return;
|
|
@@ -71508,16 +71508,16 @@ var require_commonjs = __commonJS({
|
|
|
71508
71508
|
this.signal.onabort?.(reason);
|
|
71509
71509
|
}
|
|
71510
71510
|
};
|
|
71511
|
-
let printACPolyfillWarning =
|
|
71511
|
+
let printACPolyfillWarning = PROCESS2.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
|
71512
71512
|
const warnACPolyfill = () => {
|
|
71513
71513
|
if (!printACPolyfillWarning)
|
|
71514
71514
|
return;
|
|
71515
71515
|
printACPolyfillWarning = false;
|
|
71516
|
-
|
|
71516
|
+
emitWarning2("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill);
|
|
71517
71517
|
};
|
|
71518
71518
|
}
|
|
71519
71519
|
var shouldWarn = (code) => !warned3.has(code);
|
|
71520
|
-
var
|
|
71520
|
+
var TYPE2 = Symbol("type");
|
|
71521
71521
|
var isPosInt = (n7) => n7 && n7 === Math.floor(n7) && n7 > 0 && isFinite(n7);
|
|
71522
71522
|
var getUintArray = (max) => !isPosInt(max) ? null : max <= Math.pow(2, 8) ? Uint8Array : max <= Math.pow(2, 16) ? Uint16Array : max <= Math.pow(2, 32) ? Uint32Array : max <= Number.MAX_SAFE_INTEGER ? ZeroArray : null;
|
|
71523
71523
|
var ZeroArray = class extends Array {
|
|
@@ -71554,7 +71554,7 @@ var require_commonjs = __commonJS({
|
|
|
71554
71554
|
return this.heap[--this.length];
|
|
71555
71555
|
}
|
|
71556
71556
|
};
|
|
71557
|
-
var
|
|
71557
|
+
var LRUCache2 = class _LRUCache {
|
|
71558
71558
|
// options that cannot be changed without disaster
|
|
71559
71559
|
#max;
|
|
71560
71560
|
#maxSize;
|
|
@@ -71812,7 +71812,7 @@ var require_commonjs = __commonJS({
|
|
|
71812
71812
|
if (shouldWarn(code)) {
|
|
71813
71813
|
warned3.add(code);
|
|
71814
71814
|
const msg = "TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.";
|
|
71815
|
-
|
|
71815
|
+
emitWarning2(msg, "UnboundedCacheWarning", code, _LRUCache);
|
|
71816
71816
|
}
|
|
71817
71817
|
}
|
|
71818
71818
|
}
|
|
@@ -71828,7 +71828,7 @@ var require_commonjs = __commonJS({
|
|
|
71828
71828
|
const starts = new ZeroArray(this.#max);
|
|
71829
71829
|
this.#ttls = ttls;
|
|
71830
71830
|
this.#starts = starts;
|
|
71831
|
-
this.#setItemTTL = (index, ttl, start =
|
|
71831
|
+
this.#setItemTTL = (index, ttl, start = perf2.now()) => {
|
|
71832
71832
|
starts[index] = ttl !== 0 ? start : 0;
|
|
71833
71833
|
ttls[index] = ttl;
|
|
71834
71834
|
if (ttl !== 0 && this.ttlAutopurge) {
|
|
@@ -71843,7 +71843,7 @@ var require_commonjs = __commonJS({
|
|
|
71843
71843
|
}
|
|
71844
71844
|
};
|
|
71845
71845
|
this.#updateItemAge = (index) => {
|
|
71846
|
-
starts[index] = ttls[index] !== 0 ?
|
|
71846
|
+
starts[index] = ttls[index] !== 0 ? perf2.now() : 0;
|
|
71847
71847
|
};
|
|
71848
71848
|
this.#statusTTL = (status, index) => {
|
|
71849
71849
|
if (ttls[index]) {
|
|
@@ -71860,7 +71860,7 @@ var require_commonjs = __commonJS({
|
|
|
71860
71860
|
};
|
|
71861
71861
|
let cachedNow = 0;
|
|
71862
71862
|
const getNow = () => {
|
|
71863
|
-
const n7 =
|
|
71863
|
+
const n7 = perf2.now();
|
|
71864
71864
|
if (this.ttlResolution > 0) {
|
|
71865
71865
|
cachedNow = n7;
|
|
71866
71866
|
const t6 = setTimeout(() => cachedNow = 0, this.ttlResolution);
|
|
@@ -72163,7 +72163,7 @@ var require_commonjs = __commonJS({
|
|
|
72163
72163
|
const ttl = this.#ttls[i10];
|
|
72164
72164
|
const start = this.#starts[i10];
|
|
72165
72165
|
if (ttl && start) {
|
|
72166
|
-
const remain = ttl - (
|
|
72166
|
+
const remain = ttl - (perf2.now() - start);
|
|
72167
72167
|
entry.ttl = remain;
|
|
72168
72168
|
entry.start = Date.now();
|
|
72169
72169
|
}
|
|
@@ -72197,7 +72197,7 @@ var require_commonjs = __commonJS({
|
|
|
72197
72197
|
const entry = { value };
|
|
72198
72198
|
if (this.#ttls && this.#starts) {
|
|
72199
72199
|
entry.ttl = this.#ttls[i10];
|
|
72200
|
-
const age =
|
|
72200
|
+
const age = perf2.now() - this.#starts[i10];
|
|
72201
72201
|
entry.start = Math.floor(Date.now() - age);
|
|
72202
72202
|
}
|
|
72203
72203
|
if (this.#sizes) {
|
|
@@ -72221,7 +72221,7 @@ var require_commonjs = __commonJS({
|
|
|
72221
72221
|
for (const [key, entry] of arr) {
|
|
72222
72222
|
if (entry.start) {
|
|
72223
72223
|
const age = Date.now() - entry.start;
|
|
72224
|
-
entry.start =
|
|
72224
|
+
entry.start = perf2.now() - age;
|
|
72225
72225
|
}
|
|
72226
72226
|
this.set(key, entry.value, entry);
|
|
72227
72227
|
}
|
|
@@ -72461,7 +72461,7 @@ var require_commonjs = __commonJS({
|
|
|
72461
72461
|
if (this.#isBackgroundFetch(v5)) {
|
|
72462
72462
|
return v5;
|
|
72463
72463
|
}
|
|
72464
|
-
const ac = new
|
|
72464
|
+
const ac = new AC2();
|
|
72465
72465
|
const { signal } = options;
|
|
72466
72466
|
signal?.addEventListener("abort", () => ac.abort(signal.reason), {
|
|
72467
72467
|
signal: ac.signal
|
|
@@ -72567,7 +72567,7 @@ var require_commonjs = __commonJS({
|
|
|
72567
72567
|
if (!this.#hasFetchMethod)
|
|
72568
72568
|
return false;
|
|
72569
72569
|
const b10 = p8;
|
|
72570
|
-
return !!b10 && b10 instanceof Promise && b10.hasOwnProperty("__staleWhileFetching") && b10.__abortController instanceof
|
|
72570
|
+
return !!b10 && b10 instanceof Promise && b10.hasOwnProperty("__staleWhileFetching") && b10.__abortController instanceof AC2;
|
|
72571
72571
|
}
|
|
72572
72572
|
async fetch(k10, fetchOptions = {}) {
|
|
72573
72573
|
const {
|
|
@@ -72841,7 +72841,7 @@ var require_commonjs = __commonJS({
|
|
|
72841
72841
|
}
|
|
72842
72842
|
}
|
|
72843
72843
|
};
|
|
72844
|
-
exports.LRUCache =
|
|
72844
|
+
exports.LRUCache = LRUCache2;
|
|
72845
72845
|
}
|
|
72846
72846
|
});
|
|
72847
72847
|
|
|
@@ -72915,9 +72915,9 @@ var require_dist_node20 = __commonJS({
|
|
|
72915
72915
|
}
|
|
72916
72916
|
}
|
|
72917
72917
|
}
|
|
72918
|
-
var
|
|
72918
|
+
var import_lru_cache2 = require_commonjs();
|
|
72919
72919
|
function getCache() {
|
|
72920
|
-
return new
|
|
72920
|
+
return new import_lru_cache2.LRUCache({
|
|
72921
72921
|
// cache max. 15000 tokens, that will use less than 10mb memory
|
|
72922
72922
|
max: 15e3,
|
|
72923
72923
|
// Cache for 1 minute less than GitHub expiry
|
|
@@ -78938,6 +78938,50 @@ function isGenerationCurrent(snapshotToken, read) {
|
|
|
78938
78938
|
return read.ok && read.token === snapshotToken;
|
|
78939
78939
|
}
|
|
78940
78940
|
|
|
78941
|
+
// ../../node_modules/.pnpm/lru-cache@10.4.3/node_modules/lru-cache/dist/esm/index.js
|
|
78942
|
+
var perf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
|
|
78943
|
+
var PROCESS = typeof process === "object" && !!process ? process : {};
|
|
78944
|
+
var emitWarning = (msg, type, code, fn) => {
|
|
78945
|
+
typeof PROCESS.emitWarning === "function" ? PROCESS.emitWarning(msg, type, code, fn) : console.error(`[${code}] ${type}: ${msg}`);
|
|
78946
|
+
};
|
|
78947
|
+
var AC = globalThis.AbortController;
|
|
78948
|
+
var AS = globalThis.AbortSignal;
|
|
78949
|
+
if (typeof AC === "undefined") {
|
|
78950
|
+
AS = class AbortSignal {
|
|
78951
|
+
onabort;
|
|
78952
|
+
_onabort = [];
|
|
78953
|
+
reason;
|
|
78954
|
+
aborted = false;
|
|
78955
|
+
addEventListener(_3, fn) {
|
|
78956
|
+
this._onabort.push(fn);
|
|
78957
|
+
}
|
|
78958
|
+
};
|
|
78959
|
+
AC = class AbortController {
|
|
78960
|
+
constructor() {
|
|
78961
|
+
warnACPolyfill();
|
|
78962
|
+
}
|
|
78963
|
+
signal = new AS();
|
|
78964
|
+
abort(reason) {
|
|
78965
|
+
if (this.signal.aborted)
|
|
78966
|
+
return;
|
|
78967
|
+
this.signal.reason = reason;
|
|
78968
|
+
this.signal.aborted = true;
|
|
78969
|
+
for (const fn of this.signal._onabort) {
|
|
78970
|
+
fn(reason);
|
|
78971
|
+
}
|
|
78972
|
+
this.signal.onabort?.(reason);
|
|
78973
|
+
}
|
|
78974
|
+
};
|
|
78975
|
+
let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
|
78976
|
+
const warnACPolyfill = () => {
|
|
78977
|
+
if (!printACPolyfillWarning)
|
|
78978
|
+
return;
|
|
78979
|
+
printACPolyfillWarning = false;
|
|
78980
|
+
emitWarning("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.", "NO_ABORT_CONTROLLER", "ENOTSUP", warnACPolyfill);
|
|
78981
|
+
};
|
|
78982
|
+
}
|
|
78983
|
+
var TYPE = Symbol("type");
|
|
78984
|
+
|
|
78941
78985
|
// ../canopycms/src/id.ts
|
|
78942
78986
|
var import_short_uuid = __toESM(require_dist3(), 1);
|
|
78943
78987
|
init_validation();
|
|
@@ -79060,6 +79104,7 @@ async function readHeadBranch(gitDir, git = simpleGit()) {
|
|
|
79060
79104
|
}
|
|
79061
79105
|
|
|
79062
79106
|
// ../canopycms/src/branch-schema-cache.ts
|
|
79107
|
+
var SNAPSHOT_MEMO_MAX_BYTES = 64 * 1024 * 1024;
|
|
79063
79108
|
var SCHEMA_CACHE_FILE = "schema-cache.json";
|
|
79064
79109
|
var SCHEMA_GENERATION_RESOURCE = "schema";
|
|
79065
79110
|
|
|
@@ -83077,7 +83122,7 @@ init_error();
|
|
|
83077
83122
|
init_worker_status();
|
|
83078
83123
|
|
|
83079
83124
|
// ../canopycms/src/version.ts
|
|
83080
|
-
var CANOPYCMS_VERSION = "0.8.
|
|
83125
|
+
var CANOPYCMS_VERSION = "0.8.1";
|
|
83081
83126
|
|
|
83082
83127
|
// ../canopycms/src/worker/schema-gate.ts
|
|
83083
83128
|
import fs14 from "node:fs/promises";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5a8f40789e1cee198bf3380867f06e75b80f2e874f624d98776ae0a8bb6df59a index.js
|