node-firebird 2.3.4 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/README.md +544 -6
  2. package/lib/callback.d.ts +20 -0
  3. package/lib/callback.js +6 -16
  4. package/lib/firebird.msg.json +1370 -1370
  5. package/lib/gdscodes.d.ts +1519 -1520
  6. package/lib/gdscodes.js +5 -5
  7. package/lib/ieee754-decimal.d.ts +38 -0
  8. package/lib/ieee754-decimal.js +71 -118
  9. package/lib/index.d.ts +37 -338
  10. package/lib/index.js +97 -86
  11. package/lib/messages.d.ts +6 -0
  12. package/lib/messages.js +135 -162
  13. package/lib/pool.d.ts +23 -0
  14. package/lib/pool.js +34 -47
  15. package/lib/srp.d.ts +51 -0
  16. package/lib/srp.js +62 -72
  17. package/lib/types.d.ts +375 -0
  18. package/lib/types.js +22 -0
  19. package/lib/unix-crypt.d.ts +1 -0
  20. package/lib/unix-crypt.js +126 -152
  21. package/lib/utils.d.ts +16 -0
  22. package/lib/utils.js +24 -48
  23. package/lib/wire/connection.d.ts +100 -0
  24. package/lib/wire/connection.js +1029 -1009
  25. package/lib/wire/const.d.ts +567 -0
  26. package/lib/wire/const.js +620 -599
  27. package/lib/wire/database.d.ts +57 -0
  28. package/lib/wire/database.js +111 -108
  29. package/lib/wire/eventConnection.d.ts +16 -0
  30. package/lib/wire/eventConnection.js +29 -31
  31. package/lib/wire/fbEventManager.d.ts +45 -0
  32. package/lib/wire/fbEventManager.js +38 -57
  33. package/lib/wire/serialize.d.ts +97 -0
  34. package/lib/wire/serialize.js +42 -141
  35. package/lib/wire/service.d.ts +66 -0
  36. package/lib/wire/service.js +374 -401
  37. package/lib/wire/socket.d.ts +59 -0
  38. package/lib/wire/socket.js +79 -40
  39. package/lib/wire/statement.d.ts +25 -0
  40. package/lib/wire/statement.js +13 -9
  41. package/lib/wire/transaction.d.ts +21 -0
  42. package/lib/wire/transaction.js +33 -61
  43. package/lib/wire/xsqlvar.d.ts +175 -0
  44. package/lib/wire/xsqlvar.js +169 -269
  45. package/package.json +12 -4
  46. package/src/callback.ts +55 -0
  47. package/{poc/node_modules/node-firebird/lib/gdscodes.js → src/gdscodes.ts} +3 -3
  48. package/{poc/node_modules/node-firebird/lib/ieee754-decimal.js → src/ieee754-decimal.ts} +7 -14
  49. package/src/index.ts +157 -0
  50. package/{poc/node_modules/node-firebird/lib/messages.js → src/messages.ts} +163 -162
  51. package/src/pool.ts +209 -0
  52. package/{poc/node_modules/node-firebird/lib/srp.js → src/srp.ts} +74 -33
  53. package/src/types.ts +419 -0
  54. package/{poc/node_modules/node-firebird/lib/unix-crypt.js → src/unix-crypt.ts} +6 -12
  55. package/{poc/node_modules/node-firebird/lib/utils.js → src/utils.ts} +11 -20
  56. package/{poc/node_modules/node-firebird/lib/wire/connection.js → src/wire/connection.ts} +611 -129
  57. package/{poc/node_modules/node-firebird/lib/wire/const.js → src/wire/const.ts} +96 -9
  58. package/{poc/node_modules/node-firebird/lib/wire/database.js → src/wire/database.ts} +110 -44
  59. package/{poc/node_modules/node-firebird/lib/wire/eventConnection.js → src/wire/eventConnection.ts} +29 -14
  60. package/{poc/node_modules/node-firebird/lib/wire/fbEventManager.js → src/wire/fbEventManager.ts} +39 -30
  61. package/{poc/node_modules/node-firebird/lib/wire/serialize.js → src/wire/serialize.ts} +78 -59
  62. package/{poc/node_modules/node-firebird/lib/wire/service.js → src/wire/service.ts} +90 -88
  63. package/src/wire/socket.ts +262 -0
  64. package/src/wire/statement.ts +71 -0
  65. package/{poc/node_modules/node-firebird/lib/wire/transaction.js → src/wire/transaction.ts} +25 -19
  66. package/{poc/node_modules/node-firebird/lib/wire/xsqlvar.js → src/wire/xsqlvar.ts} +244 -143
  67. package/.eslintrc.json +0 -12
  68. package/.github/workflows/codeql.yml +0 -76
  69. package/.github/workflows/node.js.yml +0 -95
  70. package/BIGINT_MIGRATION.md +0 -374
  71. package/CI_DEBUGGING_GUIDE.md +0 -148
  72. package/ENCRYPTION_CALLBACK.md +0 -152
  73. package/FIREBIRD_LOG_FEATURE.md +0 -145
  74. package/MINIMAL_CHANGES_SUMMARY.md +0 -136
  75. package/PR_SUMMARY.md +0 -96
  76. package/ROADMAP.md +0 -223
  77. package/SRP_PROTOCOL.md +0 -482
  78. package/poc/README.md +0 -160
  79. package/poc/helpers.js +0 -59
  80. package/poc/node_modules/.package-lock.json +0 -14
  81. package/poc/node_modules/node-firebird/.eslintrc.json +0 -12
  82. package/poc/node_modules/node-firebird/.github/workflows/codeql.yml +0 -76
  83. package/poc/node_modules/node-firebird/.github/workflows/node.js.yml +0 -95
  84. package/poc/node_modules/node-firebird/BIGINT_MIGRATION.md +0 -374
  85. package/poc/node_modules/node-firebird/CI_DEBUGGING_GUIDE.md +0 -148
  86. package/poc/node_modules/node-firebird/ENCRYPTION_CALLBACK.md +0 -152
  87. package/poc/node_modules/node-firebird/FIREBIRD_LOG_FEATURE.md +0 -145
  88. package/poc/node_modules/node-firebird/LICENSE +0 -373
  89. package/poc/node_modules/node-firebird/MINIMAL_CHANGES_SUMMARY.md +0 -136
  90. package/poc/node_modules/node-firebird/PR_SUMMARY.md +0 -96
  91. package/poc/node_modules/node-firebird/README.md +0 -794
  92. package/poc/node_modules/node-firebird/ROADMAP.md +0 -223
  93. package/poc/node_modules/node-firebird/SRP_PROTOCOL.md +0 -482
  94. package/poc/node_modules/node-firebird/lib/callback.js +0 -38
  95. package/poc/node_modules/node-firebird/lib/gdscodes.d.ts +0 -1524
  96. package/poc/node_modules/node-firebird/lib/index.d.ts +0 -316
  97. package/poc/node_modules/node-firebird/lib/index.js +0 -128
  98. package/poc/node_modules/node-firebird/lib/pool.js +0 -108
  99. package/poc/node_modules/node-firebird/lib/wire/socket.js +0 -175
  100. package/poc/node_modules/node-firebird/lib/wire/statement.js +0 -48
  101. package/poc/node_modules/node-firebird/package.json +0 -38
  102. package/poc/node_modules/node-firebird/vitest.config.js +0 -24
  103. package/poc/package-lock.json +0 -21
  104. package/poc/package.json +0 -12
  105. package/poc/reproduce-fixed.js +0 -150
  106. package/poc/reproduce.js +0 -133
  107. package/vitest.config.js +0 -27
  108. /package/{poc/node_modules/node-firebird/lib → src}/firebird.msg +0 -0
  109. /package/{poc/node_modules/node-firebird/lib → src}/firebird.msg.json +0 -0
