@rxap/remote-method 16.0.0-dev.0 → 16.0.0-dev.10

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 (86) hide show
  1. package/CHANGELOG.md +295 -0
  2. package/LICENSE +621 -24
  3. package/LICENSE.md +621 -0
  4. package/README.md +8 -73
  5. package/directive/index.d.ts +5 -5
  6. package/directive/lib/remote-method-template-collection.directive.d.ts +38 -43
  7. package/directive/lib/remote-method-template.directive.d.ts +7 -12
  8. package/directive/lib/remote-method.directive.d.ts +7 -12
  9. package/esm2022/directive/index.mjs +6 -0
  10. package/esm2022/directive/lib/error.mjs +1 -1
  11. package/esm2022/directive/lib/remote-method-template-collection.directive.mjs +115 -129
  12. package/esm2022/directive/lib/remote-method-template.directive.mjs +45 -55
  13. package/esm2022/directive/lib/remote-method.directive.mjs +28 -41
  14. package/esm2022/directive/lib/tokens.mjs +1 -1
  15. package/esm2022/directive/rxap-remote-method-directive.mjs +2 -2
  16. package/esm2022/http/directive/index.mjs +3 -0
  17. package/esm2022/http/directive/lib/contenteditable.directive.mjs +16 -39
  18. package/esm2022/http/directive/lib/http-remote-method.directive.mjs +8 -21
  19. package/esm2022/http/directive/rxap-remote-method-http-directive.mjs +2 -2
  20. package/esm2022/http/index.mjs +4 -0
  21. package/esm2022/http/lib/base-http.remote-method.mjs +19 -20
  22. package/esm2022/http/lib/http-remote-method.loader.mjs +7 -8
  23. package/esm2022/http/lib/http.remote-method.mjs +31 -22
  24. package/esm2022/http/rxap-remote-method-http.mjs +2 -2
  25. package/esm2022/index.mjs +1 -1
  26. package/esm2022/lib/base.remote-method.mjs +8 -9
  27. package/esm2022/lib/error.mjs +1 -1
  28. package/esm2022/lib/proxy.remote-method.mjs +8 -9
  29. package/esm2022/lib/remote-method-loader.mjs +7 -8
  30. package/esm2022/lib/tokens.mjs +1 -1
  31. package/esm2022/rxap-remote-method.mjs +1 -1
  32. package/esm2022/testing/index.mjs +2 -0
  33. package/esm2022/testing/lib/remote-method-testing-loader.mjs +3 -3
  34. package/esm2022/testing/rxap-remote-method-testing.mjs +2 -2
  35. package/fesm2022/rxap-remote-method-directive.mjs +175 -204
  36. package/fesm2022/rxap-remote-method-directive.mjs.map +1 -1
  37. package/fesm2022/rxap-remote-method-http-directive.mjs +20 -52
  38. package/fesm2022/rxap-remote-method-http-directive.mjs.map +1 -1
  39. package/fesm2022/rxap-remote-method-http.mjs +43 -33
  40. package/fesm2022/rxap-remote-method-http.mjs.map +1 -1
  41. package/fesm2022/rxap-remote-method-testing.mjs +1 -1
  42. package/fesm2022/rxap-remote-method-testing.mjs.map +1 -1
  43. package/fesm2022/rxap-remote-method.mjs +10 -10
  44. package/fesm2022/rxap-remote-method.mjs.map +1 -1
  45. package/http/directive/index.d.ts +2 -5
  46. package/http/directive/lib/contenteditable.directive.d.ts +1 -9
  47. package/http/directive/lib/http-remote-method.directive.d.ts +2 -7
  48. package/http/index.d.ts +3 -5
  49. package/http/lib/base-http.remote-method.d.ts +3 -3
  50. package/http/lib/http-remote-method.loader.d.ts +2 -2
  51. package/http/lib/http.remote-method.d.ts +3 -3
  52. package/lib/base.remote-method.d.ts +2 -2
  53. package/lib/proxy.remote-method.d.ts +1 -1
  54. package/lib/remote-method-loader.d.ts +1 -1
  55. package/package.json +51 -42
  56. package/testing/index.d.ts +1 -5
  57. package/testing/lib/remote-method-testing-loader.d.ts +2 -2
  58. package/theme.css +1 -0
  59. package/collection.json +0 -25
  60. package/directive/public_api.d.ts +0 -5
  61. package/esm2022/directive/public_api.mjs +0 -6
  62. package/esm2022/http/directive/public_api.mjs +0 -3
  63. package/esm2022/http/public_api.mjs +0 -4
  64. package/esm2022/testing/public_api.mjs +0 -2
  65. package/http/directive/public_api.d.ts +0 -2
  66. package/http/public_api.d.ts +0 -3
  67. package/migration.json +0 -4
  68. package/src/schematics/base/files/__name@dasherize__.remote-method.ts.template +0 -14
  69. package/src/schematics/base/index.d.ts +0 -12
  70. package/src/schematics/base/index.js +0 -116
  71. package/src/schematics/base/index.js.map +0 -1
  72. package/src/schematics/base/schema.json +0 -54
  73. package/src/schematics/directive/index.d.ts +0 -18
  74. package/src/schematics/directive/index.js +0 -346
  75. package/src/schematics/directive/index.js.map +0 -1
  76. package/src/schematics/directive/schema.json +0 -50
  77. package/src/schematics/http/files/__name@dasherize__.remote-method.ts.template +0 -16
  78. package/src/schematics/http/index.d.ts +0 -3
  79. package/src/schematics/http/index.js +0 -26
  80. package/src/schematics/http/index.js.map +0 -1
  81. package/src/schematics/http/schema.json +0 -30
  82. package/src/schematics/ng-add/index.d.ts +0 -2
  83. package/src/schematics/ng-add/index.js +0 -8
  84. package/src/schematics/ng-add/index.js.map +0 -1
  85. package/src/schematics/ng-add/schema.json +0 -7
  86. package/testing/public_api.d.ts +0 -1
