@vcd/sdk 0.13.0 → 15.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 (91) hide show
  1. package/README.md +3 -118
  2. package/client/client/api.result.service.d.ts +20 -0
  3. package/client/client/constants.d.ts +10 -0
  4. package/client/client/index.d.ts +7 -0
  5. package/client/client/logging.interceptor.d.ts +14 -0
  6. package/client/client/request.headers.interceptor.d.ts +20 -0
  7. package/client/client/response.normalization.interceptor.d.ts +39 -0
  8. package/client/client/vcd.api.client.d.ts +351 -0
  9. package/client/client/vcd.http.client.d.ts +32 -0
  10. package/client/client/vcd.transfer.client.d.ts +121 -0
  11. package/client/container-hooks/index.d.ts +58 -0
  12. package/client/index.d.ts +2 -0
  13. package/client/openapi.d.ts +76 -0
  14. package/client/query/filter.builder.d.ts +162 -0
  15. package/client/query/index.d.ts +2 -0
  16. package/client/query/query.builder.d.ts +30 -0
  17. package/common/container-hooks.d.ts +2 -2
  18. package/core/plugin.module.d.ts +10 -5
  19. package/esm2020/client/client/api.result.service.mjs +43 -0
  20. package/esm2020/client/client/constants.mjs +13 -0
  21. package/esm2020/client/client/index.mjs +8 -0
  22. package/esm2020/client/client/logging.interceptor.mjs +44 -0
  23. package/esm2020/client/client/request.headers.interceptor.mjs +91 -0
  24. package/esm2020/client/client/response.normalization.interceptor.mjs +59 -0
  25. package/esm2020/client/client/vcd.api.client.mjs +602 -0
  26. package/esm2020/client/client/vcd.http.client.mjs +52 -0
  27. package/esm2020/client/client/vcd.transfer.client.mjs +166 -0
  28. package/esm2020/client/container-hooks/index.mjs +57 -0
  29. package/esm2020/client/index.mjs +3 -0
  30. package/esm2020/client/openapi.mjs +16 -0
  31. package/esm2020/client/query/filter.builder.mjs +195 -0
  32. package/esm2020/client/query/index.mjs +3 -0
  33. package/esm2020/client/query/query.builder.mjs +79 -0
  34. package/esm2020/common/container-hooks.mjs +74 -0
  35. package/esm2020/common/index.mjs +2 -0
  36. package/esm2020/core/index.mjs +2 -0
  37. package/esm2020/core/plugin.module.mjs +18 -0
  38. package/esm2020/main.mjs +45 -0
  39. package/esm2020/public-api.mjs +8 -0
  40. package/esm2020/vcd-sdk.mjs +5 -0
  41. package/fesm2015/vcd-sdk.mjs +1513 -0
  42. package/fesm2015/vcd-sdk.mjs.map +1 -0
  43. package/fesm2020/vcd-sdk.mjs +1508 -0
  44. package/fesm2020/vcd-sdk.mjs.map +1 -0
  45. package/index.d.ts +5 -0
  46. package/main.d.ts +11 -5
  47. package/package.json +30 -39
  48. package/public-api.d.ts +1 -1
  49. package/LICENSE.txt +0 -12
  50. package/bundles/vcd-sdk.umd.js +0 -810
  51. package/bundles/vcd-sdk.umd.js.map +0 -1
  52. package/bundles/vcd-sdk.umd.min.js +0 -16
  53. package/bundles/vcd-sdk.umd.min.js.map +0 -1
  54. package/esm2015/common/container-hooks.js +0 -219
  55. package/esm2015/common/index.js +0 -6
  56. package/esm2015/core/index.js +0 -6
  57. package/esm2015/core/plugin.module.js +0 -53
  58. package/esm2015/i18n/index.js +0 -8
  59. package/esm2015/i18n/translate.pipe.js +0 -92
  60. package/esm2015/i18n/translate.service.js +0 -229
  61. package/esm2015/i18n/translation.loader.js +0 -63
  62. package/esm2015/main.js +0 -37
  63. package/esm2015/public-api.js +0 -12
  64. package/esm2015/vcd-sdk.js +0 -10
  65. package/esm5/common/container-hooks.js +0 -266
  66. package/esm5/common/index.js +0 -6
  67. package/esm5/core/index.js +0 -6
  68. package/esm5/core/plugin.module.js +0 -64
  69. package/esm5/i18n/index.js +0 -8
  70. package/esm5/i18n/translate.pipe.js +0 -108
  71. package/esm5/i18n/translate.service.js +0 -280
  72. package/esm5/i18n/translation.loader.js +0 -68
  73. package/esm5/main.js +0 -41
  74. package/esm5/public-api.js +0 -12
  75. package/esm5/vcd-sdk.js +0 -10
  76. package/fesm2015/vcd-sdk.js +0 -511
  77. package/fesm2015/vcd-sdk.js.map +0 -1
  78. package/fesm5/vcd-sdk.js +0 -620
  79. package/fesm5/vcd-sdk.js.map +0 -1
  80. package/i18n/index.d.ts +0 -3
  81. package/i18n/translate.pipe.d.ts +0 -12
  82. package/i18n/translate.service.d.ts +0 -21
  83. package/i18n/translation.loader.d.ts +0 -11
  84. package/schematics/collection.json +0 -10
  85. package/schematics/ng-add/index.d.ts +0 -3
  86. package/schematics/ng-add/index.js +0 -101
  87. package/schematics/ng-add/index.ts +0 -134
  88. package/schematics/ng-add/schema.d.ts +0 -8
  89. package/schematics/ng-add/schema.json +0 -19
  90. package/vcd-sdk.d.ts +0 -5
  91. package/vcd-sdk.metadata.json +0 -1
