@objectql/server 3.0.1 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/dist/adapters/graphql.d.ts +7 -0
  2. package/dist/adapters/graphql.js +8 -1
  3. package/dist/adapters/graphql.js.map +1 -1
  4. package/dist/adapters/node.d.ts +7 -0
  5. package/dist/adapters/node.js +7 -0
  6. package/dist/adapters/node.js.map +1 -1
  7. package/dist/adapters/rest.d.ts +7 -0
  8. package/dist/adapters/rest.js +7 -0
  9. package/dist/adapters/rest.js.map +1 -1
  10. package/dist/file-handler.d.ts +7 -0
  11. package/dist/file-handler.js +7 -0
  12. package/dist/file-handler.js.map +1 -1
  13. package/dist/index.d.ts +7 -0
  14. package/dist/index.js +7 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/metadata.d.ts +7 -0
  17. package/dist/metadata.js +10 -3
  18. package/dist/metadata.js.map +1 -1
  19. package/dist/openapi.d.ts +7 -0
  20. package/dist/openapi.js +7 -0
  21. package/dist/openapi.js.map +1 -1
  22. package/dist/server.d.ts +7 -0
  23. package/dist/server.js +7 -0
  24. package/dist/server.js.map +1 -1
  25. package/dist/storage.d.ts +7 -0
  26. package/dist/storage.js +7 -0
  27. package/dist/storage.js.map +1 -1
  28. package/dist/templates.d.ts +7 -0
  29. package/dist/templates.js +7 -0
  30. package/dist/templates.js.map +1 -1
  31. package/dist/types.d.ts +7 -0
  32. package/dist/types.js +8 -1
  33. package/dist/types.js.map +1 -1
  34. package/dist/utils.d.ts +7 -0
  35. package/dist/utils.js +8 -1
  36. package/dist/utils.js.map +1 -1
  37. package/jest.config.js +8 -0
  38. package/package.json +3 -3
  39. package/src/adapters/graphql.ts +9 -1
  40. package/src/adapters/node.ts +8 -0
  41. package/src/adapters/rest.ts +8 -0
  42. package/src/file-handler.ts +8 -0
  43. package/src/index.ts +8 -0
  44. package/src/metadata.ts +11 -3
  45. package/src/openapi.ts +8 -0
  46. package/src/server.ts +8 -0
  47. package/src/storage.ts +8 -0
  48. package/src/templates.ts +8 -0
  49. package/src/types.ts +8 -0
  50. package/src/utils.ts +8 -0
  51. package/test/custom-routes.test.ts +8 -0
  52. package/test/file-upload-integration.example.ts +8 -0
  53. package/test/file-validation.test.ts +8 -0
  54. package/test/graphql.test.ts +8 -0
  55. package/test/integration-example.ts +8 -0
  56. package/test/metadata.test.ts +8 -0
  57. package/test/node.test.ts +8 -0
  58. package/test/openapi.test.ts +8 -0
  59. package/test/rest-advanced.test.ts +8 -0
  60. package/test/rest.test.ts +8 -0
  61. package/test/storage.test.ts +8 -0
  62. package/tsconfig.tsbuildinfo +1 -1
package/dist/types.d.ts CHANGED
@@ -1,3 +1,10 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
1
8
  /**
2
9
  * Standardized error codes for ObjectQL API
3
10
  */
package/dist/types.js CHANGED
@@ -1,7 +1,14 @@
1
1
  "use strict";
