@api-client/core 0.19.23 → 0.19.25

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 (118) hide show
  1. package/build/src/browser.d.ts +3 -0
  2. package/build/src/browser.d.ts.map +1 -1
  3. package/build/src/browser.js +2 -0
  4. package/build/src/browser.js.map +1 -1
  5. package/build/src/index.d.ts +5 -0
  6. package/build/src/index.d.ts.map +1 -1
  7. package/build/src/index.js +4 -0
  8. package/build/src/index.js.map +1 -1
  9. package/build/src/mocking/ModelingMock.d.ts +2 -0
  10. package/build/src/mocking/ModelingMock.d.ts.map +1 -1
  11. package/build/src/mocking/ModelingMock.js +2 -0
  12. package/build/src/mocking/ModelingMock.js.map +1 -1
  13. package/build/src/mocking/lib/Deployment.d.ts +16 -0
  14. package/build/src/mocking/lib/Deployment.d.ts.map +1 -0
  15. package/build/src/mocking/lib/Deployment.js +76 -0
  16. package/build/src/mocking/lib/Deployment.js.map +1 -0
  17. package/build/src/modeling/Bindings.d.ts +4 -0
  18. package/build/src/modeling/Bindings.d.ts.map +1 -1
  19. package/build/src/modeling/Bindings.js.map +1 -1
  20. package/build/src/modeling/DataFormat.d.ts +1 -1
  21. package/build/src/modeling/DataFormat.d.ts.map +1 -1
  22. package/build/src/modeling/DataFormat.js +2 -0
  23. package/build/src/modeling/DataFormat.js.map +1 -1
  24. package/build/src/modeling/DomainAssociation.d.ts +7 -0
  25. package/build/src/modeling/DomainAssociation.d.ts.map +1 -1
  26. package/build/src/modeling/DomainAssociation.js +10 -0
  27. package/build/src/modeling/DomainAssociation.js.map +1 -1
  28. package/build/src/modeling/DomainEntity.d.ts +9 -1
  29. package/build/src/modeling/DomainEntity.d.ts.map +1 -1
  30. package/build/src/modeling/DomainEntity.js +26 -1
  31. package/build/src/modeling/DomainEntity.js.map +1 -1
  32. package/build/src/modeling/ExposedEntity.d.ts +12 -1
  33. package/build/src/modeling/ExposedEntity.d.ts.map +1 -1
  34. package/build/src/modeling/ExposedEntity.js +24 -1
  35. package/build/src/modeling/ExposedEntity.js.map +1 -1
  36. package/build/src/modeling/RuntimeApiModel.d.ts +52 -0
  37. package/build/src/modeling/RuntimeApiModel.d.ts.map +1 -0
  38. package/build/src/modeling/RuntimeApiModel.js +85 -0
  39. package/build/src/modeling/RuntimeApiModel.js.map +1 -0
  40. package/build/src/modeling/actions/index.d.ts +10 -0
  41. package/build/src/modeling/actions/index.d.ts.map +1 -1
  42. package/build/src/modeling/actions/index.js +30 -0
  43. package/build/src/modeling/actions/index.js.map +1 -1
  44. package/build/src/modeling/index.d.ts.map +1 -1
  45. package/build/src/modeling/index.js +1 -0
  46. package/build/src/modeling/index.js.map +1 -1
  47. package/build/src/modeling/types.d.ts +25 -1
  48. package/build/src/modeling/types.d.ts.map +1 -1
  49. package/build/src/modeling/types.js.map +1 -1
  50. package/build/src/models/kinds.d.ts +1 -0
  51. package/build/src/models/kinds.d.ts.map +1 -1
  52. package/build/src/models/kinds.js +1 -0
  53. package/build/src/models/kinds.js.map +1 -1
  54. package/build/src/models/store/CustomDomain.d.ts +50 -0
  55. package/build/src/models/store/CustomDomain.d.ts.map +1 -0
  56. package/build/src/models/store/CustomDomain.js +79 -0
  57. package/build/src/models/store/CustomDomain.js.map +1 -0
  58. package/build/src/models/store/Deployment.d.ts +118 -0
  59. package/build/src/models/store/Deployment.d.ts.map +1 -0
  60. package/build/src/models/store/Deployment.js +182 -0
  61. package/build/src/models/store/Deployment.js.map +1 -0
  62. package/build/src/models/store/DeploymentCustomDomain.d.ts +52 -0
  63. package/build/src/models/store/DeploymentCustomDomain.d.ts.map +1 -0
  64. package/build/src/models/store/DeploymentCustomDomain.js +84 -0
  65. package/build/src/models/store/DeploymentCustomDomain.js.map +1 -0
  66. package/build/src/sdk/DataCatalogSdk.d.ts.map +1 -1
  67. package/build/src/sdk/DataCatalogSdk.js +22 -179
  68. package/build/src/sdk/DataCatalogSdk.js.map +1 -1
  69. package/build/src/sdk/DeploymentsSdk.d.ts +48 -0
  70. package/build/src/sdk/DeploymentsSdk.d.ts.map +1 -0
  71. package/build/src/sdk/DeploymentsSdk.js +94 -0
  72. package/build/src/sdk/DeploymentsSdk.js.map +1 -0
  73. package/build/src/sdk/RouteBuilder.d.ts +2 -0
  74. package/build/src/sdk/RouteBuilder.d.ts.map +1 -1
  75. package/build/src/sdk/RouteBuilder.js +6 -0
  76. package/build/src/sdk/RouteBuilder.js.map +1 -1
  77. package/build/src/sdk/Sdk.d.ts +2 -0
  78. package/build/src/sdk/Sdk.d.ts.map +1 -1
  79. package/build/src/sdk/Sdk.js +2 -0
  80. package/build/src/sdk/Sdk.js.map +1 -1
  81. package/build/src/sdk/SdkBase.d.ts +19 -1
  82. package/build/src/sdk/SdkBase.d.ts.map +1 -1
  83. package/build/src/sdk/SdkBase.js +31 -1
  84. package/build/src/sdk/SdkBase.js.map +1 -1
  85. package/build/src/sdk/SdkMock.d.ts +9 -0
  86. package/build/src/sdk/SdkMock.d.ts.map +1 -1
  87. package/build/src/sdk/SdkMock.js +73 -0
  88. package/build/src/sdk/SdkMock.js.map +1 -1
  89. package/build/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +2 -1
  91. package/src/matchit.d.ts +19 -0
  92. package/src/mocking/ModelingMock.ts +2 -0
  93. package/src/mocking/lib/Deployment.ts +88 -0
  94. package/src/modeling/Bindings.ts +4 -0
  95. package/src/modeling/DataFormat.ts +4 -0
  96. package/src/modeling/DomainAssociation.ts +11 -0
  97. package/src/modeling/DomainEntity.ts +30 -1
  98. package/src/modeling/ExposedEntity.ts +26 -1
  99. package/src/modeling/RuntimeApiModel.ts +137 -0
  100. package/src/modeling/types.ts +26 -1
  101. package/src/models/kinds.ts +1 -0
  102. package/src/models/store/CustomDomain.ts +119 -0
  103. package/src/models/store/Deployment.ts +250 -0
  104. package/src/models/store/DeploymentCustomDomain.ts +120 -0
  105. package/src/sdk/DataCatalogSdk.ts +22 -176
  106. package/src/sdk/DeploymentsSdk.ts +123 -0
  107. package/src/sdk/RouteBuilder.ts +8 -0
  108. package/src/sdk/Sdk.ts +3 -0
  109. package/src/sdk/SdkBase.ts +35 -3
  110. package/src/sdk/SdkMock.ts +103 -0
  111. package/tests/unit/modeling/RuntimeApiModel.spec.ts +122 -0
  112. package/tests/unit/modeling/actions/index.spec.ts +113 -0
  113. package/tests/unit/modeling/domain_asociation.spec.ts +28 -0
  114. package/tests/unit/modeling/domain_entity_parents.spec.ts +49 -0
  115. package/tests/unit/modeling/exposed_entity_actions.spec.ts +47 -0
  116. package/tests/unit/models/store/CustomDomain.spec.ts +111 -0
  117. package/tests/unit/models/store/Deployment.spec.ts +198 -0
  118. package/tests/unit/models/store/DeploymentCustomDomain.spec.ts +122 -0
