foobara-typescript-remote-command-generator 0.0.4 → 0.0.5
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/src/remote_generator/services/aggregate_model_generator.rb +0 -5
- data/src/remote_generator/services/atom_model_generator.rb +0 -5
- data/src/remote_generator/services/type_generator.rb +1 -1
- data/src/remote_generator/services/typescript_from_manifest_base_generator.rb +0 -4
- data/src/remote_generator/services/unloaded_entity_generator.rb +0 -5
- data/templates/Command/Result.ts.erb +1 -1
- data/templates/Entity/Aggregate.ts.erb +5 -5
- data/templates/Entity/Ambiguous.ts.erb +9 -9
- data/templates/Entity/Atom.ts.erb +5 -5
- data/templates/Entity/Loaded.ts.erb +3 -3
- data/templates/Entity/Unloaded.ts.erb +6 -6
- data/templates/EntityVariants.ts.erb +25 -25
- data/templates/Error.ts.erb +1 -1
- data/templates/Model/Aggregate.ts.erb +6 -6
- data/templates/Model/Atom.ts.erb +6 -6
- data/templates/Model/Model.ts.erb +5 -5
- data/templates/ModelVariants.ts.erb +15 -15
- data/templates/Type/Type.ts.erb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a7d35269e0cccd832d9f2273e87df63886b43653f8f3188c835f3d98b57bbb6
|
4
|
+
data.tar.gz: 2a28d7e124c91342b41f598e2d83fde63f9a6d1a4a882d8865b68da39763773b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 221ffce09538be115791fd15ef205a4d381828974a8076fd693db489a749598edcdf68c5faafe21f570830c73f8ff3fb838af3b4a9c388ccf665282b6ce41952
|
7
|
+
data.tar.gz: e3a47338014c6d6f819c6ac9e1b6269558cf2955ae1d4a709a4c000d03029de634617683566c3f6a6d3f3a056add55fc4ff8a039e4acb4115b4f13a6fbdb4780
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<% dependency_roots.each do |dependency_root| %>
|
2
|
-
import
|
2
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
type Result = <%= foobara_type_to_ts_type(result_type, dependency_group:, association_depth:) %>
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
2
|
+
<%= entity_short_name %>AttributesType
|
3
3
|
} from "./Ambiguous"
|
4
|
-
import { Loaded<%=
|
4
|
+
import { Loaded<%= entity_short_name %> } from "./Loaded"
|
5
5
|
<% dependency_roots.each do |dependency_root| %>
|
6
|
-
import
|
6
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
export interface <%=
|
9
|
+
export interface <%= entity_short_name %>AggregateAttributesType extends <%= entity_short_name %>AttributesType <%= attributes_type_ts_type %>
|
10
10
|
|
11
|
-
export class <%=
|
11
|
+
export class <%= entity_short_name %>Aggregate extends Loaded<%= entity_short_name %><<%= entity_short_name %>AggregateAttributesType> {
|
12
12
|
<% if has_associations? %>
|
13
13
|
/* eslint-disable @typescript-eslint/class-literal-property-style */
|
14
14
|
get isAtom (): false { return false }
|
@@ -1,20 +1,20 @@
|
|
1
1
|
import { Entity } from "<%= path_to_root %>base/Entity"
|
2
2
|
<% dependency_roots.each do |dependency_root| %>
|
3
|
-
import
|
3
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
4
4
|
<% end %>
|
5
5
|
|
6
|
-
export type <%=
|
6
|
+
export type <%= entity_short_name %>PrimaryKeyType = <%= primary_key_ts_type %>
|
7
7
|
export const <%= entity_name_downcase %>PrimaryKeyAttributeName: "<%= primary_key_name %>" = "<%= primary_key_name %>"
|
8
|
-
export interface <%=
|
8
|
+
export interface <%= entity_short_name %>AttributesType <%= attributes_type_ts_type %>
|
9
9
|
|
10
|
-
export class <%=
|
11
|
-
AttributesType extends <%=
|
12
|
-
> extends Entity<<%=
|
13
|
-
static readonly modelName: string = "<%=
|
14
|
-
static readonly entityName: string = "<%=
|
10
|
+
export class <%= entity_short_name %><
|
11
|
+
AttributesType extends <%= entity_short_name %>AttributesType = <%= entity_short_name %>AttributesType
|
12
|
+
> extends Entity<<%= entity_short_name %>PrimaryKeyType, AttributesType> {
|
13
|
+
static readonly modelName: string = "<%= entity_short_name %>"
|
14
|
+
static readonly entityName: string = "<%= entity_short_name %>"
|
15
15
|
static readonly primaryKeyAttributeName: "<%= primary_key_name %>" = "<%= primary_key_name %>"
|
16
16
|
|
17
|
-
get <%= primary_key_name %> (): <%=
|
17
|
+
get <%= primary_key_name %> (): <%= entity_short_name %>PrimaryKeyType {
|
18
18
|
return this.primaryKey
|
19
19
|
}
|
20
20
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
2
|
+
<%= entity_short_name %>AttributesType
|
3
3
|
} from "./Ambiguous"
|
4
|
-
import { Loaded<%=
|
4
|
+
import { Loaded<%= entity_short_name %> } from "./Loaded"
|
5
5
|
<% dependency_roots.each do |dependency_root| %>
|
6
|
-
import
|
6
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
export interface <%=
|
9
|
+
export interface <%= entity_short_name %>AtomAttributesType extends <%= entity_short_name %>AttributesType <%= atom_attributes_ts_type %>
|
10
10
|
|
11
|
-
export class <%=
|
11
|
+
export class <%= entity_short_name %>Atom extends Loaded<%= entity_short_name %><<%= entity_short_name %>AtomAttributesType> {
|
12
12
|
<% if has_associations? %>
|
13
13
|
/* eslint-disable @typescript-eslint/class-literal-property-style */
|
14
14
|
get isAtom (): true { return true }
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
3
|
-
<%=
|
2
|
+
<%= entity_short_name %>,
|
3
|
+
<%= entity_short_name %>AttributesType
|
4
4
|
} from "./Ambiguous"
|
5
5
|
|
6
|
-
export class Loaded<%=
|
6
|
+
export class Loaded<%= entity_short_name %><T extends <%= entity_short_name %>AttributesType = <%= entity_short_name %>AttributesType> extends <%= entity_short_name %><T> {
|
7
7
|
readonly isLoaded: true = true
|
8
8
|
<% unless has_associations? %>
|
9
9
|
/* eslint-disable @typescript-eslint/class-literal-property-style */
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { Never } from "<%= path_to_root %>base/Entity"
|
2
2
|
import {
|
3
|
-
<%=
|
4
|
-
//<%=
|
5
|
-
<%=
|
3
|
+
<%= entity_short_name %>,
|
4
|
+
//<%= entity_short_name %>PrimaryKeyType
|
5
|
+
<%= entity_short_name %>AttributesType
|
6
6
|
} from "./Ambiguous"
|
7
7
|
|
8
|
-
export type Unloaded<%=
|
8
|
+
export type Unloaded<%= entity_short_name %>AttributesType = Never<<%= entity_short_name %>AttributesType>
|
9
9
|
|
10
|
-
export class Unloaded<%=
|
10
|
+
export class Unloaded<%= entity_short_name %> extends <%= entity_short_name %><Unloaded<%= entity_short_name %>AttributesType> {
|
11
11
|
/*
|
12
|
-
constructor(id: <%=
|
12
|
+
constructor(id: <%= entity_short_name %>PrimaryKeyType) {
|
13
13
|
super(id, {})
|
14
14
|
}
|
15
15
|
*/
|
@@ -1,40 +1,40 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
3
|
-
<%=
|
2
|
+
<%= entity_short_name %>,
|
3
|
+
<%= entity_short_name %>PrimaryKeyType,
|
4
4
|
<%= entity_name_downcase %>PrimaryKeyAttributeName,
|
5
|
-
<%=
|
6
|
-
} from "./<%=
|
5
|
+
<%= entity_short_name %>AttributesType
|
6
|
+
} from "./<%= entity_short_name %>/Ambiguous"
|
7
7
|
import {
|
8
|
-
Unloaded<%=
|
9
|
-
Unloaded<%=
|
10
|
-
} from "./<%=
|
8
|
+
Unloaded<%= entity_short_name %>,
|
9
|
+
Unloaded<%= entity_short_name %>AttributesType
|
10
|
+
} from "./<%= entity_short_name %>/Unloaded"
|
11
11
|
import {
|
12
|
-
Loaded<%=
|
13
|
-
} from "./<%=
|
12
|
+
Loaded<%= entity_short_name %>
|
13
|
+
} from "./<%= entity_short_name %>/Loaded"
|
14
14
|
|
15
15
|
<% if has_associations? %>
|
16
16
|
import {
|
17
|
-
<%=
|
18
|
-
<%=
|
19
|
-
} from "./<%=
|
17
|
+
<%= entity_short_name %>Atom,
|
18
|
+
<%= entity_short_name %>AtomAttributesType
|
19
|
+
} from "./<%= entity_short_name %>/Atom"
|
20
20
|
import {
|
21
|
-
<%=
|
22
|
-
<%=
|
23
|
-
} from "./<%=
|
21
|
+
<%= entity_short_name %>Aggregate,
|
22
|
+
<%= entity_short_name %>AggregateAttributesType
|
23
|
+
} from "./<%= entity_short_name %>/Aggregate"
|
24
24
|
<% end %>
|
25
25
|
|
26
26
|
export {
|
27
|
-
<%=
|
28
|
-
type <%=
|
29
|
-
Unloaded<%=
|
30
|
-
type Unloaded<%=
|
31
|
-
Loaded<%=
|
27
|
+
<%= entity_short_name %>,
|
28
|
+
type <%= entity_short_name %>AttributesType,
|
29
|
+
Unloaded<%= entity_short_name %>,
|
30
|
+
type Unloaded<%= entity_short_name %>AttributesType,
|
31
|
+
Loaded<%= entity_short_name %>,
|
32
32
|
<% if has_associations? %>
|
33
|
-
<%=
|
34
|
-
type <%=
|
35
|
-
<%=
|
36
|
-
type <%=
|
33
|
+
<%= entity_short_name %>Atom,
|
34
|
+
type <%= entity_short_name %>AtomAttributesType,
|
35
|
+
<%= entity_short_name %>Aggregate,
|
36
|
+
type <%= entity_short_name %>AggregateAttributesType,
|
37
37
|
<% end %>
|
38
|
-
type <%=
|
38
|
+
type <%= entity_short_name %>PrimaryKeyType,
|
39
39
|
<%= entity_name_downcase %>PrimaryKeyAttributeName
|
40
40
|
}
|
data/templates/Error.ts.erb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<% dependency_roots.each do |dependency_root| %>
|
2
|
-
import
|
2
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
import { <%= error_base_class %> } from "<%= path_to_root %>base/Error"
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
3
|
-
<%=
|
4
|
-
} from "./<%=
|
2
|
+
<%= model_short_name %>,
|
3
|
+
<%= model_short_name %>AttributesType
|
4
|
+
} from "./<%= model_short_name %>"
|
5
5
|
<% dependency_roots.each do |dependency_root| %>
|
6
|
-
import
|
6
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
export interface <%=
|
9
|
+
export interface <%= model_short_name %>AggregateAttributesType extends <%= model_short_name %>AttributesType <%= attributes_type_ts_type %>
|
10
10
|
|
11
|
-
export class <%=
|
11
|
+
export class <%= model_short_name %>Aggregate extends <%= model_short_name %><<%= model_short_name %>AggregateAttributesType> {
|
12
12
|
}
|
data/templates/Model/Atom.ts.erb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
3
|
-
<%=
|
4
|
-
} from "./<%=
|
2
|
+
<%= model_short_name %>,
|
3
|
+
<%= model_short_name %>AttributesType
|
4
|
+
} from "./<%= model_short_name %>"
|
5
5
|
<% dependency_roots.each do |dependency_root| %>
|
6
|
-
import
|
6
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
7
7
|
<% end %>
|
8
8
|
|
9
|
-
export interface <%=
|
9
|
+
export interface <%= model_short_name %>AtomAttributesType extends <%= model_short_name %>AttributesType <%= atom_attributes_ts_type %>
|
10
10
|
|
11
|
-
export class <%=
|
11
|
+
export class <%= model_short_name %>Atom extends <%= model_short_name %><<%= model_short_name %>AtomAttributesType> {
|
12
12
|
}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { Model } from "<%= path_to_root %>base/Model"
|
2
2
|
<% dependency_roots.each do |dependency_root| %>
|
3
|
-
import
|
3
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
4
4
|
<% end %>
|
5
5
|
|
6
|
-
export interface <%=
|
6
|
+
export interface <%= model_short_name %>AttributesType <%= attributes_type_ts_type %>
|
7
7
|
|
8
|
-
export class <%=
|
9
|
-
AttributesType extends <%=
|
8
|
+
export class <%= model_short_name %><
|
9
|
+
AttributesType extends <%= model_short_name %>AttributesType = <%= model_short_name %>AttributesType
|
10
10
|
> extends Model<AttributesType> {
|
11
|
-
static readonly modelName: string = "<%=
|
11
|
+
static readonly modelName: string = "<%= model_short_name %>"
|
12
12
|
|
13
13
|
<% attribute_names.each do |attribute_name| %>
|
14
14
|
get <%= attribute_name %> (): AttributesType["<%= attribute_name %>"] {
|
@@ -1,26 +1,26 @@
|
|
1
1
|
import {
|
2
|
-
<%=
|
3
|
-
<%=
|
4
|
-
} from "./<%=
|
2
|
+
<%= model_short_name %>,
|
3
|
+
<%= model_short_name %>AttributesType
|
4
|
+
} from "./<%= model_short_name %>/<%= model_short_name %>"
|
5
5
|
|
6
6
|
<% if has_associations? %>
|
7
7
|
import {
|
8
|
-
<%=
|
9
|
-
<%=
|
10
|
-
} from "./<%=
|
8
|
+
<%= model_short_name %>Atom,
|
9
|
+
<%= model_short_name %>AtomAttributesType
|
10
|
+
} from "./<%= model_short_name %>/Atom"
|
11
11
|
import {
|
12
|
-
<%=
|
13
|
-
<%=
|
14
|
-
} from "./<%=
|
12
|
+
<%= model_short_name %>Aggregate,
|
13
|
+
<%= model_short_name %>AggregateAttributesType
|
14
|
+
} from "./<%= model_short_name %>/Aggregate"
|
15
15
|
<% end %>
|
16
16
|
|
17
17
|
export {
|
18
|
-
<%=
|
19
|
-
type <%=
|
18
|
+
<%= model_short_name %>,
|
19
|
+
type <%= model_short_name %>AttributesType,
|
20
20
|
<% if has_associations? %>
|
21
|
-
<%=
|
22
|
-
type <%=
|
23
|
-
<%=
|
24
|
-
type <%=
|
21
|
+
<%= model_short_name %>Atom,
|
22
|
+
type <%= model_short_name %>AtomAttributesType,
|
23
|
+
<%= model_short_name %>Aggregate,
|
24
|
+
type <%= model_short_name %>AggregateAttributesType,
|
25
25
|
<% end %>
|
26
26
|
}
|
data/templates/Type/Type.ts.erb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
<% dependency_roots.each do |dependency_root| %>
|
2
|
-
import
|
2
|
+
import <%= dependency_root.import_destructure %> from "<%= path_to_root %><%= dependency_root.import_path %>"
|
3
3
|
<% end %>
|
4
4
|
|
5
|
-
export type <%=
|
5
|
+
export type <%= type_short_name %> = <%= type_guts %>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara-typescript-remote-command-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foobara
|