@contember/client 2.0.0-alpha.1 → 2.0.0-alpha.12
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/api-extractor.json +3 -0
- package/dist/development/index.cjs +14 -19
- package/dist/development/index.cjs.map +1 -1
- package/dist/development/index.js +10 -14
- package/dist/development/index.js.map +1 -1
- package/dist/development/src/content/formatContentApiRelativeUrl.cjs.map +1 -0
- package/dist/development/src/content/formatContentApiRelativeUrl.js.map +1 -0
- package/dist/development/src/content/params/whereToFilter.cjs.map +1 -0
- package/dist/development/src/content/params/whereToFilter.js.map +1 -0
- package/dist/development/src/content/replaceGraphQlLiteral.cjs.map +1 -0
- package/dist/development/src/content/replaceGraphQlLiteral.js.map +1 -0
- package/dist/development/{content → src/content}/upload/GenerateUploadUrlMutationBuilder.cjs +8 -11
- package/dist/development/src/content/upload/GenerateUploadUrlMutationBuilder.cjs.map +1 -0
- package/dist/development/{content → src/content}/upload/GenerateUploadUrlMutationBuilder.js +7 -10
- package/dist/development/src/content/upload/GenerateUploadUrlMutationBuilder.js.map +1 -0
- package/dist/development/src/graphQlBuilder/GraphQlLiteral.cjs.map +1 -0
- package/dist/development/src/graphQlBuilder/GraphQlLiteral.js.map +1 -0
- package/dist/development/src/graphQlClient/GraphQlClient.cjs.map +1 -0
- package/dist/development/src/graphQlClient/GraphQlClient.js.map +1 -0
- package/dist/development/src/system/formatSystemApiRelativeUrl.cjs.map +1 -0
- package/dist/development/src/system/formatSystemApiRelativeUrl.js.map +1 -0
- package/dist/development/src/tenant/loginMutation.cjs.map +1 -0
- package/dist/development/src/tenant/loginMutation.js.map +1 -0
- package/dist/development/src/tenant/tenantApiRelativeUrl.cjs.map +1 -0
- package/dist/development/src/tenant/tenantApiRelativeUrl.js.map +1 -0
- package/dist/development/src/tenant/tenantErrorMessages.cjs.map +1 -0
- package/dist/development/src/tenant/tenantErrorMessages.js.map +1 -0
- package/dist/production/index.cjs +14 -19
- package/dist/production/index.cjs.map +1 -1
- package/dist/production/index.js +10 -14
- package/dist/production/index.js.map +1 -1
- package/dist/production/src/content/formatContentApiRelativeUrl.cjs.map +1 -0
- package/dist/production/src/content/formatContentApiRelativeUrl.js.map +1 -0
- package/dist/production/src/content/params/whereToFilter.cjs.map +1 -0
- package/dist/production/src/content/params/whereToFilter.js.map +1 -0
- package/dist/production/src/content/replaceGraphQlLiteral.cjs.map +1 -0
- package/dist/production/src/content/replaceGraphQlLiteral.js.map +1 -0
- package/dist/production/{content → src/content}/upload/GenerateUploadUrlMutationBuilder.cjs +8 -11
- package/dist/production/src/content/upload/GenerateUploadUrlMutationBuilder.cjs.map +1 -0
- package/dist/production/{content → src/content}/upload/GenerateUploadUrlMutationBuilder.js +7 -10
- package/dist/production/src/content/upload/GenerateUploadUrlMutationBuilder.js.map +1 -0
- package/dist/production/src/graphQlBuilder/GraphQlLiteral.cjs.map +1 -0
- package/dist/production/src/graphQlBuilder/GraphQlLiteral.js.map +1 -0
- package/dist/production/src/graphQlClient/GraphQlClient.cjs.map +1 -0
- package/dist/production/src/graphQlClient/GraphQlClient.js.map +1 -0
- package/dist/production/src/system/formatSystemApiRelativeUrl.cjs.map +1 -0
- package/dist/production/src/system/formatSystemApiRelativeUrl.js.map +1 -0
- package/dist/production/src/tenant/loginMutation.cjs.map +1 -0
- package/dist/production/src/tenant/loginMutation.js.map +1 -0
- package/dist/production/src/tenant/tenantApiRelativeUrl.cjs.map +1 -0
- package/dist/production/src/tenant/tenantApiRelativeUrl.js.map +1 -0
- package/dist/production/src/tenant/tenantErrorMessages.cjs.map +1 -0
- package/dist/production/src/tenant/tenantErrorMessages.js.map +1 -0
- package/dist/types/content/params/whereToFilter.d.ts.map +1 -1
- package/dist/types/content/replaceGraphQlLiteral.d.ts.map +1 -1
- package/dist/types/content/upload/index.d.ts +0 -6
- package/dist/types/content/upload/index.d.ts.map +1 -1
- package/dist/types/graphQlClient/GraphQlClient.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/utils/readFileAsArrayBuffer.d.ts.map +1 -1
- package/package.json +9 -17
- package/src/content/replaceGraphQlLiteral.ts +1 -1
- package/src/content/upload/index.ts +0 -6
- package/src/graphQlClient/GraphQlClient.ts +1 -0
- package/src/index.ts +2 -2
- package/src/tsconfig.json +7 -1
- package/tests/cases/unit/generateUploadUrlMutationBuilder.spec.ts +80 -0
- package/tests/cases/unit/params.spec.ts +26 -0
- package/tests/tsconfig.json +10 -0
- package/tsconfig.json +8 -0
- package/tsdoc.json +6 -0
- package/vitest.config.ts +3 -0
- package/dist/development/content/formatContentApiRelativeUrl.cjs.map +0 -1
- package/dist/development/content/formatContentApiRelativeUrl.js.map +0 -1
- package/dist/development/content/params/whereToFilter.cjs.map +0 -1
- package/dist/development/content/params/whereToFilter.js.map +0 -1
- package/dist/development/content/replaceGraphQlLiteral.cjs.map +0 -1
- package/dist/development/content/replaceGraphQlLiteral.js.map +0 -1
- package/dist/development/content/upload/FileUploadError.cjs +0 -10
- package/dist/development/content/upload/FileUploadError.cjs.map +0 -1
- package/dist/development/content/upload/FileUploadError.js +0 -10
- package/dist/development/content/upload/FileUploadError.js.map +0 -1
- package/dist/development/content/upload/GenerateUploadUrlMutationBuilder.cjs.map +0 -1
- package/dist/development/content/upload/GenerateUploadUrlMutationBuilder.js.map +0 -1
- package/dist/development/content/upload/S3FileUploader.cjs +0 -107
- package/dist/development/content/upload/S3FileUploader.cjs.map +0 -1
- package/dist/development/content/upload/S3FileUploader.js +0 -107
- package/dist/development/content/upload/S3FileUploader.js.map +0 -1
- package/dist/development/graphQlBuilder/GraphQlLiteral.cjs.map +0 -1
- package/dist/development/graphQlBuilder/GraphQlLiteral.js.map +0 -1
- package/dist/development/graphQlClient/GraphQlClient.cjs.map +0 -1
- package/dist/development/graphQlClient/GraphQlClient.js.map +0 -1
- package/dist/development/system/formatSystemApiRelativeUrl.cjs.map +0 -1
- package/dist/development/system/formatSystemApiRelativeUrl.js.map +0 -1
- package/dist/development/tenant/loginMutation.cjs.map +0 -1
- package/dist/development/tenant/loginMutation.js.map +0 -1
- package/dist/development/tenant/tenantApiRelativeUrl.cjs.map +0 -1
- package/dist/development/tenant/tenantApiRelativeUrl.js.map +0 -1
- package/dist/development/tenant/tenantErrorMessages.cjs.map +0 -1
- package/dist/development/tenant/tenantErrorMessages.js.map +0 -1
- package/dist/development/utils/readFileAsArrayBuffer.cjs +0 -15
- package/dist/development/utils/readFileAsArrayBuffer.cjs.map +0 -1
- package/dist/development/utils/readFileAsArrayBuffer.js +0 -15
- package/dist/development/utils/readFileAsArrayBuffer.js.map +0 -1
- package/dist/production/content/formatContentApiRelativeUrl.cjs.map +0 -1
- package/dist/production/content/formatContentApiRelativeUrl.js.map +0 -1
- package/dist/production/content/params/whereToFilter.cjs.map +0 -1
- package/dist/production/content/params/whereToFilter.js.map +0 -1
- package/dist/production/content/replaceGraphQlLiteral.cjs.map +0 -1
- package/dist/production/content/replaceGraphQlLiteral.js.map +0 -1
- package/dist/production/content/upload/FileUploadError.cjs +0 -10
- package/dist/production/content/upload/FileUploadError.cjs.map +0 -1
- package/dist/production/content/upload/FileUploadError.js +0 -10
- package/dist/production/content/upload/FileUploadError.js.map +0 -1
- package/dist/production/content/upload/GenerateUploadUrlMutationBuilder.cjs.map +0 -1
- package/dist/production/content/upload/GenerateUploadUrlMutationBuilder.js.map +0 -1
- package/dist/production/content/upload/S3FileUploader.cjs +0 -107
- package/dist/production/content/upload/S3FileUploader.cjs.map +0 -1
- package/dist/production/content/upload/S3FileUploader.js +0 -107
- package/dist/production/content/upload/S3FileUploader.js.map +0 -1
- package/dist/production/graphQlBuilder/GraphQlLiteral.cjs.map +0 -1
- package/dist/production/graphQlBuilder/GraphQlLiteral.js.map +0 -1
- package/dist/production/graphQlClient/GraphQlClient.cjs.map +0 -1
- package/dist/production/graphQlClient/GraphQlClient.js.map +0 -1
- package/dist/production/system/formatSystemApiRelativeUrl.cjs.map +0 -1
- package/dist/production/system/formatSystemApiRelativeUrl.js.map +0 -1
- package/dist/production/tenant/loginMutation.cjs.map +0 -1
- package/dist/production/tenant/loginMutation.js.map +0 -1
- package/dist/production/tenant/tenantApiRelativeUrl.cjs.map +0 -1
- package/dist/production/tenant/tenantApiRelativeUrl.js.map +0 -1
- package/dist/production/tenant/tenantErrorMessages.cjs.map +0 -1
- package/dist/production/tenant/tenantErrorMessages.js.map +0 -1
- package/dist/production/utils/readFileAsArrayBuffer.cjs +0 -15
- package/dist/production/utils/readFileAsArrayBuffer.cjs.map +0 -1
- package/dist/production/utils/readFileAsArrayBuffer.js +0 -15
- package/dist/production/utils/readFileAsArrayBuffer.js.map +0 -1
- package/dist/types/content/upload/FileUploadError.d.ts +0 -9
- package/dist/types/content/upload/FileUploadError.d.ts.map +0 -1
- package/dist/types/content/upload/FileUploadProgress.d.ts +0 -4
- package/dist/types/content/upload/FileUploadProgress.d.ts.map +0 -1
- package/dist/types/content/upload/FileUploader.d.ts +0 -15
- package/dist/types/content/upload/FileUploader.d.ts.map +0 -1
- package/dist/types/content/upload/S3FileUploader.d.ts +0 -33
- package/dist/types/content/upload/S3FileUploader.d.ts.map +0 -1
- package/dist/types/content/upload/SwitchFileUploader.d.ts +0 -13
- package/dist/types/content/upload/SwitchFileUploader.d.ts.map +0 -1
- package/dist/types/content/upload/UploadedFileMetadata.d.ts +0 -4
- package/dist/types/content/upload/UploadedFileMetadata.d.ts.map +0 -1
- package/src/content/upload/FileUploadError.ts +0 -10
- package/src/content/upload/FileUploadProgress.ts +0 -3
- package/src/content/upload/FileUploader.ts +0 -19
- package/src/content/upload/S3FileUploader.ts +0 -150
- package/src/content/upload/SwitchFileUploader.ts +0 -40
- package/src/content/upload/UploadedFileMetadata.ts +0 -3
- /package/dist/development/{content → src/content}/formatContentApiRelativeUrl.cjs +0 -0
- /package/dist/development/{content → src/content}/formatContentApiRelativeUrl.js +0 -0
- /package/dist/development/{content → src/content}/params/whereToFilter.cjs +0 -0
- /package/dist/development/{content → src/content}/params/whereToFilter.js +0 -0
- /package/dist/development/{content → src/content}/replaceGraphQlLiteral.cjs +0 -0
- /package/dist/development/{content → src/content}/replaceGraphQlLiteral.js +0 -0
- /package/dist/development/{graphQlBuilder → src/graphQlBuilder}/GraphQlLiteral.cjs +0 -0
- /package/dist/development/{graphQlBuilder → src/graphQlBuilder}/GraphQlLiteral.js +0 -0
- /package/dist/development/{graphQlClient → src/graphQlClient}/GraphQlClient.cjs +0 -0
- /package/dist/development/{graphQlClient → src/graphQlClient}/GraphQlClient.js +0 -0
- /package/dist/development/{system → src/system}/formatSystemApiRelativeUrl.cjs +0 -0
- /package/dist/development/{system → src/system}/formatSystemApiRelativeUrl.js +0 -0
- /package/dist/development/{tenant → src/tenant}/loginMutation.cjs +0 -0
- /package/dist/development/{tenant → src/tenant}/loginMutation.js +0 -0
- /package/dist/development/{tenant → src/tenant}/tenantApiRelativeUrl.cjs +0 -0
- /package/dist/development/{tenant → src/tenant}/tenantApiRelativeUrl.js +0 -0
- /package/dist/development/{tenant → src/tenant}/tenantErrorMessages.cjs +0 -0
- /package/dist/development/{tenant → src/tenant}/tenantErrorMessages.js +0 -0
- /package/dist/production/{content → src/content}/formatContentApiRelativeUrl.cjs +0 -0
- /package/dist/production/{content → src/content}/formatContentApiRelativeUrl.js +0 -0
- /package/dist/production/{content → src/content}/params/whereToFilter.cjs +0 -0
- /package/dist/production/{content → src/content}/params/whereToFilter.js +0 -0
- /package/dist/production/{content → src/content}/replaceGraphQlLiteral.cjs +0 -0
- /package/dist/production/{content → src/content}/replaceGraphQlLiteral.js +0 -0
- /package/dist/production/{graphQlBuilder → src/graphQlBuilder}/GraphQlLiteral.cjs +0 -0
- /package/dist/production/{graphQlBuilder → src/graphQlBuilder}/GraphQlLiteral.js +0 -0
- /package/dist/production/{graphQlClient → src/graphQlClient}/GraphQlClient.cjs +0 -0
- /package/dist/production/{graphQlClient → src/graphQlClient}/GraphQlClient.js +0 -0
- /package/dist/production/{system → src/system}/formatSystemApiRelativeUrl.cjs +0 -0
- /package/dist/production/{system → src/system}/formatSystemApiRelativeUrl.js +0 -0
- /package/dist/production/{tenant → src/tenant}/loginMutation.cjs +0 -0
- /package/dist/production/{tenant → src/tenant}/loginMutation.js +0 -0
- /package/dist/production/{tenant → src/tenant}/tenantApiRelativeUrl.cjs +0 -0
- /package/dist/production/{tenant → src/tenant}/tenantApiRelativeUrl.js +0 -0
- /package/dist/production/{tenant → src/tenant}/tenantErrorMessages.cjs +0 -0
- /package/dist/production/{tenant → src/tenant}/tenantErrorMessages.js +0 -0
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const clientContent = require("@contember/client-content");
|
|
4
|
-
const GraphQlLiteral = require("./graphQlBuilder/GraphQlLiteral.cjs");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const formatContentApiRelativeUrl = require("./content/formatContentApiRelativeUrl.cjs");
|
|
10
|
-
const replaceGraphQlLiteral = require("./content/replaceGraphQlLiteral.cjs");
|
|
4
|
+
const GraphQlLiteral = require("./src/graphQlBuilder/GraphQlLiteral.cjs");
|
|
5
|
+
const GenerateUploadUrlMutationBuilder = require("./src/content/upload/GenerateUploadUrlMutationBuilder.cjs");
|
|
6
|
+
const whereToFilter = require("./src/content/params/whereToFilter.cjs");
|
|
7
|
+
const formatContentApiRelativeUrl = require("./src/content/formatContentApiRelativeUrl.cjs");
|
|
8
|
+
const replaceGraphQlLiteral = require("./src/content/replaceGraphQlLiteral.cjs");
|
|
11
9
|
const graphqlClient = require("@contember/graphql-client");
|
|
12
|
-
const GraphQlClient = require("./graphQlClient/GraphQlClient.cjs");
|
|
13
|
-
const formatSystemApiRelativeUrl = require("./system/formatSystemApiRelativeUrl.cjs");
|
|
14
|
-
const loginMutation = require("./tenant/loginMutation.cjs");
|
|
15
|
-
const tenantApiRelativeUrl = require("./tenant/tenantApiRelativeUrl.cjs");
|
|
16
|
-
const tenantErrorMessages = require("./tenant/tenantErrorMessages.cjs");
|
|
10
|
+
const GraphQlClient = require("./src/graphQlClient/GraphQlClient.cjs");
|
|
11
|
+
const formatSystemApiRelativeUrl = require("./src/system/formatSystemApiRelativeUrl.cjs");
|
|
12
|
+
const loginMutation = require("./src/tenant/loginMutation.cjs");
|
|
13
|
+
const tenantApiRelativeUrl = require("./src/tenant/tenantApiRelativeUrl.cjs");
|
|
14
|
+
const tenantErrorMessages = require("./src/tenant/tenantErrorMessages.cjs");
|
|
17
15
|
exports.GraphQlBuilder = void 0;
|
|
18
16
|
((GraphQlBuilder2) => {
|
|
19
17
|
GraphQlBuilder2.GraphqlLiteral = GraphQlLiteral.GraphQlLiteral;
|
|
20
18
|
GraphQlBuilder2.GraphQlLiteral = GraphQlLiteral.GraphQlLiteral;
|
|
21
19
|
})(exports.GraphQlBuilder || (exports.GraphQlBuilder = {}));
|
|
22
20
|
exports.GraphQlLiteral = GraphQlLiteral.GraphQlLiteral;
|
|
23
|
-
exports.FileUploadError = FileUploadError.FileUploadError;
|
|
24
21
|
exports.GenerateUploadUrlMutationBuilder = GenerateUploadUrlMutationBuilder.GenerateUploadUrlMutationBuilder;
|
|
25
|
-
exports.S3FileUploader = S3FileUploader.S3FileUploader;
|
|
26
22
|
exports.whereToFilter = whereToFilter.whereToFilter;
|
|
27
23
|
exports.formatContentApiRelativeUrl = formatContentApiRelativeUrl.formatContentApiRelativeUrl;
|
|
28
24
|
exports.replaceGraphQlLiteral = replaceGraphQlLiteral.replaceGraphQlLiteral;
|
|
@@ -37,10 +33,9 @@ exports.tenantApiRelativeUrl = tenantApiRelativeUrl.tenantApiRelativeUrl;
|
|
|
37
33
|
exports.getTenantErrorMessage = tenantErrorMessages.getTenantErrorMessage;
|
|
38
34
|
exports.tenantErrorMessages = tenantErrorMessages.tenantErrorMessages;
|
|
39
35
|
Object.keys(clientContent).forEach((k) => {
|
|
40
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
36
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: () => clientContent[k]
|
|
39
|
+
});
|
|
45
40
|
});
|
|
46
41
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../packages/client/src/index.ts"],"sourcesContent":["import * as CrudQueryBuilderTmp from './crudQueryBuilder'\n\nimport * as GraphQlBuilderTmp from './graphQlBuilder'\n\nexport { GraphQlLiteral } from './graphQlBuilder'\n\nexport namespace GraphQlBuilder {\n\texport import GraphqlLiteral = GraphQlBuilderTmp.GraphQlLiteral\n\texport import GraphQlLiteral = GraphQlBuilderTmp.GraphQlLiteral\n}\n\nexport namespace CrudQueryBuilder {\n\texport type OrderDirection = CrudQueryBuilderTmp.OrderDirection\n}\n\nexport * from './content'\nexport * from './graphQlClient'\nexport * from './system'\nexport * from './tenant'\n\nexport * from '@contember/client-content'\n\nexport type { Input, Value, Result, Writable } from '@contember/schema'\n"],"names":["GraphQlBuilder","GraphQlBuilderTmp.GraphQlLiteral"],"mappings":";;;;;;;;;;;;;;AAMiBA,QAAA,iBAAA;AAAA,CAAV,CAAUA,oBAAV;AACQA,kBAAA,iBAAiBC;AACjBD,kBAAA,iBAAiBC;AAAkB,GAFjCD,QAAA,mBAAAA,yBAAA,CAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
export * from "@contember/client-content";
|
|
2
|
-
import { GraphQlLiteral } from "./graphQlBuilder/GraphQlLiteral.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { formatContentApiRelativeUrl } from "./content/formatContentApiRelativeUrl.js";
|
|
8
|
-
import { replaceGraphQlLiteral } from "./content/replaceGraphQlLiteral.js";
|
|
2
|
+
import { GraphQlLiteral } from "./src/graphQlBuilder/GraphQlLiteral.js";
|
|
3
|
+
import { GenerateUploadUrlMutationBuilder } from "./src/content/upload/GenerateUploadUrlMutationBuilder.js";
|
|
4
|
+
import { whereToFilter } from "./src/content/params/whereToFilter.js";
|
|
5
|
+
import { formatContentApiRelativeUrl } from "./src/content/formatContentApiRelativeUrl.js";
|
|
6
|
+
import { replaceGraphQlLiteral } from "./src/content/replaceGraphQlLiteral.js";
|
|
9
7
|
import { GraphQlClientError } from "@contember/graphql-client";
|
|
10
|
-
import { GraphQlClient } from "./graphQlClient/GraphQlClient.js";
|
|
11
|
-
import { formatSystemApiRelativeUrl } from "./system/formatSystemApiRelativeUrl.js";
|
|
12
|
-
import { loginMutation } from "./tenant/loginMutation.js";
|
|
13
|
-
import { tenantApiRelativeUrl } from "./tenant/tenantApiRelativeUrl.js";
|
|
14
|
-
import { getTenantErrorMessage, tenantErrorMessages } from "./tenant/tenantErrorMessages.js";
|
|
8
|
+
import { GraphQlClient } from "./src/graphQlClient/GraphQlClient.js";
|
|
9
|
+
import { formatSystemApiRelativeUrl } from "./src/system/formatSystemApiRelativeUrl.js";
|
|
10
|
+
import { loginMutation } from "./src/tenant/loginMutation.js";
|
|
11
|
+
import { tenantApiRelativeUrl } from "./src/tenant/tenantApiRelativeUrl.js";
|
|
12
|
+
import { getTenantErrorMessage, tenantErrorMessages } from "./src/tenant/tenantErrorMessages.js";
|
|
15
13
|
var GraphQlBuilder;
|
|
16
14
|
((GraphQlBuilder2) => {
|
|
17
15
|
GraphQlBuilder2.GraphqlLiteral = GraphQlLiteral;
|
|
18
16
|
GraphQlBuilder2.GraphQlLiteral = GraphQlLiteral;
|
|
19
17
|
})(GraphQlBuilder || (GraphQlBuilder = {}));
|
|
20
18
|
export {
|
|
21
|
-
FileUploadError,
|
|
22
19
|
GenerateUploadUrlMutationBuilder,
|
|
23
20
|
GraphQlBuilder,
|
|
24
21
|
GraphQlClient,
|
|
25
22
|
GraphQlClientError,
|
|
26
23
|
GraphQlLiteral,
|
|
27
|
-
S3FileUploader,
|
|
28
24
|
formatContentApiRelativeUrl,
|
|
29
25
|
formatSystemApiRelativeUrl,
|
|
30
26
|
getTenantErrorMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../packages/client/src/index.ts"],"sourcesContent":["import * as CrudQueryBuilderTmp from './crudQueryBuilder'\n\nimport * as GraphQlBuilderTmp from './graphQlBuilder'\n\nexport { GraphQlLiteral } from './graphQlBuilder'\n\nexport namespace GraphQlBuilder {\n\texport import GraphqlLiteral = GraphQlBuilderTmp.GraphQlLiteral\n\texport import GraphQlLiteral = GraphQlBuilderTmp.GraphQlLiteral\n}\n\nexport namespace CrudQueryBuilder {\n\texport type OrderDirection = CrudQueryBuilderTmp.OrderDirection\n}\n\nexport * from './content'\nexport * from './graphQlClient'\nexport * from './system'\nexport * from './tenant'\n\nexport * from '@contember/client-content'\n\nexport type { Input, Value, Result, Writable } from '@contember/schema'\n"],"names":["GraphQlBuilder","GraphQlBuilderTmp.GraphQlLiteral"],"mappings":";;;;;;;;;;;;AAMiB,IAAA;AAAA,CAAV,CAAUA,oBAAV;AACQA,kBAAA,iBAAiBC;AACjBD,kBAAA,iBAAiBC;AAAkB,GAFjC,mBAAA,iBAAA,CAAA,EAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatContentApiRelativeUrl.cjs","sources":["../../../../../packages/client/src/content/formatContentApiRelativeUrl.ts"],"sourcesContent":["export const formatContentApiRelativeUrl = (projectSlug: string, stageSlug: string) =>\n\t`/content/${projectSlug}/${stageSlug}`\n"],"names":[],"mappings":";;AAAO,MAAM,8BAA8B,CAAC,aAAqB,cAChE,YAAY,WAAW,IAAI,SAAS;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatContentApiRelativeUrl.js","sources":["../../../../../packages/client/src/content/formatContentApiRelativeUrl.ts"],"sourcesContent":["export const formatContentApiRelativeUrl = (projectSlug: string, stageSlug: string) =>\n\t`/content/${projectSlug}/${stageSlug}`\n"],"names":[],"mappings":"AAAO,MAAM,8BAA8B,CAAC,aAAqB,cAChE,YAAY,WAAW,IAAI,SAAS;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whereToFilter.cjs","sources":["../../../../../../packages/client/src/content/params/whereToFilter.ts"],"sourcesContent":["import type { Input, Writable } from '@contember/schema'\nimport { GraphQlLiteral } from '../../graphQlBuilder'\n\nexport const whereToFilter = (\n\tby: Input.UniqueWhere<GraphQlLiteral>,\n): Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>> => {\n\tconst where: Writable<Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>>> = {}\n\tfor (const key in by) {\n\t\tconst value = by[key]\n\n\t\tif (value instanceof GraphQlLiteral || typeof value === 'string' || typeof value === 'number') {\n\t\t\twhere[key] = { eq: value }\n\t\t} else {\n\t\t\twhere[key] = whereToFilter(value)\n\t\t}\n\t}\n\n\treturn where\n}\n"],"names":["GraphQlLiteral"],"mappings":";;;AAGa,MAAA,gBAAgB,CAC5B,OACqE;AACrE,QAAM,QAAmF,CAAA;AACzF,aAAW,OAAO,IAAI;AACf,UAAA,QAAQ,GAAG,GAAG;AAEpB,QAAI,iBAAiBA,eAAAA,kBAAkB,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;AAC9F,YAAM,GAAG,IAAI,EAAE,IAAI,MAAM;AAAA,IAAA,OACnB;AACA,YAAA,GAAG,IAAI,cAAc,KAAK;AAAA,IACjC;AAAA,EACD;AAEO,SAAA;AACR;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whereToFilter.js","sources":["../../../../../../packages/client/src/content/params/whereToFilter.ts"],"sourcesContent":["import type { Input, Writable } from '@contember/schema'\nimport { GraphQlLiteral } from '../../graphQlBuilder'\n\nexport const whereToFilter = (\n\tby: Input.UniqueWhere<GraphQlLiteral>,\n): Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>> => {\n\tconst where: Writable<Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>>> = {}\n\tfor (const key in by) {\n\t\tconst value = by[key]\n\n\t\tif (value instanceof GraphQlLiteral || typeof value === 'string' || typeof value === 'number') {\n\t\t\twhere[key] = { eq: value }\n\t\t} else {\n\t\t\twhere[key] = whereToFilter(value)\n\t\t}\n\t}\n\n\treturn where\n}\n"],"names":[],"mappings":";AAGa,MAAA,gBAAgB,CAC5B,OACqE;AACrE,QAAM,QAAmF,CAAA;AACzF,aAAW,OAAO,IAAI;AACf,UAAA,QAAQ,GAAG,GAAG;AAEpB,QAAI,iBAAiB,kBAAkB,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;AAC9F,YAAM,GAAG,IAAI,EAAE,IAAI,MAAM;AAAA,IAAA,OACnB;AACA,YAAA,GAAG,IAAI,cAAc,KAAK;AAAA,IACjC;AAAA,EACD;AAEO,SAAA;AACR;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replaceGraphQlLiteral.cjs","sources":["../../../../../packages/client/src/content/replaceGraphQlLiteral.ts"],"sourcesContent":["import { GraphQlLiteral } from '../graphQlBuilder'\n\nexport type ReplaceGraphQlLiteral<T> = T extends GraphQlLiteral<infer Value>\n\t? Value\n\t: T extends string | number | boolean | null\n\t\t? T // Keep primitives as is\n\t\t: T extends {}\n\t\t\t? { [K in keyof T]: ReplaceGraphQlLiteral<T[K]> } // Recursively apply to objects\n\t\t\t: T extends any[]\n\t\t\t\t? ReplaceGraphQlLiteral<T[number]>[] // Recursively apply to array elements\n\t\t\t\t: T\n\nexport const replaceGraphQlLiteral = <T>(input: T): ReplaceGraphQlLiteral<T> => {\n\tif (input instanceof GraphQlLiteral) {\n\t\treturn input.value as any\n\t} else if (Array.isArray(input)) {\n\t\treturn input.map(replaceGraphQlLiteral) as any\n\t} else if (typeof input === 'object' && input !== null) {\n\t\treturn Object.fromEntries(Object.entries(input).map(([key, value]) => value !== undefined ? [key, replaceGraphQlLiteral(value)] : undefined).filter(Boolean) as any) as any\n\t}\n\treturn input as any\n}\n"],"names":["GraphQlLiteral"],"mappings":";;;AAYa,MAAA,wBAAwB,CAAI,UAAuC;AAC/E,MAAI,iBAAiBA,eAAAA,gBAAgB;AACpC,WAAO,MAAM;AAAA,EACH,WAAA,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAA,MAAM,IAAI,qBAAqB;AAAA,EAC5B,WAAA,OAAO,UAAU,YAAY,UAAU,MAAM;AAChD,WAAA,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,UAAU,SAAY,CAAC,KAAK,sBAAsB,KAAK,CAAC,IAAI,MAAS,EAAE,OAAO,OAAO,CAAQ;AAAA,EACpK;AACO,SAAA;AACR;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replaceGraphQlLiteral.js","sources":["../../../../../packages/client/src/content/replaceGraphQlLiteral.ts"],"sourcesContent":["import { GraphQlLiteral } from '../graphQlBuilder'\n\nexport type ReplaceGraphQlLiteral<T> = T extends GraphQlLiteral<infer Value>\n\t? Value\n\t: T extends string | number | boolean | null\n\t\t? T // Keep primitives as is\n\t\t: T extends {}\n\t\t\t? { [K in keyof T]: ReplaceGraphQlLiteral<T[K]> } // Recursively apply to objects\n\t\t\t: T extends any[]\n\t\t\t\t? ReplaceGraphQlLiteral<T[number]>[] // Recursively apply to array elements\n\t\t\t\t: T\n\nexport const replaceGraphQlLiteral = <T>(input: T): ReplaceGraphQlLiteral<T> => {\n\tif (input instanceof GraphQlLiteral) {\n\t\treturn input.value as any\n\t} else if (Array.isArray(input)) {\n\t\treturn input.map(replaceGraphQlLiteral) as any\n\t} else if (typeof input === 'object' && input !== null) {\n\t\treturn Object.fromEntries(Object.entries(input).map(([key, value]) => value !== undefined ? [key, replaceGraphQlLiteral(value)] : undefined).filter(Boolean) as any) as any\n\t}\n\treturn input as any\n}\n"],"names":[],"mappings":";AAYa,MAAA,wBAAwB,CAAI,UAAuC;AAC/E,MAAI,iBAAiB,gBAAgB;AACpC,WAAO,MAAM;AAAA,EACH,WAAA,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAA,MAAM,IAAI,qBAAqB;AAAA,EAC5B,WAAA,OAAO,UAAU,YAAY,UAAU,MAAM;AAChD,WAAA,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,UAAU,SAAY,CAAC,KAAK,sBAAsB,KAAK,CAAC,IAAI,MAAS,EAAE,OAAO,OAAO,CAAQ;AAAA,EACpK;AACO,SAAA;AACR;"}
|
package/dist/development/{content → src/content}/upload/GenerateUploadUrlMutationBuilder.cjs
RENAMED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
-
var __publicField = (obj, key, value) => {
|
|
5
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
-
return value;
|
|
7
|
-
};
|
|
8
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
3
|
const graphqlBuilder = require("@contember/graphql-builder");
|
|
10
|
-
const
|
|
4
|
+
const client_index = require("../../../index.cjs");
|
|
11
5
|
const replaceGraphQlLiteral = require("../replaceGraphQlLiteral.cjs");
|
|
12
|
-
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
9
|
+
const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilder2 {
|
|
13
10
|
/**
|
|
14
11
|
* @internal
|
|
15
12
|
*/
|
|
@@ -24,7 +21,7 @@ const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilde
|
|
|
24
21
|
value,
|
|
25
22
|
graphQlType: "S3GenerateSignedUploadInput"
|
|
26
23
|
}
|
|
27
|
-
},
|
|
24
|
+
}, _GenerateUploadUrlMutationBuilder2.generateUploadUrlFields));
|
|
28
25
|
} else {
|
|
29
26
|
selectionItems.push(new graphqlBuilder.GraphQlField(alias, "generateUploadUrl", {
|
|
30
27
|
contentType: {
|
|
@@ -41,9 +38,9 @@ const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilde
|
|
|
41
38
|
},
|
|
42
39
|
acl: {
|
|
43
40
|
graphQlType: "S3Acl",
|
|
44
|
-
value: fileParameters.acl instanceof
|
|
41
|
+
value: fileParameters.acl instanceof client_index.GraphQlBuilder.GraphqlLiteral ? fileParameters.acl?.value : fileParameters.acl
|
|
45
42
|
}
|
|
46
|
-
},
|
|
43
|
+
}, _GenerateUploadUrlMutationBuilder2.generateUploadUrlFields));
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
const printer = new graphqlBuilder.GraphQlQueryPrinter();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenerateUploadUrlMutationBuilder.cjs","sources":["../../../../../../packages/client/src/content/upload/GenerateUploadUrlMutationBuilder.ts"],"sourcesContent":["import { GraphQlLiteral } from '../../graphQlBuilder'\nimport { GraphQlField, GraphQlPrintResult, GraphQlQueryPrinter, GraphQlSelectionSetItem } from '@contember/graphql-builder'\nimport { GraphQlBuilder } from '../../index'\nimport { replaceGraphQlLiteral } from '../replaceGraphQlLiteral'\n\nclass GenerateUploadUrlMutationBuilder {\n\tprivate static generateUploadUrlFields = [\n\t\tnew GraphQlField(null, 'url'),\n\t\tnew GraphQlField(null, 'publicUrl'),\n\t\tnew GraphQlField(null, 'method'),\n\t\tnew GraphQlField(null, 'headers', {}, [\n\t\t\tnew GraphQlField(null, 'key'),\n\t\t\tnew GraphQlField(null, 'value'),\n\t\t]),\n\t]\n\t/**\n\t * @internal\n\t */\n\tpublic static buildQuery(parameters: GenerateUploadUrlMutationBuilder.MutationParameters): GraphQlPrintResult {\n\t\tconst selectionItems: GraphQlSelectionSetItem[] = []\n\t\tfor (const alias in parameters) {\n\t\t\tconst fileParameters = parameters[alias]\n\t\t\tif (fileParameters.suffix || fileParameters.fileName || fileParameters.extension) {\n\t\t\t\tconst value = replaceGraphQlLiteral(fileParameters)\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tinput: {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tgraphQlType: 'S3GenerateSignedUploadInput',\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t} else {\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tcontentType: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.contentType,\n\t\t\t\t\t},\n\t\t\t\t\texpiration: {\n\t\t\t\t\t\tgraphQlType: 'Int',\n\t\t\t\t\t\tvalue: fileParameters.expiration,\n\t\t\t\t\t},\n\t\t\t\t\tprefix: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.prefix,\n\t\t\t\t\t},\n\t\t\t\t\tacl: {\n\t\t\t\t\t\tgraphQlType: 'S3Acl',\n\t\t\t\t\t\tvalue: fileParameters.acl instanceof GraphQlBuilder.GraphqlLiteral ? fileParameters.acl?.value : fileParameters.acl,\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t}\n\t\t}\n\n\t\tconst printer = new GraphQlQueryPrinter()\n\t\treturn printer.printDocument('mutation', selectionItems, {})\n\t}\n}\n\nnamespace GenerateUploadUrlMutationBuilder {\n\texport type Acl =\n\t\t| 'PUBLIC_READ'\n\t\t| 'PRIVATE'\n\t\t| 'NONE'\n\t\t| GraphQlLiteral<'PUBLIC_READ' | 'PRIVATE' | 'NONE'>\n\n\texport type FileParameters = {\n\t\tcontentType: string\n\t\texpiration?: number\n\t\tsize?: number\n\t\tprefix?: string\n\t\textension?: string\n\t\tsuffix?: string\n\t\tfileName?: string\n\t\tacl?: Acl\n\t}\n\n\texport interface MutationParameters {\n\t\t[alias: string]: FileParameters\n\t}\n\n\texport interface ResponseBody {\n\t\turl: string\n\t\tpublicUrl: string\n\t\tmethod: string\n\t\theaders: Array<{\n\t\t\tkey: string\n\t\t\tvalue: string\n\t\t}>\n\t}\n\n\texport interface MutationResponse {\n\t\t[alias: string]: ResponseBody\n\t}\n}\n\nexport { GenerateUploadUrlMutationBuilder }\n"],"names":["_GenerateUploadUrlMutationBuilder","replaceGraphQlLiteral","GraphQlField","GraphQlBuilder","GraphQlQueryPrinter"],"mappings":";;;;;;;;AAKA,MAAM,oCAAN,MAAMA,mCAAiC;AAAA;AAAA;AAAA;AAAA,EAatC,OAAc,WAAW,YAAqF;AAC7G,UAAM,iBAA4C,CAAA;AAClD,eAAW,SAAS,YAAY;AACzB,YAAA,iBAAiB,WAAW,KAAK;AACvC,UAAI,eAAe,UAAU,eAAe,YAAY,eAAe,WAAW;AAC3E,cAAA,QAAQC,4CAAsB,cAAc;AAClD,uBAAe,KAAK,IAAIC,4BAAa,OAAO,qBAAqB;AAAA,UAChE,OAAO;AAAA,YACN;AAAA,YACA,aAAa;AAAA,UACd;AAAA,QAAA,GACEF,mCAAiC,uBAAuB,CAAC;AAAA,MAAA,OACtD;AACN,uBAAe,KAAK,IAAIE,4BAAa,OAAO,qBAAqB;AAAA,UAChE,aAAa;AAAA,YACZ,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,YAAY;AAAA,YACX,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,QAAQ;AAAA,YACP,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,KAAK;AAAA,YACJ,aAAa;AAAA,YACb,OAAO,eAAe,eAAeC,4BAAe,iBAAiB,eAAe,KAAK,QAAQ,eAAe;AAAA,UACjH;AAAA,QAAA,GACEH,mCAAiC,uBAAuB,CAAC;AAAA,MAC7D;AAAA,IACD;AAEM,UAAA,UAAU,IAAII,eAAAA;AACpB,WAAO,QAAQ,cAAc,YAAY,gBAAgB,CAAE,CAAA;AAAA,EAC5D;AACD;AAjDC,cADK,mCACU,2BAA0B;AAAA,EACxC,IAAIF,eAAa,aAAA,MAAM,KAAK;AAAA,EAC5B,IAAIA,eAAa,aAAA,MAAM,WAAW;AAAA,EAClC,IAAIA,eAAa,aAAA,MAAM,QAAQ;AAAA,EAC/B,IAAIA,4BAAa,MAAM,WAAW,IAAI;AAAA,IACrC,IAAIA,eAAa,aAAA,MAAM,KAAK;AAAA,IAC5B,IAAIA,eAAa,aAAA,MAAM,OAAO;AAAA,EAAA,CAC9B;AACF,CAAA;AATD,IAAM,mCAAN;;"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => {
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
1
|
import { GraphQlField, GraphQlQueryPrinter } from "@contember/graphql-builder";
|
|
8
|
-
import { GraphQlBuilder } from "
|
|
2
|
+
import { GraphQlBuilder } from "../../../index.js";
|
|
9
3
|
import { replaceGraphQlLiteral } from "../replaceGraphQlLiteral.js";
|
|
10
|
-
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
7
|
+
const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilder2 {
|
|
11
8
|
/**
|
|
12
9
|
* @internal
|
|
13
10
|
*/
|
|
@@ -22,7 +19,7 @@ const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilde
|
|
|
22
19
|
value,
|
|
23
20
|
graphQlType: "S3GenerateSignedUploadInput"
|
|
24
21
|
}
|
|
25
|
-
},
|
|
22
|
+
}, _GenerateUploadUrlMutationBuilder2.generateUploadUrlFields));
|
|
26
23
|
} else {
|
|
27
24
|
selectionItems.push(new GraphQlField(alias, "generateUploadUrl", {
|
|
28
25
|
contentType: {
|
|
@@ -41,7 +38,7 @@ const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilde
|
|
|
41
38
|
graphQlType: "S3Acl",
|
|
42
39
|
value: fileParameters.acl instanceof GraphQlBuilder.GraphqlLiteral ? fileParameters.acl?.value : fileParameters.acl
|
|
43
40
|
}
|
|
44
|
-
},
|
|
41
|
+
}, _GenerateUploadUrlMutationBuilder2.generateUploadUrlFields));
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
44
|
const printer = new GraphQlQueryPrinter();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenerateUploadUrlMutationBuilder.js","sources":["../../../../../../packages/client/src/content/upload/GenerateUploadUrlMutationBuilder.ts"],"sourcesContent":["import { GraphQlLiteral } from '../../graphQlBuilder'\nimport { GraphQlField, GraphQlPrintResult, GraphQlQueryPrinter, GraphQlSelectionSetItem } from '@contember/graphql-builder'\nimport { GraphQlBuilder } from '../../index'\nimport { replaceGraphQlLiteral } from '../replaceGraphQlLiteral'\n\nclass GenerateUploadUrlMutationBuilder {\n\tprivate static generateUploadUrlFields = [\n\t\tnew GraphQlField(null, 'url'),\n\t\tnew GraphQlField(null, 'publicUrl'),\n\t\tnew GraphQlField(null, 'method'),\n\t\tnew GraphQlField(null, 'headers', {}, [\n\t\t\tnew GraphQlField(null, 'key'),\n\t\t\tnew GraphQlField(null, 'value'),\n\t\t]),\n\t]\n\t/**\n\t * @internal\n\t */\n\tpublic static buildQuery(parameters: GenerateUploadUrlMutationBuilder.MutationParameters): GraphQlPrintResult {\n\t\tconst selectionItems: GraphQlSelectionSetItem[] = []\n\t\tfor (const alias in parameters) {\n\t\t\tconst fileParameters = parameters[alias]\n\t\t\tif (fileParameters.suffix || fileParameters.fileName || fileParameters.extension) {\n\t\t\t\tconst value = replaceGraphQlLiteral(fileParameters)\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tinput: {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tgraphQlType: 'S3GenerateSignedUploadInput',\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t} else {\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tcontentType: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.contentType,\n\t\t\t\t\t},\n\t\t\t\t\texpiration: {\n\t\t\t\t\t\tgraphQlType: 'Int',\n\t\t\t\t\t\tvalue: fileParameters.expiration,\n\t\t\t\t\t},\n\t\t\t\t\tprefix: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.prefix,\n\t\t\t\t\t},\n\t\t\t\t\tacl: {\n\t\t\t\t\t\tgraphQlType: 'S3Acl',\n\t\t\t\t\t\tvalue: fileParameters.acl instanceof GraphQlBuilder.GraphqlLiteral ? fileParameters.acl?.value : fileParameters.acl,\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t}\n\t\t}\n\n\t\tconst printer = new GraphQlQueryPrinter()\n\t\treturn printer.printDocument('mutation', selectionItems, {})\n\t}\n}\n\nnamespace GenerateUploadUrlMutationBuilder {\n\texport type Acl =\n\t\t| 'PUBLIC_READ'\n\t\t| 'PRIVATE'\n\t\t| 'NONE'\n\t\t| GraphQlLiteral<'PUBLIC_READ' | 'PRIVATE' | 'NONE'>\n\n\texport type FileParameters = {\n\t\tcontentType: string\n\t\texpiration?: number\n\t\tsize?: number\n\t\tprefix?: string\n\t\textension?: string\n\t\tsuffix?: string\n\t\tfileName?: string\n\t\tacl?: Acl\n\t}\n\n\texport interface MutationParameters {\n\t\t[alias: string]: FileParameters\n\t}\n\n\texport interface ResponseBody {\n\t\turl: string\n\t\tpublicUrl: string\n\t\tmethod: string\n\t\theaders: Array<{\n\t\t\tkey: string\n\t\t\tvalue: string\n\t\t}>\n\t}\n\n\texport interface MutationResponse {\n\t\t[alias: string]: ResponseBody\n\t}\n}\n\nexport { GenerateUploadUrlMutationBuilder }\n"],"names":["_GenerateUploadUrlMutationBuilder"],"mappings":";;;;;;AAKA,MAAM,oCAAN,MAAMA,mCAAiC;AAAA;AAAA;AAAA;AAAA,EAatC,OAAc,WAAW,YAAqF;AAC7G,UAAM,iBAA4C,CAAA;AAClD,eAAW,SAAS,YAAY;AACzB,YAAA,iBAAiB,WAAW,KAAK;AACvC,UAAI,eAAe,UAAU,eAAe,YAAY,eAAe,WAAW;AAC3E,cAAA,QAAQ,sBAAsB,cAAc;AAClD,uBAAe,KAAK,IAAI,aAAa,OAAO,qBAAqB;AAAA,UAChE,OAAO;AAAA,YACN;AAAA,YACA,aAAa;AAAA,UACd;AAAA,QAAA,GACEA,mCAAiC,uBAAuB,CAAC;AAAA,MAAA,OACtD;AACN,uBAAe,KAAK,IAAI,aAAa,OAAO,qBAAqB;AAAA,UAChE,aAAa;AAAA,YACZ,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,YAAY;AAAA,YACX,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,QAAQ;AAAA,YACP,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,KAAK;AAAA,YACJ,aAAa;AAAA,YACb,OAAO,eAAe,eAAe,eAAe,iBAAiB,eAAe,KAAK,QAAQ,eAAe;AAAA,UACjH;AAAA,QAAA,GACEA,mCAAiC,uBAAuB,CAAC;AAAA,MAC7D;AAAA,IACD;AAEM,UAAA,UAAU,IAAI;AACpB,WAAO,QAAQ,cAAc,YAAY,gBAAgB,CAAE,CAAA;AAAA,EAC5D;AACD;AAjDC,cADK,mCACU,2BAA0B;AAAA,EACxC,IAAI,aAAa,MAAM,KAAK;AAAA,EAC5B,IAAI,aAAa,MAAM,WAAW;AAAA,EAClC,IAAI,aAAa,MAAM,QAAQ;AAAA,EAC/B,IAAI,aAAa,MAAM,WAAW,IAAI;AAAA,IACrC,IAAI,aAAa,MAAM,KAAK;AAAA,IAC5B,IAAI,aAAa,MAAM,OAAO;AAAA,EAAA,CAC9B;AACF,CAAA;AATD,IAAM,mCAAN;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphQlLiteral.cjs","sources":["../../../../../packages/client/src/graphQlBuilder/GraphQlLiteral.ts"],"sourcesContent":["/**\n * @deprecated Directly use the value instead.\n */\nexport class GraphQlLiteral<Value extends string = string> {\n\tconstructor(public readonly value: Value) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.warn('GraphQlLiteral is deprecated, use the value directly instead.')\n\t\t}\n\t}\n\n\tpublic toString() {\n\t\treturn `Literal(${this.value})`\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,eAA8C;AAAA,EAC1D,YAA4B,OAAc;AAAd,SAAA,QAAA;AACF;AACxB,cAAQ,KAAK,+DAA+D;AAAA,IAC7E;AAAA,EACD;AAAA,EAEO,WAAW;AACV,WAAA,WAAW,KAAK,KAAK;AAAA,EAC7B;AACD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphQlLiteral.js","sources":["../../../../../packages/client/src/graphQlBuilder/GraphQlLiteral.ts"],"sourcesContent":["/**\n * @deprecated Directly use the value instead.\n */\nexport class GraphQlLiteral<Value extends string = string> {\n\tconstructor(public readonly value: Value) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.warn('GraphQlLiteral is deprecated, use the value directly instead.')\n\t\t}\n\t}\n\n\tpublic toString() {\n\t\treturn `Literal(${this.value})`\n\t}\n}\n"],"names":[],"mappings":"AAGO,MAAM,eAA8C;AAAA,EAC1D,YAA4B,OAAc;AAAd,SAAA,QAAA;AACF;AACxB,cAAQ,KAAK,+DAA+D;AAAA,IAC7E;AAAA,EACD;AAAA,EAEO,WAAW;AACV,WAAA,WAAW,KAAK,KAAK;AAAA,EAC7B;AACD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphQlClient.cjs","sources":["../../../../../packages/client/src/graphQlClient/GraphQlClient.ts"],"sourcesContent":["import { GraphQlClient as BaseGraphQLClient, GraphQlClientRequestOptions as BaseGraphQlClientRequestOptions } from '@contember/graphql-client'\n\nexport interface GraphQlClientRequestOptions extends BaseGraphQlClientRequestOptions {\n\t/**\n\t * @deprecated use apiToken\n\t */\n\tapiTokenOverride?: string\n}\n\nexport type GraphQlClientFailedRequestMetadata = Pick<Response, 'status' | 'statusText'> & {\n\tresponseText: string\n}\n\nexport class GraphQlClient extends BaseGraphQLClient {\n\t/**\n\t * @deprecated use execute\n\t */\n\tasync sendRequest<T = unknown>(query: string, options: GraphQlClientRequestOptions = {}): Promise<T> {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.debug(query)\n\t\tconst response = await this.doExecute(query, {\n\t\t\t...options,\n\t\t\tapiToken: options.apiTokenOverride ?? options.apiToken,\n\t\t})\n\n\t\tif (response.ok) {\n\t\t\t// It may still have errors (e.g. unfilled fields) but as far as the request goes, it is ok.\n\t\t\treturn await response.json()\n\t\t}\n\n\t\tconst failedRequest: GraphQlClientFailedRequestMetadata = {\n\t\t\tstatus: response.status,\n\t\t\tstatusText: response.statusText,\n\t\t\tresponseText: await response.text(),\n\t\t}\n\n\t\treturn Promise.reject(failedRequest)\n\t}\n\n}\n"],"names":["BaseGraphQLClient"],"mappings":";;;AAaO,MAAM,sBAAsBA,cAAAA,cAAkB;AAAA;AAAA;AAAA;AAAA,EAIpD,MAAM,YAAyB,OAAe,UAAuC,IAAgB;AAEpG,YAAQ,MAAM,KAAK;AACnB,UAAM,WAAW,MAAM,KAAK,UAAU,OAAO;AAAA,MAC5C,GAAG;AAAA,MACH,UAAU,QAAQ,oBAAoB,QAAQ;AAAA,IAAA,CAC9C;AAED,QAAI,SAAS,IAAI;AAET,aAAA,MAAM,SAAS;IACvB;AAEA,UAAM,gBAAoD;AAAA,MACzD,QAAQ,SAAS;AAAA,MACjB,YAAY,SAAS;AAAA,MACrB,cAAc,MAAM,SAAS,KAAK;AAAA,IAAA;AAG5B,WAAA,QAAQ,OAAO,aAAa;AAAA,EACpC;AAED;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphQlClient.js","sources":["../../../../../packages/client/src/graphQlClient/GraphQlClient.ts"],"sourcesContent":["import { GraphQlClient as BaseGraphQLClient, GraphQlClientRequestOptions as BaseGraphQlClientRequestOptions } from '@contember/graphql-client'\n\nexport interface GraphQlClientRequestOptions extends BaseGraphQlClientRequestOptions {\n\t/**\n\t * @deprecated use apiToken\n\t */\n\tapiTokenOverride?: string\n}\n\nexport type GraphQlClientFailedRequestMetadata = Pick<Response, 'status' | 'statusText'> & {\n\tresponseText: string\n}\n\nexport class GraphQlClient extends BaseGraphQLClient {\n\t/**\n\t * @deprecated use execute\n\t */\n\tasync sendRequest<T = unknown>(query: string, options: GraphQlClientRequestOptions = {}): Promise<T> {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.debug(query)\n\t\tconst response = await this.doExecute(query, {\n\t\t\t...options,\n\t\t\tapiToken: options.apiTokenOverride ?? options.apiToken,\n\t\t})\n\n\t\tif (response.ok) {\n\t\t\t// It may still have errors (e.g. unfilled fields) but as far as the request goes, it is ok.\n\t\t\treturn await response.json()\n\t\t}\n\n\t\tconst failedRequest: GraphQlClientFailedRequestMetadata = {\n\t\t\tstatus: response.status,\n\t\t\tstatusText: response.statusText,\n\t\t\tresponseText: await response.text(),\n\t\t}\n\n\t\treturn Promise.reject(failedRequest)\n\t}\n\n}\n"],"names":["BaseGraphQLClient"],"mappings":";AAaO,MAAM,sBAAsBA,gBAAkB;AAAA;AAAA;AAAA;AAAA,EAIpD,MAAM,YAAyB,OAAe,UAAuC,IAAgB;AAEpG,YAAQ,MAAM,KAAK;AACnB,UAAM,WAAW,MAAM,KAAK,UAAU,OAAO;AAAA,MAC5C,GAAG;AAAA,MACH,UAAU,QAAQ,oBAAoB,QAAQ;AAAA,IAAA,CAC9C;AAED,QAAI,SAAS,IAAI;AAET,aAAA,MAAM,SAAS;IACvB;AAEA,UAAM,gBAAoD;AAAA,MACzD,QAAQ,SAAS;AAAA,MACjB,YAAY,SAAS;AAAA,MACrB,cAAc,MAAM,SAAS,KAAK;AAAA,IAAA;AAG5B,WAAA,QAAQ,OAAO,aAAa;AAAA,EACpC;AAED;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatSystemApiRelativeUrl.cjs","sources":["../../../../../packages/client/src/system/formatSystemApiRelativeUrl.ts"],"sourcesContent":["export const formatSystemApiRelativeUrl = (projectSlug: string) => `/system/${projectSlug}`\n"],"names":[],"mappings":";;AAAO,MAAM,6BAA6B,CAAC,gBAAwB,WAAW,WAAW;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatSystemApiRelativeUrl.js","sources":["../../../../../packages/client/src/system/formatSystemApiRelativeUrl.ts"],"sourcesContent":["export const formatSystemApiRelativeUrl = (projectSlug: string) => `/system/${projectSlug}`\n"],"names":[],"mappings":"AAAO,MAAM,6BAA6B,CAAC,gBAAwB,WAAW,WAAW;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loginMutation.cjs","sources":["../../../../../packages/client/src/tenant/loginMutation.ts"],"sourcesContent":["export interface LoginMutationResponse {\n\tdata: {\n\t\tsignIn: {\n\t\t\tok: boolean\n\t\t\terrors: Array<{\n\t\t\t\tendUserMessage: string | null\n\t\t\t\tcode: string\n\t\t\t}>\n\t\t\tresult: {\n\t\t\t\ttoken: string\n\t\t\t\tperson: {\n\t\t\t\t\tid: string\n\t\t\t\t\temail: string\n\t\t\t\t\tidentity: {\n\t\t\t\t\t\tid: string\n\t\t\t\t\t\tprojects: Array<{\n\t\t\t\t\t\t\tproject: {\n\t\t\t\t\t\t\t\tid: string\n\t\t\t\t\t\t\t\tslug: string\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmemberships: Array<{\n\t\t\t\t\t\t\t\trole: string\n\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t}>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} | null\n\t\t}\n\t}\n}\n\nexport const loginMutation = `\n\tmutation($email: String!, $password: String!, $expiration: Int) {\n\t\tsignIn(email: $email, password: $password, expiration: $expiration) {\n\t\t\tok\n\t\t\terrors {\n\t\t\t\tendUserMessage\n\t\t\t\tcode\n\t\t\t}\n\t\t\tresult {\n\t\t\t\ttoken\n\t\t\t\tperson {\n\t\t\t\t\tid\n\t\t\t\t\temail\n\t\t\t\t\tidentity {\n\t\t\t\t\t\tid\n\t\t\t\t\t\tprojects {\n\t\t\t\t\t\t\tproject {\n\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmemberships {\n\t\t\t\t\t\t\t\trole\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n`\n"],"names":[],"mappings":";;AA+BO,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loginMutation.js","sources":["../../../../../packages/client/src/tenant/loginMutation.ts"],"sourcesContent":["export interface LoginMutationResponse {\n\tdata: {\n\t\tsignIn: {\n\t\t\tok: boolean\n\t\t\terrors: Array<{\n\t\t\t\tendUserMessage: string | null\n\t\t\t\tcode: string\n\t\t\t}>\n\t\t\tresult: {\n\t\t\t\ttoken: string\n\t\t\t\tperson: {\n\t\t\t\t\tid: string\n\t\t\t\t\temail: string\n\t\t\t\t\tidentity: {\n\t\t\t\t\t\tid: string\n\t\t\t\t\t\tprojects: Array<{\n\t\t\t\t\t\t\tproject: {\n\t\t\t\t\t\t\t\tid: string\n\t\t\t\t\t\t\t\tslug: string\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmemberships: Array<{\n\t\t\t\t\t\t\t\trole: string\n\t\t\t\t\t\t\t}>\n\t\t\t\t\t\t}>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} | null\n\t\t}\n\t}\n}\n\nexport const loginMutation = `\n\tmutation($email: String!, $password: String!, $expiration: Int) {\n\t\tsignIn(email: $email, password: $password, expiration: $expiration) {\n\t\t\tok\n\t\t\terrors {\n\t\t\t\tendUserMessage\n\t\t\t\tcode\n\t\t\t}\n\t\t\tresult {\n\t\t\t\ttoken\n\t\t\t\tperson {\n\t\t\t\t\tid\n\t\t\t\t\temail\n\t\t\t\t\tidentity {\n\t\t\t\t\t\tid\n\t\t\t\t\t\tprojects {\n\t\t\t\t\t\t\tproject {\n\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\tslug\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmemberships {\n\t\t\t\t\t\t\t\trole\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n`\n"],"names":[],"mappings":"AA+BO,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenantApiRelativeUrl.cjs","sources":["../../../../../packages/client/src/tenant/tenantApiRelativeUrl.ts"],"sourcesContent":["export const tenantApiRelativeUrl = '/tenant'\n"],"names":[],"mappings":";;AAAO,MAAM,uBAAuB;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenantApiRelativeUrl.js","sources":["../../../../../packages/client/src/tenant/tenantApiRelativeUrl.ts"],"sourcesContent":["export const tenantApiRelativeUrl = '/tenant'\n"],"names":[],"mappings":"AAAO,MAAM,uBAAuB;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenantErrorMessages.cjs","sources":["../../../../../packages/client/src/tenant/tenantErrorMessages.ts"],"sourcesContent":["export const tenantErrorMessages: { [key: string]: string } = {\n\tTOO_WEAK: 'Password is too weak.',\n\tEMAIL_ALREADY_EXISTS: 'Email already exists.',\n\tUNKNOWN_EMAIL: 'Unknown email.',\n\tINVALID_PASSWORD: 'Password is invalid.',\n\tALREADY_MEMBER: 'User is already a member of this project.',\n}\n\nexport const getTenantErrorMessage = (errorCode: string): string => {\n\tif (errorCode in tenantErrorMessages) {\n\t\treturn tenantErrorMessages[errorCode]\n\t}\n\treturn `Unknown error occurred. [${errorCode}]`\n}\n"],"names":[],"mappings":";;AAAO,MAAM,sBAAiD;AAAA,EAC7D,UAAU;AAAA,EACV,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,gBAAgB;AACjB;AAEa,MAAA,wBAAwB,CAAC,cAA8B;AACnE,MAAI,aAAa,qBAAqB;AACrC,WAAO,oBAAoB,SAAS;AAAA,EACrC;AACA,SAAO,4BAA4B,SAAS;AAC7C;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenantErrorMessages.js","sources":["../../../../../packages/client/src/tenant/tenantErrorMessages.ts"],"sourcesContent":["export const tenantErrorMessages: { [key: string]: string } = {\n\tTOO_WEAK: 'Password is too weak.',\n\tEMAIL_ALREADY_EXISTS: 'Email already exists.',\n\tUNKNOWN_EMAIL: 'Unknown email.',\n\tINVALID_PASSWORD: 'Password is invalid.',\n\tALREADY_MEMBER: 'User is already a member of this project.',\n}\n\nexport const getTenantErrorMessage = (errorCode: string): string => {\n\tif (errorCode in tenantErrorMessages) {\n\t\treturn tenantErrorMessages[errorCode]\n\t}\n\treturn `Unknown error occurred. [${errorCode}]`\n}\n"],"names":[],"mappings":"AAAO,MAAM,sBAAiD;AAAA,EAC7D,UAAU;AAAA,EACV,sBAAsB;AAAA,EACtB,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,gBAAgB;AACjB;AAEa,MAAA,wBAAwB,CAAC,cAA8B;AACnE,MAAI,aAAa,qBAAqB;AACrC,WAAO,oBAAoB,SAAS;AAAA,EACrC;AACA,SAAO,4BAA4B,SAAS;AAC7C;"}
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const clientContent = require("@contember/client-content");
|
|
4
|
-
const GraphQlLiteral = require("./graphQlBuilder/GraphQlLiteral.cjs");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const formatContentApiRelativeUrl = require("./content/formatContentApiRelativeUrl.cjs");
|
|
10
|
-
const replaceGraphQlLiteral = require("./content/replaceGraphQlLiteral.cjs");
|
|
4
|
+
const GraphQlLiteral = require("./src/graphQlBuilder/GraphQlLiteral.cjs");
|
|
5
|
+
const GenerateUploadUrlMutationBuilder = require("./src/content/upload/GenerateUploadUrlMutationBuilder.cjs");
|
|
6
|
+
const whereToFilter = require("./src/content/params/whereToFilter.cjs");
|
|
7
|
+
const formatContentApiRelativeUrl = require("./src/content/formatContentApiRelativeUrl.cjs");
|
|
8
|
+
const replaceGraphQlLiteral = require("./src/content/replaceGraphQlLiteral.cjs");
|
|
11
9
|
const graphqlClient = require("@contember/graphql-client");
|
|
12
|
-
const GraphQlClient = require("./graphQlClient/GraphQlClient.cjs");
|
|
13
|
-
const formatSystemApiRelativeUrl = require("./system/formatSystemApiRelativeUrl.cjs");
|
|
14
|
-
const loginMutation = require("./tenant/loginMutation.cjs");
|
|
15
|
-
const tenantApiRelativeUrl = require("./tenant/tenantApiRelativeUrl.cjs");
|
|
16
|
-
const tenantErrorMessages = require("./tenant/tenantErrorMessages.cjs");
|
|
10
|
+
const GraphQlClient = require("./src/graphQlClient/GraphQlClient.cjs");
|
|
11
|
+
const formatSystemApiRelativeUrl = require("./src/system/formatSystemApiRelativeUrl.cjs");
|
|
12
|
+
const loginMutation = require("./src/tenant/loginMutation.cjs");
|
|
13
|
+
const tenantApiRelativeUrl = require("./src/tenant/tenantApiRelativeUrl.cjs");
|
|
14
|
+
const tenantErrorMessages = require("./src/tenant/tenantErrorMessages.cjs");
|
|
17
15
|
exports.GraphQlBuilder = void 0;
|
|
18
16
|
((GraphQlBuilder2) => {
|
|
19
17
|
GraphQlBuilder2.GraphqlLiteral = GraphQlLiteral.GraphQlLiteral;
|
|
20
18
|
GraphQlBuilder2.GraphQlLiteral = GraphQlLiteral.GraphQlLiteral;
|
|
21
19
|
})(exports.GraphQlBuilder || (exports.GraphQlBuilder = {}));
|
|
22
20
|
exports.GraphQlLiteral = GraphQlLiteral.GraphQlLiteral;
|
|
23
|
-
exports.FileUploadError = FileUploadError.FileUploadError;
|
|
24
21
|
exports.GenerateUploadUrlMutationBuilder = GenerateUploadUrlMutationBuilder.GenerateUploadUrlMutationBuilder;
|
|
25
|
-
exports.S3FileUploader = S3FileUploader.S3FileUploader;
|
|
26
22
|
exports.whereToFilter = whereToFilter.whereToFilter;
|
|
27
23
|
exports.formatContentApiRelativeUrl = formatContentApiRelativeUrl.formatContentApiRelativeUrl;
|
|
28
24
|
exports.replaceGraphQlLiteral = replaceGraphQlLiteral.replaceGraphQlLiteral;
|
|
@@ -37,10 +33,9 @@ exports.tenantApiRelativeUrl = tenantApiRelativeUrl.tenantApiRelativeUrl;
|
|
|
37
33
|
exports.getTenantErrorMessage = tenantErrorMessages.getTenantErrorMessage;
|
|
38
34
|
exports.tenantErrorMessages = tenantErrorMessages.tenantErrorMessages;
|
|
39
35
|
Object.keys(clientContent).forEach((k) => {
|
|
40
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
36
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: () => clientContent[k]
|
|
39
|
+
});
|
|
45
40
|
});
|
|
46
41
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../packages/client/src/index.ts"],"sourcesContent":["import * as CrudQueryBuilderTmp from './crudQueryBuilder'\n\nimport * as GraphQlBuilderTmp from './graphQlBuilder'\n\nexport { GraphQlLiteral } from './graphQlBuilder'\n\nexport namespace GraphQlBuilder {\n\texport import GraphqlLiteral = GraphQlBuilderTmp.GraphQlLiteral\n\texport import GraphQlLiteral = GraphQlBuilderTmp.GraphQlLiteral\n}\n\nexport namespace CrudQueryBuilder {\n\texport type OrderDirection = CrudQueryBuilderTmp.OrderDirection\n}\n\nexport * from './content'\nexport * from './graphQlClient'\nexport * from './system'\nexport * from './tenant'\n\nexport * from '@contember/client-content'\n\nexport type { Input, Value, Result, Writable } from '@contember/schema'\n"],"names":["GraphQlBuilder","GraphQlBuilderTmp.GraphQlLiteral"],"mappings":";;;;;;;;;;;;;;AAMiBA,QAAA,iBAAA;AAAA,CAAV,CAAUA,oBAAV;AACQA,kBAAA,iBAAiBC;AACjBD,kBAAA,iBAAiBC;AAAkB,GAFjCD,QAAA,mBAAAA,yBAAA,CAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/production/index.js
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
export * from "@contember/client-content";
|
|
2
|
-
import { GraphQlLiteral } from "./graphQlBuilder/GraphQlLiteral.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { formatContentApiRelativeUrl } from "./content/formatContentApiRelativeUrl.js";
|
|
8
|
-
import { replaceGraphQlLiteral } from "./content/replaceGraphQlLiteral.js";
|
|
2
|
+
import { GraphQlLiteral } from "./src/graphQlBuilder/GraphQlLiteral.js";
|
|
3
|
+
import { GenerateUploadUrlMutationBuilder } from "./src/content/upload/GenerateUploadUrlMutationBuilder.js";
|
|
4
|
+
import { whereToFilter } from "./src/content/params/whereToFilter.js";
|
|
5
|
+
import { formatContentApiRelativeUrl } from "./src/content/formatContentApiRelativeUrl.js";
|
|
6
|
+
import { replaceGraphQlLiteral } from "./src/content/replaceGraphQlLiteral.js";
|
|
9
7
|
import { GraphQlClientError } from "@contember/graphql-client";
|
|
10
|
-
import { GraphQlClient } from "./graphQlClient/GraphQlClient.js";
|
|
11
|
-
import { formatSystemApiRelativeUrl } from "./system/formatSystemApiRelativeUrl.js";
|
|
12
|
-
import { loginMutation } from "./tenant/loginMutation.js";
|
|
13
|
-
import { tenantApiRelativeUrl } from "./tenant/tenantApiRelativeUrl.js";
|
|
14
|
-
import { getTenantErrorMessage, tenantErrorMessages } from "./tenant/tenantErrorMessages.js";
|
|
8
|
+
import { GraphQlClient } from "./src/graphQlClient/GraphQlClient.js";
|
|
9
|
+
import { formatSystemApiRelativeUrl } from "./src/system/formatSystemApiRelativeUrl.js";
|
|
10
|
+
import { loginMutation } from "./src/tenant/loginMutation.js";
|
|
11
|
+
import { tenantApiRelativeUrl } from "./src/tenant/tenantApiRelativeUrl.js";
|
|
12
|
+
import { getTenantErrorMessage, tenantErrorMessages } from "./src/tenant/tenantErrorMessages.js";
|
|
15
13
|
var GraphQlBuilder;
|
|
16
14
|
((GraphQlBuilder2) => {
|
|
17
15
|
GraphQlBuilder2.GraphqlLiteral = GraphQlLiteral;
|
|
18
16
|
GraphQlBuilder2.GraphQlLiteral = GraphQlLiteral;
|
|
19
17
|
})(GraphQlBuilder || (GraphQlBuilder = {}));
|
|
20
18
|
export {
|
|
21
|
-
FileUploadError,
|
|
22
19
|
GenerateUploadUrlMutationBuilder,
|
|
23
20
|
GraphQlBuilder,
|
|
24
21
|
GraphQlClient,
|
|
25
22
|
GraphQlClientError,
|
|
26
23
|
GraphQlLiteral,
|
|
27
|
-
S3FileUploader,
|
|
28
24
|
formatContentApiRelativeUrl,
|
|
29
25
|
formatSystemApiRelativeUrl,
|
|
30
26
|
getTenantErrorMessage,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../packages/client/src/index.ts"],"sourcesContent":["import * as CrudQueryBuilderTmp from './crudQueryBuilder'\n\nimport * as GraphQlBuilderTmp from './graphQlBuilder'\n\nexport { GraphQlLiteral } from './graphQlBuilder'\n\nexport namespace GraphQlBuilder {\n\texport import GraphqlLiteral = GraphQlBuilderTmp.GraphQlLiteral\n\texport import GraphQlLiteral = GraphQlBuilderTmp.GraphQlLiteral\n}\n\nexport namespace CrudQueryBuilder {\n\texport type OrderDirection = CrudQueryBuilderTmp.OrderDirection\n}\n\nexport * from './content'\nexport * from './graphQlClient'\nexport * from './system'\nexport * from './tenant'\n\nexport * from '@contember/client-content'\n\nexport type { Input, Value, Result, Writable } from '@contember/schema'\n"],"names":["GraphQlBuilder","GraphQlBuilderTmp.GraphQlLiteral"],"mappings":";;;;;;;;;;;;AAMiB,IAAA;AAAA,CAAV,CAAUA,oBAAV;AACQA,kBAAA,iBAAiBC;AACjBD,kBAAA,iBAAiBC;AAAkB,GAFjC,mBAAA,iBAAA,CAAA,EAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatContentApiRelativeUrl.cjs","sources":["../../../../../packages/client/src/content/formatContentApiRelativeUrl.ts"],"sourcesContent":["export const formatContentApiRelativeUrl = (projectSlug: string, stageSlug: string) =>\n\t`/content/${projectSlug}/${stageSlug}`\n"],"names":[],"mappings":";;AAAO,MAAM,8BAA8B,CAAC,aAAqB,cAChE,YAAY,WAAW,IAAI,SAAS;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatContentApiRelativeUrl.js","sources":["../../../../../packages/client/src/content/formatContentApiRelativeUrl.ts"],"sourcesContent":["export const formatContentApiRelativeUrl = (projectSlug: string, stageSlug: string) =>\n\t`/content/${projectSlug}/${stageSlug}`\n"],"names":[],"mappings":"AAAO,MAAM,8BAA8B,CAAC,aAAqB,cAChE,YAAY,WAAW,IAAI,SAAS;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whereToFilter.cjs","sources":["../../../../../../packages/client/src/content/params/whereToFilter.ts"],"sourcesContent":["import type { Input, Writable } from '@contember/schema'\nimport { GraphQlLiteral } from '../../graphQlBuilder'\n\nexport const whereToFilter = (\n\tby: Input.UniqueWhere<GraphQlLiteral>,\n): Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>> => {\n\tconst where: Writable<Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>>> = {}\n\tfor (const key in by) {\n\t\tconst value = by[key]\n\n\t\tif (value instanceof GraphQlLiteral || typeof value === 'string' || typeof value === 'number') {\n\t\t\twhere[key] = { eq: value }\n\t\t} else {\n\t\t\twhere[key] = whereToFilter(value)\n\t\t}\n\t}\n\n\treturn where\n}\n"],"names":["GraphQlLiteral"],"mappings":";;;AAGa,MAAA,gBAAgB,CAC5B,OACqE;AACrE,QAAM,QAAmF,CAAA;AACzF,aAAW,OAAO,IAAI;AACf,UAAA,QAAQ,GAAG,GAAG;AAEpB,QAAI,iBAAiBA,eAAAA,kBAAkB,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;AAC9F,YAAM,GAAG,IAAI,EAAE,IAAI,MAAM;AAAA,IAAA,OACnB;AACA,YAAA,GAAG,IAAI,cAAc,KAAK;AAAA,IACjC;AAAA,EACD;AAEO,SAAA;AACR;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"whereToFilter.js","sources":["../../../../../../packages/client/src/content/params/whereToFilter.ts"],"sourcesContent":["import type { Input, Writable } from '@contember/schema'\nimport { GraphQlLiteral } from '../../graphQlBuilder'\n\nexport const whereToFilter = (\n\tby: Input.UniqueWhere<GraphQlLiteral>,\n): Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>> => {\n\tconst where: Writable<Input.Where<Input.Condition<Input.ColumnValue<GraphQlLiteral>>>> = {}\n\tfor (const key in by) {\n\t\tconst value = by[key]\n\n\t\tif (value instanceof GraphQlLiteral || typeof value === 'string' || typeof value === 'number') {\n\t\t\twhere[key] = { eq: value }\n\t\t} else {\n\t\t\twhere[key] = whereToFilter(value)\n\t\t}\n\t}\n\n\treturn where\n}\n"],"names":[],"mappings":";AAGa,MAAA,gBAAgB,CAC5B,OACqE;AACrE,QAAM,QAAmF,CAAA;AACzF,aAAW,OAAO,IAAI;AACf,UAAA,QAAQ,GAAG,GAAG;AAEpB,QAAI,iBAAiB,kBAAkB,OAAO,UAAU,YAAY,OAAO,UAAU,UAAU;AAC9F,YAAM,GAAG,IAAI,EAAE,IAAI,MAAM;AAAA,IAAA,OACnB;AACA,YAAA,GAAG,IAAI,cAAc,KAAK;AAAA,IACjC;AAAA,EACD;AAEO,SAAA;AACR;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replaceGraphQlLiteral.cjs","sources":["../../../../../packages/client/src/content/replaceGraphQlLiteral.ts"],"sourcesContent":["import { GraphQlLiteral } from '../graphQlBuilder'\n\nexport type ReplaceGraphQlLiteral<T> = T extends GraphQlLiteral<infer Value>\n\t? Value\n\t: T extends string | number | boolean | null\n\t\t? T // Keep primitives as is\n\t\t: T extends {}\n\t\t\t? { [K in keyof T]: ReplaceGraphQlLiteral<T[K]> } // Recursively apply to objects\n\t\t\t: T extends any[]\n\t\t\t\t? ReplaceGraphQlLiteral<T[number]>[] // Recursively apply to array elements\n\t\t\t\t: T\n\nexport const replaceGraphQlLiteral = <T>(input: T): ReplaceGraphQlLiteral<T> => {\n\tif (input instanceof GraphQlLiteral) {\n\t\treturn input.value as any\n\t} else if (Array.isArray(input)) {\n\t\treturn input.map(replaceGraphQlLiteral) as any\n\t} else if (typeof input === 'object' && input !== null) {\n\t\treturn Object.fromEntries(Object.entries(input).map(([key, value]) => value !== undefined ? [key, replaceGraphQlLiteral(value)] : undefined).filter(Boolean) as any) as any\n\t}\n\treturn input as any\n}\n"],"names":["GraphQlLiteral"],"mappings":";;;AAYa,MAAA,wBAAwB,CAAI,UAAuC;AAC/E,MAAI,iBAAiBA,eAAAA,gBAAgB;AACpC,WAAO,MAAM;AAAA,EACH,WAAA,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAA,MAAM,IAAI,qBAAqB;AAAA,EAC5B,WAAA,OAAO,UAAU,YAAY,UAAU,MAAM;AAChD,WAAA,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,UAAU,SAAY,CAAC,KAAK,sBAAsB,KAAK,CAAC,IAAI,MAAS,EAAE,OAAO,OAAO,CAAQ;AAAA,EACpK;AACO,SAAA;AACR;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replaceGraphQlLiteral.js","sources":["../../../../../packages/client/src/content/replaceGraphQlLiteral.ts"],"sourcesContent":["import { GraphQlLiteral } from '../graphQlBuilder'\n\nexport type ReplaceGraphQlLiteral<T> = T extends GraphQlLiteral<infer Value>\n\t? Value\n\t: T extends string | number | boolean | null\n\t\t? T // Keep primitives as is\n\t\t: T extends {}\n\t\t\t? { [K in keyof T]: ReplaceGraphQlLiteral<T[K]> } // Recursively apply to objects\n\t\t\t: T extends any[]\n\t\t\t\t? ReplaceGraphQlLiteral<T[number]>[] // Recursively apply to array elements\n\t\t\t\t: T\n\nexport const replaceGraphQlLiteral = <T>(input: T): ReplaceGraphQlLiteral<T> => {\n\tif (input instanceof GraphQlLiteral) {\n\t\treturn input.value as any\n\t} else if (Array.isArray(input)) {\n\t\treturn input.map(replaceGraphQlLiteral) as any\n\t} else if (typeof input === 'object' && input !== null) {\n\t\treturn Object.fromEntries(Object.entries(input).map(([key, value]) => value !== undefined ? [key, replaceGraphQlLiteral(value)] : undefined).filter(Boolean) as any) as any\n\t}\n\treturn input as any\n}\n"],"names":[],"mappings":";AAYa,MAAA,wBAAwB,CAAI,UAAuC;AAC/E,MAAI,iBAAiB,gBAAgB;AACpC,WAAO,MAAM;AAAA,EACH,WAAA,MAAM,QAAQ,KAAK,GAAG;AACzB,WAAA,MAAM,IAAI,qBAAqB;AAAA,EAC5B,WAAA,OAAO,UAAU,YAAY,UAAU,MAAM;AAChD,WAAA,OAAO,YAAY,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,UAAU,SAAY,CAAC,KAAK,sBAAsB,KAAK,CAAC,IAAI,MAAS,EAAE,OAAO,OAAO,CAAQ;AAAA,EACpK;AACO,SAAA;AACR;"}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
-
var __publicField = (obj, key, value) => {
|
|
5
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
6
|
-
return value;
|
|
7
|
-
};
|
|
8
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
3
|
const graphqlBuilder = require("@contember/graphql-builder");
|
|
10
|
-
const
|
|
4
|
+
const client_index = require("../../../index.cjs");
|
|
11
5
|
const replaceGraphQlLiteral = require("../replaceGraphQlLiteral.cjs");
|
|
12
|
-
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
9
|
+
const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilder2 {
|
|
13
10
|
/**
|
|
14
11
|
* @internal
|
|
15
12
|
*/
|
|
@@ -24,7 +21,7 @@ const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilde
|
|
|
24
21
|
value,
|
|
25
22
|
graphQlType: "S3GenerateSignedUploadInput"
|
|
26
23
|
}
|
|
27
|
-
},
|
|
24
|
+
}, _GenerateUploadUrlMutationBuilder2.generateUploadUrlFields));
|
|
28
25
|
} else {
|
|
29
26
|
selectionItems.push(new graphqlBuilder.GraphQlField(alias, "generateUploadUrl", {
|
|
30
27
|
contentType: {
|
|
@@ -41,9 +38,9 @@ const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilde
|
|
|
41
38
|
},
|
|
42
39
|
acl: {
|
|
43
40
|
graphQlType: "S3Acl",
|
|
44
|
-
value: fileParameters.acl instanceof
|
|
41
|
+
value: fileParameters.acl instanceof client_index.GraphQlBuilder.GraphqlLiteral ? fileParameters.acl?.value : fileParameters.acl
|
|
45
42
|
}
|
|
46
|
-
},
|
|
43
|
+
}, _GenerateUploadUrlMutationBuilder2.generateUploadUrlFields));
|
|
47
44
|
}
|
|
48
45
|
}
|
|
49
46
|
const printer = new graphqlBuilder.GraphQlQueryPrinter();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenerateUploadUrlMutationBuilder.cjs","sources":["../../../../../../packages/client/src/content/upload/GenerateUploadUrlMutationBuilder.ts"],"sourcesContent":["import { GraphQlLiteral } from '../../graphQlBuilder'\nimport { GraphQlField, GraphQlPrintResult, GraphQlQueryPrinter, GraphQlSelectionSetItem } from '@contember/graphql-builder'\nimport { GraphQlBuilder } from '../../index'\nimport { replaceGraphQlLiteral } from '../replaceGraphQlLiteral'\n\nclass GenerateUploadUrlMutationBuilder {\n\tprivate static generateUploadUrlFields = [\n\t\tnew GraphQlField(null, 'url'),\n\t\tnew GraphQlField(null, 'publicUrl'),\n\t\tnew GraphQlField(null, 'method'),\n\t\tnew GraphQlField(null, 'headers', {}, [\n\t\t\tnew GraphQlField(null, 'key'),\n\t\t\tnew GraphQlField(null, 'value'),\n\t\t]),\n\t]\n\t/**\n\t * @internal\n\t */\n\tpublic static buildQuery(parameters: GenerateUploadUrlMutationBuilder.MutationParameters): GraphQlPrintResult {\n\t\tconst selectionItems: GraphQlSelectionSetItem[] = []\n\t\tfor (const alias in parameters) {\n\t\t\tconst fileParameters = parameters[alias]\n\t\t\tif (fileParameters.suffix || fileParameters.fileName || fileParameters.extension) {\n\t\t\t\tconst value = replaceGraphQlLiteral(fileParameters)\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tinput: {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tgraphQlType: 'S3GenerateSignedUploadInput',\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t} else {\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tcontentType: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.contentType,\n\t\t\t\t\t},\n\t\t\t\t\texpiration: {\n\t\t\t\t\t\tgraphQlType: 'Int',\n\t\t\t\t\t\tvalue: fileParameters.expiration,\n\t\t\t\t\t},\n\t\t\t\t\tprefix: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.prefix,\n\t\t\t\t\t},\n\t\t\t\t\tacl: {\n\t\t\t\t\t\tgraphQlType: 'S3Acl',\n\t\t\t\t\t\tvalue: fileParameters.acl instanceof GraphQlBuilder.GraphqlLiteral ? fileParameters.acl?.value : fileParameters.acl,\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t}\n\t\t}\n\n\t\tconst printer = new GraphQlQueryPrinter()\n\t\treturn printer.printDocument('mutation', selectionItems, {})\n\t}\n}\n\nnamespace GenerateUploadUrlMutationBuilder {\n\texport type Acl =\n\t\t| 'PUBLIC_READ'\n\t\t| 'PRIVATE'\n\t\t| 'NONE'\n\t\t| GraphQlLiteral<'PUBLIC_READ' | 'PRIVATE' | 'NONE'>\n\n\texport type FileParameters = {\n\t\tcontentType: string\n\t\texpiration?: number\n\t\tsize?: number\n\t\tprefix?: string\n\t\textension?: string\n\t\tsuffix?: string\n\t\tfileName?: string\n\t\tacl?: Acl\n\t}\n\n\texport interface MutationParameters {\n\t\t[alias: string]: FileParameters\n\t}\n\n\texport interface ResponseBody {\n\t\turl: string\n\t\tpublicUrl: string\n\t\tmethod: string\n\t\theaders: Array<{\n\t\t\tkey: string\n\t\t\tvalue: string\n\t\t}>\n\t}\n\n\texport interface MutationResponse {\n\t\t[alias: string]: ResponseBody\n\t}\n}\n\nexport { GenerateUploadUrlMutationBuilder }\n"],"names":["_GenerateUploadUrlMutationBuilder","replaceGraphQlLiteral","GraphQlField","GraphQlBuilder","GraphQlQueryPrinter"],"mappings":";;;;;;;;AAKA,MAAM,oCAAN,MAAMA,mCAAiC;AAAA;AAAA;AAAA;AAAA,EAatC,OAAc,WAAW,YAAqF;AAC7G,UAAM,iBAA4C,CAAA;AAClD,eAAW,SAAS,YAAY;AACzB,YAAA,iBAAiB,WAAW,KAAK;AACvC,UAAI,eAAe,UAAU,eAAe,YAAY,eAAe,WAAW;AAC3E,cAAA,QAAQC,4CAAsB,cAAc;AAClD,uBAAe,KAAK,IAAIC,4BAAa,OAAO,qBAAqB;AAAA,UAChE,OAAO;AAAA,YACN;AAAA,YACA,aAAa;AAAA,UACd;AAAA,QAAA,GACEF,mCAAiC,uBAAuB,CAAC;AAAA,MAAA,OACtD;AACN,uBAAe,KAAK,IAAIE,4BAAa,OAAO,qBAAqB;AAAA,UAChE,aAAa;AAAA,YACZ,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,YAAY;AAAA,YACX,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,QAAQ;AAAA,YACP,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,KAAK;AAAA,YACJ,aAAa;AAAA,YACb,OAAO,eAAe,eAAeC,4BAAe,iBAAiB,eAAe,KAAK,QAAQ,eAAe;AAAA,UACjH;AAAA,QAAA,GACEH,mCAAiC,uBAAuB,CAAC;AAAA,MAC7D;AAAA,IACD;AAEM,UAAA,UAAU,IAAII,eAAAA;AACpB,WAAO,QAAQ,cAAc,YAAY,gBAAgB,CAAE,CAAA;AAAA,EAC5D;AACD;AAjDC,cADK,mCACU,2BAA0B;AAAA,EACxC,IAAIF,eAAa,aAAA,MAAM,KAAK;AAAA,EAC5B,IAAIA,eAAa,aAAA,MAAM,WAAW;AAAA,EAClC,IAAIA,eAAa,aAAA,MAAM,QAAQ;AAAA,EAC/B,IAAIA,4BAAa,MAAM,WAAW,IAAI;AAAA,IACrC,IAAIA,eAAa,aAAA,MAAM,KAAK;AAAA,IAC5B,IAAIA,eAAa,aAAA,MAAM,OAAO;AAAA,EAAA,CAC9B;AACF,CAAA;AATD,IAAM,mCAAN;;"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => {
|
|
4
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
return value;
|
|
6
|
-
};
|
|
7
1
|
import { GraphQlField, GraphQlQueryPrinter } from "@contember/graphql-builder";
|
|
8
|
-
import { GraphQlBuilder } from "
|
|
2
|
+
import { GraphQlBuilder } from "../../../index.js";
|
|
9
3
|
import { replaceGraphQlLiteral } from "../replaceGraphQlLiteral.js";
|
|
10
|
-
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
7
|
+
const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilder2 {
|
|
11
8
|
/**
|
|
12
9
|
* @internal
|
|
13
10
|
*/
|
|
@@ -22,7 +19,7 @@ const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilde
|
|
|
22
19
|
value,
|
|
23
20
|
graphQlType: "S3GenerateSignedUploadInput"
|
|
24
21
|
}
|
|
25
|
-
},
|
|
22
|
+
}, _GenerateUploadUrlMutationBuilder2.generateUploadUrlFields));
|
|
26
23
|
} else {
|
|
27
24
|
selectionItems.push(new GraphQlField(alias, "generateUploadUrl", {
|
|
28
25
|
contentType: {
|
|
@@ -41,7 +38,7 @@ const _GenerateUploadUrlMutationBuilder = class _GenerateUploadUrlMutationBuilde
|
|
|
41
38
|
graphQlType: "S3Acl",
|
|
42
39
|
value: fileParameters.acl instanceof GraphQlBuilder.GraphqlLiteral ? fileParameters.acl?.value : fileParameters.acl
|
|
43
40
|
}
|
|
44
|
-
},
|
|
41
|
+
}, _GenerateUploadUrlMutationBuilder2.generateUploadUrlFields));
|
|
45
42
|
}
|
|
46
43
|
}
|
|
47
44
|
const printer = new GraphQlQueryPrinter();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenerateUploadUrlMutationBuilder.js","sources":["../../../../../../packages/client/src/content/upload/GenerateUploadUrlMutationBuilder.ts"],"sourcesContent":["import { GraphQlLiteral } from '../../graphQlBuilder'\nimport { GraphQlField, GraphQlPrintResult, GraphQlQueryPrinter, GraphQlSelectionSetItem } from '@contember/graphql-builder'\nimport { GraphQlBuilder } from '../../index'\nimport { replaceGraphQlLiteral } from '../replaceGraphQlLiteral'\n\nclass GenerateUploadUrlMutationBuilder {\n\tprivate static generateUploadUrlFields = [\n\t\tnew GraphQlField(null, 'url'),\n\t\tnew GraphQlField(null, 'publicUrl'),\n\t\tnew GraphQlField(null, 'method'),\n\t\tnew GraphQlField(null, 'headers', {}, [\n\t\t\tnew GraphQlField(null, 'key'),\n\t\t\tnew GraphQlField(null, 'value'),\n\t\t]),\n\t]\n\t/**\n\t * @internal\n\t */\n\tpublic static buildQuery(parameters: GenerateUploadUrlMutationBuilder.MutationParameters): GraphQlPrintResult {\n\t\tconst selectionItems: GraphQlSelectionSetItem[] = []\n\t\tfor (const alias in parameters) {\n\t\t\tconst fileParameters = parameters[alias]\n\t\t\tif (fileParameters.suffix || fileParameters.fileName || fileParameters.extension) {\n\t\t\t\tconst value = replaceGraphQlLiteral(fileParameters)\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tinput: {\n\t\t\t\t\t\tvalue: value,\n\t\t\t\t\t\tgraphQlType: 'S3GenerateSignedUploadInput',\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t} else {\n\t\t\t\tselectionItems.push(new GraphQlField(alias, 'generateUploadUrl', {\n\t\t\t\t\tcontentType: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.contentType,\n\t\t\t\t\t},\n\t\t\t\t\texpiration: {\n\t\t\t\t\t\tgraphQlType: 'Int',\n\t\t\t\t\t\tvalue: fileParameters.expiration,\n\t\t\t\t\t},\n\t\t\t\t\tprefix: {\n\t\t\t\t\t\tgraphQlType: 'String',\n\t\t\t\t\t\tvalue: fileParameters.prefix,\n\t\t\t\t\t},\n\t\t\t\t\tacl: {\n\t\t\t\t\t\tgraphQlType: 'S3Acl',\n\t\t\t\t\t\tvalue: fileParameters.acl instanceof GraphQlBuilder.GraphqlLiteral ? fileParameters.acl?.value : fileParameters.acl,\n\t\t\t\t\t},\n\t\t\t\t}, GenerateUploadUrlMutationBuilder.generateUploadUrlFields))\n\t\t\t}\n\t\t}\n\n\t\tconst printer = new GraphQlQueryPrinter()\n\t\treturn printer.printDocument('mutation', selectionItems, {})\n\t}\n}\n\nnamespace GenerateUploadUrlMutationBuilder {\n\texport type Acl =\n\t\t| 'PUBLIC_READ'\n\t\t| 'PRIVATE'\n\t\t| 'NONE'\n\t\t| GraphQlLiteral<'PUBLIC_READ' | 'PRIVATE' | 'NONE'>\n\n\texport type FileParameters = {\n\t\tcontentType: string\n\t\texpiration?: number\n\t\tsize?: number\n\t\tprefix?: string\n\t\textension?: string\n\t\tsuffix?: string\n\t\tfileName?: string\n\t\tacl?: Acl\n\t}\n\n\texport interface MutationParameters {\n\t\t[alias: string]: FileParameters\n\t}\n\n\texport interface ResponseBody {\n\t\turl: string\n\t\tpublicUrl: string\n\t\tmethod: string\n\t\theaders: Array<{\n\t\t\tkey: string\n\t\t\tvalue: string\n\t\t}>\n\t}\n\n\texport interface MutationResponse {\n\t\t[alias: string]: ResponseBody\n\t}\n}\n\nexport { GenerateUploadUrlMutationBuilder }\n"],"names":["_GenerateUploadUrlMutationBuilder"],"mappings":";;;;;;AAKA,MAAM,oCAAN,MAAMA,mCAAiC;AAAA;AAAA;AAAA;AAAA,EAatC,OAAc,WAAW,YAAqF;AAC7G,UAAM,iBAA4C,CAAA;AAClD,eAAW,SAAS,YAAY;AACzB,YAAA,iBAAiB,WAAW,KAAK;AACvC,UAAI,eAAe,UAAU,eAAe,YAAY,eAAe,WAAW;AAC3E,cAAA,QAAQ,sBAAsB,cAAc;AAClD,uBAAe,KAAK,IAAI,aAAa,OAAO,qBAAqB;AAAA,UAChE,OAAO;AAAA,YACN;AAAA,YACA,aAAa;AAAA,UACd;AAAA,QAAA,GACEA,mCAAiC,uBAAuB,CAAC;AAAA,MAAA,OACtD;AACN,uBAAe,KAAK,IAAI,aAAa,OAAO,qBAAqB;AAAA,UAChE,aAAa;AAAA,YACZ,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,YAAY;AAAA,YACX,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,QAAQ;AAAA,YACP,aAAa;AAAA,YACb,OAAO,eAAe;AAAA,UACvB;AAAA,UACA,KAAK;AAAA,YACJ,aAAa;AAAA,YACb,OAAO,eAAe,eAAe,eAAe,iBAAiB,eAAe,KAAK,QAAQ,eAAe;AAAA,UACjH;AAAA,QAAA,GACEA,mCAAiC,uBAAuB,CAAC;AAAA,MAC7D;AAAA,IACD;AAEM,UAAA,UAAU,IAAI;AACpB,WAAO,QAAQ,cAAc,YAAY,gBAAgB,CAAE,CAAA;AAAA,EAC5D;AACD;AAjDC,cADK,mCACU,2BAA0B;AAAA,EACxC,IAAI,aAAa,MAAM,KAAK;AAAA,EAC5B,IAAI,aAAa,MAAM,WAAW;AAAA,EAClC,IAAI,aAAa,MAAM,QAAQ;AAAA,EAC/B,IAAI,aAAa,MAAM,WAAW,IAAI;AAAA,IACrC,IAAI,aAAa,MAAM,KAAK;AAAA,IAC5B,IAAI,aAAa,MAAM,OAAO;AAAA,EAAA,CAC9B;AACF,CAAA;AATD,IAAM,mCAAN;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphQlLiteral.cjs","sources":["../../../../../packages/client/src/graphQlBuilder/GraphQlLiteral.ts"],"sourcesContent":["/**\n * @deprecated Directly use the value instead.\n */\nexport class GraphQlLiteral<Value extends string = string> {\n\tconstructor(public readonly value: Value) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.warn('GraphQlLiteral is deprecated, use the value directly instead.')\n\t\t}\n\t}\n\n\tpublic toString() {\n\t\treturn `Literal(${this.value})`\n\t}\n}\n"],"names":[],"mappings":";;AAGO,MAAM,eAA8C;AAAA,EAC1D,YAA4B,OAAc;AAAd,SAAA,QAAA;AAAA,EAI5B;AAAA,EAEO,WAAW;AACV,WAAA,WAAW,KAAK,KAAK;AAAA,EAC7B;AACD;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphQlLiteral.js","sources":["../../../../../packages/client/src/graphQlBuilder/GraphQlLiteral.ts"],"sourcesContent":["/**\n * @deprecated Directly use the value instead.\n */\nexport class GraphQlLiteral<Value extends string = string> {\n\tconstructor(public readonly value: Value) {\n\t\tif (import.meta.env.DEV) {\n\t\t\tconsole.warn('GraphQlLiteral is deprecated, use the value directly instead.')\n\t\t}\n\t}\n\n\tpublic toString() {\n\t\treturn `Literal(${this.value})`\n\t}\n}\n"],"names":[],"mappings":"AAGO,MAAM,eAA8C;AAAA,EAC1D,YAA4B,OAAc;AAAd,SAAA,QAAA;AAAA,EAI5B;AAAA,EAEO,WAAW;AACV,WAAA,WAAW,KAAK,KAAK;AAAA,EAC7B;AACD;"}
|