@conduit-client/command-http-graphql-normalized-cache-control 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.
package/dist/index.js ADDED
@@ -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,56 @@
1
+ import { CacheControlStrategyConfig } from '@conduit-client/service-cache-control/v1';
2
+ import { HttpGraphQLNormalizedCacheControlCommand } from '../http-graphql-normalized-cache-control-command';
3
+ import { BaseScalarFieldDef, BaseObjectFieldDef, GraphQLData, GraphQLDocumentRootTypeRepository, IdentifiableGraphQLTypeRepository, GraphQLInputExtension } from '@conduit-client/graphql-normalization/v1';
4
+ import { WriteInput } from '@conduit-client/type-normalization/v1';
5
+ export declare class TestHttpGraphQLNormalizedCacheControlCommand extends HttpGraphQLNormalizedCacheControlCommand {
6
+ get url(): string;
7
+ endpoint: string;
8
+ protected get cacheControlStrategyConfig(): CacheControlStrategyConfig;
9
+ }
10
+ export declare const namespace = "Test";
11
+ export type User = {
12
+ id: string;
13
+ name: string;
14
+ email: string | null;
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ __typename: 'User';
18
+ };
19
+ export declare class TestGraphQLTypeRootRepository extends GraphQLDocumentRootTypeRepository<GraphQLData, GraphQLData> {
20
+ readonly namespace = "Test";
21
+ readonly typeName = "Root";
22
+ cacheControl: {
23
+ readonly type: "max-age";
24
+ readonly maxAge: 100;
25
+ readonly generatedTime: 0;
26
+ };
27
+ get fields(): {
28
+ user: BaseObjectFieldDef<Record<string, any>, Record<string, any>, Record<string, unknown>>;
29
+ };
30
+ }
31
+ export declare class UserRepository extends IdentifiableGraphQLTypeRepository<User, any, {
32
+ id: string;
33
+ }> {
34
+ namespace: string;
35
+ typeName: string;
36
+ implementedInterfaces: never[];
37
+ cacheControl: {
38
+ readonly type: "max-age";
39
+ readonly maxAge: 100;
40
+ readonly generatedTime: 0;
41
+ };
42
+ buildKeyParams(input: WriteInput<User, GraphQLInputExtension>): {
43
+ id: string;
44
+ };
45
+ get fields(): {
46
+ id: BaseScalarFieldDef<User, User, Record<string, unknown>>;
47
+ name: BaseScalarFieldDef<User, User, Record<string, unknown>>;
48
+ email: BaseScalarFieldDef<User, User, Record<string, unknown>>;
49
+ createdAt: BaseScalarFieldDef<User, User, Record<string, unknown>>;
50
+ updatedAt: BaseScalarFieldDef<User, User, Record<string, unknown>>;
51
+ __typename: BaseScalarFieldDef<User, User, Record<string, unknown>>;
52
+ };
53
+ }
54
+ export declare const TypeRepositoryRegistry: {
55
+ User: UserRepository;
56
+ };
@@ -0,0 +1,45 @@
1
+ import { HttpNormalizedCacheControlCommand } from '@conduit-client/command-http-normalized-cache-control/v1';
2
+ import { type NamedPubSubService } from '@conduit-client/service-pubsub/v1';
3
+ import type { DataOf, ReadInputOf, WriteInputOf, WriteResponseOf } from '@conduit-client/type-normalization/v1';
4
+ import type { NamedCacheControllerService } from '@conduit-client/service-cache-control/v1';
5
+ import type { FetchService, NamedFetchService } from '@conduit-client/service-fetch-network/v1';
6
+ import { GraphQLDocumentRootTypeRepository, GraphQLRequestParams } from '@conduit-client/graphql-normalization/v1';
7
+ import { GraphQLResponse, GraphQLVariables, GraphQLFragmentDefinitions } from '@conduit-client/graphql-normalization/v1';
8
+ import { SelectionNode } from '@conduit-client/onestore-graphql-parser/v1';
9
+ import { Result, SubscribableResult, SyncOrAsync } from '@conduit-client/utils';
10
+ import { CacheControlRequestRunner } from '@conduit-client/command-cache-control/v1';
11
+ /**
12
+ * An implementation of BaseCommand that allows for extending abstract cache methods with GraphQL support
13
+ *
14
+ * @typeParam Data cache result for read operations
15
+ * @typeParam NetworkResult cache result including network metadata
16
+ * @typeParam ExtraServices additional named services needed by a subclass
17
+ */
18
+ export declare abstract class HttpGraphQLNormalizedCacheControlCommand<ExtraServices extends object = object> extends HttpNormalizedCacheControlCommand<GraphQLDocumentRootTypeRepository<any, any>, DataOf<GraphQLDocumentRootTypeRepository<any, any>>, GraphQLResponse, ReadInputOf<GraphQLDocumentRootTypeRepository<any, any>>, WriteResponseOf<GraphQLDocumentRootTypeRepository<any, any>>, WriteInputOf<GraphQLDocumentRootTypeRepository<any, any>>, ExtraServices> {
19
+ protected config: GraphQLRequestParams;
20
+ protected documentRootType: GraphQLDocumentRootTypeRepository<any, any>;
21
+ protected services: NamedCacheControllerService & Partial<NamedPubSubService> & NamedFetchService & ExtraServices;
22
+ constructor(config: GraphQLRequestParams, documentRootType: GraphQLDocumentRootTypeRepository<any, any>, services: NamedCacheControllerService & Partial<NamedPubSubService> & NamedFetchService & ExtraServices);
23
+ buildResultType(): GraphQLDocumentRootTypeRepository<any, any, Record<string, unknown>>;
24
+ protected get operationType(): 'query' | 'mutation';
25
+ buildQuery(): {
26
+ selections: SelectionNode[];
27
+ request: {
28
+ definitions: {
29
+ variables: GraphQLVariables;
30
+ fragments: GraphQLFragmentDefinitions;
31
+ };
32
+ };
33
+ parentFieldSelection: import("@conduit-client/onestore-graphql-parser/v1").FieldNode | undefined;
34
+ type: string;
35
+ keyParams: null;
36
+ };
37
+ abstract get url(): Parameters<FetchService>[0];
38
+ get fetchParams(): Parameters<FetchService>;
39
+ get originalFetchParams(): Parameters<FetchService>;
40
+ buildRequestQuery(): import("@conduit-client/onestore-graphql-parser/v1").DocumentNode;
41
+ buildWriteInput(data: GraphQLResponse): any;
42
+ protected processFetchReturnValue(json: GraphQLResponse): Result<GraphQLResponse, Error>;
43
+ runOriginalRequest(): SyncOrAsync<SubscribableResult<GraphQLResponse, Error>>;
44
+ handleCacheControllerResult(result: Result<void, Error>, requestRunner: CacheControlRequestRunner<GraphQLResponse, GraphQLResponse>): SyncOrAsync<SubscribableResult<any, Error>>;
45
+ }
@@ -0,0 +1,6 @@
1
+ import { type NamedService, type ServiceDescriptor } from '@conduit-client/utils';
2
+ import { HttpGraphQLNormalizedCacheControlCommand } from './http-graphql-normalized-cache-control-command';
3
+ export { HttpGraphQLNormalizedCacheControlCommand } from './http-graphql-normalized-cache-control-command';
4
+ export type HttpGraphQLNormalizedCacheControlCommandServiceDescriptor = ServiceDescriptor<typeof HttpGraphQLNormalizedCacheControlCommand, 'httpGraphQLNormalizedCacheControlCommand', '1.0'>;
5
+ export type NamedHttpGraphQLNormalizedCacheControlCommand = NamedService<'httpGraphQLNormalizedCacheControlCommand', typeof HttpGraphQLNormalizedCacheControlCommand>;
6
+ export declare function buildServiceDescriptor(): HttpGraphQLNormalizedCacheControlCommandServiceDescriptor;
@@ -0,0 +1,126 @@
1
+ /*!
2
+ * Copyright (c) 2022, Salesforce, Inc.,
3
+ * All rights reserved.
4
+ * For full license text, see the LICENSE.txt file
5
+ */
6
+ import { HttpNormalizedCacheControlCommand } from "@conduit-client/command-http-normalized-cache-control/v1";
7
+ import { findExecutableOperation, buildGraphQLInputExtension, addTypenameToDocument } from "@conduit-client/graphql-normalization/v1";
8
+ import { print } from "@conduit-client/onestore-graphql-parser/v1";
9
+ import { InternalError, err, UserVisibleError, ok, buildSubscribableResult } from "@conduit-client/utils";
10
+ class HttpGraphQLNormalizedCacheControlCommand extends HttpNormalizedCacheControlCommand {
11
+ constructor(config, documentRootType, services) {
12
+ super(services);
13
+ this.config = config;
14
+ this.documentRootType = documentRootType;
15
+ this.services = services;
16
+ }
17
+ buildResultType() {
18
+ return this.documentRootType;
19
+ }
20
+ get operationType() {
21
+ const operationResult = findExecutableOperation(this.config);
22
+ if (operationResult.isErr()) {
23
+ return "mutation";
24
+ }
25
+ const operationType = operationResult.value.operation.toString();
26
+ if (operationType === "mutation" || operationType === "query") {
27
+ return operationType;
28
+ }
29
+ return "mutation";
30
+ }
31
+ buildQuery() {
32
+ const extensionResult = buildGraphQLInputExtension(this.config);
33
+ if (extensionResult.isErr()) {
34
+ throw extensionResult.error;
35
+ }
36
+ return {
37
+ type: "keyParams",
38
+ keyParams: null,
39
+ ...extensionResult.value
40
+ };
41
+ }
42
+ get fetchParams() {
43
+ const body = { ...this.config, query: print(this.buildRequestQuery()) };
44
+ const headers = {
45
+ "Content-Type": "application/json"
46
+ };
47
+ const params = {
48
+ method: "POST",
49
+ cache: "no-cache",
50
+ headers,
51
+ body: JSON.stringify(body)
52
+ };
53
+ return [this.url, params];
54
+ }
55
+ get originalFetchParams() {
56
+ const body = { ...this.config, query: print(this.config.query) };
57
+ const headers = {
58
+ "Content-Type": "application/json"
59
+ };
60
+ const params = {
61
+ method: "POST",
62
+ cache: "no-cache",
63
+ headers,
64
+ body: JSON.stringify(body)
65
+ };
66
+ return [this.url, params];
67
+ }
68
+ buildRequestQuery() {
69
+ const augmentedQueryResult = this.documentRootType.buildAugmentedQuery(this.config);
70
+ if (augmentedQueryResult.isErr()) {
71
+ throw augmentedQueryResult.error;
72
+ }
73
+ return addTypenameToDocument(augmentedQueryResult.value);
74
+ }
75
+ buildWriteInput(data) {
76
+ const extensionResult = buildGraphQLInputExtension({
77
+ ...this.config,
78
+ query: this.buildRequestQuery()
79
+ });
80
+ if (extensionResult.isErr()) {
81
+ throw new InternalError(extensionResult.error);
82
+ }
83
+ return { data: data.data, ...extensionResult.value };
84
+ }
85
+ processFetchReturnValue(json) {
86
+ if (json.hasOwnProperty("errors") && json.errors && json.errors.length > 0) {
87
+ return err(new UserVisibleError(json));
88
+ }
89
+ return ok(json);
90
+ }
91
+ runOriginalRequest() {
92
+ return this.convertFetchResponseToData(
93
+ this.services.fetch(...this.originalFetchParams)
94
+ ).then((result) => {
95
+ return buildSubscribableResult(result, this.buildSubscribe(), () => this.refresh());
96
+ });
97
+ }
98
+ // Any changes to this method should most likely be duplicated in the aura command as well
99
+ handleCacheControllerResult(result, requestRunner) {
100
+ if (this.operationType === "mutation") {
101
+ return super.handleCacheControllerResult(result, requestRunner);
102
+ }
103
+ const { networkError, returnData } = requestRunner;
104
+ return this.publishUpdatedKeys().then(() => {
105
+ if (networkError || returnData === void 0 || returnData.isErr() || result.isErr()) {
106
+ return this.runOriginalRequest();
107
+ }
108
+ if (this.subscriptions.length > 0) {
109
+ this.subscribe();
110
+ }
111
+ return returnData;
112
+ });
113
+ }
114
+ }
115
+ function buildServiceDescriptor() {
116
+ return {
117
+ type: "httpGraphQLNormalizedCacheControlCommand",
118
+ version: "1.0",
119
+ service: HttpGraphQLNormalizedCacheControlCommand
120
+ };
121
+ }
122
+ export {
123
+ HttpGraphQLNormalizedCacheControlCommand,
124
+ buildServiceDescriptor
125
+ };
126
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/v1/http-graphql-normalized-cache-control-command.ts","../../src/v1/index.ts"],"sourcesContent":["import { HttpNormalizedCacheControlCommand } from '@conduit-client/command-http-normalized-cache-control/v1';\nimport { type NamedPubSubService } from '@conduit-client/service-pubsub/v1';\nimport type {\n DataOf,\n ReadInputOf,\n WriteInputOf,\n WriteResponseOf,\n} from '@conduit-client/type-normalization/v1';\nimport type { NamedCacheControllerService } from '@conduit-client/service-cache-control/v1';\nimport type { FetchService, NamedFetchService } from '@conduit-client/service-fetch-network/v1';\nimport {\n addTypenameToDocument,\n buildGraphQLInputExtension,\n findExecutableOperation,\n GraphQLDocumentRootTypeRepository,\n GraphQLRequestParams,\n} from '@conduit-client/graphql-normalization/v1';\nimport {\n GraphQLResponse,\n GraphQLVariables,\n GraphQLFragmentDefinitions,\n} from '@conduit-client/graphql-normalization/v1';\nimport { print, SelectionNode } from '@conduit-client/onestore-graphql-parser/v1';\nimport {\n buildSubscribableResult,\n err,\n InternalError,\n ok,\n Result,\n SubscribableResult,\n SyncOrAsync,\n UserVisibleError,\n} from '@conduit-client/utils';\nimport { CacheControlRequestRunner } from '@conduit-client/command-cache-control/v1';\n\n/**\n * An implementation of BaseCommand that allows for extending abstract cache methods with GraphQL support\n *\n * @typeParam Data cache result for read operations\n * @typeParam NetworkResult cache result including network metadata\n * @typeParam ExtraServices additional named services needed by a subclass\n */\nexport abstract class HttpGraphQLNormalizedCacheControlCommand<\n ExtraServices extends object = object,\n> extends HttpNormalizedCacheControlCommand<\n GraphQLDocumentRootTypeRepository<any, any>,\n DataOf<GraphQLDocumentRootTypeRepository<any, any>>,\n GraphQLResponse,\n ReadInputOf<GraphQLDocumentRootTypeRepository<any, any>>,\n WriteResponseOf<GraphQLDocumentRootTypeRepository<any, any>>,\n WriteInputOf<GraphQLDocumentRootTypeRepository<any, any>>,\n ExtraServices\n> {\n constructor(\n protected config: GraphQLRequestParams,\n protected documentRootType: GraphQLDocumentRootTypeRepository<any, any>,\n protected services: NamedCacheControllerService &\n Partial<NamedPubSubService> &\n NamedFetchService &\n ExtraServices\n ) {\n super(services);\n }\n\n buildResultType() {\n return this.documentRootType;\n }\n\n protected get operationType(): 'query' | 'mutation' {\n const operationResult = findExecutableOperation(this.config);\n if (operationResult.isErr()) {\n return 'mutation'; // Default to mutation to avoid subscribing to an invalid operation\n }\n const operationType = operationResult.value.operation.toString();\n if (operationType === 'mutation' || operationType === 'query') {\n return operationType;\n }\n return 'mutation'; // Coerce unhandled operation types to mutation\n }\n\n buildQuery() {\n const extensionResult = buildGraphQLInputExtension(this.config);\n if (extensionResult.isErr()) {\n throw extensionResult.error;\n }\n return {\n type: 'keyParams',\n keyParams: null,\n ...extensionResult.value,\n };\n }\n\n abstract get url(): Parameters<FetchService>[0];\n\n get fetchParams(): Parameters<FetchService> {\n const body = { ...this.config, query: print(this.buildRequestQuery()) };\n const headers: Record<string, any> = {\n 'Content-Type': 'application/json',\n };\n const params: Parameters<FetchService>[1] = {\n method: 'POST',\n cache: 'no-cache',\n headers,\n body: JSON.stringify(body),\n };\n return [this.url, params];\n }\n\n get originalFetchParams(): Parameters<FetchService> {\n const body = { ...this.config, query: print(this.config.query) };\n const headers: Record<string, any> = {\n 'Content-Type': 'application/json',\n };\n const params: Parameters<FetchService>[1] = {\n method: 'POST',\n cache: 'no-cache',\n headers,\n body: JSON.stringify(body),\n };\n return [this.url, params];\n }\n\n buildRequestQuery() {\n const augmentedQueryResult = this.documentRootType.buildAugmentedQuery(this.config);\n if (augmentedQueryResult.isErr()) {\n throw augmentedQueryResult.error;\n }\n return addTypenameToDocument(augmentedQueryResult.value);\n }\n\n buildWriteInput(data: GraphQLResponse): any {\n const extensionResult = buildGraphQLInputExtension({\n ...this.config,\n query: this.buildRequestQuery(),\n });\n if (extensionResult.isErr()) {\n throw new InternalError(extensionResult.error);\n }\n return { data: data.data, ...extensionResult.value };\n }\n\n protected processFetchReturnValue(json: GraphQLResponse): Result<GraphQLResponse, Error> {\n if (json.hasOwnProperty('errors') && json.errors && json.errors.length > 0) {\n return err(new UserVisibleError(json));\n }\n return ok(json);\n }\n\n runOriginalRequest(): SyncOrAsync<SubscribableResult<GraphQLResponse, Error>> {\n return this.convertFetchResponseToData(\n this.services.fetch!(...this.originalFetchParams)\n ).then((result) => {\n return buildSubscribableResult(result, this.buildSubscribe(), () => this.refresh());\n });\n }\n\n // Any changes to this method should most likely be duplicated in the aura command as well\n handleCacheControllerResult(\n result: Result<void, Error>,\n requestRunner: CacheControlRequestRunner<GraphQLResponse, GraphQLResponse>\n ) {\n if (this.operationType === 'mutation') {\n return super.handleCacheControllerResult(result, requestRunner);\n }\n const { networkError, returnData } = requestRunner;\n return this.publishUpdatedKeys().then(() => {\n // For any error state, we want to return the original requests response\n // Possible error states are:\n // We got a network error\n // We didn't get any return data\n // The return data (read from cache result) was an error\n // The cache control execution returned an internal error\n if (networkError || returnData === undefined || returnData.isErr() || result.isErr()) {\n return this.runOriginalRequest();\n }\n if (this.subscriptions.length > 0) {\n this.subscribe();\n }\n return returnData;\n });\n }\n}\n","import { type NamedService, type ServiceDescriptor } from '@conduit-client/utils';\nimport { HttpGraphQLNormalizedCacheControlCommand } from './http-graphql-normalized-cache-control-command';\n\nexport { HttpGraphQLNormalizedCacheControlCommand } from './http-graphql-normalized-cache-control-command';\n\nexport type HttpGraphQLNormalizedCacheControlCommandServiceDescriptor = ServiceDescriptor<\n typeof HttpGraphQLNormalizedCacheControlCommand,\n 'httpGraphQLNormalizedCacheControlCommand',\n '1.0'\n>;\n\nexport type NamedHttpGraphQLNormalizedCacheControlCommand = NamedService<\n 'httpGraphQLNormalizedCacheControlCommand',\n typeof HttpGraphQLNormalizedCacheControlCommand\n>;\n\nexport function buildServiceDescriptor(): HttpGraphQLNormalizedCacheControlCommandServiceDescriptor {\n return {\n type: 'httpGraphQLNormalizedCacheControlCommand',\n version: '1.0',\n service: HttpGraphQLNormalizedCacheControlCommand,\n };\n}\n"],"names":[],"mappings":"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"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@conduit-client/command-http-graphql-normalized-cache-control",
3
+ "version": "2.0.0",
4
+ "private": false,
5
+ "description": "Luvio Http GraphQL Normalized Cache Control 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/http-graphql-normalized-cache-control"
11
+ },
12
+ "license": "SEE LICENSE IN LICENSE.txt",
13
+ "exports": {
14
+ "./v1": {
15
+ "types": "./dist/types/v1/index.d.ts",
16
+ "import": "./dist/v1/index.js",
17
+ "require": "./dist/v1/index.js"
18
+ }
19
+ },
20
+ "main": "./dist/index.js",
21
+ "module": "./dist/index.js",
22
+ "types": "./dist/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-cache-control": "2.0.0",
36
+ "@conduit-client/command-http-cache-control": "2.0.0",
37
+ "@conduit-client/command-http-normalized-cache-control": "2.0.0",
38
+ "@conduit-client/graphql-normalization": "2.0.0",
39
+ "@conduit-client/onestore-graphql-parser": "2.0.0",
40
+ "@conduit-client/service-cache-control": "2.0.0",
41
+ "@conduit-client/service-fetch-network": "2.0.0",
42
+ "@conduit-client/service-pubsub": "2.0.0",
43
+ "@conduit-client/type-normalization": "2.0.0",
44
+ "@conduit-client/utils": "2.0.0"
45
+ },
46
+ "volta": {
47
+ "extends": "../../../../package.json"
48
+ },
49
+ "size-limit": [
50
+ {
51
+ "path": "./dist/v1/index.js",
52
+ "limit": "3 kB"
53
+ }
54
+ ]
55
+ }