@@ -1,116 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AddExport = exports.CreateRemoteMethod = void 0;
4
- const tslib_1 = require("tslib");
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const workspace_1 = require("@schematics/angular/utility/workspace");
7
- const path_1 = require("path");
8
- const ts_morph_1 = require("ts-morph");
9
- const core_1 = require("@angular-devkit/core");
10
- const { classify, camelize, dasherize } = core_1.strings;
11
- function CreateRemoteMethod({ filePath, name, parametersType, returnType, collection }) {
12
- return tree => {
13
- if (tree.exists(filePath)) {
14
- console.warn(`The file '${filePath}' already exists!`);
15
- return;
16
- }
17
- const project = new ts_morph_1.Project({
18
- manipulationSettings: { quoteKind: ts_morph_1.QuoteKind.Single, indentationText: ts_morph_1.IndentationText.TwoSpaces, useTrailingCommas: true },
19
- useInMemoryFileSystem: true
20
- });
21
- const sourceFile = project.createSourceFile(filePath);
22
- const remoteMethodName = classify([name, 'remote-method'].join('-'));
23
- sourceFile.addClass({
24
- name: remoteMethodName,
25
- decorators: [
26
- {
27
- name: 'RxapRemoteMethod',
28
- arguments: [ts_morph_1.Writers.object({
29
- id: writer => writer.quote(dasherize(name))
30
- })]
31
- },
32
- {
33
- name: 'Injectable',
34
- arguments: [],
35
- }
36
- ],
37
- isExported: true,
38
- extends: `BaseRemoteMethod<${returnType}${collection ? '[]' : ''}, ${parametersType}>`,
39
- methods: [
40
- {
41
- name: '_call',
42
- isAsync: true,
43
- parameters: [
44
- {
45
- name: 'parameters',
46
- hasQuestionToken: true,
47
- type: parametersType
48
- }
49
- ],
50
- scope: ts_morph_1.Scope.Protected,
51
- returnType: `Promise<${returnType}${collection ? '[]' : ''}>`,
52
- statements: [
53
- `return Promise.reject('Not yet implemented')`,
54
- ]
55
- }
56
- ]
57
- });
58
- sourceFile.addImportDeclarations([
59
- {
60
- namedImports: [{ name: 'Injectable' }],
61
- moduleSpecifier: '@angular/core'
62
- },
63
- {
64
- moduleSpecifier: '@rxap/remote-method',
65
- namedImports: [
66
- { name: 'RxapRemoteMethod' },
67
- { name: 'BaseRemoteMethod' }
68
- ]
69
- }
70
- ]);
71
- tree.create(filePath, sourceFile.getFullText());
72
- };
73
- }
74
- exports.CreateRemoteMethod = CreateRemoteMethod;
75
- function AddExport(basePath, filePath) {
76
- return tree => {
77
- const indexFilePath = (0, path_1.join)(basePath, 'index.ts');
78
- if (!tree.exists(indexFilePath)) {
79
- console.warn('Could not find index file!');
80
- return;
81
- }
82
- const relPath = (0, path_1.relative)(basePath.replace(/^\//, ''), filePath.replace(/^\//, ''));
83
- let indexFile = tree.get(indexFilePath).content.toString('utf-8');
84
- indexFile += `\nexport * from './${relPath.replace(/\.ts$/, '')}';`;
85
- tree.overwrite(indexFilePath, indexFile);
86
- };
87
- }
88
- exports.AddExport = AddExport;
89
- function default_1(options) {
90
- return (host) => tslib_1.__awaiter(this, void 0, void 0, function* () {
91
- const projectBasePath = yield (0, workspace_1.createDefaultPath)(host, options.project);
92
- let path = projectBasePath;
93
- if (options.path) {
94
- if (options.path[0] === '/') {
95
- path = (0, path_1.join)(path, options.path);
96
- }
97
- else {
98
- path = options.path;
99
- }
100
- }
101
- const filePath = (0, path_1.join)(path, [dasherize(options.name), 'remote-method', 'ts'].join('.'));
102
- return (0, schematics_1.chain)([
103
- CreateRemoteMethod({
104
- filePath,
105
- name: options.name,
106
- collection: options.collection,
107
- returnType: options.returnType,
108
- parametersType: options.parametersType,
109
- }),
110
- (0, schematics_1.schematic)('directive', options),
111
- options.export ? AddExport((0, path_1.join)(projectBasePath, '..'), filePath) : (0, schematics_1.noop)(),
112
- ]);
113
- });
114
- }
115
- exports.default = default_1;
116
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/remote-method/src/schematics/base/index.ts"],"names":[],"mappings":";;;;AAAA,2DAMoC;AACpC,qEAA0E;AAC1E,+BAGc;AAEd,uCAOkB;AAElB,+CAA+C;AAE/C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,cAAO,CAAC;AAUlD,SAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAA6B;IACtH,OAAO,IAAI,CAAC,EAAE;QAEZ,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;YACzB,OAAO,CAAC,IAAI,CAAC,aAAa,QAAQ,mBAAmB,CAAC,CAAC;YACvD,OAAO;SACR;QAED,MAAM,OAAO,GAAG,IAAI,kBAAO,CAAC;YAC1B,oBAAoB,EAAG,EAAE,SAAS,EAAE,oBAAS,CAAC,MAAM,EAAE,eAAe,EAAE,0BAAe,CAAC,SAAS,EAAE,iBAAiB,EAAE,IAAI,EAAE;YAC3H,qBAAqB,EAAE,IAAI;SAC5B,CAAC,CAAC;QAEH,MAAM,UAAU,GAAe,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAElE,MAAM,gBAAgB,GAAG,QAAQ,CAAC,CAAE,IAAI,EAAE,eAAe,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAA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AAC;aACrB;SACF;QAED,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,CAAE,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,IAAI,CAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAE1F,OAAO,IAAA,kBAAK,EAAC;YACX,kBAAkB,CAAC;gBACjB,QAAQ;gBACR,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;aACvC,CAAC;YACF,IAAA,sBAAS,EAAC,WAAW,EAAE,OAAO,CAAC;YAC/B,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAA,WAAI,EAAC,eAAe,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAI,GAAE;SAC3E,CAAC,CAAC;IAEL,CAAC,CAAA,CAAC;AAEJ,CAAC;AA/BD,4BA+BC"}
@@ -1,54 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "base",
4
- "type": "object",
5
- "description": "",
6
- "properties": {
7
- "name": {
8
- "type": "string",
9
- "description": "",
10
- "$default": {
11
- "$source": "argv",
12
- "index": 0
13
- }
14
- },
15
- "path": {
16
- "type": "string",
17
- "format": "path",
18
- "description": "",
19
- "visible": false
20
- },
21
- "template": {
22
- "type": "boolean",
23
- "description": "",
24
- "default": false
25
- },
26
- "collection": {
27
- "type": "boolean",
28
- "description": "",
29
- "default": false
30
- },
31
- "parametersType": {
32
- "type": "string",
33
- "description": "",
34
- "default": "any"
35
- },
36
- "returnType": {
37
- "type": "string",
38
- "description": "",
39
- "default": "any"
40
- },
41
- "export": {
42
- "type": "boolean",
43
- "default": true
44
- },
45
- "project": {
46
- "type": "string",
47
- "description": "",
48
- "$default": {
49
- "$source": "projectName"
50
- }
51
- }
52
- },
53
- "required": []
54
- }
@@ -1,18 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { DirectiveSchema } from './schema';
3
- import { SourceFile } from 'ts-morph';
4
- export interface CreateDirectiveRuleOptions {
5
- filePath: string;
6
- name: string;
7
- prefix: string;
8
- parametersType: string;
9
- returnType: string;
10
- template: boolean;
11
- collection: boolean;
12
- }
13
- export interface CreateDirectiveOptions extends CreateDirectiveRuleOptions {
14
- sourceFile: SourceFile;
15
- }
16
- export declare function CreateDirective({ filePath, sourceFile, name, prefix, parametersType, returnType, template, collection, }: CreateDirectiveOptions): void;
17
- export declare function CreateDirectiveRule(options: CreateDirectiveRuleOptions): Rule;
18
- export default function (options: DirectiveSchema): Rule;
@@ -1,346 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateDirectiveRule = exports.CreateDirective = void 0;
4
- const tslib_1 = require("tslib");
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const workspace_1 = require("@schematics/angular/utility/workspace");
7
- const path_1 = require("path");
8
- const ts_morph_1 = require("ts-morph");
9
- const schematics_utilities_1 = require("@rxap/schematics-utilities");
10
- const core_1 = require("@angular-devkit/core");
11
- const { classify, camelize, dasherize } = core_1.strings;
12
- function AssertImportSpecifierStructureArray(obj) {
13
- if (!obj || !Array.isArray(obj)) {
14
- throw new Error('Should be a array of OptionalKind<ImportSpecifierStructure>');
15
- }
16
- }
17
- function CreateDirective({ filePath, sourceFile, name, prefix, parametersType, returnType, template, collection, }) {
18
- const remoteMethodName = classify([name, 'remote-method'].join('-'));
19
- if (!sourceFile.getClass(remoteMethodName)) {
20
- console.warn(`A remote method class with the name '${remoteMethodName}' is not declared in the file '${filePath}'.`);
21
- return;
22
- }
23
- const directiveName = classify([remoteMethodName, 'directive'].join('-'));
24
- const classDeclaration = sourceFile.getClass(directiveName);
25
- if (classDeclaration) {
26
- console.warn(`A class with name '${directiveName}' already exists in the file '${filePath}'!`);
27
- return;
28
- }
29
- // region build selector
30
- const selectorFragments = [prefix, name];
31
- if (collection) {
32
- selectorFragments.push('collection');
33
- }
34
- selectorFragments.push('remote-method');
35
- const selector = camelize(selectorFragments.join('-'));
36
- // endregion
37
- const ctorsParameters = [
38
- {
39
- name: 'remoteMethodLoader',
40
- type: 'RemoteMethodLoader',
41
- decorators: [
42
- {
43
- name: 'Inject',
44
- arguments: ['RemoteMethodLoader'],
45
- },
46
- ],
47
- },
48
- {
49
- name: 'injector',
50
- type: 'Injector',
51
- decorators: [
52
- {
53
- name: 'Inject',
54
- arguments: ['INJECTOR'],
55
- },
56
- ],
57
- },
58
- {
59
- name: 'remoteMethod',
60
- type: remoteMethodName,
61
- decorators: [
62
- {
63
- name: 'Inject',
64
- arguments: [remoteMethodName],
65
- },
66
- ],
67
- },
68
- ];
69
- let ctorsSupperCallParameters = ['remoteMethodLoader', 'injector'].join(', ');
70
- let directiveClassExtends;
71
- const remoteMethodDirectiveImportStructure = {
72
- namedImports: [],
73
- moduleSpecifier: '@rxap/remote-method/directive',
74
- };
75
- const remoteMethodImportStructure = {
76
- namedImports: [{ name: 'RemoteMethodLoader' }],
77
- moduleSpecifier: '@rxap/remote-method',
78
- };
79
- const angularCoreImportStructure = {
80
- namedImports: [
81
- { name: 'Inject' },
82
- { name: 'Directive' },
83
- { name: 'NgModule' },
84
- { name: 'INJECTOR' },
85
- { name: 'Injector' },
86
- ],
87
- moduleSpecifier: '@angular/core',
88
- };
89
- const directiveClassProperties = [];
90
- const directiveClassSetAccessors = [];
91
- const ctorsStatements = [];
92
- const importStructure = [
93
- angularCoreImportStructure,
94
- remoteMethodImportStructure,
95
- remoteMethodDirectiveImportStructure,
96
- ];
97
- AssertImportSpecifierStructureArray(angularCoreImportStructure.namedImports);
98
- AssertImportSpecifierStructureArray(remoteMethodImportStructure.namedImports);
99
- AssertImportSpecifierStructureArray(remoteMethodDirectiveImportStructure.namedImports);
100
- if (template) {
101
- if (parametersType === 'void') {
102
- ctorsStatements.push('this.withoutParameters = true;');
103
- }
104
- angularCoreImportStructure.namedImports.push({ name: 'TemplateRef' });
105
- ctorsSupperCallParameters = [
106
- 'template',
107
- 'remoteMethodLoader',
108
- 'injector',
109
- 'viewContainerRef',
110
- 'cdr',
111
- ].join(', ');
112
- directiveClassProperties.push({
113
- name: 'parameters',
114
- hasQuestionToken: true,
115
- scope: ts_morph_1.Scope.Public,
116
- type: parametersType,
117
- decorators: [
118
- {
119
- name: 'Input',
120
- arguments: [
121
- (writer) => writer.quote(camelize([selector, 'Parameters'].join('-'))),
122
- ],
123
- },
124
- ],
125
- });
126
- if (collection) {
127
- ctorsSupperCallParameters = [
128
- ctorsSupperCallParameters,
129
- 'differs',
130
- 'zone',
131
- ].join(', ');
132
- directiveClassExtends = `RemoteMethodTemplateCollectionDirective<${returnType}, ${parametersType}>`;
133
- remoteMethodDirectiveImportStructure.namedImports.push({
134
- name: 'RemoteMethodTemplateCollectionDirective',
135
- });
136
- ctorsParameters.push({
137
- name: 'template',
138
- type: `TemplateRef<RemoteMethodTemplateCollectionDirectiveContext<${returnType}>>`,
139
- decorators: [
140
- {
141
- name: 'Inject',
142
- arguments: ['TemplateRef'],
143
- },
144
- ],
145
- }, {
146
- name: 'differs',
147
- type: 'IterableDiffers',
148
- decorators: [
149
- {
150
- name: 'Inject',
151
- arguments: ['IterableDiffers'],
152
- },
153
- ],
154
- }, {
155
- name: 'zone',
156
- type: 'NgZone',
157
- decorators: [
158
- {
159
- name: 'Inject',
160
- arguments: ['NgZone'],
161
- },
162
- ],
163
- });
164
- remoteMethodDirectiveImportStructure.namedImports.push({ name: 'RemoteMethodTemplateCollectionDirectiveContext' }, { name: 'RemoteMethodTemplateCollectionDirectiveErrorContext' });
165
- directiveClassProperties.push({
166
- name: 'errorTemplate',
167
- hasQuestionToken: true,
168
- scope: ts_morph_1.Scope.Public,
169
- type: `TemplateRef<RemoteMethodTemplateCollectionDirectiveErrorContext>`,
170
- decorators: [
171
- {
172
- name: 'Input',
173
- arguments: [
174
- (writer) => writer.quote(camelize([selector, 'Error'].join('-'))),
175
- ],
176
- },
177
- ],
178
- }, {
179
- name: 'emptyTemplate',
180
- leadingTrivia: '// tslint:disable-next-line:no-input-rename',
181
- hasQuestionToken: true,
182
- scope: ts_morph_1.Scope.Public,
183
- type: 'TemplateRef<void>',
184
- decorators: [
185
- {
186
- name: 'Input',
187
- arguments: [
188
- (writer) => writer.quote(camelize([selector, 'Empty'].join('-'))),
189
- ],
190
- },
191
- ],
192
- });
193
- angularCoreImportStructure.namedImports.push({ name: 'IterableDiffers' }, { name: 'NgZone' });
194
- }
195
- else {
196
- directiveClassExtends = `RemoteMethodTemplateDirective<${returnType}, ${parametersType}>`;
197
- remoteMethodDirectiveImportStructure.namedImports.push({
198
- name: 'RemoteMethodTemplateDirective',
199
- });
200
- ctorsParameters.push({
201
- name: 'template',
202
- type: `TemplateRef<RemoteMethodTemplateDirectiveContext<${returnType}>>`,
203
- decorators: [
204
- {
205
- name: 'Inject',
206
- arguments: ['TemplateRef'],
207
- },
208
- ],
209
- });
210
- remoteMethodDirectiveImportStructure.namedImports.push({ name: 'RemoteMethodTemplateDirectiveContext' }, { name: 'RemoteMethodTemplateDirectiveErrorContext' });
211
- directiveClassProperties.push({
212
- name: 'errorTemplate',
213
- hasQuestionToken: true,
214
- type: `TemplateRef<RemoteMethodTemplateDirectiveErrorContext>`,
215
- scope: ts_morph_1.Scope.Public,
216
- decorators: [
217
- {
218
- name: 'Input',
219
- arguments: [
220
- (writer) => writer.quote(camelize([selector, 'Error'].join('-'))),
221
- ],
222
- },
223
- ],
224
- });
225
- }
226
- ctorsParameters.push({
227
- name: 'viewContainerRef',
228
- type: 'ViewContainerRef',
229
- decorators: [
230
- {
231
- name: 'Inject',
232
- arguments: ['ViewContainerRef'],
233
- },
234
- ],
235
- }, {
236
- name: 'cdr',
237
- type: 'ChangeDetectorRef',
238
- decorators: [
239
- {
240
- name: 'Inject',
241
- arguments: ['ChangeDetectorRef'],
242
- },
243
- ],
244
- });
245
- angularCoreImportStructure.namedImports.push({ name: 'ChangeDetectorRef' }, { name: 'ViewContainerRef' }, { name: 'Input' });
246
- }
247
- else {
248
- directiveClassExtends = `RemoteMethodDirective<${returnType}, ${parametersType}>`;
249
- remoteMethodDirectiveImportStructure.namedImports.push({
250
- name: 'RemoteMethodDirective',
251
- });
252
- }
253
- const directiveClassStructure = {
254
- name: directiveName,
255
- decorators: [
256
- {
257
- name: 'Directive',
258
- arguments: ts_morph_1.Writers.object({
259
- selector: (writer) => writer.quote(`[${selector}]`),
260
- exportAs: (writer) => writer.quote(selector),
261
- }),
262
- },
263
- ],
264
- extends: directiveClassExtends,
265
- ctors: [
266
- {
267
- parameters: ctorsParameters,
268
- statements: [
269
- `super(${ctorsSupperCallParameters});`,
270
- 'this.remoteMethodOrIdOrToken = remoteMethod;',
271
- ...ctorsStatements,
272
- ],
273
- },
274
- ],
275
- setAccessors: directiveClassSetAccessors,
276
- properties: directiveClassProperties,
277
- isExported: true,
278
- };
279
- const directiveModuleClassStructure = {
280
- name: directiveName + 'Module',
281
- decorators: [
282
- {
283
- name: 'NgModule',
284
- arguments: [
285
- ts_morph_1.Writers.object({
286
- declarations: `[ ${directiveName} ]`,
287
- exports: `[ ${directiveName} ]`,
288
- }),
289
- ],
290
- },
291
- ],
292
- isExported: true,
293
- };
294
- sourceFile.addClass(directiveClassStructure);
295
- sourceFile.addClass(directiveModuleClassStructure);
296
- sourceFile.addImportDeclarations(importStructure);
297
- }
298
- exports.CreateDirective = CreateDirective;
299
- function CreateDirectiveRule(options) {
300
- return (tree) => {
301
- if (!tree.exists(options.filePath)) {
302
- console.warn(`The file '${options.filePath}' does not exists!`);
303
- return;
304
- }
305
- const project = new ts_morph_1.Project({
306
- manipulationSettings: {
307
- quoteKind: ts_morph_1.QuoteKind.Single,
308
- indentationText: ts_morph_1.IndentationText.TwoSpaces,
309
- useTrailingCommas: true,
310
- },
311
- useInMemoryFileSystem: true,
312
- });
313
- const sourceFile = project.createSourceFile(options.filePath, tree.get(options.filePath).content.toString('utf-8'));
314
- CreateDirective(Object.assign(Object.assign({}, options), { sourceFile }));
315
- if (sourceFile) {
316
- tree.overwrite(options.filePath, sourceFile.getFullText());
317
- }
318
- };
319
- }
320
- exports.CreateDirectiveRule = CreateDirectiveRule;
321
- function default_1(options) {
322
- return (host) => tslib_1.__awaiter(this, void 0, void 0, function* () {
323
- const projectRootPath = yield (0, workspace_1.createDefaultPath)(host, options.project);
324
- if (!options.path) {
325
- options.path = projectRootPath;
326
- }
327
- else if (options.path[0] === '/') {
328
- options.path = (0, path_1.join)(projectRootPath, options.path);
329
- }
330
- const filePath = (0, path_1.join)(options.path, [dasherize(options.name), 'remote-method', 'ts'].join('.'));
331
- const prefix = (0, schematics_utilities_1.GetProjectPrefix)(host, options.project);
332
- return (0, schematics_1.chain)([
333
- CreateDirectiveRule({
334
- prefix,
335
- filePath,
336
- name: options.name,
337
- template: options.template || options.collection,
338
- collection: options.collection,
339
- returnType: options.returnType,
340
- parametersType: options.parametersType,
341
- }),
342
- ]);
343
- });
344
- }
345
- exports.default = default_1;
346
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/remote-method/src/schematics/directive/index.ts"],"names":[],"mappings":";;;;AAAA,2DAIoC;AACpC,qEAA0E;AAC1E,+BAA4B;AAE5B,uCAekB;AAClB,qEAA8D;AAC9D,+CAA+C;AAE/C,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,cAAO,CAAC;AAgBlD,SAAS,mCAAmC,CAC1C,GAAQ;IAER,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAC/B,MAAM,IAAI,KAAK,CACb,6DAA6D,CAC9D,CAAC;KACH;AACH,CAAC;AAED,SAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,UAAU,EACV,IAAI,EACJ,MAAM,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M,IAAA,6BAAiB,EAC7C,IAAI,EACJ,OAAO,CAAC,OAAiB,CAC1B,CAAC;QAEF,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YACjB,OAAO,CAAC,IAAI,GAAG,eAAe,CAAC;SAChC;aAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YAClC,OAAO,CAAC,IAAI,GAAG,IAAA,WAAI,EAAC,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;SACpD;QAED,MAAM,QAAQ,GAAG,IAAA,WAAI,EACnB,OAAO,CAAC,IAAI,EACZ,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAC3D,CAAC;QAEF,MAAM,MAAM,GAAG,IAAA,uCAAgB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEvD,OAAO,IAAA,kBAAK,EAAC;YACX,mBAAmB,CAAC;gBAClB,MAAM;gBACN,QAAQ;gBACR,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,UAAU;gBAChD,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,cAAc,EAAE,OAAO,CAAC,cAAc;aACvC,CAAC;SACH,CAAC,CAAC;IACL,CAAC,CAAA,CAAC;AACJ,CAAC;AAhCD,4BAgCC"}
@@ -1,50 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "$id": "directive",
4
- "type": "object",
5
- "description": "",
6
- "properties": {
7
- "name": {
8
- "type": "string",
9
- "description": "",
10
- "$default": {
11
- "$source": "argv",
12
- "index": 0
13
- }
14
- },
15
- "path": {
16
- "type": "string",
17
- "format": "path",
18
- "description": "",
19
- "visible": false
20
- },
21
- "template": {
22
- "type": "boolean",
23
- "description": "",
24
- "default": false
25
- },
26
- "collection": {
27
- "type": "boolean",
28
- "description": "",
29
- "default": false
30
- },
31
- "parametersType": {
32
- "type": "string",
33
- "description": "",
34
- "default": "any"
35
- },
36
- "returnType": {
37
- "type": "string",
38
- "description": "",
39
- "default": "any"
40
- },
41
- "project": {
42
- "type": "string",
43
- "description": "",
44
- "$default": {
45
- "$source": "projectName"
46
- }
47
- }
48
- },
49
- "required": []
50
- }
@@ -1,16 +0,0 @@
1
- import { RxapRemoteMethod, HttpRemoteMethod, HttpRemoteMethodParameter } from '@rxap/remote-method';
2
- import { Injectable } from '@angular/core';
3
-
4
- @RxapRemoteMethod({
5
- id: '<%= dasherize(name) %>',
6
- url: '',
7
- method: '',
8
- })
9
- @Injectable()
10
- export class <%= classify(name) %>RemoteMethod extends HttpRemoteMethod {
11
-
12
- public createHttpRequestParameters(parameters?: any): Partial<HttpRemoteMethodParameter> {
13
- return parameters ?? {} as any;
14
- }
15
-
16
- }
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { HttpSchema } from './schema';
3
- export default function (options: HttpSchema): Rule;
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const workspace_1 = require("@schematics/angular/utility/workspace");
6
- const path_1 = require("path");
7
- const core_1 = require("@angular-devkit/core");
8
- function default_1(options) {
9
- return (host) => tslib_1.__awaiter(this, void 0, void 0, function* () {
10
- const projectRootPath = yield (0, workspace_1.createDefaultPath)(host, options.project);
11
- if (!options.path) {
12
- options.path = projectRootPath;
13
- }
14
- else if (options.path[0] === '/') {
15
- options.path = (0, path_1.join)(projectRootPath, options.path);
16
- }
17
- return (0, schematics_1.chain)([
18
- (0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files'), [
19
- (0, schematics_1.applyTemplates)(Object.assign(Object.assign({}, core_1.strings), options)),
20
- (0, schematics_1.move)(options.path)
21
- ]))
22
- ]);
23
- });
24
- }
25
- exports.default = default_1;
26
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../libs/remote-method/src/schematics/http/index.ts"],"names":[],"mappings":";;;AAAA,2DASoC;AACpC,qEAA0E;AAC1E,+BAA4B;AAC5B,+CAA+C;AAG/C,mBAAwB,OAAmB;IAEzC,OAAO,CAAO,IAAU,EAAE,EAAE;QAE1B,MAAM,eAAe,GAAG,MAAM,IAAA,6BAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAiB,CAAC,CAAC;QAEjF,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YACjB,OAAO,CAAC,IAAI,GAAG,eAAe,CAAC;SAChC;aAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YAClC,OAAO,CAAC,IAAI,GAAG,IAAA,WAAI,EAAC,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;SACpD;QAED,OAAO,IAAA,kBAAK,EAAC;YACX,IAAA,sBAAS,EAAC,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,SAAS,CAAC,EAAE;gBAC9B,IAAA,2BAAc,kCACT,cAAO,GACP,OAAO,EACV;gBACF,IAAA,iBAAI,EAAC,OAAO,CAAC,IAAI,CAAC;aACnB,CAAC,CAAC;SACJ,CAAC,CAAC;IAEL,CAAC,CAAA,CAAC;AAEJ,CAAC;AAxBD,4BAwBC"}