@contember/client 1.2.6 → 1.3.0-alpha.10
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/dist/development/content/formatContentApiRelativeUrl.cjs +5 -0
- package/dist/development/content/formatContentApiRelativeUrl.cjs.map +1 -0
- package/dist/development/content/formatContentApiRelativeUrl.js.map +1 -1
- package/dist/development/content/params/whereToFilter.cjs +17 -0
- package/dist/development/content/params/whereToFilter.cjs.map +1 -0
- package/dist/development/content/replaceGraphQlLiteral.cjs +15 -0
- package/dist/development/content/replaceGraphQlLiteral.cjs.map +1 -0
- package/dist/development/content/replaceGraphQlLiteral.js +15 -0
- package/dist/development/content/replaceGraphQlLiteral.js.map +1 -0
- package/dist/development/content/upload/FileUploadError.cjs +10 -0
- package/dist/development/content/upload/FileUploadError.cjs.map +1 -0
- package/dist/development/content/upload/GenerateUploadUrlMutationBuilder.cjs +64 -0
- package/dist/development/content/upload/GenerateUploadUrlMutationBuilder.cjs.map +1 -0
- package/dist/development/content/upload/GenerateUploadUrlMutationBuilder.js +49 -20
- package/dist/development/content/upload/GenerateUploadUrlMutationBuilder.js.map +1 -1
- package/dist/development/content/upload/S3FileUploader.cjs +107 -0
- package/dist/development/content/upload/S3FileUploader.cjs.map +1 -0
- package/dist/development/content/upload/S3FileUploader.js +2 -3
- package/dist/development/content/upload/S3FileUploader.js.map +1 -1
- package/dist/development/graphQlBuilder/GraphQlLiteral.cjs +15 -0
- package/dist/development/graphQlBuilder/GraphQlLiteral.cjs.map +1 -0
- package/dist/development/graphQlBuilder/GraphQlLiteral.js +3 -0
- package/dist/development/graphQlBuilder/GraphQlLiteral.js.map +1 -1
- package/dist/development/graphQlClient/GraphQlClient.cjs +26 -0
- package/dist/development/graphQlClient/GraphQlClient.cjs.map +1 -0
- package/dist/development/graphQlClient/GraphQlClient.js +9 -16
- package/dist/development/graphQlClient/GraphQlClient.js.map +1 -1
- package/dist/development/index.cjs +46 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +5 -26
- package/dist/development/index.js.map +1 -1
- package/dist/development/system/formatSystemApiRelativeUrl.cjs +5 -0
- package/dist/development/system/formatSystemApiRelativeUrl.cjs.map +1 -0
- package/dist/development/system/formatSystemApiRelativeUrl.js.map +1 -1
- package/dist/development/tenant/loginMutation.cjs +34 -0
- package/dist/development/tenant/loginMutation.cjs.map +1 -0
- package/dist/development/tenant/tenantApiRelativeUrl.cjs +5 -0
- package/dist/development/tenant/tenantApiRelativeUrl.cjs.map +1 -0
- package/dist/development/tenant/tenantErrorMessages.cjs +18 -0
- package/dist/development/tenant/tenantErrorMessages.cjs.map +1 -0
- package/dist/development/tenant/tenantErrorMessages.js.map +1 -1
- package/dist/development/utils/readFileAsArrayBuffer.cjs +15 -0
- package/dist/development/utils/readFileAsArrayBuffer.cjs.map +1 -0
- package/dist/production/content/formatContentApiRelativeUrl.cjs +5 -0
- package/dist/production/content/formatContentApiRelativeUrl.cjs.map +1 -0
- package/dist/production/content/formatContentApiRelativeUrl.js.map +1 -1
- package/dist/production/content/params/whereToFilter.cjs +17 -0
- package/dist/production/content/params/whereToFilter.cjs.map +1 -0
- package/dist/production/content/replaceGraphQlLiteral.cjs +15 -0
- package/dist/production/content/replaceGraphQlLiteral.cjs.map +1 -0
- package/dist/production/content/replaceGraphQlLiteral.js +15 -0
- package/dist/production/content/replaceGraphQlLiteral.js.map +1 -0
- package/dist/production/content/upload/FileUploadError.cjs +10 -0
- package/dist/production/content/upload/FileUploadError.cjs.map +1 -0
- package/dist/production/content/upload/GenerateUploadUrlMutationBuilder.cjs +64 -0
- package/dist/production/content/upload/GenerateUploadUrlMutationBuilder.cjs.map +1 -0
- package/dist/production/content/upload/GenerateUploadUrlMutationBuilder.js +49 -20
- package/dist/production/content/upload/GenerateUploadUrlMutationBuilder.js.map +1 -1
- package/dist/production/content/upload/S3FileUploader.cjs +107 -0
- package/dist/production/content/upload/S3FileUploader.cjs.map +1 -0
- package/dist/production/content/upload/S3FileUploader.js +2 -3
- package/dist/production/content/upload/S3FileUploader.js.map +1 -1
- package/dist/production/graphQlBuilder/GraphQlLiteral.cjs +12 -0
- package/dist/production/graphQlBuilder/GraphQlLiteral.cjs.map +1 -0
- package/dist/production/graphQlBuilder/GraphQlLiteral.js.map +1 -1
- package/dist/production/graphQlClient/GraphQlClient.cjs +26 -0
- package/dist/production/graphQlClient/GraphQlClient.cjs.map +1 -0
- package/dist/production/graphQlClient/GraphQlClient.js +9 -16
- package/dist/production/graphQlClient/GraphQlClient.js.map +1 -1
- package/dist/production/index.cjs +46 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.js +5 -26
- package/dist/production/index.js.map +1 -1
- package/dist/production/system/formatSystemApiRelativeUrl.cjs +5 -0
- package/dist/production/system/formatSystemApiRelativeUrl.cjs.map +1 -0
- package/dist/production/system/formatSystemApiRelativeUrl.js.map +1 -1
- package/dist/production/tenant/loginMutation.cjs +34 -0
- package/dist/production/tenant/loginMutation.cjs.map +1 -0
- package/dist/production/tenant/tenantApiRelativeUrl.cjs +5 -0
- package/dist/production/tenant/tenantApiRelativeUrl.cjs.map +1 -0
- package/dist/production/tenant/tenantErrorMessages.cjs +18 -0
- package/dist/production/tenant/tenantErrorMessages.cjs.map +1 -0
- package/dist/production/tenant/tenantErrorMessages.js.map +1 -1
- package/dist/production/utils/readFileAsArrayBuffer.cjs +15 -0
- package/dist/production/utils/readFileAsArrayBuffer.cjs.map +1 -0
- package/dist/types/content/index.d.ts +1 -0
- package/dist/types/content/index.d.ts.map +1 -1
- package/dist/types/content/replaceGraphQlLiteral.d.ts +6 -0
- package/dist/types/content/replaceGraphQlLiteral.d.ts.map +1 -0
- package/dist/types/content/upload/GenerateUploadUrlMutationBuilder.d.ts +8 -4
- package/dist/types/content/upload/GenerateUploadUrlMutationBuilder.d.ts.map +1 -1
- package/dist/types/content/upload/S3FileUploader.d.ts.map +1 -1
- package/dist/types/crudQueryBuilder/index.d.ts +0 -6
- package/dist/types/crudQueryBuilder/index.d.ts.map +1 -1
- package/dist/types/crudQueryBuilder/types.d.ts +2 -43
- package/dist/types/crudQueryBuilder/types.d.ts.map +1 -1
- package/dist/types/graphQlBuilder/GraphQlLiteral.d.ts +3 -0
- package/dist/types/graphQlBuilder/GraphQlLiteral.d.ts.map +1 -1
- package/dist/types/graphQlBuilder/QueryBuilder.d.ts +2 -8
- package/dist/types/graphQlBuilder/QueryBuilder.d.ts.map +1 -1
- package/dist/types/graphQlBuilder/index.d.ts +0 -3
- package/dist/types/graphQlBuilder/index.d.ts.map +1 -1
- package/dist/types/graphQlClient/GraphQlClient.d.ts +10 -12
- package/dist/types/graphQlClient/GraphQlClient.d.ts.map +1 -1
- package/dist/types/graphQlClient/index.d.ts +2 -0
- package/dist/types/graphQlClient/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -29
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +19 -4
- package/src/content/index.ts +1 -1
- package/src/content/replaceGraphQlLiteral.ts +22 -0
- package/src/content/upload/GenerateUploadUrlMutationBuilder.ts +56 -33
- package/src/content/upload/S3FileUploader.ts +1 -2
- package/src/crudQueryBuilder/index.ts +0 -6
- package/src/crudQueryBuilder/types.ts +5 -70
- package/src/graphQlBuilder/GraphQlLiteral.ts +8 -1
- package/src/graphQlBuilder/QueryBuilder.ts +2 -23
- package/src/graphQlBuilder/index.ts +0 -3
- package/src/graphQlClient/GraphQlClient.ts +15 -28
- package/src/graphQlClient/index.ts +7 -0
- package/src/index.ts +5 -31
- package/src/tsconfig.json +12 -1
- package/dist/development/crudQueryBuilder/CrudQueryBuilder.js +0 -104
- package/dist/development/crudQueryBuilder/CrudQueryBuilder.js.map +0 -1
- package/dist/development/crudQueryBuilder/CrudQueryBuilderError.js +0 -6
- package/dist/development/crudQueryBuilder/CrudQueryBuilderError.js.map +0 -1
- package/dist/development/crudQueryBuilder/ErrorsRelationBuilder.js +0 -15
- package/dist/development/crudQueryBuilder/ErrorsRelationBuilder.js.map +0 -1
- package/dist/development/crudQueryBuilder/ReadBuilder.js +0 -70
- package/dist/development/crudQueryBuilder/ReadBuilder.js.map +0 -1
- package/dist/development/crudQueryBuilder/ValidationRelationBuilder.js +0 -18
- package/dist/development/crudQueryBuilder/ValidationRelationBuilder.js.map +0 -1
- package/dist/development/crudQueryBuilder/WriteBuilder.js +0 -54
- package/dist/development/crudQueryBuilder/WriteBuilder.js.map +0 -1
- package/dist/development/crudQueryBuilder/WriteDataBuilder.js +0 -110
- package/dist/development/crudQueryBuilder/WriteDataBuilder.js.map +0 -1
- package/dist/development/crudQueryBuilder/WriteManyRelationBuilder.js +0 -77
- package/dist/development/crudQueryBuilder/WriteManyRelationBuilder.js.map +0 -1
- package/dist/development/crudQueryBuilder/WriteOneRelationBuilder.js +0 -51
- package/dist/development/crudQueryBuilder/WriteOneRelationBuilder.js.map +0 -1
- package/dist/development/crudQueryBuilder/types.js +0 -40
- package/dist/development/crudQueryBuilder/types.js.map +0 -1
- package/dist/development/graphQlBuilder/GraphQlBuilderError.js +0 -6
- package/dist/development/graphQlBuilder/GraphQlBuilderError.js.map +0 -1
- package/dist/development/graphQlBuilder/ObjectBuilder.js +0 -80
- package/dist/development/graphQlBuilder/ObjectBuilder.js.map +0 -1
- package/dist/development/graphQlBuilder/QueryBuilder.js +0 -22
- package/dist/development/graphQlBuilder/QueryBuilder.js.map +0 -1
- package/dist/development/graphQlBuilder/QueryCompiler.js +0 -101
- package/dist/development/graphQlBuilder/QueryCompiler.js.map +0 -1
- package/dist/development/graphQlBuilder/RootObjectBuilder.js +0 -31
- package/dist/development/graphQlBuilder/RootObjectBuilder.js.map +0 -1
- package/dist/development/utils/isEmptyObject.js +0 -12
- package/dist/development/utils/isEmptyObject.js.map +0 -1
- package/dist/production/crudQueryBuilder/CrudQueryBuilder.js +0 -104
- package/dist/production/crudQueryBuilder/CrudQueryBuilder.js.map +0 -1
- package/dist/production/crudQueryBuilder/CrudQueryBuilderError.js +0 -6
- package/dist/production/crudQueryBuilder/CrudQueryBuilderError.js.map +0 -1
- package/dist/production/crudQueryBuilder/ErrorsRelationBuilder.js +0 -15
- package/dist/production/crudQueryBuilder/ErrorsRelationBuilder.js.map +0 -1
- package/dist/production/crudQueryBuilder/ReadBuilder.js +0 -70
- package/dist/production/crudQueryBuilder/ReadBuilder.js.map +0 -1
- package/dist/production/crudQueryBuilder/ValidationRelationBuilder.js +0 -18
- package/dist/production/crudQueryBuilder/ValidationRelationBuilder.js.map +0 -1
- package/dist/production/crudQueryBuilder/WriteBuilder.js +0 -54
- package/dist/production/crudQueryBuilder/WriteBuilder.js.map +0 -1
- package/dist/production/crudQueryBuilder/WriteDataBuilder.js +0 -110
- package/dist/production/crudQueryBuilder/WriteDataBuilder.js.map +0 -1
- package/dist/production/crudQueryBuilder/WriteManyRelationBuilder.js +0 -77
- package/dist/production/crudQueryBuilder/WriteManyRelationBuilder.js.map +0 -1
- package/dist/production/crudQueryBuilder/WriteOneRelationBuilder.js +0 -51
- package/dist/production/crudQueryBuilder/WriteOneRelationBuilder.js.map +0 -1
- package/dist/production/crudQueryBuilder/types.js +0 -40
- package/dist/production/crudQueryBuilder/types.js.map +0 -1
- package/dist/production/graphQlBuilder/GraphQlBuilderError.js +0 -6
- package/dist/production/graphQlBuilder/GraphQlBuilderError.js.map +0 -1
- package/dist/production/graphQlBuilder/ObjectBuilder.js +0 -80
- package/dist/production/graphQlBuilder/ObjectBuilder.js.map +0 -1
- package/dist/production/graphQlBuilder/QueryBuilder.js +0 -22
- package/dist/production/graphQlBuilder/QueryBuilder.js.map +0 -1
- package/dist/production/graphQlBuilder/QueryCompiler.js +0 -101
- package/dist/production/graphQlBuilder/QueryCompiler.js.map +0 -1
- package/dist/production/graphQlBuilder/RootObjectBuilder.js +0 -31
- package/dist/production/graphQlBuilder/RootObjectBuilder.js.map +0 -1
- package/dist/production/utils/isEmptyObject.js +0 -12
- package/dist/production/utils/isEmptyObject.js.map +0 -1
- package/dist/types/crudQueryBuilder/CrudQueryBuilder.d.ts +0 -21
- package/dist/types/crudQueryBuilder/CrudQueryBuilder.d.ts.map +0 -1
- package/dist/types/crudQueryBuilder/CrudQueryBuilderError.d.ts +0 -3
- package/dist/types/crudQueryBuilder/CrudQueryBuilderError.d.ts.map +0 -1
- package/dist/types/crudQueryBuilder/ErrorsRelationBuilder.d.ts +0 -5
- package/dist/types/crudQueryBuilder/ErrorsRelationBuilder.d.ts.map +0 -1
- package/dist/types/crudQueryBuilder/ReadBuilder.d.ts +0 -31
- package/dist/types/crudQueryBuilder/ReadBuilder.d.ts.map +0 -1
- package/dist/types/crudQueryBuilder/ValidationRelationBuilder.d.ts +0 -5
- package/dist/types/crudQueryBuilder/ValidationRelationBuilder.d.ts.map +0 -1
- package/dist/types/crudQueryBuilder/WriteBuilder.d.ts +0 -24
- package/dist/types/crudQueryBuilder/WriteBuilder.d.ts.map +0 -1
- package/dist/types/crudQueryBuilder/WriteDataBuilder.d.ts +0 -24
- package/dist/types/crudQueryBuilder/WriteDataBuilder.d.ts.map +0 -1
- package/dist/types/crudQueryBuilder/WriteManyRelationBuilder.d.ts +0 -27
- package/dist/types/crudQueryBuilder/WriteManyRelationBuilder.d.ts.map +0 -1
- package/dist/types/crudQueryBuilder/WriteOneRelationBuilder.d.ts +0 -28
- package/dist/types/crudQueryBuilder/WriteOneRelationBuilder.d.ts.map +0 -1
- package/dist/types/graphQlBuilder/GraphQlBuilderError.d.ts +0 -3
- package/dist/types/graphQlBuilder/GraphQlBuilderError.d.ts.map +0 -1
- package/dist/types/graphQlBuilder/ObjectBuilder.d.ts +0 -28
- package/dist/types/graphQlBuilder/ObjectBuilder.d.ts.map +0 -1
- package/dist/types/graphQlBuilder/QueryCompiler.d.ts +0 -13
- package/dist/types/graphQlBuilder/QueryCompiler.d.ts.map +0 -1
- package/dist/types/graphQlBuilder/RootObjectBuilder.d.ts +0 -17
- package/dist/types/graphQlBuilder/RootObjectBuilder.d.ts.map +0 -1
- package/src/crudQueryBuilder/CrudQueryBuilder.ts +0 -168
- package/src/crudQueryBuilder/CrudQueryBuilderError.ts +0 -1
- package/src/crudQueryBuilder/ErrorsRelationBuilder.ts +0 -16
- package/src/crudQueryBuilder/ReadBuilder.ts +0 -106
- package/src/crudQueryBuilder/ValidationRelationBuilder.ts +0 -17
- package/src/crudQueryBuilder/WriteBuilder.ts +0 -79
- package/src/crudQueryBuilder/WriteDataBuilder.ts +0 -153
- package/src/crudQueryBuilder/WriteManyRelationBuilder.ts +0 -141
- package/src/crudQueryBuilder/WriteOneRelationBuilder.ts +0 -101
- package/src/graphQlBuilder/GraphQlBuilderError.ts +0 -1
- package/src/graphQlBuilder/ObjectBuilder.ts +0 -87
- package/src/graphQlBuilder/QueryCompiler.ts +0 -115
- package/src/graphQlBuilder/RootObjectBuilder.ts +0 -36
|
@@ -0,0 +1,107 @@
|
|
|
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
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
|
+
const pLimit = require("p-limit");
|
|
10
|
+
const FileUploadError = require("./FileUploadError.cjs");
|
|
11
|
+
const GenerateUploadUrlMutationBuilder = require("./GenerateUploadUrlMutationBuilder.cjs");
|
|
12
|
+
const readFileAsArrayBuffer = require("../../utils/readFileAsArrayBuffer.cjs");
|
|
13
|
+
class S3FileUploader {
|
|
14
|
+
constructor(options = {}) {
|
|
15
|
+
__publicField(this, "uploadState");
|
|
16
|
+
__publicField(this, "generateNewAlias", /* @__PURE__ */ (() => {
|
|
17
|
+
let alias = 1;
|
|
18
|
+
return () => alias++;
|
|
19
|
+
})());
|
|
20
|
+
this.options = options;
|
|
21
|
+
this.uploadState = /* @__PURE__ */ new WeakMap();
|
|
22
|
+
}
|
|
23
|
+
static formatFullAlias(alias) {
|
|
24
|
+
return `file${alias}`;
|
|
25
|
+
}
|
|
26
|
+
async upload(files, options) {
|
|
27
|
+
const parameters = {};
|
|
28
|
+
for (const [file, metadata] of files) {
|
|
29
|
+
if (this.uploadState.has(file)) {
|
|
30
|
+
const uploadState = this.uploadState.get(file);
|
|
31
|
+
uploadState.request?.abort();
|
|
32
|
+
}
|
|
33
|
+
const alias = this.generateNewAlias();
|
|
34
|
+
this.uploadState.set(file, {
|
|
35
|
+
alias
|
|
36
|
+
});
|
|
37
|
+
const uploadOptions = this.options.getUploadOptions?.(file);
|
|
38
|
+
parameters[S3FileUploader.formatFullAlias(alias)] = {
|
|
39
|
+
contentType: uploadOptions?.fileType ?? file.type,
|
|
40
|
+
prefix: uploadOptions?.filePrefix,
|
|
41
|
+
suffix: uploadOptions?.fileSuffix,
|
|
42
|
+
size: uploadOptions?.fileSize,
|
|
43
|
+
extension: uploadOptions?.fileExtension,
|
|
44
|
+
fileName: uploadOptions?.fileName,
|
|
45
|
+
expiration: uploadOptions?.fileExpiration,
|
|
46
|
+
acl: uploadOptions?.fileAcl
|
|
47
|
+
};
|
|
48
|
+
metadata.abortSignal.addEventListener("abort", () => {
|
|
49
|
+
this.uploadState.get(file)?.request?.abort();
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const mutation = GenerateUploadUrlMutationBuilder.GenerateUploadUrlMutationBuilder.buildQuery(parameters);
|
|
53
|
+
try {
|
|
54
|
+
const responseData = await options.contentApiClient.execute(mutation.query, { variables: mutation.variables });
|
|
55
|
+
const limit = pLimit(this.options.concurrency ?? 5);
|
|
56
|
+
const promises = [];
|
|
57
|
+
for (const [file] of files) {
|
|
58
|
+
promises.push(limit(() => this.uploadSingleFile(file, responseData, options)));
|
|
59
|
+
}
|
|
60
|
+
await Promise.all(promises);
|
|
61
|
+
} catch (error) {
|
|
62
|
+
if (error instanceof FileUploadError.FileUploadError) {
|
|
63
|
+
const fileUploadError = error;
|
|
64
|
+
options.onError(Array.from(files).map(([file]) => [file, fileUploadError]));
|
|
65
|
+
} else {
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
uploadSingleFile(file, responseData, { onProgress, onError, onSuccess }) {
|
|
71
|
+
return new Promise(async (resolve, reject) => {
|
|
72
|
+
const fileState = this.uploadState.get(file);
|
|
73
|
+
const datumBody = responseData[S3FileUploader.formatFullAlias(fileState.alias)];
|
|
74
|
+
const uploadRequestBody = await readFileAsArrayBuffer.readFileAsArrayBuffer(file);
|
|
75
|
+
const xhr = new XMLHttpRequest();
|
|
76
|
+
fileState.request = xhr;
|
|
77
|
+
xhr.open(datumBody.method, datumBody.url);
|
|
78
|
+
for (const header of datumBody.headers) {
|
|
79
|
+
xhr.setRequestHeader(header.key, header.value);
|
|
80
|
+
}
|
|
81
|
+
xhr.addEventListener("load", () => {
|
|
82
|
+
const successMetadata = {
|
|
83
|
+
fileUrl: datumBody.publicUrl
|
|
84
|
+
};
|
|
85
|
+
onSuccess([[file, successMetadata]]);
|
|
86
|
+
resolve();
|
|
87
|
+
});
|
|
88
|
+
xhr.addEventListener("error", (e) => {
|
|
89
|
+
onError([file]);
|
|
90
|
+
reject(e);
|
|
91
|
+
});
|
|
92
|
+
xhr.upload?.addEventListener("progress", (e) => {
|
|
93
|
+
onProgress([
|
|
94
|
+
[
|
|
95
|
+
file,
|
|
96
|
+
{
|
|
97
|
+
progress: e.loaded / e.total
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
]);
|
|
101
|
+
});
|
|
102
|
+
xhr.send(uploadRequestBody);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.S3FileUploader = S3FileUploader;
|
|
107
|
+
//# sourceMappingURL=S3FileUploader.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"S3FileUploader.cjs","sources":["../../../../src/content/upload/S3FileUploader.ts"],"sourcesContent":["import pLimit from 'p-limit'\nimport { readFileAsArrayBuffer } from '../../utils'\nimport { FileUploadError } from './FileUploadError'\nimport type { FileUploader, FileUploaderInitializeOptions } from './FileUploader'\nimport { GenerateUploadUrlMutationBuilder } from './GenerateUploadUrlMutationBuilder'\nimport type { UploadedFileMetadata } from './UploadedFileMetadata'\n\ninterface S3UploadState {\n\trequest?: XMLHttpRequest\n\talias: number\n}\n\nclass S3FileUploader implements FileUploader<S3FileUploader.SuccessMetadata> {\n\tprivate readonly uploadState: WeakMap<File, S3UploadState>\n\n\tpublic constructor(public readonly options: S3FileUploader.Options = {}) {\n\t\tthis.uploadState = new WeakMap()\n\t}\n\n\tprivate generateNewAlias = (() => {\n\t\tlet alias = 1\n\t\treturn () => alias++\n\t})()\n\n\tprivate static formatFullAlias(alias: number) {\n\t\treturn `file${alias}`\n\t}\n\n\tpublic async upload(\n\t\tfiles: Map<File, UploadedFileMetadata>,\n\t\toptions: FileUploaderInitializeOptions,\n\t) {\n\t\tconst parameters: GenerateUploadUrlMutationBuilder.MutationParameters = {}\n\n\t\tfor (const [file, metadata] of files) {\n\t\t\tif (this.uploadState.has(file)) {\n\t\t\t\tconst uploadState = this.uploadState.get(file)!\n\t\t\t\tuploadState.request?.abort()\n\t\t\t}\n\n\t\t\tconst alias = this.generateNewAlias()\n\t\t\tthis.uploadState.set(file, {\n\t\t\t\talias,\n\t\t\t})\n\n\t\t\tconst uploadOptions = this.options.getUploadOptions?.(file)\n\n\t\t\tparameters[S3FileUploader.formatFullAlias(alias)] = {\n\t\t\t\tcontentType: uploadOptions?.fileType ?? file.type,\n\t\t\t\tprefix: uploadOptions?.filePrefix,\n\t\t\t\tsuffix: uploadOptions?.fileSuffix,\n\t\t\t\tsize: uploadOptions?.fileSize,\n\t\t\t\textension: uploadOptions?.fileExtension,\n\t\t\t\tfileName: uploadOptions?.fileName,\n\t\t\t\texpiration: uploadOptions?.fileExpiration,\n\t\t\t\tacl: uploadOptions?.fileAcl,\n\t\t\t}\n\n\t\t\tmetadata.abortSignal.addEventListener('abort', () => {\n\t\t\t\tthis.uploadState.get(file)?.request?.abort()\n\t\t\t})\n\t\t}\n\n\t\tconst mutation = GenerateUploadUrlMutationBuilder.buildQuery(parameters)\n\t\ttry {\n\t\t\tconst responseData = await options.contentApiClient.execute<GenerateUploadUrlMutationBuilder.MutationResponse>(mutation.query, { variables: mutation.variables })\n\t\t\tconst limit = pLimit(this.options.concurrency ?? 5)\n\t\t\tconst promises: Promise<void>[] = []\n\t\t\tfor (const [file] of files) {\n\t\t\t\tpromises.push(limit(() => this.uploadSingleFile(file, responseData, options)))\n\t\t\t}\n\t\t\tawait Promise.all(promises)\n\t\t} catch (error) {\n\t\t\tif (error instanceof FileUploadError) {\n\t\t\t\tconst fileUploadError = error\n\t\t\t\toptions.onError(Array.from(files).map(([file]) => [file, fileUploadError]))\n\n\t\t\t} else {\n\t\t\t\tthrow error\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate uploadSingleFile(\n\t\tfile: File,\n\t\tresponseData: GenerateUploadUrlMutationBuilder.MutationResponse,\n\t\t{ onProgress, onError, onSuccess }: FileUploaderInitializeOptions,\n\t) {\n\t\treturn new Promise<void>(async (resolve, reject) => {\n\t\t\tconst fileState = this.uploadState.get(file)!\n\t\t\tconst datumBody = responseData[S3FileUploader.formatFullAlias(fileState.alias)]\n\t\t\tconst uploadRequestBody = await readFileAsArrayBuffer(file)\n\t\t\tconst xhr = new XMLHttpRequest()\n\n\t\t\tfileState.request = xhr\n\n\t\t\txhr.open(datumBody.method, datumBody.url)\n\n\t\t\tfor (const header of datumBody.headers) {\n\t\t\t\txhr.setRequestHeader(header.key, header.value)\n\t\t\t}\n\t\t\txhr.addEventListener('load', () => {\n\t\t\t\tconst successMetadata: S3FileUploader.SuccessMetadata = {\n\t\t\t\t\tfileUrl: datumBody.publicUrl,\n\t\t\t\t}\n\t\t\t\tonSuccess([[file, successMetadata]])\n\t\t\t\tresolve()\n\t\t\t})\n\t\t\txhr.addEventListener('error', e => {\n\t\t\t\tonError([file])\n\t\t\t\treject(e)\n\t\t\t})\n\t\t\txhr.upload?.addEventListener('progress', e => {\n\t\t\t\tonProgress([\n\t\t\t\t\t[\n\t\t\t\t\t\tfile,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprogress: e.loaded / e.total,\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\txhr.send(uploadRequestBody)\n\t\t})\n\t}\n}\n\nnamespace S3FileUploader {\n\texport interface SuccessMetadata {\n\t\tfileUrl: string\n\t}\n\n\texport interface Options {\n\t\tgetUploadOptions?: (file: File) => S3UploadOptions\n\t\tconcurrency?: number\n\t}\n\n\texport interface S3UploadOptions {\n\t\tfileType?: GenerateUploadUrlMutationBuilder.FileParameters['contentType']\n\t\tfileExpiration?: number\n\t\tfileSize?: number\n\t\tfilePrefix?: string\n\t\tfileSuffix?: string\n\t\tfileName?: string\n\t\tfileExtension?: string\n\t\tfileAcl?: GenerateUploadUrlMutationBuilder.Acl\n\t}\n}\n\nexport { S3FileUploader }\n"],"names":["GenerateUploadUrlMutationBuilder","FileUploadError","readFileAsArrayBuffer"],"mappings":"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"}
|
|
@@ -11,7 +11,7 @@ import { readFileAsArrayBuffer } from "../../utils/readFileAsArrayBuffer.js";
|
|
|
11
11
|
class S3FileUploader {
|
|
12
12
|
constructor(options = {}) {
|
|
13
13
|
__publicField(this, "uploadState");
|
|
14
|
-
__publicField(this, "generateNewAlias", (() => {
|
|
14
|
+
__publicField(this, "generateNewAlias", /* @__PURE__ */ (() => {
|
|
15
15
|
let alias = 1;
|
|
16
16
|
return () => alias++;
|
|
17
17
|
})());
|
|
@@ -49,8 +49,7 @@ class S3FileUploader {
|
|
|
49
49
|
}
|
|
50
50
|
const mutation = GenerateUploadUrlMutationBuilder.buildQuery(parameters);
|
|
51
51
|
try {
|
|
52
|
-
const
|
|
53
|
-
const responseData = response.data;
|
|
52
|
+
const responseData = await options.contentApiClient.execute(mutation.query, { variables: mutation.variables });
|
|
54
53
|
const limit = pLimit(this.options.concurrency ?? 5);
|
|
55
54
|
const promises = [];
|
|
56
55
|
for (const [file] of files) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"S3FileUploader.js","sources":["../../../../src/content/upload/S3FileUploader.ts"],"sourcesContent":["import pLimit from 'p-limit'\nimport { readFileAsArrayBuffer } from '../../utils'\nimport { FileUploadError } from './FileUploadError'\nimport type { FileUploader, FileUploaderInitializeOptions } from './FileUploader'\nimport { GenerateUploadUrlMutationBuilder } from './GenerateUploadUrlMutationBuilder'\nimport type { UploadedFileMetadata } from './UploadedFileMetadata'\n\ninterface S3UploadState {\n\trequest?: XMLHttpRequest\n\talias: number\n}\n\nclass S3FileUploader implements FileUploader<S3FileUploader.SuccessMetadata> {\n\tprivate readonly uploadState: WeakMap<File, S3UploadState>\n\n\tpublic constructor(public readonly options: S3FileUploader.Options = {}) {\n\t\tthis.uploadState = new WeakMap()\n\t}\n\n\tprivate generateNewAlias = (() => {\n\t\tlet alias = 1\n\t\treturn () => alias++\n\t})()\n\n\tprivate static formatFullAlias(alias: number) {\n\t\treturn `file${alias}`\n\t}\n\n\tpublic async upload(\n\t\tfiles: Map<File, UploadedFileMetadata>,\n\t\toptions: FileUploaderInitializeOptions,\n\t) {\n\t\tconst parameters: GenerateUploadUrlMutationBuilder.MutationParameters = {}\n\n\t\tfor (const [file, metadata] of files) {\n\t\t\tif (this.uploadState.has(file)) {\n\t\t\t\tconst uploadState = this.uploadState.get(file)!\n\t\t\t\tuploadState.request?.abort()\n\t\t\t}\n\n\t\t\tconst alias = this.generateNewAlias()\n\t\t\tthis.uploadState.set(file, {\n\t\t\t\talias,\n\t\t\t})\n\n\t\t\tconst uploadOptions = this.options.getUploadOptions?.(file)\n\n\t\t\tparameters[S3FileUploader.formatFullAlias(alias)] = {\n\t\t\t\tcontentType: uploadOptions?.fileType ?? file.type,\n\t\t\t\tprefix: uploadOptions?.filePrefix,\n\t\t\t\tsuffix: uploadOptions?.fileSuffix,\n\t\t\t\tsize: uploadOptions?.fileSize,\n\t\t\t\textension: uploadOptions?.fileExtension,\n\t\t\t\tfileName: uploadOptions?.fileName,\n\t\t\t\texpiration: uploadOptions?.fileExpiration,\n\t\t\t\tacl: uploadOptions?.fileAcl,\n\t\t\t}\n\n\t\t\tmetadata.abortSignal.addEventListener('abort', () => {\n\t\t\t\tthis.uploadState.get(file)?.request?.abort()\n\t\t\t})\n\t\t}\n\n\t\tconst mutation = GenerateUploadUrlMutationBuilder.buildQuery(parameters)\n\t\ttry {\n\t\t\tconst
|
|
1
|
+
{"version":3,"file":"S3FileUploader.js","sources":["../../../../src/content/upload/S3FileUploader.ts"],"sourcesContent":["import pLimit from 'p-limit'\nimport { readFileAsArrayBuffer } from '../../utils'\nimport { FileUploadError } from './FileUploadError'\nimport type { FileUploader, FileUploaderInitializeOptions } from './FileUploader'\nimport { GenerateUploadUrlMutationBuilder } from './GenerateUploadUrlMutationBuilder'\nimport type { UploadedFileMetadata } from './UploadedFileMetadata'\n\ninterface S3UploadState {\n\trequest?: XMLHttpRequest\n\talias: number\n}\n\nclass S3FileUploader implements FileUploader<S3FileUploader.SuccessMetadata> {\n\tprivate readonly uploadState: WeakMap<File, S3UploadState>\n\n\tpublic constructor(public readonly options: S3FileUploader.Options = {}) {\n\t\tthis.uploadState = new WeakMap()\n\t}\n\n\tprivate generateNewAlias = (() => {\n\t\tlet alias = 1\n\t\treturn () => alias++\n\t})()\n\n\tprivate static formatFullAlias(alias: number) {\n\t\treturn `file${alias}`\n\t}\n\n\tpublic async upload(\n\t\tfiles: Map<File, UploadedFileMetadata>,\n\t\toptions: FileUploaderInitializeOptions,\n\t) {\n\t\tconst parameters: GenerateUploadUrlMutationBuilder.MutationParameters = {}\n\n\t\tfor (const [file, metadata] of files) {\n\t\t\tif (this.uploadState.has(file)) {\n\t\t\t\tconst uploadState = this.uploadState.get(file)!\n\t\t\t\tuploadState.request?.abort()\n\t\t\t}\n\n\t\t\tconst alias = this.generateNewAlias()\n\t\t\tthis.uploadState.set(file, {\n\t\t\t\talias,\n\t\t\t})\n\n\t\t\tconst uploadOptions = this.options.getUploadOptions?.(file)\n\n\t\t\tparameters[S3FileUploader.formatFullAlias(alias)] = {\n\t\t\t\tcontentType: uploadOptions?.fileType ?? file.type,\n\t\t\t\tprefix: uploadOptions?.filePrefix,\n\t\t\t\tsuffix: uploadOptions?.fileSuffix,\n\t\t\t\tsize: uploadOptions?.fileSize,\n\t\t\t\textension: uploadOptions?.fileExtension,\n\t\t\t\tfileName: uploadOptions?.fileName,\n\t\t\t\texpiration: uploadOptions?.fileExpiration,\n\t\t\t\tacl: uploadOptions?.fileAcl,\n\t\t\t}\n\n\t\t\tmetadata.abortSignal.addEventListener('abort', () => {\n\t\t\t\tthis.uploadState.get(file)?.request?.abort()\n\t\t\t})\n\t\t}\n\n\t\tconst mutation = GenerateUploadUrlMutationBuilder.buildQuery(parameters)\n\t\ttry {\n\t\t\tconst responseData = await options.contentApiClient.execute<GenerateUploadUrlMutationBuilder.MutationResponse>(mutation.query, { variables: mutation.variables })\n\t\t\tconst limit = pLimit(this.options.concurrency ?? 5)\n\t\t\tconst promises: Promise<void>[] = []\n\t\t\tfor (const [file] of files) {\n\t\t\t\tpromises.push(limit(() => this.uploadSingleFile(file, responseData, options)))\n\t\t\t}\n\t\t\tawait Promise.all(promises)\n\t\t} catch (error) {\n\t\t\tif (error instanceof FileUploadError) {\n\t\t\t\tconst fileUploadError = error\n\t\t\t\toptions.onError(Array.from(files).map(([file]) => [file, fileUploadError]))\n\n\t\t\t} else {\n\t\t\t\tthrow error\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate uploadSingleFile(\n\t\tfile: File,\n\t\tresponseData: GenerateUploadUrlMutationBuilder.MutationResponse,\n\t\t{ onProgress, onError, onSuccess }: FileUploaderInitializeOptions,\n\t) {\n\t\treturn new Promise<void>(async (resolve, reject) => {\n\t\t\tconst fileState = this.uploadState.get(file)!\n\t\t\tconst datumBody = responseData[S3FileUploader.formatFullAlias(fileState.alias)]\n\t\t\tconst uploadRequestBody = await readFileAsArrayBuffer(file)\n\t\t\tconst xhr = new XMLHttpRequest()\n\n\t\t\tfileState.request = xhr\n\n\t\t\txhr.open(datumBody.method, datumBody.url)\n\n\t\t\tfor (const header of datumBody.headers) {\n\t\t\t\txhr.setRequestHeader(header.key, header.value)\n\t\t\t}\n\t\t\txhr.addEventListener('load', () => {\n\t\t\t\tconst successMetadata: S3FileUploader.SuccessMetadata = {\n\t\t\t\t\tfileUrl: datumBody.publicUrl,\n\t\t\t\t}\n\t\t\t\tonSuccess([[file, successMetadata]])\n\t\t\t\tresolve()\n\t\t\t})\n\t\t\txhr.addEventListener('error', e => {\n\t\t\t\tonError([file])\n\t\t\t\treject(e)\n\t\t\t})\n\t\t\txhr.upload?.addEventListener('progress', e => {\n\t\t\t\tonProgress([\n\t\t\t\t\t[\n\t\t\t\t\t\tfile,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tprogress: e.loaded / e.total,\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\txhr.send(uploadRequestBody)\n\t\t})\n\t}\n}\n\nnamespace S3FileUploader {\n\texport interface SuccessMetadata {\n\t\tfileUrl: string\n\t}\n\n\texport interface Options {\n\t\tgetUploadOptions?: (file: File) => S3UploadOptions\n\t\tconcurrency?: number\n\t}\n\n\texport interface S3UploadOptions {\n\t\tfileType?: GenerateUploadUrlMutationBuilder.FileParameters['contentType']\n\t\tfileExpiration?: number\n\t\tfileSize?: number\n\t\tfilePrefix?: string\n\t\tfileSuffix?: string\n\t\tfileName?: string\n\t\tfileExtension?: string\n\t\tfileAcl?: GenerateUploadUrlMutationBuilder.Acl\n\t}\n}\n\nexport { S3FileUploader }\n"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
class GraphQlLiteral {
|
|
4
|
+
constructor(value) {
|
|
5
|
+
this.value = value;
|
|
6
|
+
}
|
|
7
|
+
toString() {
|
|
8
|
+
return `Literal(${this.value})`;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.GraphQlLiteral = GraphQlLiteral;
|
|
12
|
+
//# sourceMappingURL=GraphQlLiteral.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphQlLiteral.cjs","sources":["../../../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;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphQlLiteral.js","sources":["../../../src/graphQlBuilder/GraphQlLiteral.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"GraphQlLiteral.js","sources":["../../../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,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const graphqlClient = require("@contember/graphql-client");
|
|
4
|
+
class GraphQlClient extends graphqlClient.GraphQlClient {
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated use execute
|
|
7
|
+
*/
|
|
8
|
+
async sendRequest(query, options = {}) {
|
|
9
|
+
console.debug(query);
|
|
10
|
+
const response = await this.doExecute(query, {
|
|
11
|
+
...options,
|
|
12
|
+
apiToken: options.apiTokenOverride ?? options.apiToken
|
|
13
|
+
});
|
|
14
|
+
if (response.ok) {
|
|
15
|
+
return await response.json();
|
|
16
|
+
}
|
|
17
|
+
const failedRequest = {
|
|
18
|
+
status: response.status,
|
|
19
|
+
statusText: response.statusText,
|
|
20
|
+
responseText: await response.text()
|
|
21
|
+
};
|
|
22
|
+
return Promise.reject(failedRequest);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.GraphQlClient = GraphQlClient;
|
|
26
|
+
//# sourceMappingURL=GraphQlClient.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphQlClient.cjs","sources":["../../../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\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;AACpG,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;;"}
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
async sendRequest(query,
|
|
7
|
-
const resolvedHeaders = { "Content-Type": "application/json", ...headers };
|
|
8
|
-
const resolvedToken = apiTokenOverride ?? this.apiToken;
|
|
9
|
-
if (resolvedToken !== void 0) {
|
|
10
|
-
resolvedHeaders["Authorization"] = `Bearer ${resolvedToken}`;
|
|
11
|
-
}
|
|
1
|
+
import { GraphQlClient as GraphQlClient$1 } from "@contember/graphql-client";
|
|
2
|
+
class GraphQlClient extends GraphQlClient$1 {
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated use execute
|
|
5
|
+
*/
|
|
6
|
+
async sendRequest(query, options = {}) {
|
|
12
7
|
console.debug(query);
|
|
13
|
-
const response = await
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
signal,
|
|
17
|
-
body: JSON.stringify({ query, variables })
|
|
8
|
+
const response = await this.doExecute(query, {
|
|
9
|
+
...options,
|
|
10
|
+
apiToken: options.apiTokenOverride ?? options.apiToken
|
|
18
11
|
});
|
|
19
12
|
if (response.ok) {
|
|
20
13
|
return await response.json();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphQlClient.js","sources":["../../../src/graphQlClient/GraphQlClient.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"GraphQlClient.js","sources":["../../../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\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;AACpG,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,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const clientContent = require("@contember/client-content");
|
|
4
|
+
const GraphQlLiteral = require("./graphQlBuilder/GraphQlLiteral.cjs");
|
|
5
|
+
const FileUploadError = require("./content/upload/FileUploadError.cjs");
|
|
6
|
+
const GenerateUploadUrlMutationBuilder = require("./content/upload/GenerateUploadUrlMutationBuilder.cjs");
|
|
7
|
+
const S3FileUploader = require("./content/upload/S3FileUploader.cjs");
|
|
8
|
+
const whereToFilter = require("./content/params/whereToFilter.cjs");
|
|
9
|
+
const formatContentApiRelativeUrl = require("./content/formatContentApiRelativeUrl.cjs");
|
|
10
|
+
const replaceGraphQlLiteral = require("./content/replaceGraphQlLiteral.cjs");
|
|
11
|
+
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");
|
|
17
|
+
exports.GraphQlBuilder = void 0;
|
|
18
|
+
((GraphQlBuilder2) => {
|
|
19
|
+
GraphQlBuilder2.GraphqlLiteral = GraphQlLiteral.GraphQlLiteral;
|
|
20
|
+
GraphQlBuilder2.GraphQlLiteral = GraphQlLiteral.GraphQlLiteral;
|
|
21
|
+
})(exports.GraphQlBuilder || (exports.GraphQlBuilder = {}));
|
|
22
|
+
exports.GraphQlLiteral = GraphQlLiteral.GraphQlLiteral;
|
|
23
|
+
exports.FileUploadError = FileUploadError.FileUploadError;
|
|
24
|
+
exports.GenerateUploadUrlMutationBuilder = GenerateUploadUrlMutationBuilder.GenerateUploadUrlMutationBuilder;
|
|
25
|
+
exports.S3FileUploader = S3FileUploader.S3FileUploader;
|
|
26
|
+
exports.whereToFilter = whereToFilter.whereToFilter;
|
|
27
|
+
exports.formatContentApiRelativeUrl = formatContentApiRelativeUrl.formatContentApiRelativeUrl;
|
|
28
|
+
exports.replaceGraphQlLiteral = replaceGraphQlLiteral.replaceGraphQlLiteral;
|
|
29
|
+
Object.defineProperty(exports, "GraphQlClientError", {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: () => graphqlClient.GraphQlClientError
|
|
32
|
+
});
|
|
33
|
+
exports.GraphQlClient = GraphQlClient.GraphQlClient;
|
|
34
|
+
exports.formatSystemApiRelativeUrl = formatSystemApiRelativeUrl.formatSystemApiRelativeUrl;
|
|
35
|
+
exports.loginMutation = loginMutation.loginMutation;
|
|
36
|
+
exports.tenantApiRelativeUrl = tenantApiRelativeUrl.tenantApiRelativeUrl;
|
|
37
|
+
exports.getTenantErrorMessage = tenantErrorMessages.getTenantErrorMessage;
|
|
38
|
+
exports.tenantErrorMessages = tenantErrorMessages.tenantErrorMessages;
|
|
39
|
+
Object.keys(clientContent).forEach((k) => {
|
|
40
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k))
|
|
41
|
+
Object.defineProperty(exports, k, {
|
|
42
|
+
enumerable: true,
|
|
43
|
+
get: () => clientContent[k]
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../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,20 +1,12 @@
|
|
|
1
|
+
export * from "@contember/client-content";
|
|
1
2
|
import { GraphQlLiteral } from "./graphQlBuilder/GraphQlLiteral.js";
|
|
2
|
-
import { ObjectBuilder } from "./graphQlBuilder/ObjectBuilder.js";
|
|
3
|
-
import { QueryCompiler } from "./graphQlBuilder/QueryCompiler.js";
|
|
4
|
-
import { QueryBuilder } from "./graphQlBuilder/QueryBuilder.js";
|
|
5
|
-
import { RootObjectBuilder } from "./graphQlBuilder/RootObjectBuilder.js";
|
|
6
|
-
import { CrudQueryBuilder as CrudQueryBuilder$1 } from "./crudQueryBuilder/CrudQueryBuilder.js";
|
|
7
|
-
import { ReadBuilder } from "./crudQueryBuilder/ReadBuilder.js";
|
|
8
|
-
import { WriteBuilder } from "./crudQueryBuilder/WriteBuilder.js";
|
|
9
|
-
import { WriteDataBuilder } from "./crudQueryBuilder/WriteDataBuilder.js";
|
|
10
|
-
import { WriteManyRelationBuilder } from "./crudQueryBuilder/WriteManyRelationBuilder.js";
|
|
11
|
-
import { WriteOneRelationBuilder } from "./crudQueryBuilder/WriteOneRelationBuilder.js";
|
|
12
|
-
import { WriteOperation } from "./crudQueryBuilder/types.js";
|
|
13
3
|
import { FileUploadError } from "./content/upload/FileUploadError.js";
|
|
14
4
|
import { GenerateUploadUrlMutationBuilder } from "./content/upload/GenerateUploadUrlMutationBuilder.js";
|
|
15
5
|
import { S3FileUploader } from "./content/upload/S3FileUploader.js";
|
|
16
6
|
import { whereToFilter } from "./content/params/whereToFilter.js";
|
|
17
7
|
import { formatContentApiRelativeUrl } from "./content/formatContentApiRelativeUrl.js";
|
|
8
|
+
import { replaceGraphQlLiteral } from "./content/replaceGraphQlLiteral.js";
|
|
9
|
+
import { GraphQlClientError } from "@contember/graphql-client";
|
|
18
10
|
import { GraphQlClient } from "./graphQlClient/GraphQlClient.js";
|
|
19
11
|
import { formatSystemApiRelativeUrl } from "./system/formatSystemApiRelativeUrl.js";
|
|
20
12
|
import { loginMutation } from "./tenant/loginMutation.js";
|
|
@@ -24,33 +16,20 @@ var GraphQlBuilder;
|
|
|
24
16
|
((GraphQlBuilder2) => {
|
|
25
17
|
GraphQlBuilder2.GraphqlLiteral = GraphQlLiteral;
|
|
26
18
|
GraphQlBuilder2.GraphQlLiteral = GraphQlLiteral;
|
|
27
|
-
GraphQlBuilder2.ObjectBuilder = ObjectBuilder;
|
|
28
|
-
GraphQlBuilder2.QueryCompiler = QueryCompiler;
|
|
29
|
-
GraphQlBuilder2.QueryBuilder = QueryBuilder;
|
|
30
|
-
GraphQlBuilder2.RootObjectBuilder = RootObjectBuilder;
|
|
31
19
|
})(GraphQlBuilder || (GraphQlBuilder = {}));
|
|
32
|
-
var CrudQueryBuilder;
|
|
33
|
-
((_CrudQueryBuilder) => {
|
|
34
|
-
_CrudQueryBuilder.CrudQueryBuilder = CrudQueryBuilder$1;
|
|
35
|
-
_CrudQueryBuilder.ReadBuilder = ReadBuilder;
|
|
36
|
-
_CrudQueryBuilder.WriteBuilder = WriteBuilder;
|
|
37
|
-
_CrudQueryBuilder.WriteDataBuilder = WriteDataBuilder;
|
|
38
|
-
_CrudQueryBuilder.WriteManyRelationBuilder = WriteManyRelationBuilder;
|
|
39
|
-
_CrudQueryBuilder.WriteOneRelationBuilder = WriteOneRelationBuilder;
|
|
40
|
-
_CrudQueryBuilder.WriteOperation = WriteOperation;
|
|
41
|
-
})(CrudQueryBuilder || (CrudQueryBuilder = {}));
|
|
42
20
|
export {
|
|
43
|
-
CrudQueryBuilder,
|
|
44
21
|
FileUploadError,
|
|
45
22
|
GenerateUploadUrlMutationBuilder,
|
|
46
23
|
GraphQlBuilder,
|
|
47
24
|
GraphQlClient,
|
|
25
|
+
GraphQlClientError,
|
|
48
26
|
GraphQlLiteral,
|
|
49
27
|
S3FileUploader,
|
|
50
28
|
formatContentApiRelativeUrl,
|
|
51
29
|
formatSystemApiRelativeUrl,
|
|
52
30
|
getTenantErrorMessage,
|
|
53
31
|
loginMutation,
|
|
32
|
+
replaceGraphQlLiteral,
|
|
54
33
|
tenantApiRelativeUrl,
|
|
55
34
|
tenantErrorMessages,
|
|
56
35
|
whereToFilter
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"sourcesContent":["import * as CrudQueryBuilderTmp from './crudQueryBuilder'\n\nimport * as GraphQlBuilderTmp from './graphQlBuilder'\nexport { GraphQlLiteral } from './graphQlBuilder'\n\nexport namespace GraphQlBuilder {\n\texport import GraphqlLiteral = GraphQlBuilderTmp.GraphQlLiteral
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../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,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const formatSystemApiRelativeUrl = (projectSlug) => `/system/${projectSlug}`;
|
|
4
|
+
exports.formatSystemApiRelativeUrl = formatSystemApiRelativeUrl;
|
|
5
|
+
//# sourceMappingURL=formatSystemApiRelativeUrl.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatSystemApiRelativeUrl.cjs","sources":["../../../src/system/formatSystemApiRelativeUrl.ts"],"sourcesContent":["export const formatSystemApiRelativeUrl = (projectSlug: string) => `/system/${projectSlug}`\n"],"names":[],"mappings":";;AAAO,MAAM,6BAA6B,CAAC,gBAAwB,WAAW,WAAW;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatSystemApiRelativeUrl.js","sources":["../../../src/system/formatSystemApiRelativeUrl.ts"],"sourcesContent":["export const formatSystemApiRelativeUrl = (projectSlug: string) => `/system/${projectSlug}`\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatSystemApiRelativeUrl.js","sources":["../../../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,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const loginMutation = `
|
|
4
|
+
mutation($email: String!, $password: String!, $expiration: Int) {
|
|
5
|
+
signIn(email: $email, password: $password, expiration: $expiration) {
|
|
6
|
+
ok
|
|
7
|
+
errors {
|
|
8
|
+
endUserMessage
|
|
9
|
+
code
|
|
10
|
+
}
|
|
11
|
+
result {
|
|
12
|
+
token
|
|
13
|
+
person {
|
|
14
|
+
id
|
|
15
|
+
email
|
|
16
|
+
identity {
|
|
17
|
+
id
|
|
18
|
+
projects {
|
|
19
|
+
project {
|
|
20
|
+
id
|
|
21
|
+
slug
|
|
22
|
+
}
|
|
23
|
+
memberships {
|
|
24
|
+
role
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
exports.loginMutation = loginMutation;
|
|
34
|
+
//# sourceMappingURL=loginMutation.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loginMutation.cjs","sources":["../../../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":["../../../src/tenant/tenantApiRelativeUrl.ts"],"sourcesContent":["export const tenantApiRelativeUrl = '/tenant'\n"],"names":[],"mappings":";;AAAO,MAAM,uBAAuB;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const tenantErrorMessages = {
|
|
4
|
+
TOO_WEAK: "Password is too weak.",
|
|
5
|
+
EMAIL_ALREADY_EXISTS: "Email already exists.",
|
|
6
|
+
UNKNOWN_EMAIL: "Unknown email.",
|
|
7
|
+
INVALID_PASSWORD: "Password is invalid.",
|
|
8
|
+
ALREADY_MEMBER: "User is already a member of this project."
|
|
9
|
+
};
|
|
10
|
+
const getTenantErrorMessage = (errorCode) => {
|
|
11
|
+
if (errorCode in tenantErrorMessages) {
|
|
12
|
+
return tenantErrorMessages[errorCode];
|
|
13
|
+
}
|
|
14
|
+
return `Unknown error occurred. [${errorCode}]`;
|
|
15
|
+
};
|
|
16
|
+
exports.getTenantErrorMessage = getTenantErrorMessage;
|
|
17
|
+
exports.tenantErrorMessages = tenantErrorMessages;
|
|
18
|
+
//# sourceMappingURL=tenantErrorMessages.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenantErrorMessages.cjs","sources":["../../../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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenantErrorMessages.js","sources":["../../../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;
|
|
1
|
+
{"version":3,"file":"tenantErrorMessages.js","sources":["../../../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,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const readFileAsArrayBuffer = (file) => new Promise((resolve, reject) => {
|
|
4
|
+
const reader = new FileReader();
|
|
5
|
+
reader.onload = () => {
|
|
6
|
+
if (reader.result === null) {
|
|
7
|
+
reject();
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
resolve(reader.result);
|
|
11
|
+
};
|
|
12
|
+
reader.readAsArrayBuffer(file);
|
|
13
|
+
});
|
|
14
|
+
exports.readFileAsArrayBuffer = readFileAsArrayBuffer;
|
|
15
|
+
//# sourceMappingURL=readFileAsArrayBuffer.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readFileAsArrayBuffer.cjs","sources":["../../../src/utils/readFileAsArrayBuffer.ts"],"sourcesContent":["export const readFileAsArrayBuffer = (file: File): Promise<string | ArrayBuffer> =>\n\tnew Promise((resolve, reject) => {\n\t\tconst reader = new FileReader()\n\t\treader.onload = () => {\n\t\t\tif (reader.result === null) {\n\t\t\t\treject()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tresolve(reader.result)\n\t\t}\n\t\treader.readAsArrayBuffer(file)\n\t})\n"],"names":[],"mappings":";;AAAO,MAAM,wBAAwB,CAAC,SACrC,IAAI,QAAQ,CAAC,SAAS,WAAW;AAC1B,QAAA,SAAS,IAAI;AACnB,SAAO,SAAS,MAAM;AACjB,QAAA,OAAO,WAAW,MAAM;AACpB;AACP;AAAA,IACD;AACA,YAAQ,OAAO,MAAM;AAAA,EAAA;AAEtB,SAAO,kBAAkB,IAAI;AAC9B,CAAC;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { GraphQlLiteral } from '../graphQlBuilder';
|
|
2
|
+
export type ReplaceGraphQlLiteral<T> = T extends GraphQlLiteral<infer Value> ? Value : T extends string | number | boolean | null ? T : T extends {} ? {
|
|
3
|
+
[K in keyof T]: ReplaceGraphQlLiteral<T[K]>;
|
|
4
|
+
} : T extends any[] ? ReplaceGraphQlLiteral<T[number]>[] : T;
|
|
5
|
+
export declare const replaceGraphQlLiteral: <T>(input: T) => ReplaceGraphQlLiteral<T>;
|
|
6
|
+
//# sourceMappingURL=replaceGraphQlLiteral.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replaceGraphQlLiteral.d.ts","sourceRoot":"","sources":["../../../src/content/replaceGraphQlLiteral.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAElD,MAAM,MAAM,qBAAqB,CAAC,CAAC,IAAI,CAAC,SAAS,cAAc,CAAC,MAAM,KAAK,CAAC,GACzE,KAAK,GACL,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GACzC,CAAC,GACD,CAAC,SAAS,EAAE,GACX;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GAC/C,CAAC,SAAS,GAAG,EAAE,GACd,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,GAClC,CAAC,CAAC;AAER,eAAO,MAAM,qBAAqB,2CASjC,CAAA"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { GraphQlLiteral } from '../../graphQlBuilder';
|
|
2
|
+
import { GraphQlPrintResult } from '@contember/graphql-builder';
|
|
2
3
|
declare class GenerateUploadUrlMutationBuilder {
|
|
3
4
|
private static generateUploadUrlFields;
|
|
4
|
-
|
|
5
|
+
/**
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
static buildQuery(parameters: GenerateUploadUrlMutationBuilder.MutationParameters): GraphQlPrintResult;
|
|
5
9
|
}
|
|
6
10
|
declare namespace GenerateUploadUrlMutationBuilder {
|
|
7
|
-
type Acl = GraphQlLiteral<'PUBLIC_READ' | 'PRIVATE' | 'NONE'>;
|
|
8
|
-
|
|
11
|
+
type Acl = 'PUBLIC_READ' | 'PRIVATE' | 'NONE' | GraphQlLiteral<'PUBLIC_READ' | 'PRIVATE' | 'NONE'>;
|
|
12
|
+
type FileParameters = {
|
|
9
13
|
contentType: string;
|
|
10
14
|
expiration?: number;
|
|
11
15
|
size?: number;
|
|
@@ -14,7 +18,7 @@ declare namespace GenerateUploadUrlMutationBuilder {
|
|
|
14
18
|
suffix?: string;
|
|
15
19
|
fileName?: string;
|
|
16
20
|
acl?: Acl;
|
|
17
|
-
}
|
|
21
|
+
};
|
|
18
22
|
interface MutationParameters {
|
|
19
23
|
[alias: string]: FileParameters;
|
|
20
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateUploadUrlMutationBuilder.d.ts","sourceRoot":"","sources":["../../../../src/content/upload/GenerateUploadUrlMutationBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"GenerateUploadUrlMutationBuilder.d.ts","sourceRoot":"","sources":["../../../../src/content/upload/GenerateUploadUrlMutationBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAgB,kBAAkB,EAAgD,MAAM,4BAA4B,CAAA;AAI3H,cAAM,gCAAgC;IACrC,OAAO,CAAC,MAAM,CAAC,uBAAuB,CAQrC;IACD;;OAEG;WACW,UAAU,CAAC,UAAU,EAAE,gCAAgC,CAAC,kBAAkB,GAAG,kBAAkB;CAqC7G;AAED,kBAAU,gCAAgC,CAAC;IAC1C,KAAY,GAAG,GACZ,aAAa,GACb,SAAS,GACT,MAAM,GACN,cAAc,CAAC,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC,CAAA;IAErD,KAAY,cAAc,GAAG;QAC5B,WAAW,EAAE,MAAM,CAAA;QACnB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,MAAM,CAAC,EAAE,MAAM,CAAA;QACf,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,GAAG,CAAC,EAAE,GAAG,CAAA;KACT,CAAA;IAED,UAAiB,kBAAkB;QAClC,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,CAAA;KAC/B;IAED,UAAiB,YAAY;QAC5B,GAAG,EAAE,MAAM,CAAA;QACX,SAAS,EAAE,MAAM,CAAA;QACjB,MAAM,EAAE,MAAM,CAAA;QACd,OAAO,EAAE,KAAK,CAAC;YACd,GAAG,EAAE,MAAM,CAAA;YACX,KAAK,EAAE,MAAM,CAAA;SACb,CAAC,CAAA;KACF;IAED,UAAiB,gBAAgB;QAChC,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,CAAA;KAC7B;CACD;AAED,OAAO,EAAE,gCAAgC,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"S3FileUploader.d.ts","sourceRoot":"","sources":["../../../../src/content/upload/S3FileUploader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAA;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAA;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAOlE,cAAM,cAAe,YAAW,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;aAGxC,OAAO,EAAE,cAAc,CAAC,OAAO;IAFlE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;gBAEvB,OAAO,GAAE,cAAc,CAAC,OAAY;IAIvE,OAAO,CAAC,gBAAgB,CAGpB;IAEJ,OAAO,CAAC,MAAM,CAAC,eAAe;IAIjB,MAAM,CAClB,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,oBAAoB,CAAC,EACtC,OAAO,EAAE,6BAA6B;
|
|
1
|
+
{"version":3,"file":"S3FileUploader.d.ts","sourceRoot":"","sources":["../../../../src/content/upload/S3FileUploader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAA;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAA;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAOlE,cAAM,cAAe,YAAW,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;aAGxC,OAAO,EAAE,cAAc,CAAC,OAAO;IAFlE,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;gBAEvB,OAAO,GAAE,cAAc,CAAC,OAAY;IAIvE,OAAO,CAAC,gBAAgB,CAGpB;IAEJ,OAAO,CAAC,MAAM,CAAC,eAAe;IAIjB,MAAM,CAClB,KAAK,EAAE,GAAG,CAAC,IAAI,EAAE,oBAAoB,CAAC,EACtC,OAAO,EAAE,6BAA6B;IAqDvC,OAAO,CAAC,gBAAgB;CA0CxB;AAED,kBAAU,cAAc,CAAC;IACxB,UAAiB,eAAe;QAC/B,OAAO,EAAE,MAAM,CAAA;KACf;IAED,UAAiB,OAAO;QACvB,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,eAAe,CAAA;QAClD,WAAW,CAAC,EAAE,MAAM,CAAA;KACpB;IAED,UAAiB,eAAe;QAC/B,QAAQ,CAAC,EAAE,gCAAgC,CAAC,cAAc,CAAC,aAAa,CAAC,CAAA;QACzE,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,aAAa,CAAC,EAAE,MAAM,CAAA;QACtB,OAAO,CAAC,EAAE,gCAAgC,CAAC,GAAG,CAAA;KAC9C;CACD;AAED,OAAO,EAAE,cAAc,EAAE,CAAA"}
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
export * from './CrudQueryBuilder';
|
|
2
|
-
export * from './ReadBuilder';
|
|
3
1
|
export * from './types';
|
|
4
|
-
export * from './WriteBuilder';
|
|
5
|
-
export * from './WriteDataBuilder';
|
|
6
|
-
export * from './WriteManyRelationBuilder';
|
|
7
|
-
export * from './WriteOneRelationBuilder';
|
|
8
2
|
//# sourceMappingURL=index.d.ts.map
|