2
- // src/types.ts
2
+ /**
3
+ * ObjectQL
4
+ * Copyright (c) 2026-present ObjectStack Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
3
9
  Object.defineProperty(exports, "__esModule", { value: true });
4
10
  exports.ErrorCode = void 0;
11
+ // src/types.ts
5
12
  /**
6
13
  * Standardized error codes for ObjectQL API
7
14
  */
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,eAAe;;;AAEf;;GAEG;AACH,IAAY,SAUX;AAVD,WAAY,SAAS;IACjB,gDAAmC,CAAA;IACnC,kDAAqC,CAAA;IACrC,0CAA6B,CAAA;IAC7B,oCAAuB,CAAA;IACvB,oCAAuB,CAAA;IACvB,kCAAqB,CAAA;IACrB,8CAAiC,CAAA;IACjC,8CAAiC,CAAA;IACjC,wDAA2C,CAAA;AAC/C,CAAC,EAVW,SAAS,yBAAT,SAAS,QAUpB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,eAAe;AAEf;;GAEG;AACH,IAAY,SAUX;AAVD,WAAY,SAAS;IACjB,gDAAmC,CAAA;IACnC,kDAAqC,CAAA;IACrC,0CAA6B,CAAA;IAC7B,oCAAuB,CAAA;IACvB,oCAAuB,CAAA;IACvB,kCAAqB,CAAA;IACrB,8CAAiC,CAAA;IACjC,8CAAiC,CAAA;IACjC,wDAA2C,CAAA;AAC/C,CAAC,EAVW,SAAS,yBAAT,SAAS,QAUpB"}
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,10 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
1
8
  /**
2
9
  * Utility functions for server operations
3
10
  */
package/dist/utils.js CHANGED
@@ -1,10 +1,17 @@
1
1
  "use strict";
2
2
  /**
3
- * Utility functions for server operations
3
+ * ObjectQL
4
+ * Copyright (c) 2026-present ObjectStack Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
4
8
  */
5
9
  Object.defineProperty(exports, "__esModule", { value: true });
6
10
  exports.escapeRegexPath = escapeRegexPath;
7
11
  exports.normalizePath = normalizePath;