@@ -1,21 +0,0 @@
1
- import { TranslationLoader } from './translation.loader';
2
- import { Observable } from 'rxjs';
3
- export declare class TranslateService {
4
- private loader;
5
- private translation$;
6
- private pending;
7
- translations: any;
8
- private _combinedTranslations;
9
- combinedTranslations: boolean;
10
- private _selectedLanguage;
11
- private _supportedLanguages;
12
- supportedLanguages: string[];
13
- private _defaultLanguage;
14
- defaultLanguage: string;
15
- constructor(loader: TranslationLoader);
16
- prepareTranslations(supportedLanguages: string[], defaultLanguage: string): void;
17
- private getBestMatchSupportedLanguage;
18
- getTranslation(language: string): Observable<any>;
19
- private getParsedResult;
20
- get(key: string, ...args: any[]): Observable<string | any>;
21
- }
@@ -1,11 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { Observable } from 'rxjs';
3
- export declare class TranslationLoader {
4
- private http;
5
- private assetUrl;
6
- private static PREFIX;
7
- private static SUFFIX;
8
- constructor(http: HttpClient, assetUrl: string);
9
- getTranslation(language: string): Observable<any>;
10
- getCombinedTranslation(): Observable<any>;
11
- }
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "../../../../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3
- "schematics": {
4
- "ng-add": {
5
- "description": "Install and setup the vcd/sdk package",
6
- "factory": "./ng-add/index#ngAdd",
7
- "schema": "./ng-add/schema.json"
8
- }
9
- }
10
- }
@@ -1,3 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { Schema } from './schema';
3
- export declare function ngAdd(options: Schema): Rule;
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const schematics_1 = require("@angular-devkit/schematics");
4
- const config_1 = require("@schematics/angular/utility/config");
5
- const ng_ast_utils_1 = require("@schematics/angular/utility/ng-ast-utils");
6
- const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
7
- const change_1 = require("@schematics/angular/utility/change");
8
- const ts = require("@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript");
9
- function ngAdd(options) {
10
- return schematics_1.chain([
11
- options && (options.skipModuleImport || !options.moduleName) ? schematics_1.noop() : addModuleToImports(options),
12
- ]);
13
- }
14
- exports.ngAdd = ngAdd;
15
- function addModuleToImports(options) {
16
- return (host, context) => {
17
- const workspace = config_1.getWorkspace(host);
18
- const project = getProjectFromWorkspace(workspace,
19
- // Takes the first project in case it's not provided by CLI
20
- (options.project ? options.project : Object.keys(workspace['projects'])[0]));
21
- const { moduleName } = options;
22
- if (options.importInModule && options.importInModule.length) {
23
- addModuleImportTo(host, moduleName, '@vcd/sdk', options.importInModule);
24
- }
25
- else {
26
- addModuleImportToRootModule(host, moduleName, '@vcd/sdk', project);
27
- }
28
- context.logger.log('info', `✅️ "${moduleName}" is imported`);
29
- context.logger.log('info', `✅️ VcdApiClient is imported`);
30
- return host;
31
- };
32
- }
33
- /**
34
- * Finds the specified project configuration in the workspace. Throws an error if the project
35
- * couldn't be found.
36
- */
37
- function getProjectFromWorkspace(workspace, projectName) {
38
- const project = workspace.projects[projectName || workspace.defaultProject];
39
- if (!project) {
40
- throw new schematics_1.SchematicsException(`Could not find project in workspace: ${projectName}`);
41
- }
42
- return project;
43
- }
44
- /** Import and add module to root app module. */
45
- function addModuleImportToRootModule(host, moduleName, src, project) {
46
- const modulePath = ng_ast_utils_1.getAppModulePath(host, getProjectMainFile(project));
47
- addModuleImportToModule(host, modulePath, moduleName, src);
48
- }
49
- /** Import and add module to selected module. */
50
- function addModuleImportTo(host, moduleName, src, pathToModule) {
51
- addModuleImportToModule(host, pathToModule, moduleName, src);
52
- }
53
- /** Looks for the main TypeScript file in the given project and returns its path. */
54
- function getProjectMainFile(project) {
55
- const buildOptions = getProjectTargetOptions(project, 'build');
56
- if (!buildOptions.main) {
57
- throw new schematics_1.SchematicsException(`Could not find the project main file inside of the ` + `workspace config (${project.sourceRoot})`);
58
- }
59
- return buildOptions.main;
60
- }
61
- /** Resolves the architect options for the build target of the given project. */
62
- function getProjectTargetOptions(project, buildTarget) {
63
- if (project.targets && project.targets[buildTarget] && project.targets[buildTarget].options) {
64
- return project.targets[buildTarget].options;
65
- }
66
- if (project.architect && project.architect[buildTarget] && project.architect[buildTarget].options) {
67
- return project.architect[buildTarget].options;
68
- }
69
- throw new schematics_1.SchematicsException(`Cannot determine project target configuration for: ${buildTarget}.`);
70
- }
71
- /**
72
- * Import and add module to specific module path.
73
- * @param host the tree we are updating
74
- * @param modulePath src location of the module to import
75
- * @param moduleName name of module to import
76
- * @param src src location to import
77
- */
78
- function addModuleImportToModule(host, modulePath, moduleName, src) {
79
- const moduleSource = getSourceFile(host, modulePath);
80
- if (!moduleSource) {
81
- throw new schematics_1.SchematicsException(`Module not found: ${modulePath}`);
82
- }
83
- const changes = [];
84
- changes.push(...ast_utils_1.addImportToModule(moduleSource, modulePath, moduleName, src));
85
- changes.push(...ast_utils_1.addProviderToModule(moduleSource, '@vcd/sdk', 'VcdApiClient', src));
86
- const recorder = host.beginUpdate(modulePath);
87
- changes.forEach((change) => {
88
- if (change instanceof change_1.InsertChange) {
89
- recorder.insertLeft(change.pos, change.toAdd);
90
- }
91
- });
92
- host.commitUpdate(recorder);
93
- }
94
- /** Reads file given path and returns TypeScript source file. */
95
- function getSourceFile(host, path) {
96
- const buffer = host.read(path);
97
- if (!buffer) {
98
- throw new schematics_1.SchematicsException(`Could not find file for path: ${path}`);
99
- }
100
- return ts.createSourceFile(path, buffer.toString(), ts.ScriptTarget.Latest, true);
101
- }
@@ -1,134 +0,0 @@
1
- import { Rule, SchematicContext, Tree, chain, noop, SchematicsException } from '@angular-devkit/schematics';
2
- import {
3
- getWorkspace,
4
- } from '@schematics/angular/utility/config';
5
- import { WorkspaceSchema, WorkspaceProject } from "@schematics/angular/utility/workspace-models";
6
- import {
7
- getAppModulePath,
8
- } from '@schematics/angular/utility/ng-ast-utils';
9
- import {
10
- addImportToModule, addProviderToModule,
11
- } from '@schematics/angular/utility/ast-utils';
12
- import {
13
- InsertChange, Change,
14
- } from '@schematics/angular/utility/change';
15
- import { Schema } from './schema';
16
- import * as ts from "@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript";
17
-
18
- export function ngAdd(options: Schema): Rule {
19
- return chain([
20
- options && (options.skipModuleImport || !options.moduleName) ? noop() : addModuleToImports(options),
21
- ]);
22
- }
23
-
24
- function addModuleToImports(options: Schema): Rule {
25
- return (host: Tree, context: SchematicContext) => {
26
- const workspace = getWorkspace(host);
27
- const project = getProjectFromWorkspace(
28
- workspace,
29
- // Takes the first project in case it's not provided by CLI
30
- (options.project ? options.project : Object.keys(workspace['projects'])[0]) as string
31
- );
32
- const {moduleName} = options;
33
-
34
- if (options.importInModule && options.importInModule.length) {
35
- addModuleImportTo(host, moduleName, '@vcd/sdk', options.importInModule);
36
- } else {
37
- addModuleImportToRootModule(host, moduleName, '@vcd/sdk', project);
38
- }
39
-
40
- context.logger.log('info', `✅️ "${moduleName}" is imported`);
41
- context.logger.log('info', `✅️ VcdApiClient is imported`);
42
-
43
- return host;
44
- };
45
- }
46
-
47
- /**
48
- * Finds the specified project configuration in the workspace. Throws an error if the project
49
- * couldn't be found.
50
- */
51
- function getProjectFromWorkspace(workspace: WorkspaceSchema, projectName?: string): WorkspaceProject {
52
- const project = workspace.projects[projectName || workspace.defaultProject!];
53
-
54
- if (!project) {
55
- throw new SchematicsException(`Could not find project in workspace: ${projectName}`);
56
- }
57
-
58
- return project as WorkspaceProject;
59
- }
60
-
61
- /** Import and add module to root app module. */
62
- function addModuleImportToRootModule(host: Tree, moduleName: string, src: string, project: WorkspaceProject) {
63
- const modulePath = getAppModulePath(host, getProjectMainFile(project));
64
- addModuleImportToModule(host, modulePath, moduleName, src);
65
- }
66
-
67
- /** Import and add module to selected module. */
68
- function addModuleImportTo(host: Tree, moduleName: string, src: string, pathToModule: string) {
69
- addModuleImportToModule(host, pathToModule, moduleName, src);
70
- }
71
-
72
- /** Looks for the main TypeScript file in the given project and returns its path. */
73
- function getProjectMainFile(project: WorkspaceProject): string {
74
- const buildOptions = getProjectTargetOptions(project, 'build');
75
-
76
- if (!buildOptions.main) {
77
- throw new SchematicsException(
78
- `Could not find the project main file inside of the ` + `workspace config (${project.sourceRoot})`
79
- );
80
- }
81
-
82
- return buildOptions.main;
83
- }
84
-
85
- /** Resolves the architect options for the build target of the given project. */
86
- function getProjectTargetOptions(project: WorkspaceProject, buildTarget: string) {
87
- if (project.targets && project.targets[buildTarget] && project.targets[buildTarget].options) {
88
- return project.targets[buildTarget].options;
89
- }
90
-
91
- if (project.architect && project.architect[buildTarget] && project.architect[buildTarget].options) {
92
- return project.architect[buildTarget].options;
93
- }
94
-
95
- throw new SchematicsException(`Cannot determine project target configuration for: ${buildTarget}.`);
96
- }
97
-
98
- /**
99
- * Import and add module to specific module path.
100
- * @param host the tree we are updating
101
- * @param modulePath src location of the module to import
102
- * @param moduleName name of module to import
103
- * @param src src location to import
104
- */
105
- function addModuleImportToModule(host: Tree, modulePath: string, moduleName: string, src: string) {
106
- const moduleSource = getSourceFile(host, modulePath);
107
-
108
- if (!moduleSource) {
109
- throw new SchematicsException(`Module not found: ${modulePath}`);
110
- }
111
-
112
- const changes: Change[] = [];
113
- changes.push(...addImportToModule(<any>moduleSource, modulePath, moduleName, src));
114
- changes.push(...addProviderToModule(<any>moduleSource, '@vcd/sdk', 'VcdApiClient', src));
115
- const recorder = host.beginUpdate(modulePath);
116
-
117
- changes.forEach((change: any) => {
118
- if (change instanceof InsertChange) {
119
- recorder.insertLeft(change.pos, change.toAdd);
120
- }
121
- });
122
-
123
- host.commitUpdate(recorder);
124
- }
125
-
126
- /** Reads file given path and returns TypeScript source file. */
127
- function getSourceFile(host: Tree, path: string): ts.SourceFile {
128
- const buffer = host.read(path);
129
- if (!buffer) {
130
- throw new SchematicsException(`Could not find file for path: ${path}`);
131
- }
132
- return ts.createSourceFile(path, buffer.toString(), ts.ScriptTarget.Latest, true);
133
- }
134
-
@@ -1,8 +0,0 @@
1
- import { WorkspaceProject, ProjectType } from "@schematics/angular/utility/workspace-models";
2
-
3
- export interface Schema {
4
- skipModuleImport: boolean;
5
- moduleName: string;
6
- importInModule: string;
7
- project: WorkspaceProject<ProjectType.Application | ProjectType.Library>;
8
- }
@@ -1,19 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "properties": {
4
- "skipModuleImport": {
5
- "type": "boolean"
6
- },
7
- "moduleName": {
8
- "type": "string",
9
- "default": "VcdSdkModule",
10
- "x-prompt": "What is the name of the module which you want to import?"
11
- },
12
- "importInModule": {
13
- "type": "string",
14
- "description": "Enter the relative path to the module.",
15
- "optional": true,
16
- "x-prompt": "In which module do you want to import it? (Optional)"
17
- }
18
- }
19
- }
package/vcd-sdk.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
5
- export { TranslatePipe as ɵa, TranslateService as ɵb, TranslationLoader as ɵc } from './i18n';
@@ -1 +0,0 @@
1
- {"__symbolic":"module","version":4,"exports":[{"from":"@vcd/angular-client"}],"metadata":{"common":{"__symbolic":"error","message":"Unsupported bundled module reference","context":{"module":"./common"}},"core":{"__symbolic":"error","message":"Unsupported bundled module reference","context":{"module":"./core"}},"i18n":{"__symbolic":"error","message":"Unsupported bundled module reference","context":{"module":"./i18n"}},"VcdSdkModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":18,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common/http","name":"HttpClientModule","line":20,"character":4},{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":21,"character":4}],"declarations":[{"__symbolic":"reference","name":"ɵa"}],"exports":[{"__symbolic":"reference","name":"ɵa"}],"providers":[{"__symbolic":"reference","name":"ɵb"},{"__symbolic":"reference","name":"ɵc"},{"__symbolic":"reference","module":"@vcd/angular-client","name":"RequestHeadersInterceptor","line":28,"character":4},{"__symbolic":"reference","module":"@vcd/angular-client","name":"LoggingInterceptor","line":29,"character":4},{"__symbolic":"reference","module":"@vcd/angular-client","name":"ResponseNormalizationInterceptor","line":30,"character":4},{"__symbolic":"reference","module":"@vcd/angular-client","name":"VcdHttpClient","line":31,"character":4},{"__symbolic":"reference","module":"@vcd/angular-client","name":"VcdApiClient","line":32,"character":4}]}]}],"members":{}}},"origins":{"common":"./main","core":"./main","i18n":"./main","VcdSdkModule":"./main","ɵa":"./i18n","ɵb":"./i18n","ɵc":"./i18n"},"importAs":"@vcd/sdk"}