@snowtop/ent 0.1.0-alpha96-2a5ea200-82e5-11ed-8c55-4da1cd949242 → 0.1.0-alpha96

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 (63) hide show
  1. package/action/action.d.ts +3 -3
  2. package/action/executor.js +6 -1
  3. package/action/experimental_action.d.ts +5 -2
  4. package/action/experimental_action.js +15 -12
  5. package/action/index.d.ts +2 -0
  6. package/action/index.js +7 -1
  7. package/action/orchestrator.d.ts +4 -2
  8. package/action/orchestrator.js +6 -0
  9. package/action/relative_value.d.ts +47 -0
  10. package/action/relative_value.js +125 -0
  11. package/action/transaction.d.ts +10 -0
  12. package/action/transaction.js +23 -0
  13. package/auth/auth.d.ts +1 -1
  14. package/core/base.d.ts +4 -2
  15. package/core/clause.d.ts +6 -1
  16. package/core/clause.js +25 -4
  17. package/core/config.d.ts +2 -1
  18. package/core/config.js +2 -0
  19. package/core/date.js +1 -5
  20. package/core/db.d.ts +9 -6
  21. package/core/db.js +14 -6
  22. package/core/ent.d.ts +3 -1
  23. package/core/ent.js +76 -26
  24. package/core/logger.d.ts +1 -1
  25. package/core/query/assoc_query.d.ts +2 -2
  26. package/core/query/shared_assoc_test.js +1 -2
  27. package/core/query/shared_test.js +0 -1
  28. package/graphql/graphql.d.ts +6 -6
  29. package/graphql/graphql.js +1 -0
  30. package/graphql/query/connection_type.d.ts +1 -1
  31. package/graphql/query/shared_assoc_test.js +1 -1
  32. package/graphql/query/shared_edge_connection.js +0 -4
  33. package/imports/index.d.ts +6 -1
  34. package/imports/index.js +14 -3
  35. package/index.d.ts +1 -0
  36. package/package.json +16 -16
  37. package/parse_schema/parse.d.ts +7 -7
  38. package/schema/base_schema.d.ts +3 -3
  39. package/schema/field.js +2 -2
  40. package/schema/schema.d.ts +10 -10
  41. package/schema/schema.js +0 -16
  42. package/scripts/custom_graphql.js +30 -4
  43. package/testutils/action/complex_schemas.d.ts +69 -0
  44. package/testutils/action/complex_schemas.js +398 -0
  45. package/testutils/builder.d.ts +21 -36
  46. package/testutils/builder.js +39 -45
  47. package/testutils/db/temp_db.d.ts +6 -3
  48. package/testutils/db/temp_db.js +79 -7
  49. package/testutils/db/value.d.ts +1 -0
  50. package/testutils/db/value.js +2 -2
  51. package/testutils/db_mock.d.ts +16 -4
  52. package/testutils/db_mock.js +48 -5
  53. package/testutils/ent-graphql-tests/index.d.ts +7 -1
  54. package/testutils/ent-graphql-tests/index.js +17 -5
  55. package/testutils/fake_data/fake_contact.d.ts +1 -0
  56. package/testutils/fake_data/fake_contact.js +6 -5
  57. package/testutils/fake_data/fake_event.d.ts +1 -0
  58. package/testutils/fake_data/fake_event.js +4 -3
  59. package/testutils/fake_data/fake_tag.d.ts +2 -1
  60. package/testutils/fake_data/fake_tag.js +6 -5
  61. package/testutils/fake_data/fake_user.d.ts +2 -1
  62. package/testutils/fake_data/fake_user.js +14 -13
  63. package/tsc/ast.d.ts +1 -1
@@ -11,6 +11,11 @@ const loaders_1 = require("../../core/loaders");
11
11
  const convert_1 = require("../../core/convert");
12
12
  const action_1 = require("../../action");
