@lwrjs/everywhere 0.10.0-alpha.7 → 0.10.0-alpha.8

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.
Files changed (28) hide show
  1. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/02b9b4ac7ae3860b355955245154923a/config.js +10 -0
  2. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/@lwrjs/app-service/amd-bootstrap/module/amd/v/{0_10_0-alpha_7 → 0_10_0-alpha_8}/s/c40e6caf07454ce13961de8ca76ab7f0/@lwrjs_app-service_amd-bootstrap_module_amd.js +4 -4
  3. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwc/v/{2_38_1/s/8cf6b94d9c0b398c70c97fdca2759caa → 2_45_2/s/97b809a5745ddedba3acd0433f339b58}/lwc.js +456 -435
  4. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/everywhereAmd/v/{0_10_0-alpha_7 → 0_10_0-alpha_8}/s/c538071acf5bde58e816967a14c465c3/lwr_everywhereAmd.js +3 -3
  5. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/init/v/{0_10_0-alpha_7/s/d26177a61a766e129dee91ebcadb74d7 → 0_10_0-alpha_8/s/8199fbc1a33dffe14973c3ee0a3f6aa3}/lwr_init.js +14 -30
  6. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/loader/v/{0_10_0-alpha_7/s/554e119a3f34b1362ff4ceb3a97b0d25 → 0_10_0-alpha_8/s/7c38605af6fc9549feac455828d00bdd}/lwr_loader.js +3 -3
  7. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_10_0-alpha_7 → 0_10_0-alpha_8}/s/3426e42c3e22ce07ab2adc62c4c523a0/lwr_metrics.js +1 -1
  8. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/{0_10_0-alpha_7 → 0_10_0-alpha_8}/s/4e65d4b97b3cc3d2f06a4cc284f3dd68/lwr_profiler.js +1 -1
  9. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/vault/v/{0_10_0-alpha_7 → 0_10_0-alpha_8}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
  10. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_10_0-alpha_7 → 0_10_0-alpha_8}/lwr-error-shim.js +1 -1
  11. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_10_0-alpha_7 → 0_10_0-alpha_8}/lwr-loader-shim.bundle.js +6 -6
  12. package/build/assets/amd/lwr-everywhere-debug.js +8 -8
  13. package/build/assets/amd/lwr-everywhere-min.js +1 -1
  14. package/build/assets/amd/lwr-everywhere.js +8 -8
  15. package/build/assets/core/lwr-everywhere-debug.js +4 -4
  16. package/build/assets/core/lwr-everywhere.js +4 -4
  17. package/build/assets/esm/lwr-everywhere-debug.js +1 -1
  18. package/build/assets/esm/lwr-everywhere-min.js +1 -1
  19. package/build/assets/esm/lwr-everywhere.js +1 -1
  20. package/build/modules/lwr/setupLDS/setupLDS.js +8 -5
  21. package/package.json +12 -12
  22. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/7b0c61d0b2d8909f14cb1696902a019c/config.js +0 -10
  23. package/build/modules/@salesforce/lds-default-luvio/lds-default-luvio.d.ts +0 -24
  24. package/build/modules/@salesforce/lds-default-luvio/lds-default-luvio.js +0 -60
  25. package/build/modules/lwr/setupNodeLDS/network.d.ts +0 -3
  26. package/build/modules/lwr/setupNodeLDS/network.js +0 -88
  27. package/build/modules/lwr/setupNodeLDS/setupNodeLDS.d.ts +0 -2
  28. package/build/modules/lwr/setupNodeLDS/setupNodeLDS.js +0 -14
