@conduit-client/command-fetch-network 2.0.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.txt ADDED
@@ -0,0 +1,27 @@
1
+ *Attorney/Client Privileged + Confidential*
2
+
3
+ Terms of Use for Public Code (Non-OSS)
4
+
5
+ *NOTE:* Before publishing code under this license/these Terms of Use, please review https://salesforce.quip.com/WFfvAMKB18AL and confirm that you’ve completed all prerequisites described therein. *These Terms of Use may not be used or modified without input from IP and Product Legal.*
6
+
7
+ *Terms of Use*
8
+
9
+ Copyright 2022 Salesforce, Inc. All rights reserved.
10
+
11
+ These Terms of Use govern the download, installation, and/or use of this software provided by Salesforce, Inc. (“Salesforce”) (the “Software”), were last updated on April 15, 2022, ** and constitute a legally binding agreement between you and Salesforce. If you do not agree to these Terms of Use, do not install or use the Software.
12
+
13
+ Salesforce grants you a worldwide, non-exclusive, no-charge, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute the Software and derivative works subject to these Terms. These Terms shall be included in all copies or substantial portions of the Software.
14
+
15
+ Subject to the limited rights expressly granted hereunder, Salesforce reserves all rights, title, and interest in and to all intellectual property subsisting in the Software. No rights are granted to you hereunder other than as expressly set forth herein. Users residing in countries on the United States Office of Foreign Assets Control sanction list, or which are otherwise subject to a US export embargo, may not use the Software.
16
+
17
+ Implementation of the Software may require development work, for which you are responsible. The Software may contain bugs, errors and incompatibilities and is made available on an AS IS basis without support, updates, or service level commitments.
18
+
19
+ Salesforce reserves the right at any time to modify, suspend, or discontinue, the Software (or any part thereof) with or without notice. You agree that Salesforce shall not be liable to you or to any third party for any modification, suspension, or discontinuance.
20
+
21
+ You agree to defend Salesforce against any claim, demand, suit or proceeding made or brought against Salesforce by a third party arising out of or accruing from (a) your use of the Software, and (b) any application you develop with the Software that infringes any copyright, trademark, trade secret, trade dress, patent, or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy (each a “Claim Against Salesforce”), and will indemnify Salesforce from any damages, attorney fees, and costs finally awarded against Salesforce as a result of, or for any amounts paid by Salesforce under a settlement approved by you in writing of, a Claim Against Salesforce, provided Salesforce (x) promptly gives you written notice of the Claim Against Salesforce, (y) gives you sole control of the defense and settlement of the Claim Against Salesforce (except that you may not settle any Claim Against Salesforce unless it unconditionally releases Salesforce of all liability), and (z) gives you all reasonable assistance, at your expense.
22
+
23
+ WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS NOT SUPPORTED AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED. IN NO EVENT SHALL SALESFORCE HAVE ANY LIABILITY FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA, OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND WHETHER IN CONTRACT, TORT, OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
24
+
25
+ These Terms of Use shall be governed exclusively by the internal laws of the State of California, without regard to its conflicts of laws rules. Each party hereby consents to the exclusive jurisdiction of the state and federal courts located in San Francisco County, California to adjudicate any dispute arising out of or relating to these Terms of Use and the download, installation, and/or use of the Software. Except as expressly stated herein, these Terms of Use constitute the entire agreement between the parties, and supersede all prior and contemporaneous agreements, proposals, or representations, written or oral, concerning their subject matter. No modification, amendment, or waiver of any provision of these Terms of Use shall be effective unless it is by an update to these Terms of Use that Salesforce makes available, or is in writing and signed by the party against whom the modification, amendment, or waiver is to be asserted.
26
+
27
+ _*Data Privacy*_: Salesforce may collect, process, and store device, system, and other information related to your use of the Software. This information includes, but is not limited to, IP address, user metrics, and other data (“Usage Data”). Salesforce may use Usage Data for analytics, product development, and marketing purposes. You acknowledge that files generated in conjunction with the Software may contain sensitive or confidential data, and you are solely responsible for anonymizing and protecting such data.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ This software is provided as-is with no support provided.
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
File without changes
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,29 @@
1
+ import type { Command } from '@conduit-client/command-base/v1';
2
+ /**
3
+ * Options interface for commands that support abortion
4
+ */
5
+ export interface AbortableCommandOptions {
6
+ /**
7
+ * Optional AbortSignal for request cancellation.
8
+ * Follows standard web platform patterns (fetch API).
9
+ */
10
+ signal?: AbortSignal;
11
+ }
12
+ /**
13
+ * Enhanced Command interface that indicates abortion capability
14
+ */
15
+ export interface AbortableCommand<T, Params extends Array<any> = []> extends Command<T, Params> {
16
+ readonly isAbortableCommand: true;
17
+ readonly signal: AbortSignal;
18
+ }
19
+ /**
20
+ * Factory function for creating abortable command proxies
21
+ *
22
+ * Provides a clean API for decorator creation with proper error handling
23
+ * and graceful degradation for non-fetch commands.
24
+ *
25
+ * @param command - The command to make abortable
26
+ * @param signal - The AbortSignal for request cancellation
27
+ * @returns Proxied command if possible, original command with warning if not
28
+ */
29
+ export declare function createAbortableDecorator<T>(command: Command<T>, options: any): Command<T>;
@@ -0,0 +1,22 @@
1
+ import { type Result } from '@conduit-client/utils';
2
+ import { NetworkCommand } from '@conduit-client/command-network/v1';
3
+ import type { NamedFetchService, FetchService } from '@conduit-client/service-fetch-network/v1';
4
+ import { createAbortableDecorator } from './abortable-request-decorator';
5
+ /**
6
+ * An implementation of NetworkCommand that uses HTTP/fetch as the transport mechanism.
7
+ */
8
+ export declare abstract class FetchNetworkCommand<Data, ExtraServices extends object = object> extends NetworkCommand<Data, NamedFetchService & ExtraServices> {
9
+ protected services: NamedFetchService & ExtraServices;
10
+ /**
11
+ * Available decorators for FetchNetworkCommand instances.
12
+ * These decorators can be applied to enhance command functionality.
13
+ */
14
+ static readonly availableDecorators: {
15
+ abortable: typeof createAbortableDecorator;
16
+ };
17
+ constructor(services: NamedFetchService & ExtraServices);
18
+ fetch(): PromiseLike<Result<Data, Error>>;
19
+ protected coerceError(errorResponse: Response): Promise<Error>;
20
+ private convertFetchResponseToData;
21
+ protected abstract readonly fetchParams: Parameters<FetchService>;
22
+ }
@@ -0,0 +1,8 @@
1
+ import { type NamedService, type ServiceDescriptor } from '@conduit-client/utils';
2
+ import { FetchNetworkCommand } from './fetch-command';
3
+ export { FetchNetworkCommand } from './fetch-command';
4
+ export { createAbortableDecorator } from './abortable-request-decorator';
5
+ export type { AbortableCommand, AbortableCommandOptions } from './abortable-request-decorator';
6
+ export type FetchNetworkCommandServiceDescriptor = ServiceDescriptor<typeof FetchNetworkCommand, 'fetchNetworkCommandBaseClass', '1.0'>;
7
+ export declare function buildServiceDescriptor(): FetchNetworkCommandServiceDescriptor;
8
+ export type NamedFetchNetworkCommandService = NamedService<'fetchNetworkCommandBaseClass', typeof FetchNetworkCommand>;
@@ -0,0 +1,185 @@
1
+ /*!
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { buildSubscribableResult, isSubscribableResult, ok, err, toError } from "@conduit-client/utils";
7
+ import { BaseCommand } from "@conduit-client/command-base/v1";
8
+ /*!
9
+ * Copyright (c) 2022, Salesforce, Inc.,
10
+ * All rights reserved.
11
+ * For full license text, see the LICENSE.txt file
12
+ */
13
+ class NetworkCommand extends BaseCommand {
14
+ constructor(services) {
15
+ super();
16
+ this.services = services;
17
+ this.subscriptions = [];
18
+ this.exposeSubscribeAndRefresh = false;
19
+ }
20
+ execute() {
21
+ const result = this.fetch();
22
+ if (this.exposeSubscribeAndRefresh) {
23
+ return this.fetchSubscribableResult(result);
24
+ }
25
+ return result;
26
+ }
27
+ fetchSubscribableResult(res) {
28
+ return res.then((networkResult) => {
29
+ return buildSubscribableResult(
30
+ networkResult,
31
+ (cb) => {
32
+ this.subscriptions.push(cb);
33
+ return () => {
34
+ this.subscriptions = this.subscriptions.filter((cb2) => cb2 !== cb);
35
+ };
36
+ },
37
+ () => this.refresh()
38
+ );
39
+ });
40
+ }
41
+ refresh() {
42
+ return this.execute().then((newResult) => {
43
+ if (isSubscribableResult(newResult)) {
44
+ const value = newResult.isOk() ? ok(newResult.value.data) : err(newResult.error.failure);
45
+ this.subscriptions.forEach((cb) => {
46
+ cb(value);
47
+ });
48
+ }
49
+ return ok(void 0);
50
+ });
51
+ }
52
+ async afterRequestHooks(_options) {
53
+ }
54
+ }
55
+ function isAbortableCommand(command) {
56
+ return "isAbortableCommand" in command && command.isAbortableCommand === true;
57
+ }
58
+ function hasFetchParams(command) {
59
+ return command && typeof command === "object" && "fetchParams" in command;
60
+ }
61
+ function createAbortableDecorator(command, options) {
62
+ if (!(options == null ? void 0 : options.signal) || !((options == null ? void 0 : options.signal) instanceof AbortSignal)) {
63
+ return command;
64
+ }
65
+ const { signal } = options;
66
+ if (isAbortableCommand(command)) {
67
+ if (process.env.NODE_ENV !== "production") {
68
+ console.warn(
69
+ "Command is already abortable. Returning original command to avoid double-wrapping."
70
+ );
71
+ }
72
+ return command;
73
+ }
74
+ if (!hasFetchParams(command)) {
75
+ if (process.env.NODE_ENV !== "production") {
76
+ console.warn(
77
+ `Command ${command.constructor.name} does not support fetch operations. AbortSignal will be ignored.`
78
+ );
79
+ }
80
+ return command;
81
+ }
82
+ try {
83
+ return new Proxy(command, {
84
+ get(target, prop, receiver) {
85
+ if (prop === "isAbortableCommand") {
86
+ return true;
87
+ }
88
+ if (prop === "signal") {
89
+ return signal;
90
+ }
91
+ if (prop === "fetchParams") {
92
+ const originalFetchParams = target[prop];
93
+ const isInternal = target.isInternalExecution === true;
94
+ if (typeof originalFetchParams === "function") {
95
+ return function(...args) {
96
+ const originalReturnValue = originalFetchParams.apply(this, args);
97
+ if (!isInternal) {
98
+ const [url, init = {}] = originalReturnValue;
99
+ return [url, { signal, ...init }];
100
+ }
101
+ return originalReturnValue;
102
+ };
103
+ } else {
104
+ if (!isInternal && originalFetchParams && Array.isArray(originalFetchParams)) {
105
+ const [url, init = {}] = originalFetchParams;
106
+ return [url, { signal, ...init }];
107
+ }
108
+ return originalFetchParams;
109
+ }
110
+ }
111
+ return Reflect.get(target, prop, receiver);
112
+ },
113
+ has(target, prop) {
114
+ if (prop === "isAbortableCommand" || prop === "signal") {
115
+ return true;
116
+ }
117
+ return Reflect.has(target, prop);
118
+ }
119
+ });
120
+ } catch (error) {
121
+ if (process.env.NODE_ENV !== "production") {
122
+ console.error(
123
+ "Failed to create abortable command proxy, returning original command unchanged.",
124
+ error
125
+ );
126
+ }
127
+ return command;
128
+ }
129
+ }
130
+ const _FetchNetworkCommand = class _FetchNetworkCommand extends NetworkCommand {
131
+ constructor(services) {
132
+ super(services);
133
+ this.services = services;
134
+ }
135
+ fetch() {
136
+ return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));
137
+ }
138
+ async coerceError(errorResponse) {
139
+ return toError(errorResponse.statusText);
140
+ }
141
+ convertFetchResponseToData(response) {
142
+ return response.then(
143
+ (response2) => {
144
+ if (response2.ok) {
145
+ return response2.json().then(
146
+ (json) => ok(json),
147
+ (reason) => err(toError(reason))
148
+ ).finally(() => {
149
+ try {
150
+ this.afterRequestHooks({ statusCode: response2.status });
151
+ } catch (e) {
152
+ }
153
+ });
154
+ } else {
155
+ return this.coerceError(response2).then((coercedError) => {
156
+ return err(coercedError);
157
+ }).finally(() => {
158
+ try {
159
+ this.afterRequestHooks({ statusCode: response2.status });
160
+ } catch (e) {
161
+ }
162
+ });
163
+ }
164
+ },
165
+ (reason) => err(toError(reason))
166
+ );
167
+ }
168
+ };
169
+ _FetchNetworkCommand.availableDecorators = {
170
+ abortable: createAbortableDecorator
171
+ };
172
+ let FetchNetworkCommand = _FetchNetworkCommand;
173
+ function buildServiceDescriptor() {
174
+ return {
175
+ type: "fetchNetworkCommandBaseClass",
176
+ version: "1.0",
177
+ service: FetchNetworkCommand
178
+ };
179
+ }
180
+ export {
181
+ FetchNetworkCommand,
182
+ buildServiceDescriptor,
183
+ createAbortableDecorator
184
+ };
185
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../network/dist/v1/index.js","../../src/v1/abortable-request-decorator.ts","../../src/v1/fetch-command.ts","../../src/v1/index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2022, Salesforce, Inc.,\n * All rights reserved.\n * For full license text, see the LICENSE.txt file\n */\nimport { buildSubscribableResult, isSubscribableResult, ok, err } from \"@conduit-client/utils\";\nimport { BaseCommand } from \"@conduit-client/command-base/v1\";\nclass NetworkCommand extends BaseCommand {\n constructor(services) {\n super();\n this.services = services;\n this.subscriptions = [];\n this.exposeSubscribeAndRefresh = false;\n }\n execute() {\n const result = this.fetch();\n if (this.exposeSubscribeAndRefresh) {\n return this.fetchSubscribableResult(result);\n }\n return result;\n }\n fetchSubscribableResult(res) {\n return res.then((networkResult) => {\n return buildSubscribableResult(\n networkResult,\n (cb) => {\n this.subscriptions.push(cb);\n return () => {\n this.subscriptions = this.subscriptions.filter((cb2) => cb2 !== cb);\n };\n },\n () => this.refresh()\n );\n });\n }\n refresh() {\n return this.execute().then((newResult) => {\n if (isSubscribableResult(newResult)) {\n const value = newResult.isOk() ? ok(newResult.value.data) : err(newResult.error.failure);\n this.subscriptions.forEach((cb) => {\n cb(value);\n });\n }\n return ok(void 0);\n });\n }\n async afterRequestHooks(_options) {\n }\n}\nfunction buildServiceDescriptor() {\n return {\n type: \"networkCommandBaseClass\",\n version: \"1.0\",\n service: NetworkCommand\n };\n}\nexport {\n NetworkCommand,\n buildServiceDescriptor\n};\n//# sourceMappingURL=index.js.map\n","import type { Command } from '@conduit-client/command-base/v1';\n\n/**\n * Options interface for commands that support abortion\n */\nexport interface AbortableCommandOptions {\n /**\n * Optional AbortSignal for request cancellation.\n * Follows standard web platform patterns (fetch API).\n */\n signal?: AbortSignal;\n}\n\n/**\n * Enhanced Command interface that indicates abortion capability\n */\nexport interface AbortableCommand<T, Params extends Array<any> = []> extends Command<T, Params> {\n readonly isAbortableCommand: true;\n readonly signal: AbortSignal;\n}\n\n/**\n * Type guard to check if a command is abortable\n */\nfunction isAbortableCommand<T>(command: Command<T>): command is AbortableCommand<T> {\n return 'isAbortableCommand' in command && (command as any).isAbortableCommand === true;\n}\n\n/**\n * Interface for commands that support fetch operations (can be aborted)\n */\ninterface FetchCapable {\n fetchParams?: unknown;\n}\n\n/**\n * Type guard to check if a command supports fetch operations\n */\nfunction hasFetchParams(command: any): command is FetchCapable {\n return command && typeof command === 'object' && 'fetchParams' in command;\n}\n\n/**\n * Factory function for creating abortable command proxies\n *\n * Provides a clean API for decorator creation with proper error handling\n * and graceful degradation for non-fetch commands.\n *\n * @param command - The command to make abortable\n * @param signal - The AbortSignal for request cancellation\n * @returns Proxied command if possible, original command with warning if not\n */\nexport function createAbortableDecorator<T>(command: Command<T>, options: any): Command<T> {\n if (!options?.signal || !(options?.signal instanceof AbortSignal)) {\n return command;\n }\n const { signal } = options;\n\n // Return original command if already decorated\n if (isAbortableCommand(command)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n 'Command is already abortable. Returning original command to avoid double-wrapping.'\n );\n }\n return command;\n }\n\n // Only decorate commands that support fetch operations\n if (!hasFetchParams(command)) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn(\n `Command ${command.constructor.name} does not support fetch operations. ` +\n 'AbortSignal will be ignored.'\n );\n }\n\n return command;\n }\n\n try {\n return new Proxy(command, {\n get(target: any, prop: string | symbol, receiver: any): any {\n // Add the abortable marker property\n if (prop === 'isAbortableCommand') {\n return true;\n }\n\n // Add signal property for access to the original AbortSignal\n if (prop === 'signal') {\n return signal;\n }\n\n // Intercept fetchParams getter/method access\n if (prop === 'fetchParams') {\n const originalFetchParams = target[prop];\n\n // Check if this is an internal execution (cache control system)\n const isInternal = target.isInternalExecution === true;\n\n // Handle both getter (property) and method patterns\n if (typeof originalFetchParams === 'function') {\n // fetchParams is a method\n return function (this: any, ...args: any[]) {\n const originalReturnValue = originalFetchParams.apply(this, args);\n\n // Only inject signal for user executions\n if (!isInternal) {\n const [url, init = {}] = originalReturnValue;\n return [url, { signal, ...init }];\n }\n\n return originalReturnValue;\n };\n } else {\n // fetchParams is a getter property\n if (\n !isInternal &&\n originalFetchParams &&\n Array.isArray(originalFetchParams)\n ) {\n const [url, init = {}] = originalFetchParams;\n return [url, { signal, ...init }];\n }\n\n return originalFetchParams;\n }\n }\n\n // Forward all other property/method access to the original command\n return Reflect.get(target, prop, receiver);\n },\n has(target: any, prop: string | symbol): boolean {\n // Ensure 'in' operator works for our synthetic properties\n if (prop === 'isAbortableCommand' || prop === 'signal') {\n return true;\n }\n return Reflect.has(target, prop);\n },\n });\n } catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(\n 'Failed to create abortable command proxy, returning original command unchanged.',\n error\n );\n }\n\n return command;\n }\n}\n","import { err, ok, toError, type Result } from '@conduit-client/utils';\nimport { NetworkCommand } from '@conduit-client/command-network/v1';\nimport type { NamedFetchService, FetchService } from '@conduit-client/service-fetch-network/v1';\nimport { createAbortableDecorator } from './abortable-request-decorator';\n\n/**\n * An implementation of NetworkCommand that uses HTTP/fetch as the transport mechanism.\n */\nexport abstract class FetchNetworkCommand<\n Data,\n ExtraServices extends object = object,\n> extends NetworkCommand<Data, NamedFetchService & ExtraServices> {\n /**\n * Available decorators for FetchNetworkCommand instances.\n * These decorators can be applied to enhance command functionality.\n */\n static readonly availableDecorators = {\n abortable: createAbortableDecorator,\n };\n\n constructor(protected services: NamedFetchService & ExtraServices) {\n super(services);\n }\n\n fetch(): PromiseLike<Result<Data, Error>> {\n return this.convertFetchResponseToData(this.services.fetch(...this.fetchParams));\n }\n\n protected async coerceError(errorResponse: Response): Promise<Error> {\n return toError(errorResponse.statusText); // Default Behavior\n }\n\n private convertFetchResponseToData<Data = unknown>(\n response: PromiseLike<Response>\n ): PromiseLike<Result<Data, Error>> {\n return response.then(\n (response) => {\n if (response.ok) {\n return response\n .json()\n .then(\n (json: Data) => ok(json),\n (reason: any) => err(toError(reason))\n )\n .finally(() => {\n try {\n this.afterRequestHooks({ statusCode: response.status });\n } catch (e) {}\n });\n } else {\n return this.coerceError(response)\n .then((coercedError) => {\n return err(coercedError);\n })\n .finally(() => {\n try {\n this.afterRequestHooks({ statusCode: response.status });\n } catch (e) {}\n });\n }\n },\n (reason) => err(toError(reason))\n );\n }\n\n protected abstract readonly fetchParams: Parameters<FetchService>;\n}\n","import { type NamedService, type ServiceDescriptor } from '@conduit-client/utils';\nimport { FetchNetworkCommand } from './fetch-command';\n\nexport { FetchNetworkCommand } from './fetch-command';\n\n// Export AbortableCommandDecorator types and utilities\nexport { createAbortableDecorator } from './abortable-request-decorator';\nexport type { AbortableCommand, AbortableCommandOptions } from './abortable-request-decorator';\n\nexport type FetchNetworkCommandServiceDescriptor = ServiceDescriptor<\n typeof FetchNetworkCommand,\n 'fetchNetworkCommandBaseClass',\n '1.0'\n>;\n\nexport function buildServiceDescriptor(): FetchNetworkCommandServiceDescriptor {\n return {\n type: 'fetchNetworkCommandBaseClass',\n version: '1.0',\n service: FetchNetworkCommand,\n };\n}\n\nexport type NamedFetchNetworkCommandService = NamedService<\n 'fetchNetworkCommandBaseClass',\n typeof FetchNetworkCommand\n>;\n"],"names":["response"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,MAAM,uBAAuB,YAAY;AAAA,EACvC,YAAY,UAAU;AACpB,UAAK;AACL,SAAK,WAAW;AAChB,SAAK,gBAAgB,CAAA;AACrB,SAAK,4BAA4B;AAAA,EACnC;AAAA,EACA,UAAU;AACR,UAAM,SAAS,KAAK,MAAK;AACzB,QAAI,KA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
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "@conduit-client/command-fetch-network",
3
+ "version": "2.0.0",
4
+ "private": false,
5
+ "description": "Luvio Fetch Network Command",
6
+ "type": "module",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/salesforce-experience-platform-emu/luvio-next.git",
10
+ "directory": "packages/@conduit-client/commands/fetch-network"
11
+ },
12
+ "license": "SEE LICENSE IN LICENSE.txt",
13
+ "exports": {
14
+ "./v1": {
15
+ "import": "./dist/v1/index.js",
16
+ "types": "./dist/types/v1/index.d.ts",
17
+ "require": "./dist/v1/index.js"
18
+ }
19
+ },
20
+ "main": "./dist/main/index.js",
21
+ "module": "./dist/main/index.js",
22
+ "types": "./dist/main/index.d.ts",
23
+ "files": [
24
+ "dist/"
25
+ ],
26
+ "scripts": {
27
+ "build": "vite build && tsc --build --emitDeclarationOnly",
28
+ "clean": "rm -rf dist",
29
+ "test": "vitest run",
30
+ "test:size": "size-limit",
31
+ "watch": "npm run build --watch"
32
+ },
33
+ "dependencies": {
34
+ "@conduit-client/command-base": "2.0.0",
35
+ "@conduit-client/command-network": "2.0.0",
36
+ "@conduit-client/service-fetch-network": "2.0.0",
37
+ "@conduit-client/utils": "2.0.0"
38
+ },
39
+ "volta": {
40
+ "extends": "../../../../package.json"
41
+ },
42
+ "size-limit": [
43
+ {
44
+ "path": "./dist/v1/index.js",
45
+ "limit": "2 kB"
46
+ }
47
+ ]
48
+ }