13
13
  class FakeTag {
14
+ getPrivacyPolicy() {
15
+ return {
16
+ rules: [new privacy_1.AllowIfViewerIsEntPropertyRule("ownerID"), privacy_1.AlwaysDenyRule],
17
+ };
18
+ }
14
19
  constructor(viewer, data) {
15
20
  this.viewer = viewer;
16
21
  this.nodeType = const_1.NodeType.FakeUser;
@@ -22,11 +27,7 @@ class FakeTag {
22
27
  this.canonicalName = data.canonical_name;
23
28
  this.ownerID = data.owner_id;
24
29
  }
25
- getPrivacyPolicy() {
26
- return {
27
- rules: [new privacy_1.AllowIfViewerIsEntPropertyRule("ownerID"), privacy_1.AlwaysDenyRule],
28
- };
29
- }
30
+ __setRawDBData(data) { }
30
31
  static getFields() {
31
32
  return [
32
33
  "id",
@@ -25,6 +25,7 @@ export declare class FakeUser implements Ent {
25
25
  protected readonly password: string | null;
26
26
  getPrivacyPolicy(): PrivacyPolicy<this>;
27
27
  constructor(viewer: Viewer, data: Data);
28
+ __setRawDBData(data: Data): void;
28
29
  static getFields(): string[];
29
30
  static getTestTable(): import("../db/temp_db").Table;
30
31
  static loaderOptions(): LoadEntOptions<FakeUser>;
@@ -41,7 +42,7 @@ export interface UserCreateInput {
41
42
  createdAt?: Date;
42
43
  updatedAt?: Date;
43
44
  }
44
- export declare type UserEditInput = Partial<UserCreateInput>;
45
+ export type UserEditInput = Partial<UserCreateInput>;
45
46
  export declare function getUserBuilder(viewer: Viewer, input: UserCreateInput): import("../builder").SimpleBuilder<FakeUser, null>;
46
47
  export declare function getUserAction(viewer: Viewer, input: UserCreateInput): SimpleAction<FakeUser, null>;
47
48
  export declare function createUser(viewer: Viewer, input: UserCreateInput): Promise<FakeUser>;
@@ -24,19 +24,6 @@ class ViewerWithAccessToken extends viewer_1.IDViewer {
24
24
  }
25
25
  exports.ViewerWithAccessToken = ViewerWithAccessToken;
26
26
  class FakeUser {
27
- constructor(viewer, data) {
28
- this.viewer = viewer;
29
- this.nodeType = const_1.NodeType.FakeUser;
30
- this.data = data;
31
- this.id = data.id;
32
- this.createdAt = (0, convert_1.convertDate)(data.created_at);
33
- this.updatedAt = (0, convert_1.convertDate)(data.updated_at);
34
- this.firstName = data.first_name;
35
- this.lastName = data.last_name;
36
- this.emailAddress = data.email_address;
37
- this.phoneNumber = data.phone_number;
38
- this.password = data.password;
39
- }
40
27
  getPrivacyPolicy() {
41
28
  return {
42
29
  rules: [
@@ -61,6 +48,20 @@ class FakeUser {
61
48
  ],
62
49
  };
63
50
  }
51
+ constructor(viewer, data) {
52
+ this.viewer = viewer;
53
+ this.nodeType = const_1.NodeType.FakeUser;
54
+ this.data = data;
55
+ this.id = data.id;
56
+ this.createdAt = (0, convert_1.convertDate)(data.created_at);
57
+ this.updatedAt = (0, convert_1.convertDate)(data.updated_at);
58
+ this.firstName = data.first_name;
59
+ this.lastName = data.last_name;
60
+ this.emailAddress = data.email_address;
61
+ this.phoneNumber = data.phone_number;
62
+ this.password = data.password;
63
+ }
64
+ __setRawDBData(data) { }
64
65
  static getFields() {
65
66
  return [
66
67
  "id",
package/tsc/ast.d.ts CHANGED
@@ -10,7 +10,7 @@ export interface ClassInfo {
10
10
  wrapClassContents(inner: string): string;
11
11
  }
12
12
  export declare function getClassInfo(fileContents: string, sourceFile: ts.SourceFile, node: ts.ClassDeclaration): ClassInfo | undefined;
13
- declare type transformImportFn = (imp: string) => string;
13
+ type transformImportFn = (imp: string) => string;
14
14
  interface transformOpts {
15
15
  removeImports?: string[];
16
16
  newImports?: string[];