@@ -1,10 +0,0 @@
1
- /* This script is generated */
2
- /* Client Bootstrap configuration */
3
- globalThis.LWR = globalThis.LWR || {};
4
- Object.assign(globalThis.LWR, {"appId":"amd-bootstrap","bootstrapModule":"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_10_0-alpha_7","autoBoot":true,"imports":{"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_10_0-alpha_7/s/c40e6caf07454ce13961de8ca76ab7f0/@lwrjs_app-service_amd-bootstrap_module_amd.js":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_10_0-alpha_7"],"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_10_0-alpha_7/s/d26177a61a766e129dee91ebcadb74d7/lwr_init.js":["lwr/init/v/0_10_0-alpha_7"],"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_10_0-alpha_7/s/3426e42c3e22ce07ab2adc62c4c523a0/lwr_metrics.js":["lwr/metrics/v/0_10_0-alpha_7"],"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_10_0-alpha_7/s/4e65d4b97b3cc3d2f06a4cc284f3dd68/lwr_profiler.js":["lwr/profiler/v/0_10_0-alpha_7"],"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F2_38_1/s/8cf6b94d9c0b398c70c97fdca2759caa/lwc.js":["lwc/v/2_38_1"],"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_10_0-alpha_7/s/c538071acf5bde58e816967a14c465c3/lwr_everywhereAmd.js":["lwr/everywhereAmd/v/0_10_0-alpha_7"],"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_10_0-alpha_7/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js":["lwr/vault/v/0_10_0-alpha_7"]},"index":{"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_10_0-alpha_7":"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_10_0-alpha_7/s/c40e6caf07454ce13961de8ca76ab7f0/@lwrjs_app-service_amd-bootstrap_module_amd.js","lwr/init/v/0_10_0-alpha_7":"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_10_0-alpha_7/s/d26177a61a766e129dee91ebcadb74d7/lwr_init.js","lwr/metrics/v/0_10_0-alpha_7":"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_10_0-alpha_7/s/3426e42c3e22ce07ab2adc62c4c523a0/lwr_metrics.js","lwr/profiler/v/0_10_0-alpha_7":"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_10_0-alpha_7/s/4e65d4b97b3cc3d2f06a4cc284f3dd68/lwr_profiler.js","lwc/v/2_38_1":"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F2_38_1/s/8cf6b94d9c0b398c70c97fdca2759caa/lwc.js","lwr/everywhereAmd/v/0_10_0-alpha_7":"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_10_0-alpha_7/s/c538071acf5bde58e816967a14c465c3/lwr_everywhereAmd.js","lwr/vault/v/0_10_0-alpha_7":"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_10_0-alpha_7/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js"},"rootComponents":["lwr/everywhereAmd/v/0_10_0-alpha_7"],"requiredModules":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_10_0-alpha_7"],"preloadModules":["lwr/init/v/0_10_0-alpha_7","lwr/metrics/v/0_10_0-alpha_7","lwc/v/2_38_1","lwr/everywhereAmd/v/0_10_0-alpha_7"],"endpoints":{"uris":{"mapping":"/1/mapping/amd/1/l/en-US/mp/"}}});
5
- globalThis.process = { env: { NODE_ENV: "compat" } };
6
- // Appended by Static Site Generator
7
- if (!globalThis.LWR.imports) { globalThis.LWR.imports = {}; }
8
- Object.assign(globalThis.LWR.imports, {"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_10_0-alpha_7/s/554e119a3f34b1362ff4ceb3a97b0d25/lwr_loader.js":["lwr/loader/v/0_10_0-alpha_7"]})
9
- if (!globalThis.LWR.index) { globalThis.LWR.index = {}; }
10
- Object.assign(globalThis.LWR.index, {"lwr/loader/v/0_10_0-alpha_7":"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_10_0-alpha_7/s/554e119a3f34b1362ff4ceb3a97b0d25/lwr_loader.js"})
@@ -1,24 +0,0 @@
1
- import { Luvio } from '@luvio/engine';
2
- export type Callback = (luvio: Luvio) => void;
3
- /**
4
- * Constructs/sets the default Luvio instance. Any previously-set default luvio instance
5
- * is overwritten.
6
- */
7
- export declare function setDefaultLuvio({ luvio }: {
8
- luvio: Luvio;
9
- }): void;
10
- /**
11
- * Registers a callback to be invoked with the default Luvio instance. Note that the
12
- * callback may be invoked multiple times if the default Luvio changes.
13
- *
14
- * @param callback callback to be invoked with default Luvio instance
15
- */
16
- export declare function withDefaultLuvio(callback: Callback): void;
17
- export type Registration = {
18
- id: string;
19
- };
20
- export type RegistrationCallback<R = Registration> = (registration: R) => void;
21
- export declare function forEachRegistration(callback: RegistrationCallback): void;
22
- export declare function withRegistration<R extends Registration>(id: R['id'], callback: RegistrationCallback<R>): void;
23
- export declare function register<R extends Registration = Registration>(r: R): void;
24
- //# sourceMappingURL=lds-default-luvio.d.ts.map
@@ -1,60 +0,0 @@
1
- // temp from https://github.com/salesforce-experience-platform-emu/lds-lightning-platform/blob/main/packages/lds-default-luvio/src/main.ts
2
-
3
- // callback used to inform interested parties that a new default Luvio has been set.
4
-
5
- // most recently set default Luvio instance
6
- let defaultLuvio;
7
-
8
- // callbacks to be invoked when default luvio instance is set/changed
9
- const callbacks = [];
10
-
11
- /**
12
- * Constructs/sets the default Luvio instance. Any previously-set default luvio instance
13
- * is overwritten.
14
- */
15
- export function setDefaultLuvio({
16
- luvio
17
- }) {
18
- if (luvio === undefined) {
19
- throw new Error('unable to construct default Luvio instance from supplied parameters');
20
- }
21
- defaultLuvio = luvio;
22
-
23
- // inform observers
24
- for (let i = 0; i < callbacks.length; ++i) {
25
- callbacks[i](defaultLuvio);
26
- }
27
- }
28
-
29
- /**
30
- * Registers a callback to be invoked with the default Luvio instance. Note that the
31
- * callback may be invoked multiple times if the default Luvio changes.
32
- *
33
- * @param callback callback to be invoked with default Luvio instance
34
- */
35
- export function withDefaultLuvio(callback) {
36
- if (defaultLuvio) {
37
- callback(defaultLuvio);
38
- }
39
- callbacks.push(callback);
40
- }
41
-
42
- // export * from './registry'; see below
43
-
44
- const registryCallbacks = [];
45
- const registrations = [];
46
- export function forEachRegistration(callback) {
47
- registryCallbacks.push(callback);
48
- registrations.forEach(r => callback(r));
49
- }
50
- export function withRegistration(id, callback) {
51
- forEachRegistration(r => {
52
- if (r.id === id) {
53
- callback(r);
54
- }
55
- });
56
- }
57
- export function register(r) {
58
- registrations.push(r);
59
- registryCallbacks.forEach(callback => callback(r));
60
- }
@@ -1,3 +0,0 @@
1
- import type { FetchResponse, ResourceRequest } from '@luvio/engine';
2
- export declare function networkAdapter(req: ResourceRequest): Promise<FetchResponse<any>>;
3
- //# sourceMappingURL=network.d.ts.map
@@ -1,88 +0,0 @@
1
- import { getAuthInfo } from 'lwr/vault';
2
-
3
- /**
4
- * Authenticated UI API Luvio Network Adapter
5
- * See LDS error handling: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.data_error
6
- */
7
-
8
- class RecordError extends Error {
9
- constructor(message, status = 404) {
10
- super(message);
11
- this.body = {
12
- message
13
- };
14
- this.ok = false;
15
- this.status = status;
16
- this.statusText = message;
17
- }
18
- }
19
-
20
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
- export async function networkAdapter(req) {
22
- const authInfo = getAuthInfo();
23
- if (authInfo) {
24
- const {
25
- instance_url,
26
- access_token
27
- } = authInfo;
28
- const {
29
- baseUri,
30
- basePath,
31
- body,
32
- queryParams,
33
- method,
34
- headers
35
- } = req;
36
- const path = `${instance_url}${baseUri}${basePath}${generateQueryString(queryParams)}`;
37
- try {
38
- const res = await fetch(path, {
39
- method: method.toUpperCase(),
40
- headers: access_token ? generateHeaders({
41
- ...headers,
42
- Authorization: `Bearer ${access_token}`
43
- }) : generateHeaders(headers),
44
- body: body === null ? null : JSON.stringify(body)
45
- });
46
- if (res.ok) {
47
- return {
48
- body: res.status === 204 ? undefined : await res.json(),
49
- // HTTP 204 = No Content
50
- status: res.status,
51
- statusText: res.statusText,
52
- ok: res.ok,
53
- headers: {}
54
- };
55
- }
56
- // Request goes through but returns HTTP errors
57
- throw new RecordError(res.statusText, res.status);
58
- } catch (e) {
59
- // Return the failure; no response status => 401
60
- const error = e;
61
- throw new RecordError(error.message, error.status >= 0 ? error.status : 401);
62
- }
63
- } else {
64
- // There is no authentication data available to make this request
65
- throw new RecordError('You are not authenticated.', 401);
66
- }
67
- }
68
-
69
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
70
- function generateQueryString(params) {
71
- const queryStrings = [];
72
- for (const key of Object.keys(params)) {
73
- const value = Array.isArray(params[key]) ? params[key].join(',') : params[key];
74
- if (value) {
75
- queryStrings.push(`${key}=${value}`);
76
- }
77
- }
78
- return queryStrings.length > 0 ? `?${queryStrings.join('&')}` : '';
79
- }
80
- function generateHeaders(headers) {
81
- const fetchHeaders = new globalThis.Headers();
82
- for (const key of Object.keys(headers)) {
83
- fetchHeaders.set(key, headers[key]);
84
- }
85
- fetchHeaders.set('Accept', 'application/json');
86
- fetchHeaders.set('Content-Type', 'application/json');
87
- return fetchHeaders;
88
- }
@@ -1,2 +0,0 @@
1
- export default function (): void;
2
- //# sourceMappingURL=setupNodeLDS.d.ts.map
@@ -1,14 +0,0 @@
1
- import { Luvio, Store, Environment } from '@luvio/engine';
2
- import { setDefaultLuvio } from '@salesforce/lds-default-luvio';
3
- import { networkAdapter } from './network';
4
-
5
- // This module is used with LWR Node.js apps, it's aliased as "lwr/setupLDS" in package.json
6
- // Set the default Luvio instance for LWR Everywhere
7
- // It uses a fetch-based "web" network adapter with OAuth headers
8
-
9
- export default function () {
10
- const luvio = new Luvio(new Environment(new Store(), networkAdapter));
11
- setDefaultLuvio({
12
- luvio
13
- });
14
- }