@kiyasov/platform-hono 1.5.6 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/bun.lock +1629 -0
  2. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  3. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  4. package/package.json +14 -13
  5. package/src/interfaces/nest-hono-application.interface.ts +3 -2
  6. package/dist/build.d.ts +0 -1
  7. package/dist/build.js +0 -28
  8. package/dist/build.js.map +0 -1
  9. package/dist/cjs/src/multer/crypto/index.d.ts +0 -1
  10. package/dist/cjs/src/multer/crypto/index.js +0 -7
  11. package/dist/cjs/src/multer/crypto/index.js.map +0 -1
  12. package/dist/cjs/src/multer/stream/index.d.ts +0 -2
  13. package/dist/cjs/src/multer/stream/index.js +0 -7
  14. package/dist/cjs/src/multer/stream/index.js.map +0 -1
  15. package/dist/esm/build.d.ts +0 -1
  16. package/dist/esm/build.js +0 -28
  17. package/dist/esm/build.js.map +0 -1
  18. package/dist/esm/src/multer/crypto/index.d.ts +0 -1
  19. package/dist/esm/src/multer/crypto/index.js +0 -4
  20. package/dist/esm/src/multer/crypto/index.js.map +0 -1
  21. package/dist/esm/src/multer/stream/index.d.ts +0 -2
  22. package/dist/esm/src/multer/stream/index.js +0 -4
  23. package/dist/esm/src/multer/stream/index.js.map +0 -1
  24. package/dist/index.d.ts +0 -4
  25. package/dist/index.js +0 -5
  26. package/dist/index.js.map +0 -1
  27. package/dist/src/adapters/hono-adapter.d.ts +0 -66
  28. package/dist/src/adapters/hono-adapter.js +0 -270
  29. package/dist/src/adapters/hono-adapter.js.map +0 -1
  30. package/dist/src/adapters/index.d.ts +0 -1
  31. package/dist/src/adapters/index.js +0 -2
  32. package/dist/src/adapters/index.js.map +0 -1
  33. package/dist/src/drivers/constants/apollo.constants.d.ts +0 -1
  34. package/dist/src/drivers/constants/apollo.constants.js +0 -2
  35. package/dist/src/drivers/constants/apollo.constants.js.map +0 -1
  36. package/dist/src/drivers/constants/index.d.ts +0 -1
  37. package/dist/src/drivers/constants/index.js +0 -2
  38. package/dist/src/drivers/constants/index.js.map +0 -1
  39. package/dist/src/drivers/graphQLUpload/GraphQLUpload.d.ts +0 -3
  40. package/dist/src/drivers/graphQLUpload/GraphQLUpload.js +0 -18
  41. package/dist/src/drivers/graphQLUpload/GraphQLUpload.js.map +0 -1
  42. package/dist/src/drivers/graphQLUpload/Upload.d.ts +0 -16
  43. package/dist/src/drivers/graphQLUpload/Upload.js +0 -17
  44. package/dist/src/drivers/graphQLUpload/Upload.js.map +0 -1
  45. package/dist/src/drivers/graphQLUpload/fs-capacitor.d.ts +0 -42
  46. package/dist/src/drivers/graphQLUpload/fs-capacitor.js +0 -185
  47. package/dist/src/drivers/graphQLUpload/fs-capacitor.js.map +0 -1
  48. package/dist/src/drivers/graphQLUpload/index.d.ts +0 -4
  49. package/dist/src/drivers/graphQLUpload/index.js +0 -5
  50. package/dist/src/drivers/graphQLUpload/index.js.map +0 -1
  51. package/dist/src/drivers/graphQLUpload/processRequest.d.ts +0 -2
  52. package/dist/src/drivers/graphQLUpload/processRequest.js +0 -47
  53. package/dist/src/drivers/graphQLUpload/processRequest.js.map +0 -1
  54. package/dist/src/drivers/graphql.driver.d.ts +0 -20
  55. package/dist/src/drivers/graphql.driver.js +0 -125
  56. package/dist/src/drivers/graphql.driver.js.map +0 -1
  57. package/dist/src/drivers/index.d.ts +0 -2
  58. package/dist/src/drivers/index.js +0 -3
  59. package/dist/src/drivers/index.js.map +0 -1
  60. package/dist/src/drivers/services/plugins-explorer.service.d.ts +0 -9
  61. package/dist/src/drivers/services/plugins-explorer.service.js +0 -22
  62. package/dist/src/drivers/services/plugins-explorer.service.js.map +0 -1
  63. package/dist/src/interfaces/hono.interface.d.ts +0 -4
  64. package/dist/src/interfaces/hono.interface.js +0 -2
  65. package/dist/src/interfaces/hono.interface.js.map +0 -1
  66. package/dist/src/interfaces/index.d.ts +0 -2
  67. package/dist/src/interfaces/index.js +0 -3
  68. package/dist/src/interfaces/index.js.map +0 -1
  69. package/dist/src/interfaces/nest-hono-application.interface.d.ts +0 -18
  70. package/dist/src/interfaces/nest-hono-application.interface.js +0 -2
  71. package/dist/src/interfaces/nest-hono-application.interface.js.map +0 -1
  72. package/dist/src/multer/decorators/index.d.ts +0 -2
  73. package/dist/src/multer/decorators/index.js +0 -3
  74. package/dist/src/multer/decorators/index.js.map +0 -1
  75. package/dist/src/multer/decorators/uploaded-file-decorator.d.ts +0 -1
  76. package/dist/src/multer/decorators/uploaded-file-decorator.js +0 -7
  77. package/dist/src/multer/decorators/uploaded-file-decorator.js.map +0 -1
  78. package/dist/src/multer/decorators/uploaded-files-decorator.d.ts +0 -1
  79. package/dist/src/multer/decorators/uploaded-files-decorator.js +0 -7
  80. package/dist/src/multer/decorators/uploaded-files-decorator.js.map +0 -1
  81. package/dist/src/multer/fs/index.d.ts +0 -2
  82. package/dist/src/multer/fs/index.js +0 -18
  83. package/dist/src/multer/fs/index.js.map +0 -1
  84. package/dist/src/multer/index.d.ts +0 -4
  85. package/dist/src/multer/index.js +0 -5
  86. package/dist/src/multer/index.js.map +0 -1
  87. package/dist/src/multer/interceptors/any-files-interceptor.d.ts +0 -3
  88. package/dist/src/multer/interceptors/any-files-interceptor.js +0 -27
  89. package/dist/src/multer/interceptors/any-files-interceptor.js.map +0 -1
  90. package/dist/src/multer/interceptors/file-fields-interceptor.d.ts +0 -4
  91. package/dist/src/multer/interceptors/file-fields-interceptor.js +0 -29
  92. package/dist/src/multer/interceptors/file-fields-interceptor.js.map +0 -1
  93. package/dist/src/multer/interceptors/file-interceptor.d.ts +0 -3
  94. package/dist/src/multer/interceptors/file-interceptor.js +0 -27
  95. package/dist/src/multer/interceptors/file-interceptor.js.map +0 -1
  96. package/dist/src/multer/interceptors/files-interceptor.d.ts +0 -3
  97. package/dist/src/multer/interceptors/files-interceptor.js +0 -27
  98. package/dist/src/multer/interceptors/files-interceptor.js.map +0 -1
  99. package/dist/src/multer/interceptors/index.d.ts +0 -4
  100. package/dist/src/multer/interceptors/index.js +0 -5
  101. package/dist/src/multer/interceptors/index.js.map +0 -1
  102. package/dist/src/multer/multipart/exceptions.d.ts +0 -1
  103. package/dist/src/multer/multipart/exceptions.js +0 -18
  104. package/dist/src/multer/multipart/exceptions.js.map +0 -1
  105. package/dist/src/multer/multipart/file.d.ts +0 -9
  106. package/dist/src/multer/multipart/file.js +0 -6
  107. package/dist/src/multer/multipart/file.js.map +0 -1
  108. package/dist/src/multer/multipart/filter.d.ts +0 -6
  109. package/dist/src/multer/multipart/filter.js +0 -18
  110. package/dist/src/multer/multipart/filter.js.map +0 -1
  111. package/dist/src/multer/multipart/handlers/any-files.d.ts +0 -10
  112. package/dist/src/multer/multipart/handlers/any-files.js +0 -29
  113. package/dist/src/multer/multipart/handlers/any-files.js.map +0 -1
  114. package/dist/src/multer/multipart/handlers/file-fields.d.ts +0 -17
  115. package/dist/src/multer/multipart/handlers/file-fields.js +0 -40
  116. package/dist/src/multer/multipart/handlers/file-fields.js.map +0 -1
  117. package/dist/src/multer/multipart/handlers/index.d.ts +0 -1
  118. package/dist/src/multer/multipart/handlers/index.js +0 -2
  119. package/dist/src/multer/multipart/handlers/index.js.map +0 -1
  120. package/dist/src/multer/multipart/handlers/multiple-files.d.ts +0 -10
  121. package/dist/src/multer/multipart/handlers/multiple-files.js +0 -36
  122. package/dist/src/multer/multipart/handlers/multiple-files.js.map +0 -1
  123. package/dist/src/multer/multipart/handlers/single-file.d.ts +0 -10
  124. package/dist/src/multer/multipart/handlers/single-file.js +0 -41
  125. package/dist/src/multer/multipart/handlers/single-file.js.map +0 -1
  126. package/dist/src/multer/multipart/index.d.ts +0 -3
  127. package/dist/src/multer/multipart/index.js +0 -3
  128. package/dist/src/multer/multipart/index.js.map +0 -1
  129. package/dist/src/multer/multipart/options.d.ts +0 -21
  130. package/dist/src/multer/multipart/options.js +0 -19
  131. package/dist/src/multer/multipart/options.js.map +0 -1
  132. package/dist/src/multer/multipart/request.d.ts +0 -15
  133. package/dist/src/multer/multipart/request.js +0 -17
  134. package/dist/src/multer/multipart/request.js.map +0 -1
  135. package/dist/src/multer/storage/disk-storage.d.ts +0 -31
  136. package/dist/src/multer/storage/disk-storage.js +0 -59
  137. package/dist/src/multer/storage/disk-storage.js.map +0 -1
  138. package/dist/src/multer/storage/index.d.ts +0 -3
  139. package/dist/src/multer/storage/index.js +0 -4
  140. package/dist/src/multer/storage/index.js.map +0 -1
  141. package/dist/src/multer/storage/memory-storage.d.ts +0 -19
  142. package/dist/src/multer/storage/memory-storage.js +0 -23
  143. package/dist/src/multer/storage/memory-storage.js.map +0 -1
  144. package/dist/src/multer/storage/storage.d.ts +0 -13
  145. package/dist/src/multer/storage/storage.js +0 -2
  146. package/dist/src/multer/storage/storage.js.map +0 -1
  147. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"GraphQLUpload.js","sourceRoot":"","sources":["../../../../src/drivers/graphQLUpload/GraphQLUpload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,iBAAiB,CAAC;IACjD,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,oDAAoD;IACjE,UAAU,CAAC,KAAmC;QAC5C,IAAI,KAAK,YAAY,MAAM;YAAE,OAAO,KAAK,CAAC,OAAO,CAAC;QAClD,MAAM,IAAI,YAAY,CAAC,uBAAuB,CAAC,CAAC;IAClD,CAAC;IACD,YAAY,CAAC,IAAyB;QACpC,MAAM,IAAI,YAAY,CAAC,6BAA6B,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACzE,CAAC;IACD,SAAS;QACP,MAAM,IAAI,YAAY,CAAC,mCAAmC,CAAC,CAAC;IAC9D,CAAC;CACF,CAAC,CAAC"}