12
+ /**
13
+ * Utility functions for server operations
14
+ */
8
15
  /**
9
16
  * Escapes special regex characters in a path string for use in RegExp
10
17
  * @param path - The path string to escape
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAOH,0CAEC;AAOD,sCAEC;AAhBD;;;;GAIG;AACH,SAAgB,eAAe,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;AACpD,CAAC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAWH,0CAEC;AAOD,sCAEC;AApBD;;GAEG;AAEH;;;;GAIG;AACH,SAAgB,eAAe,CAAC,IAAY;IACxC,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,SAAgB,aAAa,CAAC,IAAY;IACtC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;AACpD,CAAC"}
package/jest.config.js CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  module.exports = {
2
10
  preset: 'ts-jest',
3
11
  testEnvironment: 'node',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectql/server",
3
- "version": "3.0.1",
3
+ "version": "4.0.0",
4
4
  "description": "HTTP server adapter for ObjectQL - Express/NestJS compatible with GraphQL and REST API support",
5
5
  "keywords": [
6
6
  "objectql",
@@ -21,8 +21,8 @@
21
21
  "graphql": "^16.8.1",
22
22
  "@graphql-tools/schema": "^10.0.2",
23
23
  "js-yaml": "^4.1.1",
24
- "@objectql/core": "3.0.1",
25
- "@objectql/types": "3.0.1"
24
+ "@objectql/core": "4.0.0",
25
+ "@objectql/types": "4.0.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/js-yaml": "^4.0.9",
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { IObjectQL, ObjectConfig, FieldConfig } from '@objectql/types';
2
10
  import { ObjectQLServer } from '../server';
3
11
  import { ErrorCode } from '../types';
@@ -68,7 +76,7 @@ function mapFieldTypeToGraphQL(field: FieldConfig, isInput: boolean = false): Gr
68
76
  case 'currency':
69
77
  case 'percent':
70
78
  return GraphQLFloat;
71
- case 'auto_number':
79
+ case 'autonumber':
72
80
  return GraphQLInt;
73
81
  case 'boolean':
74
82
  return GraphQLBoolean;
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { IObjectQL, ApiRouteConfig, resolveApiRoutes } from '@objectql/types';
2
10
  import { ObjectQLServer } from '../server';
3
11
  import { ObjectQLRequest, ErrorCode, IFileStorage } from '../types';
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { IObjectQL, ApiRouteConfig, resolveApiRoutes } from '@objectql/types';
2
10
  import { ObjectQLServer } from '../server';
3
11
  import { ObjectQLRequest, ErrorCode } from '../types';
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { IncomingMessage, ServerResponse } from 'http';
2
10
  import { IFileStorage, AttachmentData, ErrorCode } from './types';
3
11
  import { IObjectQL, FieldConfig } from '@objectql/types';
package/src/index.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  export * from './types';
2
10
  export * from './utils';
3
11
  export * from './openapi';
package/src/metadata.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { IObjectQL, ApiRouteConfig, resolveApiRoutes } from '@objectql/types';
2
10
  import { IncomingMessage, ServerResponse } from 'http';
3
11
  import { ErrorCode } from './types';
@@ -189,9 +197,9 @@ export function createMetadataHandler(app: IObjectQL, options?: MetadataHandlerO
189
197
  options: field.options,
190
198
  min: field.min,
191
199
  max: field.max,
192
- min_length: field.min_length,
193
- max_length: field.max_length,
194
- regex: field.regex
200
+ minLength: field.minLength,
201
+ maxLength: field.maxLength,
202
+ validation: field.validation
195
203
  });
196
204
  }
197
205
 
package/src/openapi.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { IObjectQL, ObjectConfig, FieldConfig, ApiRouteConfig, resolveApiRoutes } from '@objectql/types';
2
10
 
3
11
  interface OpenAPISchema {
package/src/server.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { IObjectQL, ObjectQLContext } from '@objectql/types';
2
10
  import { ObjectQLRequest, ObjectQLResponse, ErrorCode } from './types';
3
11
 
package/src/storage.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { IFileStorage, AttachmentData, FileStorageOptions } from './types';
2
10
  import * as fs from 'fs';
3
11
  import * as path from 'path';
package/src/templates.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  export function getWelcomePageHtml(routes: { rpc: string; data: string; }) {
2
10
  return `<!DOCTYPE html>
3
11
  <html>
package/src/types.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  // src/types.ts
2
10
 
3
11
  /**
package/src/utils.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Utility functions for server operations
3
11
  */
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Tests for Custom API Route Configuration
3
11
  *
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Integration Test Example for File Upload/Download
3
11
  *
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { validateFile } from '../src/file-handler';
2
10
  import { FieldConfig } from '@objectql/types';
3
11
 
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import request from 'supertest';
2
10
  import { createServer } from 'http';
3
11
  import { ObjectQL } from '@objectql/core';
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  /**
2
10
  * Integration Example: Demonstrates the new standardized API response format
3
11
  *
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { createMetadataHandler } from '../src/metadata';
2
10
  import { ObjectQL } from '@objectql/core';
3
11
  import { IncomingMessage, ServerResponse } from 'http';
package/test/node.test.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import request from 'supertest';
2
10
  import { createServer } from 'http';
3
11
  import { ObjectQL } from '@objectql/core';
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { generateOpenAPI } from '../src/openapi';
2
10
  import { ObjectQL } from '@objectql/core';
3
11
  import { ObjectConfig } from '@objectql/types';
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import request from 'supertest';
2
10
  import { createServer } from 'http';
3
11
  import { ObjectQL } from '@objectql/core';
package/test/rest.test.ts CHANGED
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import request from 'supertest';
2
10
  import { createServer } from 'http';
3
11
  import { ObjectQL } from '@objectql/core';
@@ -1,3 +1,11 @@
1
+ /**
2
+ * ObjectQL
3
+ * Copyright (c) 2026-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
  import { MemoryFileStorage } from '../src/storage';
2
10
  import { AttachmentData } from '../src/types';
3
11