@@ -0,0 +1,100 @@
1
+ import { XdrWriter, BlrWriter } from './serialize';
2
+ import * as srp from '../srp';
3
+ declare function parseValueIfJson(value: any, options: any): any;
4
+ /***************************************
5
+ *
6
+ * Connection
7
+ *
8
+ ***************************************/
9
+ declare class Connection {
10
+ static decodeResponse: typeof decodeResponse;
11
+ static fetch_blob_async_transaction: typeof fetch_blob_async_transaction;
12
+ static fetch_blob_async: typeof fetch_blob_async;
13
+ static parseValueIfJson: typeof parseValueIfJson;
14
+ static describe: typeof describe;
15
+ db: any;
16
+ svc: any;
17
+ options: any;
18
+ accept: any;
19
+ error: any;
20
+ dbhandle: number | undefined;
21
+ svchandle: number | undefined;
22
+ clientKeys: srp.KeyPair | undefined;
23
+ serverKeys: {
24
+ salt: string;
25
+ public: bigint;
26
+ pluginName: string;
27
+ } | undefined;
28
+ _msg: XdrWriter;
29
+ _blr: BlrWriter;
30
+ _queue: any[];
31
+ _pending: string[];
32
+ _socket: any;
33
+ _xdr: any;
34
+ _isOpened: boolean;
35
+ _isClosed: boolean;
36
+ _isDetach: boolean;
37
+ _isUsed: boolean;
38
+ _pooled: boolean;
39
+ _lowercase_keys: boolean | undefined;
40
+ _detachTimeout: any;
41
+ _detachCallback: any;
42
+ _detachAuto: any;
43
+ _retry_connection_id: any;
44
+ _retry_connection_interval: number;
45
+ _max_cached_query: number;
46
+ _cache_query: Record<string, any> | null;
47
+ _messageFile: string;
48
+ _authStartTime: number | undefined;
49
+ _pendingAccept: any;
50
+ _inlineBlobs: Map<string, Buffer> | undefined;
51
+ constructor(host: string, port: number, callback: any, options: any, db?: any, svc?: any);
52
+ _setcachedquery(query: any, statement: any): void;
53
+ getCachedQuery(query: any): any;
54
+ _rejectPending(err: any): void;
55
+ _bind_events(host: any, port: any, callback: any): void;
56
+ disconnect(): void;
57
+ sendOpContAuth(authData: any, authDataEnc: any, pluginName: any): void;
58
+ sendOpCrypt(encryptPlugin: any): void;
59
+ sendOpCryptKeyCallback(pluginData: any): void;
60
+ _queueEvent(callback: any, defer?: boolean): void;
61
+ connect(options: any, callback: any): void;
62
+ attach(options: any, callback?: any, db?: any): void;
63
+ detach(callback: any): this;
64
+ createDatabase(options: any, callback: any): void;
65
+ dropDatabase(callback: any): void;
66
+ throwClosed(callback: any): this;
67
+ startTransaction(options: any, callback: any): this;
68
+ commit(transaction: any, callback: any): this;
69
+ rollback(transaction: any, callback: any): this;
70
+ commitRetaining(transaction: any, callback: any): this;
71
+ rollbackRetaining(transaction: any, callback: any): this;
72
+ allocateStatement(callback: any): this;
73
+ dropStatement(statement: any, callback: any): this;
74
+ closeStatement(statement: any, callback: any): this;
75
+ allocateAndPrepareStatement(transaction: any, query: any, plan: any, callback: any): void;
76
+ prepare(transaction: any, query: any, plan: any, callback: any): void;
77
+ prepareStatement(transaction: any, statement: any, query: any, plan: any, callback: any): this;
78
+ executeStatement(transaction: any, statement: any, params: any, callback: any, custom: any): this;
79
+ sendExecute(op: number, statement: any, transaction: any, callback: any, parameters?: any[]): void;
80
+ fetch(statement: any, transaction: any, count: any, callback: any): void;
81
+ fetchScroll(statement: any, transaction: any, direction: any, offset: any, count: any, callback: any): void;
82
+ fetchAll(statement: any, transaction: any, callback: any): void;
83
+ openBlob(blob: any, transaction: any, callback: any): void;
84
+ closeBlob(blob: any, callback: any, defer?: boolean): void;
85
+ getSegment(blob: any, callback: any): void;
86
+ createBlob2(transaction: any, callback: any): void;
87
+ batchSegments(blob: any, buffer: any, callback: any): void;
88
+ svcattach(options: any, callback?: any, svc?: any): void;
89
+ svcstart(spbaction: any, callback: any): void;
90
+ svcquery(spbquery: any, resultbuffersize: any, timeout: any, callback: any): void;
91
+ svcdetach(callback: any): void;
92
+ auxConnection(eventid: any, callback: any): this;
93
+ queEvents(events: any, eventid: any, callback: any): this;
94
+ closeEvents(eventid: any, callback: any): this;
95
+ }
96
+ declare function decodeResponse(data: any, callback: any, cnx: any, lowercase_keys: any, cb: (err?: any, obj?: any) => void): any;
97
+ declare function describe(buff: Buffer, statement: any): void;
98
+ declare function fetch_blob_async_transaction(statement: any, id: any, column: any, row: any): (transactionArg: any) => any;
99
+ declare function fetch_blob_async(statement: any, id: any, name: any, row: any): (transaction: any, callback: any) => void;
100
+ export = Connection;