@@ -1,16 +0,0 @@
1
- import { ReadStream, ReadStreamOptions, WriteStream } from './fs-capacitor';
2
- export interface FileUpload {
3
- filename: string;
4
- fieldName: string;
5
- mimetype: string;
6
- encoding: string;
7
- createReadStream(options?: ReadStreamOptions): ReadStream;
8
- capacitor: WriteStream;
9
- }
10
- export declare class Upload {
11
- promise: Promise<FileUpload>;
12
- resolve: (file?: FileUpload) => void;
13
- reject: (error?: Error | string) => void;
14
- file?: FileUpload;
15
- constructor();
16
- }
@@ -1,17 +0,0 @@
1
- export class Upload {
2
- promise;
3
- resolve;
4
- reject;
5
- file;
6
- constructor() {
7
- this.promise = new Promise((resolve, reject) => {
8
- this.resolve = (file) => {
9
- this.file = file;
10
- resolve(file);
11
- };
12
- this.reject = reject;
13
- });
14
- this.promise.catch(() => { });
15
- }
16
- }
17
- //# sourceMappingURL=Upload.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Upload.js","sourceRoot":"","sources":["../../../../src/drivers/graphQLUpload/Upload.ts"],"names":[],"mappings":"AAaA,MAAM,OAAO,MAAM;IACjB,OAAO,CAAsB;IAC7B,OAAO,CAA8B;IACrC,MAAM,CAAmC;IACzC,IAAI,CAAc;IAElB;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC7C,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,EAAE,EAAE;gBACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;gBAEjB,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,CAAC;YAEF,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACvB,CAAC,CAAC,CAAC;QAIH,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC/B,CAAC;CACF"}
@@ -1,42 +0,0 @@
1
- import { Readable, ReadableOptions, Writable, WritableOptions } from 'stream';
2
- export declare class ReadAfterDestroyedError extends Error {
3
- }
4
- export declare class ReadAfterReleasedError extends Error {
5
- }
6
- export interface ReadStreamOptions {
7
- highWaterMark?: ReadableOptions['highWaterMark'];
8
- encoding?: ReadableOptions['encoding'];
9
- }
10
- export declare class ReadStream extends Readable {
11
- private _pos;
12
- private _writeStream;
13
- constructor(writeStream: WriteStream, options?: ReadStreamOptions);
14
- _read(n: number): void;
15
- }
16
- export interface WriteStreamOptions {
17
- highWaterMark?: WritableOptions['highWaterMark'];
18
- defaultEncoding?: WritableOptions['defaultEncoding'];
19
- tmpdir?: () => string;
20
- }
21
- export declare class WriteStream extends Writable {
22
- private _fd;
23
- private _path;
24
- private _pos;
25
- private _readStreams;
26
- private _released;
27
- constructor(options?: WriteStreamOptions);
28
- _cleanup: (callback: (error: null | Error) => void) => void;
29
- _cleanupSync: () => void;
30
- _final(callback: (error?: null | Error) => unknown): void;
31
- _write(chunk: Buffer, encoding: string, callback: (error?: null | Error) => unknown): void;
32
- release(): void;
33
- _destroy(error: undefined | null | Error, callback: (error?: null | Error) => unknown): void;
34
- createReadStream(options?: ReadStreamOptions): ReadStream;
35
- }
36
- declare const _default: {
37
- WriteStream: typeof WriteStream;
38
- ReadStream: typeof ReadStream;
39
- ReadAfterDestroyedError: typeof ReadAfterDestroyedError;
40
- ReadAfterReleasedError: typeof ReadAfterReleasedError;
41
- };
42
- export default _default;
@@ -1,185 +0,0 @@
1
- import { randomBytes } from 'crypto';
2
- import { EventEmitter } from 'events';
3
- import { read, open, closeSync, unlinkSync, write, close, unlink } from 'fs';
4
- import { tmpdir } from 'os';
5
- import { join } from 'path';
6
- import { Readable, Writable } from 'stream';
7
- export class ReadAfterDestroyedError extends Error {
8
- }
9
- export class ReadAfterReleasedError extends Error {
10
- }
11
- const processExitProxy = new EventEmitter();
12
- processExitProxy.setMaxListeners(Infinity);
13
- process.once('exit', () => processExitProxy.emit('exit'));
14
- export class ReadStream extends Readable {
15
- _pos = 0;
16
- _writeStream;
17
- constructor(writeStream, options) {
18
- super({
19
- highWaterMark: options?.highWaterMark,
20
- encoding: options?.encoding,
21
- autoDestroy: true,
22
- });
23
- this._writeStream = writeStream;
24
- }
25
- _read(n) {
26
- if (this.destroyed)
27
- return;
28
- if (typeof this._writeStream['_fd'] !== 'number') {
29
- this._writeStream.once('ready', () => this._read(n));
30
- return;
31
- }
32
- const buf = new Uint8Array(Buffer.allocUnsafe(n).buffer);
33
- read(this._writeStream['_fd'], buf, 0, n, this._pos, (error, bytesRead) => {
34
- if (error)
35
- this.destroy(error);
36
- if (bytesRead) {
37
- this._pos += bytesRead;
38
- this.push(buf.slice(0, bytesRead));
39
- return;
40
- }
41
- if (this._writeStream._writableState.finished) {
42
- if (this._pos < this._writeStream._pos)
43
- this._read(n);
44
- else
45
- this.push(null);
46
- return;
47
- }
48
- const retry = () => {
49
- this._writeStream.off('finish', retry);
50
- this._writeStream.off('write', retry);
51
- this._read(n);
52
- };
53
- this._writeStream.on('finish', retry);
54
- this._writeStream.on('write', retry);
55
- });
56
- }
57
- }
58
- export class WriteStream extends Writable {
59
- _fd = null;
60
- _path = null;
61
- _pos = 0;
62
- _readStreams = new Set();
63
- _released = false;
64
- constructor(options) {
65
- super({
66
- highWaterMark: options?.highWaterMark,
67
- defaultEncoding: options?.defaultEncoding,
68
- autoDestroy: false,
69
- });
70
- randomBytes(16, (error, buffer) => {
71
- if (error) {
72
- this.destroy(error);
73
- return;
74
- }
75
- this._path = join((options?.tmpdir ?? tmpdir)(), `capacitor-${buffer.toString('hex')}.tmp`);
76
- open(this._path, 'wx+', 0o600, (error, fd) => {
77
- if (error) {
78
- this.destroy(error);
79
- return;
80
- }
81
- processExitProxy.once('exit', this._cleanupSync);
82
- this._fd = fd;
83
- this.emit('ready');
84
- });
85
- });
86
- }
87
- _cleanup = (callback) => {
88
- const fd = this._fd;
89
- const path = this._path;
90
- if (typeof fd !== 'number' || typeof path !== 'string') {
91
- callback(null);
92
- return;
93
- }
94
- close(fd, (closeError) => {
95
- unlink(path, (unlinkError) => {
96
- this._fd = null;
97
- processExitProxy.off('exit', this._cleanupSync);
98
- callback(unlinkError ?? closeError);
99
- });
100
- });
101
- };
102
- _cleanupSync = () => {
103
- processExitProxy.off('exit', this._cleanupSync);
104
- if (typeof this._fd === 'number')
105
- try {
106
- closeSync(this._fd);
107
- }
108
- catch {
109
- }
110
- try {
111
- if (this._path !== null) {
112
- unlinkSync(this._path);
113
- }
114
- }
115
- catch {
116
- }
117
- };
118
- _final(callback) {
119
- if (typeof this._fd !== 'number') {
120
- this.once('ready', () => this._final(callback));
121
- return;
122
- }
123
- callback();
124
- }
125
- _write(chunk, encoding, callback) {
126
- if (typeof this._fd !== 'number') {
127
- this.once('ready', () => this._write(chunk, encoding, callback));
128
- return;
129
- }
130
- const uint8Array = new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
131
- write(this._fd, uint8Array, 0, chunk.length, this._pos, (error) => {
132
- if (error) {
133
- callback(error);
134
- return;
135
- }
136
- this._pos += chunk.length;
137
- this.emit('write');
138
- callback();
139
- });
140
- }
141
- release() {
142
- this._released = true;
143
- if (this._readStreams.size === 0)
144
- this.destroy();
145
- }
146
- _destroy(error, callback) {
147
- for (const readStream of this._readStreams) {
148
- readStream.destroy(error || undefined);
149
- }
150
- if (typeof this._fd === 'number' && typeof this._path === 'string') {
151
- this._cleanup((cleanupError) => callback(cleanupError ?? error));
152
- return;
153
- }
154
- this.once('ready', () => {
155
- this._cleanup((cleanupError) => {
156
- if (cleanupError) {
157
- this.emit('error', cleanupError);
158
- }
159
- });
160
- });
161
- callback(error);
162
- }
163
- createReadStream(options) {
164
- if (this.destroyed)
165
- throw new ReadAfterDestroyedError('A ReadStream cannot be created from a destroyed WriteStream.');
166
- if (this._released)
167
- throw new ReadAfterReleasedError('A ReadStream cannot be created from a released WriteStream.');
168
- const readStream = new ReadStream(this, options);
169
- this._readStreams.add(readStream);
170
- readStream.once('close', () => {
171
- this._readStreams.delete(readStream);
172
- if (this._released && this._readStreams.size === 0) {
173
- this.destroy();
174
- }
175
- });
176
- return readStream;
177
- }
178
- }
179
- export default {
180
- WriteStream,
181
- ReadStream,
182
- ReadAfterDestroyedError,
183
- ReadAfterReleasedError,
184
- };
185
- //# sourceMappingURL=fs-capacitor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fs-capacitor.js","sourceRoot":"","sources":["../../../../src/drivers/graphQLUpload/fs-capacitor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,IAAI,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAmB,QAAQ,EAAmB,MAAM,QAAQ,CAAC;AAE9E,MAAM,OAAO,uBAAwB,SAAQ,KAAK;CAAG;AACrD,MAAM,OAAO,sBAAuB,SAAQ,KAAK;CAAG;AAWpD,MAAM,gBAAgB,GAAG,IAAI,YAAY,EAAE,CAAC;AAC5C,gBAAgB,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;AAC3C,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;AAE1D,MAAM,OAAO,UAAW,SAAQ,QAAQ;IAC9B,IAAI,GAAW,CAAC,CAAC;IACjB,YAAY,CAAc;IAElC,YAAY,WAAwB,EAAE,OAA2B;QAC/D,KAAK,CAAC;YACJ,aAAa,EAAE,OAAO,EAAE,aAAa;YACrC,QAAQ,EAAE,OAAO,EAAE,QAAQ;YAC3B,WAAW,EAAE,IAAI;SAClB,CAAC,CAA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,YAAY,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;gBACnD,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAED,eAAe;IACb,WAAW;IACX,UAAU;IACV,uBAAuB;IACvB,sBAAsB;CACvB,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from './fs-capacitor';
2
- export * from './Upload';
3
- export * from './GraphQLUpload';
4
- export * from './processRequest';
@@ -1,5 +0,0 @@
1
- export * from './fs-capacitor';
2
- export * from './Upload';
3
- export * from './GraphQLUpload';
4
- export * from './processRequest';
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/drivers/graphQLUpload/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
@@ -1,2 +0,0 @@
1
- import { Context } from 'hono';
2
- export declare function processRequest(ctx: Context): Promise<Record<string, unknown>>;
@@ -1,47 +0,0 @@
1
- import { Readable } from 'stream';
2
- import { WriteStream, Upload } from '.';
3
- export async function processRequest(ctx) {
4
- const body = await ctx.req.parseBody();
5
- const operations = JSON.parse(body.operations);
6
- const map = new Map(Object.entries(JSON.parse(body.map)));
7
- for (const [fieldName, file] of Object.entries(body)) {
8
- if (fieldName === 'operations' ||
9
- fieldName === 'map' ||
10
- !(file instanceof File))
11
- continue;
12
- const fileKeys = map.get(fieldName);
13
- if (!Array.isArray(fileKeys) || !fileKeys.length)
14
- continue;
15
- const buffer = Buffer.from(await file.arrayBuffer());
16
- const capacitor = new WriteStream();
17
- Readable.from(buffer).pipe(capacitor);
18
- const upload = new Upload();
19
- upload.file = {
20
- filename: file.name,
21
- mimetype: file.type,
22
- fieldName,
23
- encoding: '7bit',
24
- createReadStream: (options) => {
25
- const stream = capacitor.createReadStream(options);
26
- stream.on('close', () => {
27
- capacitor.release();
28
- });
29
- return stream;
30
- },
31
- capacitor,
32
- };
33
- upload.resolve(upload.file);
34
- for (const fileKey of fileKeys) {
35
- const pathSegments = fileKey.split('.');
36
- let current = operations;
37
- for (let i = 0; i < pathSegments.length - 1; i++) {
38
- if (!current[pathSegments[i]])
39
- current[pathSegments[i]] = {};
40
- current = current[pathSegments[i]];
41
- }
42
- current[pathSegments[pathSegments.length - 1]] = upload;
43
- }
44
- }
45
- return operations;
46
- }
47
- //# sourceMappingURL=processRequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"processRequest.js","sourceRoot":"","sources":["../../../../src/drivers/graphQLUpload/processRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,CAAC;AAExC,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,GAAY;IAEZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC;IACvC,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAoB,CAAC,CAAC;IACzD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAa,CAAC,CAAC,CAAC,CAAC;IAEpE,KAAK,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACrD,IACE,SAAS,KAAK,YAAY;YAC1B,SAAS,KAAK,KAAK;YACnB,CAAC,CAAC,IAAI,YAAY,IAAI,CAAC;YAEvB,SAAS;QAEX,MAAM,QAAQ,GAAG,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ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O,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;YACrC,CAAC;YACD,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;QAC1D,CAAC;IACH,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -1,20 +0,0 @@
1
- import { ApolloServer, BaseContext } from '@apollo/server';
2
- import { ApolloDriverConfig } from '@nestjs/apollo';
3
- import { ModulesContainer } from '@nestjs/core';
4
- import { AbstractGraphQLDriver } from '@nestjs/graphql';
5
- export declare class HonoGraphQLDriver<T extends Record<string, any> = ApolloDriverConfig> extends AbstractGraphQLDriver {
6
- protected apolloServer: ApolloServer<BaseContext>;
7
- private _subscriptionService?;
8
- private readonly pluginsExplorerService;
9
- constructor(modulesContainer: ModulesContainer);
10
- get instance(): ApolloServer<BaseContext>;
11
- start(options: T): Promise<void>;
12
- protected registerHono(options: T, { preStartHook }?: {
13
- preStartHook?: () => void;
14
- }): Promise<void>;
15
- stop(): Promise<void>;
16
- private httpHeadersToMap;
17
- private parseBody;
18
- private logError;
19
- private parseFormURL;
20
- }
@@ -1,125 +0,0 @@
1
- import { ApolloServer, HeaderMap } from '@apollo/server';
2
- import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';
3
- import { Logger } from '@nestjs/common';
4
- import { AbstractGraphQLDriver, GqlSubscriptionService, } from '@nestjs/graphql';
5
- import { processRequest } from './graphQLUpload';
6
- import { PluginsExplorerService } from './services/plugins-explorer.service';
7
- export class HonoGraphQLDriver extends AbstractGraphQLDriver {
8
- apolloServer;
9
- _subscriptionService;
10
- pluginsExplorerService;
11
- constructor(modulesContainer) {
12
- super();
13
- this.pluginsExplorerService = new PluginsExplorerService(modulesContainer);
14
- }
15
- get instance() {
16
- return this.apolloServer;
17
- }
18
- async start(options) {
19
- const { httpAdapter } = this.httpAdapterHost;
20
- const platformName = httpAdapter.getType();
21
- if (platformName !== 'hono') {
22
- throw new Error('This driver is only compatible with the Hono platform');
23
- }
24
- await this.registerHono(options);
25
- if (options.installSubscriptionHandlers || options.subscriptions) {
26
- const subscriptionsOptions = options.subscriptions || { 'subscriptions-transport-ws': {} };
27
- this._subscriptionService = new GqlSubscriptionService({
28
- schema: options.schema,
29
- path: options.path,
30
- context: options.context,
31
- ...subscriptionsOptions,
32
- }, this.httpAdapterHost.httpAdapter?.getHttpServer());
33
- }
34
- }
35
- async registerHono(options, { preStartHook } = {}) {
36
- const { path, typeDefs, resolvers, schema } = options;
37
- const { httpAdapter } = this.httpAdapterHost;
38
- const app = httpAdapter.getInstance();
39
- const drainHttpServerPlugin = ApolloServerPluginDrainHttpServer({
40
- httpServer: httpAdapter.getHttpServer(),
41
- });
42
- preStartHook?.();
43
- const server = new ApolloServer({
44
- typeDefs,
45
- resolvers,
46
- schema,
47
- ...options,
48
- plugins: (options.plugins || []).concat(drainHttpServerPlugin),
49
- });
50
- await server.start();
51
- app.use(path, async (ctx) => {
52
- const bodyData = await this.parseBody(ctx);
53
- const defaultContext = () => Promise.resolve({});
54
- const contextFunction = options?.context ?? defaultContext;
55
- const httpGraphQLResponse = await server.executeHTTPGraphQLRequest({
56
- httpGraphQLRequest: {
57
- body: bodyData,
58
- method: ctx.req.method,
59
- headers: this.httpHeadersToMap(ctx.req.raw.headers),
60
- search: new URL(ctx.req.url).search,
61
- },
62
- context: () => contextFunction(ctx, {
63
- method: ctx.req.method,
64
- url: ctx.req.url,
65
- body: ctx.req.raw.body,
66
- headers: Object.fromEntries(ctx.req.raw.headers),
67
- }),
68
- });
69
- const { headers, body, status } = httpGraphQLResponse;
70
- for (const [headerKey, headerValue] of headers) {
71
- ctx.header(headerKey, headerValue);
72
- }
73
- ctx.status(status === undefined ? 200 : status);
74
- if (body.kind === 'complete') {
75
- return ctx.body(body.string);
76
- }
77
- const readableStream = new ReadableStream({
78
- async start(controller) {
79
- for await (const chunk of body.asyncIterator) {
80
- controller.enqueue(new TextEncoder().encode(chunk));
81
- }
82
- controller.close();
83
- },
84
- });
85
- return new Response(readableStream, {
86
- headers: { 'Content-Type': 'application/octet-stream' },
87
- });
88
- });
89
- this.apolloServer = server;
90
- }
91
- async stop() {
92
- await this._subscriptionService?.stop();
93
- await this.apolloServer?.stop();
94
- }
95
- httpHeadersToMap(headers) {
96
- const map = new HeaderMap();
97
- headers.forEach((value, key) => map.set(key, value));
98
- return map;
99
- }
100
- async parseBody(ctx) {
101
- const req = ctx.req;
102
- const contentType = req.header('content-type');
103
- if (contentType === 'application/graphql')
104
- return { query: await req.text() };
105
- if (contentType === 'application/json')
106
- return req.json().catch(this.logError);
107
- if (contentType === 'application/x-www-form-urlencoded')
108
- return this.parseFormURL(req);
109
- if (contentType?.startsWith('multipart/form-data')) {
110
- return processRequest(ctx);
111
- }
112
- return {};
113
- }
114
- logError(e) {
115
- if (e instanceof Error) {
116
- Logger.error(e.stack || e.message);
117
- }
118
- throw new Error(`POST body sent invalid JSON: ${e}`);
119
- }
120
- async parseFormURL(req) {
121
- const searchParams = new URLSearchParams(await req.text());
122
- return Object.fromEntries(searchParams.entries());
123
- }
124
- }
125
- //# sourceMappingURL=graphql.driver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graphql.driver.js","sourceRoot":"","sources":["../../../src/drivers/graphql.driver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,SAAS,EAAE,MAAM,gBAAgB,CAAC;AACtE,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAE1F,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GAEvB,MAAM,iBAAiB,CAAC;AAIzB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAE7E,MAAM,OAAO,iBAGX,SAAQ,qBAAqB;IACnB,YAAY,CAA4B;IAC1C,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CAAC,IAAI,EAAE,CAAC,CAAC;QAC3D,OAAO,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC;IACpD,CAAC;CACF"}
@@ -1,2 +0,0 @@
1
- export * from './graphql.driver';
2
- export * from './graphQLUpload';
@@ -1,3 +0,0 @@
1
- export * from './graphql.driver';
2
- export * from './graphQLUpload';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/drivers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
@@ -1,9 +0,0 @@
1
- import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';
2
- import { ModulesContainer } from '@nestjs/core/injector/modules-container';
3
- import { BaseExplorerService, GqlModuleOptions } from '@nestjs/graphql';
4
- export declare class PluginsExplorerService extends BaseExplorerService {
5
- private readonly modulesContainer;
6
- constructor(modulesContainer: ModulesContainer);
7
- explore(options: GqlModuleOptions): any[];
8
- filterPlugins<T = unknown>(wrapper: InstanceWrapper<T>): T;
9
- }
@@ -1,22 +0,0 @@
1
- import { BaseExplorerService } from '@nestjs/graphql';
2
- import { PLUGIN_METADATA } from '../constants';
3
- export class PluginsExplorerService extends BaseExplorerService {
4
- modulesContainer;
5
- constructor(modulesContainer) {
6
- super();
7
- this.modulesContainer = modulesContainer;
8
- }
9
- explore(options) {
10
- const modules = this.getModules(this.modulesContainer, options.include || []);
11
- return this.flatMap(modules, (instance) => this.filterPlugins(instance));
12
- }
13
- filterPlugins(wrapper) {
14
- const { instance } = wrapper;
15
- if (!instance) {
16
- return undefined;
17
- }
18
- const metadata = Reflect.getMetadata(PLUGIN_METADATA, instance.constructor);
19
- return metadata ? instance : undefined;
20
- }
21
- }
22
- //# sourceMappingURL=plugins-explorer.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins-explorer.service.js","sourceRoot":"","sources":["../../../../src/drivers/services/plugins-explorer.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAoB,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,OAAO,sBAAuB,SAAQ,mBAAmB;IAChC;IAA7B,YAA6B,gBAAkC;QAC7D,KAAK,EAAE,CAAC;QADmB,qBAAgB,GAAhB,gBAAgB,CAAkB;IAE/D,CAAC;IAED,OAAO,CAAC,OAAyB;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAC7B,IAAI,CAAC,gBAAgB,EACrB,OAAO,CAAC,OAAO,IAAI,EAAE,CACtB,CAAC;QACF,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,aAAa,CAAc,OAA2B;QACpD,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;QAC7B,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC5E,OAAO,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;IACzC,CAAC;CACF"}
@@ -1,4 +0,0 @@
1
- import { HonoRequest as Request } from 'hono';
2
- export type HonoRequest = Request & {
3
- headers?: Record<string, string>;
4
- };
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=hono.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hono.interface.js","sourceRoot":"","sources":["../../../src/interfaces/hono.interface.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from './nest-hono-application.interface';
2
- export * from './hono.interface';
@@ -1,3 +0,0 @@
1
- export * from './nest-hono-application.interface';
2
- export * from './hono.interface';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,kBAAkB,CAAC"}
@@ -1,18 +0,0 @@
1
- import { ServeStaticOptions } from '@hono/node-server/serve-static';
2
- import { HttpServer, INestApplication } from '@nestjs/common';
3
- import { Context, Hono, MiddlewareHandler } from 'hono';
4
- export type TypeBodyParser = 'application/json' | 'text/plain' | 'application/x-www-form-urlencoded';
5
- interface HonoViewOptions {
6
- engine: string;
7
- templates: string;
8
- }
9
- export interface NestHonoApplication<TServer extends Hono = Hono> extends INestApplication<TServer> {
10
- getHttpAdapter(): HttpServer<Context, MiddlewareHandler, Hono>;
11
- useBodyParser(type: TypeBodyParser, bodyLimit?: number): this;
12
- useStaticAssets(path: string, options: ServeStaticOptions): this;
13
- setViewEngine(options: HonoViewOptions | string): this;
14
- listen(port: number | string, callback?: (err: Error, address: string) => void): Promise<TServer>;
15
- listen(port: number | string, address: string, callback?: (err: Error, address: string) => void): Promise<TServer>;
16
- listen(port: number | string, address: string, backlog: number, callback?: (err: Error, address: string) => void): Promise<TServer>;
17
- }
18
- export {};
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=nest-hono-application.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"nest-hono-application.interface.js","sourceRoot":"","sources":["../../../src/interfaces/nest-hono-application.interface.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export * from './uploaded-files-decorator';
2
- export * from './uploaded-file-decorator';
@@ -1,3 +0,0 @@
1
- export * from './uploaded-files-decorator';
2
- export * from './uploaded-file-decorator';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/multer/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC"}
@@ -1 +0,0 @@
1
- export declare const UploadedFile: (...dataOrPipes: any[]) => ParameterDecorator;