@@ -0,0 +1,118 @@
1
+ import type { FieldValidationMessage } from '../../exceptions/validation_error.js';
2
+ import { DeploymentKind } from '../kinds.js';
3
+ export { DeploymentKind };
4
+ /**
5
+ * Status of the deployment
6
+ */
7
+ export declare enum DeploymentStatus {
8
+ /**
9
+ * Deployment is pending
10
+ */
11
+ Pending = 0,
12
+ /**
13
+ * Deployment is active
14
+ */
15
+ Active = 1,
16
+ /**
17
+ * Deployment is inactive
18
+ */
19
+ Inactive = 2,
20
+ /**
21
+ * Deployment has failed
22
+ */
23
+ Failed = 3
24
+ }
25
+ /**
26
+ * Environment tag for logical deployment grouping
27
+ */
28
+ export declare enum DeploymentEnvironment {
29
+ PROD = "prod",
30
+ STAGING = "staging",
31
+ DEV = "dev"
32
+ }
33
+ export interface DeploymentSchema {
34
+ kind: typeof DeploymentKind;
35
+ /**
36
+ * Primary key (nanoid)
37
+ */
38
+ key: string;
39
+ /**
40
+ * ID of the organization
41
+ */
42
+ orgId: string;
43
+ /**
44
+ * The file ID representing the API
45
+ */
46
+ apiId: string;
47
+ /**
48
+ * Denormalized organization slug
49
+ */
50
+ orgSlug: string;
51
+ /**
52
+ * Denormalized API slug
53
+ */
54
+ apiSlug: string;
55
+ /**
56
+ * Environment tag
57
+ */
58
+ env: DeploymentEnvironment;
59
+ /**
60
+ * The version of the deployment (e.g., 'v1', 'v2')
61
+ * It must be set for production environments.
62
+ * It cannot be set for non-production environments (e.g. 'dev').
63
+ */
64
+ version?: string;
65
+ /**
66
+ * The semantic version of the deployed API model (e.g., '1.0.1').
67
+ */
68
+ modelVersion: string;
69
+ /**
70
+ * Status of the deployment
71
+ */
72
+ status: DeploymentStatus;
73
+ /**
74
+ * Timestamp of creation
75
+ */
76
+ createdAt: number;
77
+ /**
78
+ * Timestamp of last update
79
+ */
80
+ updatedAt: number;
81
+ /**
82
+ * The base URI to the API.
83
+ * Note: This field is computed at runtime when the deployment status is active.
84
+ * Note: This field is ignored when creating or updating a deployment.
85
+ */
86
+ baseUri?: string;
87
+ /**
88
+ * The URI to the API portal.
89
+ * Note: This field is computed at runtime when the deployment status is active.
90
+ * Note: This field is ignored when creating or updating a deployment.
91
+ */
92
+ portalUri?: string;
93
+ }
94
+ export declare class Deployment implements DeploymentSchema {
95
+ readonly kind: typeof DeploymentKind;
96
+ key: string;
97
+ orgId: string;
98
+ apiId: string;
99
+ orgSlug: string;
100
+ apiSlug: string;
101
+ env: DeploymentEnvironment;
102
+ version?: string;
103
+ modelVersion: string;
104
+ status: DeploymentStatus;
105
+ createdAt: number;
106
+ updatedAt: number;
107
+ baseUri?: string;
108
+ portalUri?: string;
109
+ static createSchema(input?: Partial<DeploymentSchema>): DeploymentSchema;
110
+ constructor(state?: Partial<DeploymentSchema>);
111
+ toJSON(): DeploymentSchema;
112
+ /**
113
+ * Validates the deployment.
114
+ * @returns An array of validation messages.
115
+ */
116
+ validate(): FieldValidationMessage[];
117
+ }
118
+ //# sourceMappingURL=Deployment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Deployment.d.ts","sourceRoot":"","sources":["../../../../src/models/store/Deployment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,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AAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,gBAAgB,CAAA;IACxB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,MAAM,CAAC,YAAY,CAAC,KAAK,GAAE,OAAO,CAAC,gBAAgB,CAAM,GAAG,gBAAgB;gBA2BhE,KAAK,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC;IAiB7C,MAAM,IAAI,gBAAgB;IA0B1B;;;OAGG;IACH,QAAQ,IAAI,sBAAsB,EAAE;CA4DrC"}
@@ -0,0 +1,182 @@
1
+ import { nanoid } from '../../nanoid.js';
2
+ import { DeploymentKind } from '../kinds.js';
3
+ export { DeploymentKind };
4
+ /**
5
+ * Status of the deployment
6
+ */
7
+ export var DeploymentStatus;
8
+ (function (DeploymentStatus) {
9
+ /**
10
+ * Deployment is pending
11
+ */
12
+ DeploymentStatus[DeploymentStatus["Pending"] = 0] = "Pending";
13
+ /**
14
+ * Deployment is active
15
+ */
16
+ DeploymentStatus[DeploymentStatus["Active"] = 1] = "Active";
17
+ /**
18
+ * Deployment is inactive
19
+ */
20
+ DeploymentStatus[DeploymentStatus["Inactive"] = 2] = "Inactive";
21
+ /**
22
+ * Deployment has failed
23
+ */
24
+ DeploymentStatus[DeploymentStatus["Failed"] = 3] = "Failed";
25
+ })(DeploymentStatus || (DeploymentStatus = {}));
26
+ /**
27
+ * Environment tag for logical deployment grouping
28
+ */
29
+ export var DeploymentEnvironment;
30
+ (function (DeploymentEnvironment) {
31
+ DeploymentEnvironment["PROD"] = "prod";
32
+ DeploymentEnvironment["STAGING"] = "staging";
33
+ DeploymentEnvironment["DEV"] = "dev";
34
+ })(DeploymentEnvironment || (DeploymentEnvironment = {}));
35
+ export class Deployment {
36
+ kind = DeploymentKind;
37
+ key;
38
+ orgId;
39
+ apiId;
40
+ orgSlug;
41
+ apiSlug;
42
+ env;
43
+ version;
44
+ modelVersion;
45
+ status;
46
+ createdAt;
47
+ updatedAt;
48
+ baseUri;
49
+ portalUri;
50
+ static createSchema(input = {}) {
51
+ const key = input.key ?? nanoid();
52
+ const result = {
53
+ kind: DeploymentKind,
54
+ key,
55
+ orgId: input.orgId || '',
56
+ apiId: input.apiId || '',
57
+ orgSlug: input.orgSlug || '',
58
+ apiSlug: input.apiSlug || '',
59
+ env: input.env ?? DeploymentEnvironment.DEV,
60
+ modelVersion: input.modelVersion || '0.0.0',
61
+ status: input.status ?? DeploymentStatus.Pending,
62
+ createdAt: input.createdAt ?? Date.now(),
63
+ updatedAt: input.updatedAt ?? Date.now(),
64
+ };
65
+ if (input.baseUri) {
66
+ result.baseUri = input.baseUri;
67
+ }
68
+ if (input.portalUri) {
69
+ result.portalUri = input.portalUri;
70
+ }
71
+ if (input.version) {
72
+ result.version = input.version;
73
+ }
74
+ return result;
75
+ }
76
+ constructor(state) {
77
+ const init = Deployment.createSchema(state);
78
+ this.key = init.key;
79
+ this.orgId = init.orgId;
80
+ this.apiId = init.apiId;
81
+ this.orgSlug = init.orgSlug;
82
+ this.apiSlug = init.apiSlug;
83
+ this.env = init.env;
84
+ this.version = init.version;
85
+ this.status = init.status;
86
+ this.createdAt = init.createdAt;
87
+ this.updatedAt = init.updatedAt;
88
+ this.modelVersion = init.modelVersion;
89
+ this.baseUri = init.baseUri;
90
+ this.portalUri = init.portalUri;
91
+ }
92
+ toJSON() {
93
+ const result = {
94
+ kind: DeploymentKind,
95
+ key: this.key,
96
+ orgId: this.orgId,
97
+ apiId: this.apiId,
98
+ orgSlug: this.orgSlug,
99
+ apiSlug: this.apiSlug,
100
+ env: this.env,
101
+ modelVersion: this.modelVersion,
102
+ status: this.status,
103
+ createdAt: this.createdAt,
104
+ updatedAt: this.updatedAt,
105
+ };
106
+ if (this.version) {
107
+ result.version = this.version;
108
+ }
109
+ if (this.baseUri) {
110
+ result.baseUri = this.baseUri;
111
+ }
112
+ if (this.portalUri) {
113
+ result.portalUri = this.portalUri;
114
+ }
115
+ return result;
116
+ }
117
+ /**
118
+ * Validates the deployment.
119
+ * @returns An array of validation messages.
120
+ */
121
+ validate() {
122
+ const result = [];
123
+ if (this.orgId === '') {
124
+ result.push({
125
+ field: 'orgId',
126
+ message: 'Org ID must not be empty',
127
+ rule: 'notEmpty',
128
+ });
129
+ }
130
+ if (this.apiId === '') {
131
+ result.push({
132
+ field: 'apiId',
133
+ message: 'API ID must not be empty',
134
+ rule: 'notEmpty',
135
+ });
136
+ }
137
+ if (this.orgSlug === '') {
138
+ result.push({
139
+ field: 'orgSlug',
140
+ message: 'Org slug must not be empty',
141
+ rule: 'notEmpty',
142
+ });
143
+ }
144
+ if (this.apiSlug === '') {
145
+ result.push({
146
+ field: 'apiSlug',
147
+ message: 'API slug must not be empty',
148
+ rule: 'notEmpty',
149
+ });
150
+ }
151
+ if (!this.env) {
152
+ result.push({
153
+ field: 'env',
154
+ message: 'Environment tag must not be empty',
155
+ rule: 'notEmpty',
156
+ });
157
+ }
158
+ if (this.modelVersion === '') {
159
+ result.push({
160
+ field: 'modelVersion',
161
+ message: 'API model version must not be empty',
162
+ rule: 'notEmpty',
163
+ });
164
+ }
165
+ if (this.env === DeploymentEnvironment.PROD && !this.version) {
166
+ result.push({
167
+ field: 'version',
168
+ message: 'Version must not be empty for production environment',
169
+ rule: 'notEmpty',
170
+ });
171
+ }
172
+ else if (this.env !== DeploymentEnvironment.PROD && this.version) {
173
+ result.push({
174
+ field: 'version',
175
+ message: 'Version must not be present for non-production environment',
176
+ rule: 'notEmpty',
177
+ });
178
+ }
179
+ return result;
180
+ }
181
+ }
182
+ //# sourceMappingURL=Deployment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Deployment.js","sourceRoot":"","sources":["../../../../src/models/store/Deployment.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE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,CAAC;YACnE,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,SAAS;gBAChB,OAAO,EAAE,4DAA4D;gBACrE,IAAI,EAAE,UAAU;aACjB,CAAC,CAAA;QACJ,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import type { FieldValidationMessage } from '../../exceptions/validation_error.js'\nimport { nanoid } from '../../nanoid.js'\nimport { DeploymentKind } from '../kinds.js'\n\nexport { DeploymentKind }\n\n/**\n * Status of the deployment\n */\nexport enum DeploymentStatus {\n /**\n * Deployment is pending\n */\n Pending = 0,\n /**\n * Deployment is active\n */\n Active = 1,\n /**\n * Deployment is inactive\n */\n Inactive = 2,\n /**\n * Deployment has failed\n */\n Failed = 3,\n}\n\n/**\n * Environment tag for logical deployment grouping\n */\nexport enum DeploymentEnvironment {\n PROD = 'prod',\n STAGING = 'staging',\n DEV = 'dev',\n}\n\nexport interface DeploymentSchema {\n kind: typeof DeploymentKind\n /**\n * Primary key (nanoid)\n */\n key: string\n /**\n * ID of the organization\n */\n orgId: string\n /**\n * The file ID representing the API\n */\n apiId: string\n /**\n * Denormalized organization slug\n */\n orgSlug: string\n /**\n * Denormalized API slug\n */\n apiSlug: string\n /**\n * Environment tag\n */\n env: DeploymentEnvironment\n /**\n * The version of the deployment (e.g., 'v1', 'v2')\n * It must be set for production environments.\n * It cannot be set for non-production environments (e.g. 'dev').\n */\n version?: string\n /**\n * The semantic version of the deployed API model (e.g., '1.0.1').\n */\n modelVersion: string\n /**\n * Status of the deployment\n */\n status: DeploymentStatus\n /**\n * Timestamp of creation\n */\n createdAt: number\n /**\n * Timestamp of last update\n */\n updatedAt: number\n /**\n * The base URI to the API.\n * Note: This field is computed at runtime when the deployment status is active.\n * Note: This field is ignored when creating or updating a deployment.\n */\n baseUri?: string\n /**\n * The URI to the API portal.\n * Note: This field is computed at runtime when the deployment status is active.\n * Note: This field is ignored when creating or updating a deployment.\n */\n portalUri?: string\n}\n\nexport class Deployment implements DeploymentSchema {\n readonly kind: typeof DeploymentKind = DeploymentKind\n key: string\n orgId: string\n apiId: string\n orgSlug: string\n apiSlug: string\n env: DeploymentEnvironment\n version?: string\n modelVersion: string\n status: DeploymentStatus\n createdAt: number\n updatedAt: number\n baseUri?: string\n portalUri?: string\n\n static createSchema(input: Partial<DeploymentSchema> = {}): DeploymentSchema {\n const key = input.key ?? nanoid()\n const result: DeploymentSchema = {\n kind: DeploymentKind,\n key,\n orgId: input.orgId || '',\n apiId: input.apiId || '',\n orgSlug: input.orgSlug || '',\n apiSlug: input.apiSlug || '',\n env: input.env ?? DeploymentEnvironment.DEV,\n modelVersion: input.modelVersion || '0.0.0',\n status: input.status ?? DeploymentStatus.Pending,\n createdAt: input.createdAt ?? Date.now(),\n updatedAt: input.updatedAt ?? Date.now(),\n }\n if (input.baseUri) {\n result.baseUri = input.baseUri\n }\n if (input.portalUri) {\n result.portalUri = input.portalUri\n }\n if (input.version) {\n result.version = input.version\n }\n return result\n }\n\n constructor(state?: Partial<DeploymentSchema>) {\n const init = Deployment.createSchema(state)\n this.key = init.key\n this.orgId = init.orgId\n this.apiId = init.apiId\n this.orgSlug = init.orgSlug\n this.apiSlug = init.apiSlug\n this.env = init.env\n this.version = init.version\n this.status = init.status\n this.createdAt = init.createdAt\n this.updatedAt = init.updatedAt\n this.modelVersion = init.modelVersion\n this.baseUri = init.baseUri\n this.portalUri = init.portalUri\n }\n\n toJSON(): DeploymentSchema {\n const result: DeploymentSchema = {\n kind: DeploymentKind,\n key: this.key,\n orgId: this.orgId,\n apiId: this.apiId,\n orgSlug: this.orgSlug,\n apiSlug: this.apiSlug,\n env: this.env,\n modelVersion: this.modelVersion,\n status: this.status,\n createdAt: this.createdAt,\n updatedAt: this.updatedAt,\n }\n if (this.version) {\n result.version = this.version\n }\n if (this.baseUri) {\n result.baseUri = this.baseUri\n }\n if (this.portalUri) {\n result.portalUri = this.portalUri\n }\n return result\n }\n\n /**\n * Validates the deployment.\n * @returns An array of validation messages.\n */\n validate(): FieldValidationMessage[] {\n const result: FieldValidationMessage[] = []\n\n if (this.orgId === '') {\n result.push({\n field: 'orgId',\n message: 'Org ID must not be empty',\n rule: 'notEmpty',\n })\n }\n if (this.apiId === '') {\n result.push({\n field: 'apiId',\n message: 'API ID must not be empty',\n rule: 'notEmpty',\n })\n }\n if (this.orgSlug === '') {\n result.push({\n field: 'orgSlug',\n message: 'Org slug must not be empty',\n rule: 'notEmpty',\n })\n }\n if (this.apiSlug === '') {\n result.push({\n field: 'apiSlug',\n message: 'API slug must not be empty',\n rule: 'notEmpty',\n })\n }\n if (!this.env) {\n result.push({\n field: 'env',\n message: 'Environment tag must not be empty',\n rule: 'notEmpty',\n })\n }\n if (this.modelVersion === '') {\n result.push({\n field: 'modelVersion',\n message: 'API model version must not be empty',\n rule: 'notEmpty',\n })\n }\n if (this.env === DeploymentEnvironment.PROD && !this.version) {\n result.push({\n field: 'version',\n message: 'Version must not be empty for production environment',\n rule: 'notEmpty',\n })\n } else if (this.env !== DeploymentEnvironment.PROD && this.version) {\n result.push({\n field: 'version',\n message: 'Version must not be present for non-production environment',\n rule: 'notEmpty',\n })\n }\n return result\n }\n}\n"]}
@@ -0,0 +1,52 @@
1
+ import type { FieldValidationMessage } from '../../exceptions/validation_error.js';
2
+ export declare enum SslStatus {
3
+ Initializing = 0,
4
+ PendingDns = 1,
5
+ Issuing = 2,
6
+ Active = 3,
7
+ Error = 4
8
+ }
9
+ export interface DeploymentCustomDomainSchema {
10
+ /**
11
+ * Primary key (nanoid)
12
+ */
13
+ id: string;
14
+ /**
15
+ * ID of the deployment
16
+ */
17
+ deploymentId: string;
18
+ /**
19
+ * ID of the custom domain
20
+ */
21
+ customDomainId: string;
22
+ /**
23
+ * The base path for the deployment
24
+ */
25
+ basePath: string;
26
+ /**
27
+ * Status of the SSL certificate
28
+ */
29
+ sslStatus: SslStatus;
30
+ /**
31
+ * Timestamp of creation
32
+ */
33
+ createdAt: number;
34
+ /**
35
+ * Timestamp of last update
36
+ */
37
+ updatedAt: number;
38
+ }
39
+ export declare class DeploymentCustomDomainModel implements DeploymentCustomDomainSchema {
40
+ id: string;
41
+ deploymentId: string;
42
+ customDomainId: string;
43
+ basePath: string;
44
+ sslStatus: SslStatus;
45
+ createdAt: number;
46
+ updatedAt: number;
47
+ static createSchema(input?: Partial<DeploymentCustomDomainSchema>): DeploymentCustomDomainSchema;
48
+ constructor(state?: Partial<DeploymentCustomDomainSchema>);
49
+ toJSON(): DeploymentCustomDomainSchema;
50
+ validate(): FieldValidationMessage[];
51
+ }
52
+ //# sourceMappingURL=DeploymentCustomDomain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeploymentCustomDomain.d.ts","sourceRoot":"","sources":["../../../../src/models/store/DeploymentCustomDomain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAA;AAGlF,oBAAY,SAAS;IACnB,YAAY,IAAI;IAChB,UAAU,IAAI;IACd,OAAO,IAAI;IACX,MAAM,IAAI;IACV,KAAK,IAAI;CACV;AAED,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,SAAS,EAAE,SAAS,CAAA;IACpB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,qBAAa,2BAA4B,YAAW,4BAA4B;IAC9E,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,SAAS,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAEjB,MAAM,CAAC,YAAY,CAAC,KAAK,GAAE,OAAO,CAAC,4BAA4B,CAAM,GAAG,4BAA4B;gBAaxF,KAAK,CAAC,EAAE,OAAO,CAAC,4BAA4B,CAAC;IAWzD,MAAM,IAAI,4BAA4B;IAYtC,QAAQ,IAAI,sBAAsB,EAAE;CAgCrC"}
@@ -0,0 +1,84 @@
1
+ import { nanoid } from '../../nanoid.js';
2
+ export var SslStatus;
3
+ (function (SslStatus) {
4
+ SslStatus[SslStatus["Initializing"] = 0] = "Initializing";
5
+ SslStatus[SslStatus["PendingDns"] = 1] = "PendingDns";
6
+ SslStatus[SslStatus["Issuing"] = 2] = "Issuing";
7
+ SslStatus[SslStatus["Active"] = 3] = "Active";
8
+ SslStatus[SslStatus["Error"] = 4] = "Error";
9
+ })(SslStatus || (SslStatus = {}));
10
+ export class DeploymentCustomDomainModel {
11
+ id;
12
+ deploymentId;
13
+ customDomainId;
14
+ basePath;
15
+ sslStatus;
16
+ createdAt;
17
+ updatedAt;
18
+ static createSchema(input = {}) {
19
+ const id = input.id ?? nanoid();
20
+ return {
21
+ id,
22
+ deploymentId: input.deploymentId || '',
23
+ customDomainId: input.customDomainId || '',
24
+ basePath: input.basePath ?? '/',
25
+ sslStatus: input.sslStatus ?? SslStatus.PendingDns,
26
+ createdAt: input.createdAt ?? Date.now(),
27
+ updatedAt: input.updatedAt ?? Date.now(),
28
+ };
29
+ }
30
+ constructor(state) {
31
+ const init = DeploymentCustomDomainModel.createSchema(state);
32
+ this.id = init.id;
33
+ this.deploymentId = init.deploymentId;
34
+ this.customDomainId = init.customDomainId;
35
+ this.basePath = init.basePath;
36
+ this.sslStatus = init.sslStatus;
37
+ this.createdAt = init.createdAt;
38
+ this.updatedAt = init.updatedAt;
39
+ }
40
+ toJSON() {
41
+ return {
42
+ id: this.id,
43
+ deploymentId: this.deploymentId,
44
+ customDomainId: this.customDomainId,
45
+ basePath: this.basePath,
46
+ sslStatus: this.sslStatus,
47
+ createdAt: this.createdAt,
48
+ updatedAt: this.updatedAt,
49
+ };
50
+ }
51
+ validate() {
52
+ const result = [];
53
+ if (this.basePath === '') {
54
+ result.push({
55
+ field: 'basePath',
56
+ message: 'Base path must not be empty',
57
+ rule: 'notEmpty',
58
+ });
59
+ }
60
+ else if (!this.basePath.startsWith('/')) {
61
+ result.push({
62
+ field: 'basePath',
63
+ message: 'Base path must start with a slash',
64
+ rule: 'startsWithSlash',
65
+ });
66
+ }
67
+ if (!this.deploymentId) {
68
+ result.push({
69
+ field: 'deploymentId',
70
+ message: 'Deployment ID must not be empty',
71
+ rule: 'notEmpty',
72
+ });
73
+ }
74
+ if (!this.customDomainId) {
75
+ result.push({
76
+ field: 'customDomainId',
77
+ message: 'Custom domain ID must not be empty',
78
+ rule: 'notEmpty',
79
+ });
80
+ }
81
+ return result;
82
+ }
83
+ }
84
+ //# sourceMappingURL=DeploymentCustomDomain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeploymentCustomDomain.js","sourceRoot":"","sources":["../../../../src/models/store/DeploymentCustomDomain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAExC,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,yDAAgB,CAAA;IAChB,qDAAc,CAAA;IACd,+CAAW,CAAA;IACX,6CAAU,CAAA;IACV,2CAAS,CAAA;AACX,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB;AAiCD,MAAM,OAAO,2BAA2B;IACtC,EAAE,CAAQ;IACV,YAAY,CAAQ;IACpB,cAAc,CAAQ;IACtB,QAAQ,CAAQ;IAChB,SAAS,CAAW;IACpB,SAAS,CAAQ;IACjB,SAAS,CAAQ;IAEjB,MAAM,CAAC,YAAY,CAAC,QAA+C,EAAE;QACnE,MAAM,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,MAAM,EAAE,CAAA;QAC/B,OAAO;YACL,EAAE;YACF,YAAY,EAAE,KAAK,CAAC,YA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M,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,UAAU;gBACjB,OAAO,EAAE,6BAA6B;gBACtC,IAAI,EAAE,UAAU;aACjB,CAAC,CAAA;QACJ,CAAC;aAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,UAAU;gBACjB,OAAO,EAAE,mCAAmC;gBAC5C,IAAI,EAAE,iBAAiB;aACxB,CAAC,CAAA;QACJ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;YACvB,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,cAAc;gBACrB,OAAO,EAAE,iCAAiC;gBAC1C,IAAI,EAAE,UAAU;aACjB,CAAC,CAAA;QACJ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,gBAAgB;gBACvB,OAAO,EAAE,oCAAoC;gBAC7C,IAAI,EAAE,UAAU;aACjB,CAAC,CAAA;QACJ,CAAC;QACD,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import type { FieldValidationMessage } from '../../exceptions/validation_error.js'\nimport { nanoid } from '../../nanoid.js'\n\nexport enum SslStatus {\n Initializing = 0,\n PendingDns = 1,\n Issuing = 2,\n Active = 3,\n Error = 4,\n}\n\nexport interface DeploymentCustomDomainSchema {\n /**\n * Primary key (nanoid)\n */\n id: string\n /**\n * ID of the deployment\n */\n deploymentId: string\n /**\n * ID of the custom domain\n */\n customDomainId: string\n /**\n * The base path for the deployment\n */\n basePath: string\n /**\n * Status of the SSL certificate\n */\n sslStatus: SslStatus\n /**\n * Timestamp of creation\n */\n createdAt: number\n /**\n * Timestamp of last update\n */\n updatedAt: number\n}\n\nexport class DeploymentCustomDomainModel implements DeploymentCustomDomainSchema {\n id: string\n deploymentId: string\n customDomainId: string\n basePath: string\n sslStatus: SslStatus\n createdAt: number\n updatedAt: number\n\n static createSchema(input: Partial<DeploymentCustomDomainSchema> = {}): DeploymentCustomDomainSchema {\n const id = input.id ?? nanoid()\n return {\n id,\n deploymentId: input.deploymentId || '',\n customDomainId: input.customDomainId || '',\n basePath: input.basePath ?? '/',\n sslStatus: input.sslStatus ?? SslStatus.PendingDns,\n createdAt: input.createdAt ?? Date.now(),\n updatedAt: input.updatedAt ?? Date.now(),\n }\n }\n\n constructor(state?: Partial<DeploymentCustomDomainSchema>) {\n const init = DeploymentCustomDomainModel.createSchema(state)\n this.id = init.id\n this.deploymentId = init.deploymentId\n this.customDomainId = init.customDomainId\n this.basePath = init.basePath\n this.sslStatus = init.sslStatus\n this.createdAt = init.createdAt\n this.updatedAt = init.updatedAt\n }\n\n toJSON(): DeploymentCustomDomainSchema {\n return {\n id: this.id,\n deploymentId: this.deploymentId,\n customDomainId: this.customDomainId,\n basePath: this.basePath,\n sslStatus: this.sslStatus,\n createdAt: this.createdAt,\n updatedAt: this.updatedAt,\n }\n }\n\n validate(): FieldValidationMessage[] {\n const result: FieldValidationMessage[] = []\n\n if (this.basePath === '') {\n result.push({\n field: 'basePath',\n message: 'Base path must not be empty',\n rule: 'notEmpty',\n })\n } else if (!this.basePath.startsWith('/')) {\n result.push({\n field: 'basePath',\n message: 'Base path must start with a slash',\n rule: 'startsWithSlash',\n })\n }\n if (!this.deploymentId) {\n result.push({\n field: 'deploymentId',\n message: 'Deployment ID must not be empty',\n rule: 'notEmpty',\n })\n }\n if (!this.customDomainId) {\n result.push({\n field: 'customDomainId',\n message: 'Custom domain ID must not be empty',\n rule: 'notEmpty',\n })\n }\n return result\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DataCatalogSdk.d.ts","sourceRoot":"","sources":["../../../src/sdk/DataCatalogSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAKP,UAAU,EACX,MAAM,cAAc,CAAA;AACrB,OAAO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