@fastly/compute-js-static-publish 6.2.0 → 7.0.0-beta.0
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/LICENSE +1 -1
- package/README.md +31 -575
- package/README.short.md +53 -0
- package/build/cli/commands/clean.d.ts +2 -0
- package/build/cli/commands/clean.d.ts.map +1 -0
- package/build/cli/commands/clean.js +121 -0
- package/build/cli/commands/collections/delete.d.ts +2 -0
- package/build/cli/commands/collections/delete.d.ts.map +1 -0
- package/build/cli/commands/collections/delete.js +88 -0
- package/build/cli/commands/collections/index.d.ts +2 -0
- package/build/cli/commands/collections/index.d.ts.map +1 -0
- package/build/cli/commands/collections/index.js +52 -0
- package/build/cli/commands/collections/list.d.ts +2 -0
- package/build/cli/commands/collections/list.d.ts.map +1 -0
- package/build/cli/commands/collections/list.js +62 -0
- package/build/cli/commands/index.d.ts +2 -0
- package/build/cli/commands/index.d.ts.map +1 -0
- package/build/cli/commands/index.js +67 -0
- package/build/cli/commands/init-app.d.ts +18 -2
- package/build/cli/commands/init-app.d.ts.map +1 -1
- package/build/cli/commands/init-app.js +291 -264
- package/build/cli/commands/publish-content.d.ts +2 -0
- package/build/cli/commands/publish-content.d.ts.map +1 -0
- package/build/cli/commands/publish-content.js +472 -0
- package/build/cli/compression/brotli.d.ts +1 -1
- package/build/cli/compression/brotli.d.ts.map +1 -1
- package/build/cli/compression/brotli.js +8 -11
- package/build/cli/compression/gzip.d.ts +1 -1
- package/build/cli/compression/gzip.d.ts.map +1 -1
- package/build/cli/compression/gzip.js +8 -11
- package/build/cli/compression/index.d.ts +3 -6
- package/build/cli/compression/index.d.ts.map +1 -1
- package/build/cli/compression/index.js +8 -9
- package/build/cli/fastly-api/api-token.d.ts +17 -0
- package/build/cli/fastly-api/api-token.d.ts.map +1 -0
- package/build/cli/fastly-api/api-token.js +94 -0
- package/build/cli/fastly-api/kv-store.d.ts +24 -0
- package/build/cli/fastly-api/kv-store.d.ts.map +1 -0
- package/build/cli/{util → fastly-api}/kv-store.js +42 -22
- package/build/cli/index.js +7 -91
- package/build/cli/util/args.d.ts +16 -0
- package/build/cli/util/args.d.ts.map +1 -0
- package/build/cli/util/args.js +55 -0
- package/build/cli/util/config.d.ts +13 -0
- package/build/cli/util/config.d.ts.map +1 -0
- package/build/cli/{load-config.js → util/config.js} +234 -187
- package/build/{util → cli/util}/content-types.d.ts +1 -2
- package/build/cli/util/content-types.d.ts.map +1 -0
- package/build/{util → cli/util}/content-types.js +38 -32
- package/build/cli/util/data.d.ts +3 -3
- package/build/cli/util/data.d.ts.map +1 -1
- package/build/cli/util/data.js +6 -2
- package/build/cli/util/files.d.ts +10 -2
- package/build/cli/util/files.d.ts.map +1 -1
- package/build/cli/util/files.js +53 -6
- package/build/cli/util/kv-store-items.d.ts +12 -0
- package/build/cli/util/kv-store-items.d.ts.map +1 -0
- package/build/cli/util/kv-store-items.js +161 -0
- package/build/cli/util/kv-store-local-server.d.ts +3 -0
- package/build/cli/util/kv-store-local-server.d.ts.map +1 -0
- package/build/cli/util/kv-store-local-server.js +35 -0
- package/build/cli/util/package.d.ts +9 -0
- package/build/cli/util/package.d.ts.map +1 -0
- package/build/cli/util/package.js +44 -0
- package/build/cli/util/retryable.d.ts +12 -0
- package/build/cli/util/retryable.d.ts.map +1 -0
- package/build/cli/util/retryable.js +43 -0
- package/build/cli/util/variants.d.ts +4 -0
- package/build/cli/util/variants.d.ts.map +1 -0
- package/build/cli/util/variants.js +27 -0
- package/build/index.d.ts +5 -5
- package/build/index.d.ts.map +1 -1
- package/build/index.js +7 -6
- package/build/models/assets/kvstore-assets.d.ts +17 -0
- package/build/models/assets/kvstore-assets.d.ts.map +1 -0
- package/build/models/assets/kvstore-assets.js +28 -0
- package/build/{constants/compression.d.ts → models/compression/index.d.ts} +2 -1
- package/build/models/compression/index.d.ts.map +1 -0
- package/build/models/compression/index.js +11 -0
- package/build/models/config/publish-content-config.d.ts +41 -0
- package/build/models/config/publish-content-config.d.ts.map +1 -0
- package/build/models/config/publish-content-config.js +5 -0
- package/build/models/config/publisher-server-config.d.ts +20 -0
- package/build/models/config/publisher-server-config.d.ts.map +1 -0
- package/build/models/config/publisher-server-config.js +5 -0
- package/build/models/config/static-publish-rc.d.ts +6 -0
- package/build/models/config/static-publish-rc.d.ts.map +1 -0
- package/build/models/config/static-publish-rc.js +5 -0
- package/build/server/collection-selector/from-config-store.d.ts +2 -0
- package/build/server/collection-selector/from-config-store.d.ts.map +1 -0
- package/build/server/collection-selector/from-config-store.js +15 -0
- package/build/server/collection-selector/from-cookie.d.ts +23 -0
- package/build/server/collection-selector/from-cookie.d.ts.map +1 -0
- package/build/server/collection-selector/from-cookie.js +98 -0
- package/build/server/collection-selector/from-request.d.ts +13 -0
- package/build/server/collection-selector/from-request.d.ts.map +1 -0
- package/build/server/collection-selector/from-request.js +22 -0
- package/build/server/collection-selector/index.d.ts +5 -0
- package/build/server/collection-selector/index.d.ts.map +1 -0
- package/build/server/collection-selector/index.js +7 -0
- package/build/server/collection-selector/request-collection-selector.d.ts +5 -0
- package/build/server/collection-selector/request-collection-selector.d.ts.map +1 -0
- package/build/server/collection-selector/request-collection-selector.js +5 -0
- package/build/server/publisher-server/index.d.ts +38 -0
- package/build/server/publisher-server/index.d.ts.map +1 -0
- package/build/server/publisher-server/index.js +415 -0
- package/build/server/publisher-server/serve-preconditions/if-modified-since.d.ts +3 -0
- package/build/server/publisher-server/serve-preconditions/if-modified-since.d.ts.map +1 -0
- package/build/server/{serve-preconditions → publisher-server/serve-preconditions}/if-modified-since.js +6 -2
- package/build/server/publisher-server/serve-preconditions/if-none-match.d.ts.map +1 -0
- package/build/server/{serve-preconditions → publisher-server/serve-preconditions}/if-none-match.js +4 -0
- package/build/server/util/cookies.d.ts +2 -0
- package/build/server/util/cookies.d.ts.map +1 -0
- package/build/server/util/cookies.js +14 -0
- package/build/server/util/kv-store.d.ts +3 -0
- package/build/server/util/kv-store.d.ts.map +1 -0
- package/build/server/util/kv-store.js +95 -0
- package/package.json +18 -10
- package/build/cli/commands/build-static.d.ts +0 -3
- package/build/cli/commands/build-static.d.ts.map +0 -1
- package/build/cli/commands/build-static.js +0 -541
- package/build/cli/commands/clean-kv-store.d.ts +0 -3
- package/build/cli/commands/clean-kv-store.d.ts.map +0 -1
- package/build/cli/commands/clean-kv-store.js +0 -55
- package/build/cli/load-config.d.ts +0 -6
- package/build/cli/load-config.d.ts.map +0 -1
- package/build/cli/presets/implementations/astro.d.ts +0 -7
- package/build/cli/presets/implementations/astro.d.ts.map +0 -1
- package/build/cli/presets/implementations/astro.js +0 -23
- package/build/cli/presets/implementations/create-react-app.d.ts +0 -11
- package/build/cli/presets/implementations/create-react-app.d.ts.map +0 -1
- package/build/cli/presets/implementations/create-react-app.js +0 -34
- package/build/cli/presets/implementations/docusaurus.d.ts +0 -7
- package/build/cli/presets/implementations/docusaurus.d.ts.map +0 -1
- package/build/cli/presets/implementations/docusaurus.js +0 -13
- package/build/cli/presets/implementations/gatsby.d.ts +0 -7
- package/build/cli/presets/implementations/gatsby.d.ts.map +0 -1
- package/build/cli/presets/implementations/gatsby.js +0 -13
- package/build/cli/presets/implementations/next.d.ts +0 -7
- package/build/cli/presets/implementations/next.d.ts.map +0 -1
- package/build/cli/presets/implementations/next.js +0 -13
- package/build/cli/presets/implementations/sveltekit.d.ts +0 -7
- package/build/cli/presets/implementations/sveltekit.d.ts.map +0 -1
- package/build/cli/presets/implementations/sveltekit.js +0 -13
- package/build/cli/presets/implementations/vite.d.ts +0 -7
- package/build/cli/presets/implementations/vite.d.ts.map +0 -1
- package/build/cli/presets/implementations/vite.js +0 -13
- package/build/cli/presets/implementations/vue.d.ts +0 -7
- package/build/cli/presets/implementations/vue.d.ts.map +0 -1
- package/build/cli/presets/implementations/vue.js +0 -24
- package/build/cli/presets/index.d.ts +0 -3
- package/build/cli/presets/index.d.ts.map +0 -1
- package/build/cli/presets/index.js +0 -20
- package/build/cli/presets/preset-base.d.ts +0 -21
- package/build/cli/presets/preset-base.d.ts.map +0 -1
- package/build/cli/presets/preset-base.js +0 -1
- package/build/cli/util/fastly-api.d.ts +0 -10
- package/build/cli/util/fastly-api.d.ts.map +0 -1
- package/build/cli/util/fastly-api.js +0 -47
- package/build/cli/util/hash.d.ts +0 -5
- package/build/cli/util/hash.d.ts.map +0 -1
- package/build/cli/util/hash.js +0 -9
- package/build/cli/util/id.d.ts +0 -3
- package/build/cli/util/id.d.ts.map +0 -1
- package/build/cli/util/id.js +0 -17
- package/build/cli/util/kv-store.d.ts +0 -16
- package/build/cli/util/kv-store.d.ts.map +0 -1
- package/build/cli/util/publish-id.d.ts +0 -5
- package/build/cli/util/publish-id.d.ts.map +0 -1
- package/build/cli/util/publish-id.js +0 -26
- package/build/compute-js.d.ts +0 -3
- package/build/compute-js.d.ts.map +0 -1
- package/build/compute-js.js +0 -2
- package/build/constants/compression.d.ts.map +0 -1
- package/build/constants/compression.js +0 -4
- package/build/server/assets/asset-manager.d.ts +0 -8
- package/build/server/assets/asset-manager.d.ts.map +0 -1
- package/build/server/assets/asset-manager.js +0 -14
- package/build/server/assets/content-asset-kv-store.d.ts +0 -19
- package/build/server/assets/content-asset-kv-store.d.ts.map +0 -1
- package/build/server/assets/content-asset-kv-store.js +0 -70
- package/build/server/assets/content-asset-wasm-inline.d.ts +0 -18
- package/build/server/assets/content-asset-wasm-inline.d.ts.map +0 -1
- package/build/server/assets/content-asset-wasm-inline.js +0 -52
- package/build/server/assets/content-assets.d.ts +0 -46
- package/build/server/assets/content-assets.d.ts.map +0 -1
- package/build/server/assets/content-assets.js +0 -100
- package/build/server/assets/module-assets.d.ts +0 -23
- package/build/server/assets/module-assets.d.ts.map +0 -1
- package/build/server/assets/module-assets.js +0 -45
- package/build/server/kv-store/inline-store-entry.d.ts +0 -25
- package/build/server/kv-store/inline-store-entry.d.ts.map +0 -1
- package/build/server/kv-store/inline-store-entry.js +0 -100
- package/build/server/publisher-server.d.ts +0 -23
- package/build/server/publisher-server.d.ts.map +0 -1
- package/build/server/publisher-server.js +0 -257
- package/build/server/serve-preconditions/if-modified-since.d.ts +0 -4
- package/build/server/serve-preconditions/if-modified-since.d.ts.map +0 -1
- package/build/server/serve-preconditions/if-none-match.d.ts.map +0 -1
- package/build/server/util/http.d.ts +0 -2
- package/build/server/util/http.d.ts.map +0 -1
- package/build/server/util/http.js +0 -9
- package/build/types/compute.d.ts +0 -11
- package/build/types/compute.d.ts.map +0 -1
- package/build/types/compute.js +0 -1
- package/build/types/config-normalized.d.ts +0 -34
- package/build/types/config-normalized.d.ts.map +0 -1
- package/build/types/config-normalized.js +0 -1
- package/build/types/config.d.ts +0 -37
- package/build/types/config.d.ts.map +0 -1
- package/build/types/config.js +0 -1
- package/build/types/content-assets.d.ts +0 -55
- package/build/types/content-assets.d.ts.map +0 -1
- package/build/types/content-assets.js +0 -1
- package/build/types/content-types.d.ts +0 -11
- package/build/types/content-types.d.ts.map +0 -1
- package/build/types/content-types.js +0 -1
- package/build/types/index.d.ts +0 -7
- package/build/types/index.d.ts.map +0 -1
- package/build/types/index.js +0 -1
- package/build/types/module-assets.d.ts +0 -15
- package/build/types/module-assets.d.ts.map +0 -1
- package/build/types/module-assets.js +0 -1
- package/build/types/util.d.ts +0 -7
- package/build/types/util.d.ts.map +0 -1
- package/build/types/util.js +0 -1
- package/build/util/content-types.d.ts.map +0 -1
- package/build/util/index.d.ts +0 -3
- package/build/util/index.d.ts.map +0 -1
- package/build/util/index.js +0 -2
- package/build/util/metadata.d.ts +0 -3
- package/build/util/metadata.d.ts.map +0 -1
- package/build/util/metadata.js +0 -12
- package/resources/README.md +0 -3
- package/resources/statics-metadata.d.ts +0 -10
- package/resources/statics.d.ts +0 -19
- package/resources/webpack.config.js +0 -33
- /package/build/server/{serve-preconditions → publisher-server/serve-preconditions}/if-none-match.d.ts +0 -0
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export class CreateReactAppPreset {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.name = 'Create React App';
|
|
4
|
-
this.defaultOptions = {
|
|
5
|
-
rootDir: './build',
|
|
6
|
-
staticDirs: ['[public-dir]/static'],
|
|
7
|
-
name: 'my-create-react-app',
|
|
8
|
-
description: 'Fastly Compute static site from create-react-app',
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
check(packageJson) {
|
|
12
|
-
if (packageJson == null) {
|
|
13
|
-
console.error("❌ Can't read/parse package.json");
|
|
14
|
-
console.error("Run this from a create-react-app project directory.");
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
if (packageJson?.dependencies?.['react-scripts'] == null) {
|
|
18
|
-
console.error("❌ Can't find react-scripts in dependencies");
|
|
19
|
-
console.error("Run this from a create-react-app project directory.");
|
|
20
|
-
console.log("If this is a project created with create-react-app and has since been ejected, specify preset cra-eject to skip this check.");
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
return true;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export class CreateReactAppEjectedPreset extends CreateReactAppPreset {
|
|
27
|
-
constructor() {
|
|
28
|
-
super(...arguments);
|
|
29
|
-
this.name = 'Create React App (Ejected)';
|
|
30
|
-
}
|
|
31
|
-
check() {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"docusaurus.d.ts","sourceRoot":"","sources":["../../../../src/cli/presets/implementations/docusaurus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D,qBAAa,gBAAiB,YAAW,WAAW;IAClD,IAAI,SAAgB;IACpB,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,CAIjC;IACF,KAAK;CAGN"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export class DocusaurusPreset {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.name = 'Docusaurus';
|
|
4
|
-
this.defaultOptions = {
|
|
5
|
-
rootDir: './build',
|
|
6
|
-
name: 'my-docusaurus-app',
|
|
7
|
-
description: 'Fastly Compute static site from docusaurus',
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
check() {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gatsby.d.ts","sourceRoot":"","sources":["../../../../src/cli/presets/implementations/gatsby.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D,qBAAa,YAAa,YAAW,WAAW;IAC9C,IAAI,SAAY;IAChB,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,CAIjC;IACF,KAAK;CAGN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../../src/cli/presets/implementations/next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D,qBAAa,YAAa,YAAW,WAAW;IAC9C,IAAI,SAAa;IACjB,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,CAIjC;IACF,KAAK;CAGN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sveltekit.d.ts","sourceRoot":"","sources":["../../../../src/cli/presets/implementations/sveltekit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D,qBAAa,eAAgB,YAAW,WAAW;IACjD,IAAI,SAAe;IACnB,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,CAIjC;IACF,KAAK;CAGN"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export class SvelteKitPreset {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.name = 'SvelteKit';
|
|
4
|
-
this.defaultOptions = {
|
|
5
|
-
rootDir: './dist',
|
|
6
|
-
name: 'my-sveltekit-app',
|
|
7
|
-
description: 'Fastly Compute static site from SvelteKit',
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
check() {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vite.d.ts","sourceRoot":"","sources":["../../../../src/cli/presets/implementations/vite.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D,qBAAa,UAAW,YAAW,WAAW;IAC5C,IAAI,SAAU;IACd,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,CAIjC;IACF,KAAK;CAGN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"vue.d.ts","sourceRoot":"","sources":["../../../../src/cli/presets/implementations/vue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D,qBAAa,SAAU,YAAW,WAAW;IAC3C,IAAI,SAAS;IACb,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,CAIjC;IACF,KAAK,CAAC,WAAW,EAAE,GAAG;CAcvB"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export class VuePreset {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.name = 'Vue';
|
|
4
|
-
this.defaultOptions = {
|
|
5
|
-
rootDir: './dist',
|
|
6
|
-
name: 'my-vue-app',
|
|
7
|
-
description: 'Fastly Compute static site from Vue (create-vue)',
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
check(packageJson) {
|
|
11
|
-
if (packageJson == null) {
|
|
12
|
-
console.error("❌ Can't read/parse package.json");
|
|
13
|
-
console.error("Run this from a Vue project directory created by create-vue.");
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
if (packageJson?.devDependencies?.['vite'] == null) {
|
|
17
|
-
console.error("❌ Can't find vite in dependencies");
|
|
18
|
-
console.error("Run this from a Vue project directory created by create-vue.");
|
|
19
|
-
console.log("If this is a project created with the Vue CLI, migrate it to use Vite first. Refer to the create-vue documentation at https://www.npmjs.com/package/create-vue (not authored or maintained by Fastly) for details on this process.");
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/presets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAU/C,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAS,WAAW,CAWxD,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CreateReactAppPreset, CreateReactAppEjectedPreset } from './implementations/create-react-app.js';
|
|
2
|
-
import { VitePreset } from './implementations/vite.js';
|
|
3
|
-
import { SvelteKitPreset } from './implementations/sveltekit.js';
|
|
4
|
-
import { VuePreset } from './implementations/vue.js';
|
|
5
|
-
import { NextJsPreset } from './implementations/next.js';
|
|
6
|
-
import { AstroPreset } from "./implementations/astro.js";
|
|
7
|
-
import { GatsbyPreset } from './implementations/gatsby.js';
|
|
8
|
-
import { DocusaurusPreset } from './implementations/docusaurus.js';
|
|
9
|
-
export const presets = {
|
|
10
|
-
'cra': CreateReactAppPreset,
|
|
11
|
-
'create-react-app': CreateReactAppPreset,
|
|
12
|
-
'cra-eject': CreateReactAppEjectedPreset,
|
|
13
|
-
'vite': VitePreset,
|
|
14
|
-
'sveltekit': SvelteKitPreset,
|
|
15
|
-
'vue': VuePreset,
|
|
16
|
-
'next': NextJsPreset,
|
|
17
|
-
'astro': AstroPreset,
|
|
18
|
-
'gatsby': GatsbyPreset,
|
|
19
|
-
'docusaurus': DocusaurusPreset,
|
|
20
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export type AppOptions = {
|
|
2
|
-
rootDir: string | undefined;
|
|
3
|
-
publicDir: string | undefined;
|
|
4
|
-
staticDirs: string[];
|
|
5
|
-
staticContentRootDir: string | undefined;
|
|
6
|
-
spa: string | undefined;
|
|
7
|
-
notFoundPage: string | undefined;
|
|
8
|
-
autoIndex: string[];
|
|
9
|
-
autoExt: string[];
|
|
10
|
-
name: string | undefined;
|
|
11
|
-
author: string | undefined;
|
|
12
|
-
description: string | undefined;
|
|
13
|
-
serviceId: string | undefined;
|
|
14
|
-
kvStoreName: string | undefined;
|
|
15
|
-
};
|
|
16
|
-
export interface IPresetBase {
|
|
17
|
-
name: string;
|
|
18
|
-
defaultOptions: Partial<AppOptions>;
|
|
19
|
-
check(packageJson: any | null, options: AppOptions): boolean;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=preset-base.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preset-base.d.ts","sourceRoot":"","sources":["../../../src/cli/presets/preset-base.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,oBAAoB,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IACpC,KAAK,CAAC,WAAW,EAAE,GAAG,GAAG,IAAI,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC;CAC9D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface FastlyApiContext {
|
|
2
|
-
apiToken: string;
|
|
3
|
-
}
|
|
4
|
-
export type LoadApiKeyResult = {
|
|
5
|
-
apiToken: string;
|
|
6
|
-
source: string;
|
|
7
|
-
};
|
|
8
|
-
export declare function loadApiKey(): LoadApiKeyResult | null;
|
|
9
|
-
export declare function callFastlyApi(fastlyApiContext: FastlyApiContext, endpoint: string, queryParams?: URLSearchParams | null, requestInit?: RequestInit): Promise<Response>;
|
|
10
|
-
//# sourceMappingURL=fastly-api.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fastly-api.d.ts","sourceRoot":"","sources":["../../../src/cli/util/fastly-api.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,UAAU,IAAI,gBAAgB,GAAG,IAAI,CA+BpD;AAED,wBAAsB,aAAa,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,eAAe,GAAG,IAAI,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAsB5K"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { execSync } from 'child_process';
|
|
2
|
-
;
|
|
3
|
-
export function loadApiKey() {
|
|
4
|
-
let apiToken = null;
|
|
5
|
-
let source = '';
|
|
6
|
-
// Try to get API key from FASTLY_API_TOKEN
|
|
7
|
-
apiToken = process.env.FASTLY_API_TOKEN || null;
|
|
8
|
-
if (apiToken != null) {
|
|
9
|
-
source = 'env';
|
|
10
|
-
}
|
|
11
|
-
if (apiToken == null) {
|
|
12
|
-
// Try to get API key from fastly cli
|
|
13
|
-
try {
|
|
14
|
-
apiToken = execSync('fastly profile token --quiet', {
|
|
15
|
-
encoding: 'utf-8',
|
|
16
|
-
})?.trim() || null;
|
|
17
|
-
}
|
|
18
|
-
catch {
|
|
19
|
-
apiToken = null;
|
|
20
|
-
}
|
|
21
|
-
if (apiToken != null) {
|
|
22
|
-
source = 'fastly-profile-token';
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (apiToken == null) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
return { apiToken, source };
|
|
29
|
-
}
|
|
30
|
-
export async function callFastlyApi(fastlyApiContext, endpoint, queryParams, requestInit) {
|
|
31
|
-
let finalEndpoint = endpoint;
|
|
32
|
-
if (queryParams != null) {
|
|
33
|
-
const queryString = String(queryParams);
|
|
34
|
-
if (queryString.length > 0) {
|
|
35
|
-
finalEndpoint += '?' + queryString;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const url = new URL(finalEndpoint, 'https://api.fastly.com/');
|
|
39
|
-
const headers = new Headers(requestInit?.headers);
|
|
40
|
-
headers.set('Fastly-Key', fastlyApiContext.apiToken);
|
|
41
|
-
const request = new Request(url, {
|
|
42
|
-
...requestInit,
|
|
43
|
-
headers,
|
|
44
|
-
});
|
|
45
|
-
const response = await fetch(request);
|
|
46
|
-
return response;
|
|
47
|
-
}
|
package/build/cli/util/hash.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../src/cli/util/hash.ts"],"names":[],"mappings":"AAGA,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM;;;EAUxD"}
|
package/build/cli/util/hash.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import crypto from 'crypto';
|
|
2
|
-
import fs from 'fs';
|
|
3
|
-
export function calculateFileSizeAndHash(filename) {
|
|
4
|
-
const fileBuffer = fs.readFileSync(filename);
|
|
5
|
-
const size = fileBuffer.length;
|
|
6
|
-
const hash = crypto.createHash('sha256');
|
|
7
|
-
hash.update(fileBuffer);
|
|
8
|
-
return { size, hash: hash.digest('hex') };
|
|
9
|
-
}
|
package/build/cli/util/id.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"id.d.ts","sourceRoot":"","sources":["../../../src/cli/util/id.ts"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,WAE7B;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,UAYxC"}
|
package/build/cli/util/id.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import crypto from "crypto";
|
|
2
|
-
const ID_SYMBOLS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
3
|
-
const ID_SYMBOLS_BASE = BigInt(ID_SYMBOLS.length);
|
|
4
|
-
export function createStringId() {
|
|
5
|
-
return uuidToString(crypto.randomUUID());
|
|
6
|
-
}
|
|
7
|
-
export function uuidToString(uuid) {
|
|
8
|
-
const uuidWithoutHyphens = uuid.replace(/-/g, '');
|
|
9
|
-
let number = BigInt('0x' + uuidWithoutHyphens);
|
|
10
|
-
let result = '';
|
|
11
|
-
do {
|
|
12
|
-
const [quotient, remainder] = [number / ID_SYMBOLS_BASE, Number(number % ID_SYMBOLS_BASE)];
|
|
13
|
-
result = ID_SYMBOLS.charAt(remainder) + result;
|
|
14
|
-
number = quotient;
|
|
15
|
-
} while (number > 0n);
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { FastlyApiContext } from "./fastly-api.js";
|
|
2
|
-
type KVStoreInfo = {
|
|
3
|
-
id: string;
|
|
4
|
-
name: string;
|
|
5
|
-
};
|
|
6
|
-
type KVStoreEntryInfo = string;
|
|
7
|
-
export declare function getKVStoreIdForNameMap(fastlyApiContext: FastlyApiContext): Promise<Record<string, string>>;
|
|
8
|
-
export declare function getKVStoreIdForName(fastlyApiContext: FastlyApiContext, kvStoreName: string): Promise<string | null>;
|
|
9
|
-
export declare function getKVStoreInfos(fastlyApiContext: FastlyApiContext): Promise<KVStoreInfo[]>;
|
|
10
|
-
export declare const _getKVStoreKeys: (fastlyApiContext: FastlyApiContext, kvStoreId: string) => Promise<string[]>;
|
|
11
|
-
export declare function getKVStoreKeys(fastlyApiContext: FastlyApiContext, kvStoreName: string): Promise<KVStoreEntryInfo[] | null>;
|
|
12
|
-
export declare function kvStoreEntryExists(fastlyApiContext: FastlyApiContext, kvStoreName: string, key: string): Promise<boolean>;
|
|
13
|
-
export declare function kvStoreSubmitFile(fastlyApiContext: FastlyApiContext, kvStoreName: string, key: string, data: Uint8Array | string): Promise<void>;
|
|
14
|
-
export declare function kvStoreDeleteFile(fastlyApiContext: FastlyApiContext, kvStoreName: string, key: string): Promise<void>;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=kv-store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kv-store.d.ts","sourceRoot":"","sources":["../../../src/cli/util/kv-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAElE,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAUF,KAAK,gBAAgB,GAAG,MAAM,CAAC;AAS/B,wBAAsB,sBAAsB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkBhH;AAED,wBAAsB,mBAAmB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIzH;AAwCD,wBAAsB,eAAe,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAchG;AAED,eAAO,MAAM,eAAe,qBApDgB,gBAAgB,yCAoD6F,CAAC;AAE1J,wBAAsB,cAAc,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,CAQhI;AAED,wBAAsB,kBAAkB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAa/H;AAGD,wBAAsB,iBAAiB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsBtJ;AAED,wBAAsB,iBAAiB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB3H"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"publish-id.d.ts","sourceRoot":"","sources":["../../../src/cli/util/publish-id.ts"],"names":[],"mappings":"AAGA,wBAAgB,uBAAuB;;;EA8BtC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import { createStringId } from "./id.js";
|
|
3
|
-
export function generateOrLoadPublishId() {
|
|
4
|
-
let created = false;
|
|
5
|
-
const filename = './.publish-id';
|
|
6
|
-
let contents;
|
|
7
|
-
try {
|
|
8
|
-
contents = fs.readFileSync(filename, 'utf-8');
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
-
contents = null;
|
|
12
|
-
}
|
|
13
|
-
let publishId = null;
|
|
14
|
-
if (contents != null) {
|
|
15
|
-
publishId = contents
|
|
16
|
-
.split('\n')
|
|
17
|
-
.find(line => line.length > 0 && !line.startsWith('#')) ?? null;
|
|
18
|
-
}
|
|
19
|
-
if (publishId == null) {
|
|
20
|
-
publishId = createStringId();
|
|
21
|
-
created = true;
|
|
22
|
-
const fileContents = `# Generated by @fastly/compute-js-static-publish.\n${publishId}\n`;
|
|
23
|
-
fs.writeFileSync(filename, fileContents, 'utf-8');
|
|
24
|
-
}
|
|
25
|
-
return { publishId, created };
|
|
26
|
-
}
|
package/build/compute-js.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compute-js.d.ts","sourceRoot":"","sources":["../src/compute-js.ts"],"names":[],"mappings":"AAAA,OAAO,8CAA8C,CAAC;AACtD,OAAO,2CAA2C,CAAC"}
|
package/build/compute-js.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compression.d.ts","sourceRoot":"","sources":["../../src/constants/compression.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,yBAGnB,CAAC;AAEX,MAAM,MAAM,uBAAuB,GAAG,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare abstract class AssetManager<TAsset> {
|
|
2
|
-
protected readonly assets: Record<string, TAsset>;
|
|
3
|
-
protected constructor();
|
|
4
|
-
protected initAsset(assetKey: string, asset: TAsset): void;
|
|
5
|
-
getAsset(assetKey: string): TAsset | null;
|
|
6
|
-
getAssetKeys(): string[];
|
|
7
|
-
}
|
|
8
|
-
//# sourceMappingURL=asset-manager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asset-manager.d.ts","sourceRoot":"","sources":["../../../src/server/assets/asset-manager.ts"],"names":[],"mappings":"AAAA,8BAAsB,YAAY,CAAC,MAAM;IAEvC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAElD,SAAS;IAIT,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAInD,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIzC,YAAY,IAAI,MAAM,EAAE;CAIzB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export class AssetManager {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.assets = {};
|
|
4
|
-
}
|
|
5
|
-
initAsset(assetKey, asset) {
|
|
6
|
-
this.assets[assetKey] = asset;
|
|
7
|
-
}
|
|
8
|
-
getAsset(assetKey) {
|
|
9
|
-
return this.assets[assetKey] ?? null;
|
|
10
|
-
}
|
|
11
|
-
getAssetKeys() {
|
|
12
|
-
return Object.keys(this.assets);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ContentAsset, ContentAssetMetadataMapEntry, StoreEntry } from "../../types/index.js";
|
|
2
|
-
import { ContentAssetMetadataMapEntryKVStore } from "../../types/content-assets.js";
|
|
3
|
-
import { ContentCompressionTypes } from "../../constants/compression.js";
|
|
4
|
-
export declare class ContentKVStoreAsset implements ContentAsset {
|
|
5
|
-
readonly type = "kv-store";
|
|
6
|
-
private readonly metadata;
|
|
7
|
-
private readonly kvStoreName;
|
|
8
|
-
private readonly sourceAndInfo;
|
|
9
|
-
private readonly compressedSourcesAndInfo;
|
|
10
|
-
constructor(metadata: ContentAssetMetadataMapEntryKVStore, kvStoreName: string);
|
|
11
|
-
get isLocal(): boolean;
|
|
12
|
-
get assetKey(): string;
|
|
13
|
-
getStoreEntry(acceptEncodingsGroups?: ContentCompressionTypes[][]): Promise<StoreEntry>;
|
|
14
|
-
getBytes(): Uint8Array;
|
|
15
|
-
getText(): string;
|
|
16
|
-
getJson<T = unknown>(): T;
|
|
17
|
-
getMetadata(): ContentAssetMetadataMapEntry;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=content-asset-kv-store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-asset-kv-store.d.ts","sourceRoot":"","sources":["../../../src/server/assets/content-asset-kv-store.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,4BAA4B,EAC5B,UAAU,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,mCAAmC,EACpC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAGzE,qBAAa,mBAAoB,YAAW,YAAY;IACtD,QAAQ,CAAC,IAAI,cAAc;IAE3B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsC;IAE/D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IAErC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAwB;IACtD,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAA6C;gBAE1E,QAAQ,EAAE,mCAAmC,EAAE,WAAW,EAAE,MAAM;IAqB9E,IAAI,OAAO,YAEV;IAED,IAAI,QAAQ,WAEX;IAEK,aAAa,CAAC,qBAAqB,GAAE,uBAAuB,EAAE,EAAO,GAAG,OAAO,CAAC,UAAU,CAAC;IA4BjG,QAAQ,IAAI,UAAU;IAItB,OAAO,IAAI,MAAM;IAIjB,OAAO,CAAC,CAAC,GAAG,OAAO,KAAK,CAAC;IAIzB,WAAW,IAAI,4BAA4B;CAI5C"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { KVStore } from "fastly:kv-store";
|
|
2
|
-
import { ContentAssets, findMatchingSourceAndInfo } from "./content-assets.js";
|
|
3
|
-
export class ContentKVStoreAsset {
|
|
4
|
-
constructor(metadata, kvStoreName) {
|
|
5
|
-
this.type = 'kv-store';
|
|
6
|
-
this.metadata = metadata;
|
|
7
|
-
this.kvStoreName = kvStoreName;
|
|
8
|
-
this.sourceAndInfo = {
|
|
9
|
-
source: metadata.fileInfo.kvStoreKey,
|
|
10
|
-
hash: metadata.fileInfo.hash,
|
|
11
|
-
size: metadata.fileInfo.size,
|
|
12
|
-
};
|
|
13
|
-
this.compressedSourcesAndInfo = Object.entries(metadata.compressedFileInfos)
|
|
14
|
-
.reduce((obj, [key, value]) => {
|
|
15
|
-
obj[key] = {
|
|
16
|
-
source: value.kvStoreKey,
|
|
17
|
-
hash: value.hash,
|
|
18
|
-
size: value.size,
|
|
19
|
-
};
|
|
20
|
-
return obj;
|
|
21
|
-
}, {});
|
|
22
|
-
}
|
|
23
|
-
get isLocal() {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
get assetKey() {
|
|
27
|
-
return this.metadata.assetKey;
|
|
28
|
-
}
|
|
29
|
-
async getStoreEntry(acceptEncodingsGroups = []) {
|
|
30
|
-
const { sourceAndInfo, contentEncoding } = findMatchingSourceAndInfo(acceptEncodingsGroups, this.sourceAndInfo, encoding => this.compressedSourcesAndInfo[encoding]);
|
|
31
|
-
const kvStore = new KVStore(this.kvStoreName);
|
|
32
|
-
let retries = 3;
|
|
33
|
-
while (retries > 0) {
|
|
34
|
-
const storeEntry = await kvStore.get(sourceAndInfo.source);
|
|
35
|
-
if (storeEntry != null) {
|
|
36
|
-
const { hash, size } = sourceAndInfo;
|
|
37
|
-
return Object.assign(storeEntry, { contentEncoding, hash, size });
|
|
38
|
-
}
|
|
39
|
-
// Note the null does NOT mean 404. The fact that we are here means
|
|
40
|
-
// metadata exists for this path, and we're just trying to get the data from
|
|
41
|
-
// the KV Store.
|
|
42
|
-
// So if we're here then the data is either not available yet (in which case
|
|
43
|
-
// we can wait just a bit and try again), or the data was deleted.
|
|
44
|
-
retries--;
|
|
45
|
-
// We're going to wait 250ms/500ms/750ms and try again.
|
|
46
|
-
const delay = (3 - retries) * 250;
|
|
47
|
-
await new Promise(resolve => setTimeout(resolve, delay));
|
|
48
|
-
}
|
|
49
|
-
throw new Error("Asset could not be retrieved from the KV Store.");
|
|
50
|
-
}
|
|
51
|
-
getBytes() {
|
|
52
|
-
throw new Error("Can't getBytes() for KV Store asset");
|
|
53
|
-
}
|
|
54
|
-
getText() {
|
|
55
|
-
throw new Error("Can't getText() for KV Store asset");
|
|
56
|
-
}
|
|
57
|
-
getJson() {
|
|
58
|
-
throw new Error("Can't getJson() for KV Store asset");
|
|
59
|
-
}
|
|
60
|
-
getMetadata() {
|
|
61
|
-
return this.metadata;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
ContentAssets.registerAssetBuilder('kv-store', (metadata, context) => {
|
|
65
|
-
const { kvStoreName } = context;
|
|
66
|
-
if (kvStoreName == null) {
|
|
67
|
-
throw new Error("Unexpected! KV Store name should be specified!!");
|
|
68
|
-
}
|
|
69
|
-
return new ContentKVStoreAsset(metadata, kvStoreName);
|
|
70
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ContentAsset, ContentAssetMetadataMapEntry, StoreEntry } from "../../types/index.js";
|
|
2
|
-
import { ContentAssetMetadataMapEntryWasmInline } from "../../types/content-assets.js";
|
|
3
|
-
import { ContentCompressionTypes } from "../../constants/compression.js";
|
|
4
|
-
export declare class ContentWasmInlineAsset implements ContentAsset {
|
|
5
|
-
readonly type = "wasm-inline";
|
|
6
|
-
private readonly metadata;
|
|
7
|
-
private readonly sourceAndInfo;
|
|
8
|
-
private readonly compressedSourcesAndInfo;
|
|
9
|
-
constructor(metadata: ContentAssetMetadataMapEntryWasmInline);
|
|
10
|
-
get isLocal(): boolean;
|
|
11
|
-
get assetKey(): string;
|
|
12
|
-
getStoreEntry(acceptEncodingsGroups?: ContentCompressionTypes[][]): Promise<StoreEntry>;
|
|
13
|
-
getBytes(): Uint8Array;
|
|
14
|
-
getText(): string;
|
|
15
|
-
getJson<T = unknown>(): T;
|
|
16
|
-
getMetadata(): ContentAssetMetadataMapEntry;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=content-asset-wasm-inline.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-asset-wasm-inline.d.ts","sourceRoot":"","sources":["../../../src/server/assets/content-asset-wasm-inline.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,4BAA4B,EAC5B,UAAU,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,sCAAsC,EACvC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAMzE,qBAAa,sBAAuB,YAAW,YAAY;IACzD,QAAQ,CAAC,IAAI,iBAAiB;IAE9B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyC;IAElE,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA4B;IAC1D,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAiD;gBAE9E,QAAQ,EAAE,sCAAsC;IAoB5D,IAAI,OAAO,YAEV;IAED,IAAI,QAAQ,WAEX;IAEK,aAAa,CAAC,qBAAqB,GAAE,uBAAuB,EAAE,EAAO,GAAG,OAAO,CAAC,UAAU,CAAC;IAMjG,QAAQ,IAAI,UAAU;IAItB,OAAO,IAAI,MAAM;IAOjB,OAAO,CAAC,CAAC,GAAG,OAAO,KAAK,CAAC;IAKzB,WAAW,IAAI,4BAA4B;CAG5C"}
|