@api-client/core 0.19.18 → 0.19.20
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.
- package/build/src/authorization/Utils.js +3 -3
- package/build/src/authorization/Utils.js.map +1 -1
- package/build/src/browser.d.ts +1 -1
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js.map +1 -1
- package/build/src/index.d.ts +1 -1
- package/build/src/index.d.ts.map +1 -1
- package/build/src/index.js.map +1 -1
- package/build/src/mocking/lib/Organization.d.ts +5 -1
- package/build/src/mocking/lib/Organization.d.ts.map +1 -1
- package/build/src/mocking/lib/Organization.js +17 -0
- package/build/src/mocking/lib/Organization.js.map +1 -1
- package/build/src/modeling/ApiModel.d.ts +16 -5
- package/build/src/modeling/ApiModel.d.ts.map +1 -1
- package/build/src/modeling/ApiModel.js +17 -2
- package/build/src/modeling/ApiModel.js.map +1 -1
- package/build/src/modeling/ApiValidation.d.ts.map +1 -1
- package/build/src/modeling/ApiValidation.js +2 -1
- package/build/src/modeling/ApiValidation.js.map +1 -1
- package/build/src/modeling/DomainProperty.d.ts +12 -0
- package/build/src/modeling/DomainProperty.d.ts.map +1 -1
- package/build/src/modeling/DomainProperty.js +23 -28
- package/build/src/modeling/DomainProperty.js.map +1 -1
- package/build/src/modeling/DomainSerialization.js +1 -1
- package/build/src/modeling/DomainSerialization.js.map +1 -1
- package/build/src/modeling/ExposedEntity.d.ts +15 -1
- package/build/src/modeling/ExposedEntity.d.ts.map +1 -1
- package/build/src/modeling/ExposedEntity.js +42 -4
- package/build/src/modeling/ExposedEntity.js.map +1 -1
- package/build/src/modeling/actions/Action.d.ts.map +1 -1
- package/build/src/modeling/actions/Action.js +1 -0
- package/build/src/modeling/actions/Action.js.map +1 -1
- package/build/src/modeling/actions/ListAction.d.ts +3 -17
- package/build/src/modeling/actions/ListAction.d.ts.map +1 -1
- package/build/src/modeling/actions/ListAction.js +18 -38
- package/build/src/modeling/actions/ListAction.js.map +1 -1
- package/build/src/modeling/actions/SearchAction.d.ts +4 -4
- package/build/src/modeling/actions/SearchAction.d.ts.map +1 -1
- package/build/src/modeling/actions/SearchAction.js +16 -13
- package/build/src/modeling/actions/SearchAction.js.map +1 -1
- package/build/src/modeling/generators/oas_312/OasGenerator.d.ts +32 -0
- package/build/src/modeling/generators/oas_312/OasGenerator.d.ts.map +1 -0
- package/build/src/modeling/generators/oas_312/OasGenerator.js +1452 -0
- package/build/src/modeling/generators/oas_312/OasGenerator.js.map +1 -0
- package/build/src/modeling/generators/oas_312/OasSchemaGenerator.d.ts +27 -0
- package/build/src/modeling/generators/oas_312/OasSchemaGenerator.d.ts.map +1 -0
- package/build/src/modeling/generators/oas_312/OasSchemaGenerator.js +295 -0
- package/build/src/modeling/generators/oas_312/OasSchemaGenerator.js.map +1 -0
- package/build/src/modeling/generators/oas_312/types.d.ts +1010 -0
- package/build/src/modeling/generators/oas_312/types.d.ts.map +1 -0
- package/build/src/modeling/generators/oas_312/types.js +2 -0
- package/build/src/modeling/generators/oas_312/types.js.map +1 -0
- package/build/src/modeling/generators/oas_320/OasGenerator.d.ts +16 -0
- package/build/src/modeling/generators/oas_320/OasGenerator.d.ts.map +1 -0
- package/build/src/modeling/generators/oas_320/OasGenerator.js +306 -0
- package/build/src/modeling/generators/oas_320/OasGenerator.js.map +1 -0
- package/build/src/modeling/generators/oas_320/OasSchemaGenerator.d.ts +25 -0
- package/build/src/modeling/generators/oas_320/OasSchemaGenerator.d.ts.map +1 -0
- package/build/src/modeling/generators/oas_320/OasSchemaGenerator.js +237 -0
- package/build/src/modeling/generators/oas_320/OasSchemaGenerator.js.map +1 -0
- package/build/src/modeling/generators/oas_320/types.d.ts +1219 -0
- package/build/src/modeling/generators/oas_320/types.d.ts.map +1 -0
- package/build/src/modeling/generators/oas_320/types.js +2 -0
- package/build/src/modeling/generators/oas_320/types.js.map +1 -0
- package/build/src/modeling/types.d.ts +50 -13
- package/build/src/modeling/types.d.ts.map +1 -1
- package/build/src/modeling/types.js.map +1 -1
- package/build/src/modeling/validation/api_model_rules.d.ts +1 -0
- package/build/src/modeling/validation/api_model_rules.d.ts.map +1 -1
- package/build/src/modeling/validation/api_model_rules.js +105 -29
- package/build/src/modeling/validation/api_model_rules.js.map +1 -1
- package/build/src/models/ProjectRequest.d.ts.map +1 -1
- package/build/src/models/ProjectRequest.js +0 -4
- package/build/src/models/ProjectRequest.js.map +1 -1
- package/build/src/models/store/Organization.d.ts +13 -0
- package/build/src/models/store/Organization.d.ts.map +1 -1
- package/build/src/models/store/Organization.js.map +1 -1
- package/build/src/models/transformers/ArcDexieTransformer.d.ts.map +1 -1
- package/build/src/models/transformers/ArcDexieTransformer.js +0 -4
- package/build/src/models/transformers/ArcDexieTransformer.js.map +1 -1
- package/build/src/models/transformers/ImportUtils.js +1 -1
- package/build/src/models/transformers/ImportUtils.js.map +1 -1
- package/build/src/models/transformers/PostmanBackupTransformer.d.ts.map +1 -1
- package/build/src/models/transformers/PostmanBackupTransformer.js +0 -4
- package/build/src/models/transformers/PostmanBackupTransformer.js.map +1 -1
- package/build/src/runtime/constants.d.ts +7 -0
- package/build/src/runtime/constants.d.ts.map +1 -0
- package/build/src/runtime/constants.js +8 -0
- package/build/src/runtime/constants.js.map +1 -0
- package/build/src/runtime/http-engine/ntlm/Des.d.ts.map +1 -1
- package/build/src/runtime/http-engine/ntlm/Des.js +1 -0
- package/build/src/runtime/http-engine/ntlm/Des.js.map +1 -1
- package/build/src/runtime/variables/EvalFunctions.d.ts.map +1 -1
- package/build/src/runtime/variables/EvalFunctions.js +0 -1
- package/build/src/runtime/variables/EvalFunctions.js.map +1 -1
- package/build/src/sdk/OrganizationsSdk.d.ts +17 -1
- package/build/src/sdk/OrganizationsSdk.d.ts.map +1 -1
- package/build/src/sdk/OrganizationsSdk.js +76 -0
- package/build/src/sdk/OrganizationsSdk.js.map +1 -1
- package/build/src/sdk/RouteBuilder.d.ts +2 -0
- package/build/src/sdk/RouteBuilder.d.ts.map +1 -1
- package/build/src/sdk/RouteBuilder.js +6 -0
- package/build/src/sdk/RouteBuilder.js.map +1 -1
- package/build/src/sdk/SdkMock.d.ts +12 -0
- package/build/src/sdk/SdkMock.d.ts.map +1 -1
- package/build/src/sdk/SdkMock.js +32 -0
- package/build/src/sdk/SdkMock.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/eslint.config.js +6 -0
- package/package.json +3 -1
- package/src/authorization/Utils.ts +3 -3
- package/src/mocking/lib/Organization.ts +22 -1
- package/src/modeling/ApiModel.ts +23 -8
- package/src/modeling/ApiValidation.ts +2 -0
- package/src/modeling/DomainProperty.ts +22 -18
- package/src/modeling/DomainSerialization.ts +1 -1
- package/src/modeling/ExposedEntity.ts +44 -4
- package/src/modeling/actions/Action.ts +1 -0
- package/src/modeling/actions/ListAction.ts +12 -30
- package/src/modeling/actions/SearchAction.ts +11 -8
- package/src/modeling/generators/oas_312/OasGenerator.ts +1685 -0
- package/src/modeling/generators/oas_312/OasSchemaGenerator.ts +322 -0
- package/src/modeling/generators/oas_312/types.ts +1052 -0
- package/src/modeling/generators/oas_320/OasGenerator.ts +359 -0
- package/src/modeling/generators/oas_320/OasSchemaGenerator.ts +255 -0
- package/src/modeling/generators/oas_320/types.ts +1259 -0
- package/src/modeling/types.ts +55 -22
- package/src/modeling/validation/api_model_rules.ts +103 -32
- package/src/models/ProjectRequest.ts +0 -4
- package/src/models/store/Organization.ts +14 -0
- package/src/models/transformers/ArcDexieTransformer.ts +0 -4
- package/src/models/transformers/ImportUtils.ts +1 -1
- package/src/models/transformers/PostmanBackupTransformer.ts +0 -5
- package/src/runtime/constants.ts +9 -0
- package/src/runtime/http-engine/ntlm/Des.ts +1 -0
- package/src/runtime/variables/EvalFunctions.ts +0 -1
- package/src/sdk/OrganizationsSdk.ts +81 -1
- package/src/sdk/RouteBuilder.ts +8 -0
- package/src/sdk/SdkMock.ts +50 -0
- package/tests/test-utils.ts +6 -2
- package/tests/unit/decorators/observed.spec.ts +8 -24
- package/tests/unit/decorators/observed_recursive.spec.ts +0 -1
- package/tests/unit/events/EventsTestHelpers.ts +0 -1
- package/tests/unit/events/events_polyfills.ts +0 -1
- package/tests/unit/legacy-transformers/DataTestHelper.ts +0 -2
- package/tests/unit/legacy-transformers/LegacyExportProcessor.spec.ts +0 -1
- package/tests/unit/modeling/actions/ListAction.spec.ts +9 -69
- package/tests/unit/modeling/actions/SearchAction.spec.ts +9 -35
- package/tests/unit/modeling/api_model.spec.ts +28 -0
- package/tests/unit/modeling/definitions/sku.spec.ts +0 -2
- package/tests/unit/modeling/domain_property.spec.ts +20 -1
- package/tests/unit/modeling/exposed_entity.spec.ts +71 -0
- package/tests/unit/modeling/generators/OasGenerator.spec.ts +302 -0
- package/tests/unit/modeling/validation/api_model_rules.spec.ts +113 -15
|
@@ -321,46 +321,63 @@ export function validateApiModelMetadata(model) {
|
|
|
321
321
|
}
|
|
322
322
|
return issues;
|
|
323
323
|
}
|
|
324
|
-
export function
|
|
324
|
+
export function validateApiPagination(model) {
|
|
325
325
|
const issues = [];
|
|
326
326
|
const context = {
|
|
327
|
-
apiModelKey,
|
|
328
|
-
kind:
|
|
329
|
-
key:
|
|
330
|
-
parentExposedEntityKey: parent.key,
|
|
327
|
+
apiModelKey: model.key,
|
|
328
|
+
kind: ApiModelKind,
|
|
329
|
+
key: model.key,
|
|
331
330
|
};
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
severity: 'error',
|
|
339
|
-
context: { ...context, property: 'pagination' },
|
|
340
|
-
});
|
|
331
|
+
// We only need pagination when the API contains at least one List or Search action
|
|
332
|
+
let validate = false;
|
|
333
|
+
for (const exposure of model.exposes.values()) {
|
|
334
|
+
if (exposure.actions.some((action) => ListAction.isListAction(action) || SearchAction.isSearchAction(action))) {
|
|
335
|
+
validate = true;
|
|
336
|
+
break;
|
|
341
337
|
}
|
|
342
|
-
|
|
343
|
-
|
|
338
|
+
}
|
|
339
|
+
if (!validate) {
|
|
340
|
+
return issues;
|
|
341
|
+
}
|
|
342
|
+
if (!model.pagination || !model.pagination.kind) {
|
|
343
|
+
issues.push({
|
|
344
|
+
code: createCode('API', 'MISSING_PAGINATION'),
|
|
345
|
+
message: 'The API must have a defined pagination strategy when it exposes List or Search actions.',
|
|
346
|
+
suggestion: 'Configure how results are loaded (e.g. by page or by a continuous cursor).',
|
|
347
|
+
severity: 'error',
|
|
348
|
+
context: { ...context, property: 'pagination' },
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
if (model.pagination.defaultLimit === undefined) {
|
|
344
353
|
issues.push({
|
|
345
|
-
code: createCode('
|
|
346
|
-
message: '
|
|
347
|
-
suggestion: '
|
|
348
|
-
severity: '
|
|
349
|
-
context,
|
|
354
|
+
code: createCode('API', 'MISSING_PAGINATION_DEFAULT_LIMIT'),
|
|
355
|
+
message: "The API doesn't have a defined default page limit when it exposes List or Search actions.",
|
|
356
|
+
suggestion: 'Set a default page limit for the pagination otherwise the API will use its default limit.',
|
|
357
|
+
severity: 'info',
|
|
358
|
+
context: { ...context, property: 'pagination.defaultLimit' },
|
|
350
359
|
});
|
|
351
360
|
}
|
|
352
|
-
|
|
353
|
-
if (SearchAction.isSearchAction(action)) {
|
|
354
|
-
if (!action.fields || action.fields.length === 0) {
|
|
361
|
+
if (model.pagination.maxLimit === undefined) {
|
|
355
362
|
issues.push({
|
|
356
|
-
code: createCode('
|
|
357
|
-
message: '
|
|
358
|
-
suggestion: '
|
|
359
|
-
severity: '
|
|
360
|
-
context: { ...context, property: '
|
|
363
|
+
code: createCode('API', 'MISSING_PAGINATION_MAX_LIMIT'),
|
|
364
|
+
message: "The API doesn't have a defined page size max limit when it exposes List or Search actions.",
|
|
365
|
+
suggestion: 'Set a max page size limit for the pagination otherwise the API will use its default max limit.',
|
|
366
|
+
severity: 'info',
|
|
367
|
+
context: { ...context, property: 'pagination.maxLimit' },
|
|
361
368
|
});
|
|
362
369
|
}
|
|
363
370
|
}
|
|
371
|
+
return issues;
|
|
372
|
+
}
|
|
373
|
+
export function validateAction(action, parent, apiModelKey) {
|
|
374
|
+
const issues = [];
|
|
375
|
+
const context = {
|
|
376
|
+
apiModelKey,
|
|
377
|
+
kind: 'Action',
|
|
378
|
+
key: action.kind, // Actions lack nanoids, kind represents its type
|
|
379
|
+
parentExposedEntityKey: parent.key,
|
|
380
|
+
};
|
|
364
381
|
if (DeleteAction.isDeleteAction(action)) {
|
|
365
382
|
if (!action.strategy) {
|
|
366
383
|
issues.push({
|
|
@@ -537,8 +554,14 @@ export function validateExposedEntity(entity, apiModel) {
|
|
|
537
554
|
});
|
|
538
555
|
}
|
|
539
556
|
else {
|
|
557
|
+
let hasSearch = false;
|
|
558
|
+
let hasList = false;
|
|
540
559
|
for (const action of entity.actions) {
|
|
541
560
|
issues.push(...validateAction(action, entity, apiModel.key));
|
|
561
|
+
if (SearchAction.isSearchAction(action))
|
|
562
|
+
hasSearch = true;
|
|
563
|
+
if (ListAction.isListAction(action))
|
|
564
|
+
hasList = true;
|
|
542
565
|
// Check inheritance of access rules
|
|
543
566
|
// For a rule to exist, it might be on the action, the exposure, any parent, or the apiModel.
|
|
544
567
|
let hasAuth = false;
|
|
@@ -568,6 +591,59 @@ export function validateExposedEntity(entity, apiModel) {
|
|
|
568
591
|
});
|
|
569
592
|
}
|
|
570
593
|
}
|
|
594
|
+
if (hasList || hasSearch) {
|
|
595
|
+
const contract = entity.paginationContract;
|
|
596
|
+
if (!contract) {
|
|
597
|
+
issues.push({
|
|
598
|
+
code: createCode('EXPOSURE', 'MISSING_PAGINATION_CONTRACT'),
|
|
599
|
+
message: 'The List or Search action needs a pagination contract.',
|
|
600
|
+
suggestion: 'Add a pagination contract to the exposed entity.',
|
|
601
|
+
severity: 'error',
|
|
602
|
+
context,
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
else {
|
|
606
|
+
if (hasList) {
|
|
607
|
+
if (!contract.filterableFields || contract.filterableFields.length === 0) {
|
|
608
|
+
issues.push({
|
|
609
|
+
code: createCode('EXPOSURE', 'LIST_MISSING_FILTERS'),
|
|
610
|
+
message: 'Listing all elements without filters could be overwhelming for large tables.',
|
|
611
|
+
suggestion: 'Select a few important fields to allow filtering.',
|
|
612
|
+
severity: 'warning',
|
|
613
|
+
context,
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
if (!contract.sortableFields || contract.sortableFields.length === 0) {
|
|
617
|
+
issues.push({
|
|
618
|
+
code: createCode('EXPOSURE', 'LIST_MISSING_SORTING'),
|
|
619
|
+
message: 'Listing all elements without sorting could be overwhelming for large tables.',
|
|
620
|
+
suggestion: 'Select a few important fields to allow sorting.',
|
|
621
|
+
severity: 'warning',
|
|
622
|
+
context,
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
if (hasSearch) {
|
|
627
|
+
// Search and technically be used for filtering.
|
|
628
|
+
const all = [];
|
|
629
|
+
if (Array.isArray(contract.searchableFields)) {
|
|
630
|
+
all.push(...contract.searchableFields);
|
|
631
|
+
}
|
|
632
|
+
if (Array.isArray(contract.filterableFields)) {
|
|
633
|
+
all.push(...contract.filterableFields);
|
|
634
|
+
}
|
|
635
|
+
if (!all.length) {
|
|
636
|
+
issues.push({
|
|
637
|
+
code: createCode('EXPOSURE', 'SEARCH_MISSING_FIELDS'),
|
|
638
|
+
message: 'Search action needs to know which fields to look in.',
|
|
639
|
+
suggestion: 'Select a few important fields to allow searching or full-text search.',
|
|
640
|
+
severity: 'warning',
|
|
641
|
+
context,
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
571
647
|
}
|
|
572
648
|
return issues;
|
|
573
649
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api_model_rules.js","sourceRoot":"","sources":["../../../../src/modeling/validation/api_model_rules.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA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C7B,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACxB,MAAM,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;gBACpC,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACjD,OAAO,GAAG,IAAI,CAAA;oBACd,MAAK;gBACP,CAAC;gBACD,IAAI,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAA;YACvB,CAAC;YAED,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;gBAAE,OAAO,GAAG,IAAI,CAAA;YAErF,IAAI,CAAC,OAAO,EAAE,CAAC;gBACb,MAAM,CAAC,IAAI,CAAC;oBACV,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,sBAAsB,CAAC;oBAClD,OAAO,EAAE,OAAO,MAAM,CAAC,IAAI,kFAAkF;oBAC7G,UAAU,EAAE,qDAAqD;oBACjE,QAAQ,EAAE,OAAO;oBACjB,kDAAkD;oBAClD,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,MAAM,CAAC,GAAG,EAAE;iBAC9F,CAAC,CAAA;YACJ,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import type { ApiModel } from '../ApiModel.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\nimport type { Action } from '../actions/Action.js'\nimport { ListAction } from '../actions/ListAction.js'\nimport { DeleteAction } from '../actions/DeleteAction.js'\nimport { UpdateAction } from '../actions/UpdateAction.js'\nimport { SearchAction } from '../actions/SearchAction.js'\nimport type { RolesBasedAccessControl, UsernamePasswordConfiguration } from '../types.js'\nimport type { ApiModelValidationItem, ApiModelValidationContext } from '../types.js'\nimport { ApiModelKind, ExposedEntityKind } from '../../models/kinds.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Creates a unique validation code.\n * @param entity The entity type (e.g., 'API', 'EXPOSURE', 'ACTION')\n * @param issue The issue identifier (e.g., 'MISSING_NAME')\n */\nfunction createCode(entity: string, issue: string): string {\n return `${entity}_${issue}`\n}\n\n/**\n * Validates the core properties and metadata of an ApiModel.\n */\nexport function validateApiModelInfo(model: ApiModel): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey: model.key,\n kind: ApiModelKind,\n key: model.key,\n }\n\n if (model.kind !== ApiModelKind) {\n issues.push({\n code: createCode('API', 'INVALID_KIND'),\n message: 'The API model type is incorrect.',\n suggestion: 'Set the model type to \"ApiModel\".',\n severity: 'error',\n context: { ...context, property: 'kind' },\n })\n }\n\n if (!model.key || typeof model.key !== 'string' || model.key.trim() === '') {\n issues.push({\n code: createCode('API', 'MISSING_KEY'),\n message: 'The API model is missing a unique identifier.',\n suggestion: 'Provide a valid name to use as a unique identifier.',\n severity: 'error',\n context: { ...context, property: 'key' },\n })\n }\n\n if (!model.info || !model.info.name || model.info.name.trim() === '') {\n issues.push({\n code: createCode('API', 'MISSING_NAME'),\n message: 'The API model has no defined name.',\n suggestion: 'Provide a descriptive name for your API.',\n severity: 'error',\n context: { ...context, property: 'info.name' },\n })\n }\n\n if (!model.info || !model.info.description || model.info.description.trim() === '') {\n issues.push({\n code: createCode('API', 'MISSING_DESCRIPTION'),\n message: 'Adding a description helps others understand your API.',\n suggestion: 'Add a description to clarify the purpose of this API.',\n severity: 'warning',\n context: { ...context, property: 'info.description' },\n })\n }\n\n return issues\n}\n\nexport function validateApiModelDependency(model: ApiModel): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey: model.key,\n kind: ApiModelKind,\n key: model.key,\n }\n\n const domain = model.domain\n if (!domain) {\n issues.push({\n code: createCode('API', 'MISSING_DOMAIN'),\n message: 'No Data Domain is attached to the API.',\n suggestion: 'Select a Data Domain from the settings to power your API.',\n severity: 'error',\n context,\n })\n return issues // Can't validate version if it doesn't exist\n }\n\n if (!domain.info || !domain.info.version) {\n issues.push({\n code: createCode('API', 'MISSING_DOMAIN_VERSION'),\n message: 'The selected Data Domain is missing a version number.',\n suggestion: 'Specify a version for the attached Data Domain.',\n severity: 'error',\n context,\n })\n }\n\n return issues\n}\n\nexport function validateApiModelSecurity(model: ApiModel): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey: model.key,\n kind: ApiModelKind,\n key: model.key,\n }\n\n // Resolve User target\n const userEntity = model.domain && model.user ? model.domain.findEntity(model.user.key, model.user.domain) : undefined\n\n // Authentication\n if (!model.authentication) {\n issues.push({\n code: createCode('API', 'MISSING_AUTHENTICATION'),\n message: 'The API is missing authentication settings.',\n suggestion: 'Go to the security settings and configure how users authenticate.',\n severity: 'error',\n context: { ...context, property: 'authentication' },\n })\n } else if (model.authentication.strategy === 'UsernamePassword') {\n const auth = model.authentication as UsernamePasswordConfiguration\n if (!auth.passwordKey) {\n issues.push({\n code: createCode('API', 'MISSING_PASSWORD_KEY'),\n message: 'Username & Password authentication requires a specific field for the password.',\n suggestion:\n 'Select which field in your user profile should store the password. ' +\n 'The data domain model should have a password data semantic on that property.',\n severity: 'error',\n context: { ...context, property: 'authentication.passwordKey' },\n })\n } else if (userEntity) {\n const passwordProp = Array.from(userEntity.properties).find((p) => p.key === auth.passwordKey)\n if (passwordProp && !passwordProp.hasSemantic(SemanticType.Password)) {\n issues.push({\n code: createCode('API', 'MISSING_PASSWORD_SEMANTIC'),\n message: 'The selected password field is missing the Password data semantic.',\n suggestion: 'Go to the Data Modeler and add the \"Password\" semantic to this property.',\n severity: 'error',\n context: { ...context, property: 'authentication.passwordKey' },\n })\n }\n }\n\n if (userEntity) {\n const hasUsernameSemantic = Array.from(userEntity.properties).some(\n (p) => typeof p.hasSemantic === 'function' && p.hasSemantic(SemanticType.Username)\n )\n if (!hasUsernameSemantic) {\n issues.push({\n code: createCode('API', 'MISSING_USERNAME_SEMANTIC'),\n message: 'Username & Password authentication requires a field with the Username data semantic.',\n suggestion: 'Go to the Data Modeler and add the \"Username\" semantic to the property used for login.',\n severity: 'error',\n context: { ...context, property: 'user' },\n })\n }\n }\n }\n\n // Authorization\n if (!model.authorization) {\n issues.push({\n code: createCode('API', 'MISSING_AUTHORIZATION'),\n message: 'The API is missing authorization settings.',\n suggestion: 'Go to the security settings and configure how to handle user permissions.',\n severity: 'error',\n context: { ...context, property: 'authorization' },\n })\n } else if (model.authorization.strategy === 'RBAC') {\n const rbac = model.authorization as RolesBasedAccessControl\n if (!rbac.roleKey) {\n issues.push({\n code: createCode('API', 'MISSING_ROLE_KEY'),\n message: 'Role-based access control is selected but no role field has been defined.',\n suggestion: \"Select which field in your user profile determines the user's role.\",\n severity: 'error',\n context: { ...context, property: 'authorization.roleKey' },\n })\n } else if (userEntity) {\n const roleProp = Array.from(userEntity.properties).find((p) => p.key === rbac.roleKey)\n if (roleProp && !roleProp.hasSemantic(SemanticType.UserRole)) {\n issues.push({\n code: createCode('API', 'MISSING_ROLE_SEMANTIC'),\n message: 'The selected role field is missing the User Role data semantic.',\n suggestion: 'Go to the Data Modeler and add the \"User Role\" semantic to this property.',\n severity: 'error',\n context: { ...context, property: 'authorization.roleKey' },\n })\n }\n }\n }\n\n // Session\n if (!model.session) {\n issues.push({\n code: createCode('API', 'MISSING_SESSION'),\n message: 'The API is missing session configuration.',\n suggestion: 'Configure how user sessions will be handled.',\n severity: 'error',\n context: { ...context, property: 'session' },\n })\n } else {\n if (!model.session.secret) {\n issues.push({\n code: createCode('API', 'MISSING_SESSION_SECRET'),\n message: 'A secure encryption key is required for sessions.',\n suggestion: 'Provide a strong security key in the session settings.',\n severity: 'error',\n context: { ...context, property: 'session.secret' },\n })\n }\n\n if (!model.session.properties || model.session.properties.length === 0) {\n issues.push({\n code: createCode('API', 'MISSING_SESSION_PROPERTIES'),\n message: 'The session token needs to include at least one piece of user information, like an ID.',\n suggestion: 'Select fields that should be stored securely inside the session payload.',\n severity: 'error',\n context: { ...context, property: 'session.properties' },\n })\n } else if (model.authorization && model.authorization.strategy === 'RBAC') {\n const rbac = model.authorization as RolesBasedAccessControl\n if (rbac.roleKey && !model.session.properties.includes(rbac.roleKey)) {\n issues.push({\n code: createCode('API', 'MISSING_RBAC_SESSION_PROPERTY'),\n message: 'The user role must be included in the session data for permissions to work.',\n suggestion: 'Make sure your selected role field is checked in the session settings.',\n severity: 'error',\n context: { ...context, property: 'session.properties' },\n })\n }\n }\n\n const { cookie, jwt } = model.session\n if ((!cookie || !cookie.enabled) && (!jwt || !jwt.enabled)) {\n issues.push({\n code: createCode('API', 'MISSING_SESSION_TRANSPORT'),\n message: 'No delivery method for sessions (like cookies or tokens) is enabled.',\n suggestion: 'Enable at least one session delivery mechanism in the security settings.',\n severity: 'error',\n context: { ...context, property: 'session' },\n })\n }\n }\n\n // User Target\n if (!model.user) {\n issues.push({\n code: createCode('API', 'MISSING_USER_ENTITY'),\n message: 'You need to specify what kind of object represents your users.',\n suggestion: 'Select a model from your domain that stores your user accounts.',\n severity: 'error',\n context: { ...context, property: 'user' },\n })\n } else if (model.domain && !model.domain.findEntity(model.user.key, model.user.domain)) {\n issues.push({\n code: createCode('API', 'INVALID_USER_ENTITY'),\n message: 'The selected user model no longer exists in your data domain.',\n suggestion: 'Please navigate to security settings and select a valid user model.',\n severity: 'error',\n context: { ...context, property: 'user' },\n })\n }\n\n return issues\n}\n\nexport function validateApiModelMetadata(model: ApiModel): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey: model.key,\n kind: ApiModelKind,\n key: model.key,\n }\n\n const urlRegex = /^https?:\\/\\//i\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n\n if (model.contact) {\n if (model.contact.email && !emailRegex.test(model.contact.email)) {\n issues.push({\n code: createCode('API', 'INVALID_CONTACT_EMAIL'),\n message: 'The contact email address looks invalid.',\n suggestion: 'Please double check the email address formatting.',\n severity: 'error',\n context: { ...context, property: 'contact.email' },\n })\n }\n if (model.contact.url && !urlRegex.test(model.contact.url)) {\n issues.push({\n code: createCode('API', 'INVALID_CONTACT_URL'),\n message: 'The contact link looks invalid.',\n suggestion: 'Provide a working link, starting with http:// or https://.',\n severity: 'error',\n context: { ...context, property: 'contact.url' },\n })\n }\n } else {\n issues.push({\n code: createCode('API', 'MISSING_CONTACT'),\n message: 'A contact email or link is highly recommended for API consumers.',\n suggestion: 'Add an email or help desk link in the metadata tab.',\n severity: 'info',\n context: { ...context, property: 'contact' },\n })\n }\n\n if (model.license) {\n if (model.license.url && !urlRegex.test(model.license.url)) {\n issues.push({\n code: createCode('API', 'INVALID_LICENSE_URL'),\n message: 'The license link looks invalid.',\n suggestion: 'Provide a working link, starting with http:// or https://.',\n severity: 'error',\n context: { ...context, property: 'license.url' },\n })\n }\n } else {\n issues.push({\n code: createCode('API', 'MISSING_LICENSE'),\n message: 'Adding a license to your API helps users understand its usage rights.',\n suggestion: 'Add the name and a link to your API license terms.',\n severity: 'info',\n context: { ...context, property: 'license' },\n })\n }\n\n if (!model.termsOfService) {\n issues.push({\n code: createCode('API', 'MISSING_TOS'),\n message: 'Terms of Service help legal compliance.',\n suggestion: 'Add a link to the terms of your API service.',\n severity: 'info',\n context: { ...context, property: 'termsOfService' },\n })\n }\n\n return issues\n}\n\nexport function validateAction(action: Action, parent: ExposedEntity, apiModelKey: string): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey,\n kind: 'Action',\n key: action.kind, // Actions lack nanoids, kind represents its type\n parentExposedEntityKey: parent.key,\n }\n\n if (ListAction.isListAction(action)) {\n if (!action.pagination || !action.pagination.kind) {\n issues.push({\n code: createCode('ACTION', 'LIST_MISSING_PAGINATION'),\n message: 'A List action must have a defined pagination strategy.',\n suggestion: 'Configure how results are loaded (e.g. by page or by a continuous cursor).',\n severity: 'error',\n context: { ...context, property: 'pagination' },\n })\n }\n if (\n (!action.filterableFields || action.filterableFields.length === 0) &&\n (!action.sortableFields || action.sortableFields.length === 0)\n ) {\n issues.push({\n code: createCode('ACTION', 'LIST_MISSING_FILTERS'),\n message: 'Listing all elements without filters or sorting could be overwhelming for large tables.',\n suggestion: 'Select a few important fields to allow sorting and searching by.',\n severity: 'warning',\n context,\n })\n }\n }\n\n if (SearchAction.isSearchAction(action)) {\n if (!action.fields || action.fields.length === 0) {\n issues.push({\n code: createCode('ACTION', 'SEARCH_MISSING_FIELDS'),\n message: 'A Search action needs to know which fields to look in.',\n suggestion: 'Select the properties (like names or emails) that the search will run on.',\n severity: 'error',\n context: { ...context, property: 'fields' },\n })\n }\n }\n\n if (DeleteAction.isDeleteAction(action)) {\n if (!action.strategy) {\n issues.push({\n code: createCode('ACTION', 'DELETE_MISSING_STRATEGY'),\n message: 'A Delete action must know if you want to completely erase the record, or just hide it.',\n suggestion: 'Configure the deletion type (permanent or soft).',\n severity: 'error',\n context: { ...context, property: 'strategy' },\n })\n } else if (action.strategy === 'hard') {\n issues.push({\n code: createCode('ACTION', 'DELETE_HARD_WARNING'),\n message: 'Permanent delete is active. There will be no way to restore deleted data.',\n suggestion: 'Consider switching to \"soft delete\" if users might need to undo mistakes.',\n severity: 'info',\n context: { ...context, property: 'strategy' },\n })\n }\n }\n\n if (UpdateAction.isUpdateAction(action)) {\n if (!action.allowedMethods || action.allowedMethods.length === 0) {\n issues.push({\n code: createCode('ACTION', 'UPDATE_MISSING_METHODS'),\n message:\n 'An Update action must define how the data is sent (PUT replaces everything; PATCH applies partial changes).',\n suggestion: 'Select at least one allowed HTTP method.',\n severity: 'error',\n context: { ...context, property: 'allowedMethods' },\n })\n }\n }\n\n const allRateLimiters = action.getAllRateLimiters()\n const oneHasRules = allRateLimiters.some((i) => i.rules.length)\n if (!oneHasRules) {\n issues.push({\n code: createCode('ACTION', 'MISSING_RATE_LIMITS'),\n message: 'It is best practice to configure a rate limit so your API is not overwhelmed.',\n suggestion: 'Set a reasonable maximum request speed for this operation.',\n severity: 'warning',\n context,\n })\n }\n\n return issues\n}\n\nexport function validateExposedEntity(entity: ExposedEntity, apiModel: ApiModel): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey: apiModel.key,\n kind: ExposedEntityKind,\n key: entity.key,\n }\n\n // Valid Entity Reference\n if (!entity.entity || !entity.entity.key) {\n issues.push({\n code: createCode('EXPOSURE', 'MISSING_ENTITY_REF'),\n message: 'This exposed endpoint does not point to a specific data model.',\n suggestion: 'Select which database entity this endpoint should serve.',\n severity: 'error',\n context: { ...context, property: 'entity' },\n })\n } else if (apiModel.domain && !apiModel.domain.findEntity(entity.entity.key, entity.entity.domain)) {\n issues.push({\n code: createCode('EXPOSURE', 'INVALID_ENTITY_REF'),\n message: 'This endpoint points to a data model that no longer exists.',\n suggestion: 'Select a new valid database model or delete this endpoint.',\n severity: 'error',\n context: { ...context, property: 'entity' },\n })\n }\n\n // Path Integrity\n if (entity.hasCollection) {\n if (!entity.collectionPath) {\n issues.push({\n code: createCode('EXPOSURE', 'MISSING_COLLECTION_PATH'),\n message: 'When an endpoint exposes a collection, it must define what its base URL path is.',\n suggestion: 'Add a path (e.g., \"/items\").',\n severity: 'error',\n context: { ...context, property: 'collectionPath' },\n })\n } else {\n const parts = entity.collectionPath.split('/').filter(Boolean)\n if (parts.length !== 1 || !entity.collectionPath.startsWith('/')) {\n issues.push({\n code: createCode('EXPOSURE', 'INVALID_COLLECTION_PATH'),\n message: 'The collection URL should start with \"/\" and have no extra slashes.',\n suggestion: `Ensure the path looks like exactly \"/${parts[0] || 'subresource'}\".`,\n severity: 'error',\n context: { ...context, property: 'collectionPath' },\n })\n }\n }\n\n if (!entity.resourcePath) {\n issues.push({\n code: createCode('EXPOSURE', 'MISSING_RESOURCE_PATH'),\n message: 'You need an identifier to locate single items.',\n suggestion: 'Specify the identification parameter format, like \"{id}\".',\n severity: 'error',\n context: { ...context, property: 'resourcePath' },\n })\n } else if (entity.collectionPath) {\n const colRegex = new RegExp(`^${entity.collectionPath}/\\\\{[a-zA-Z0-9_]+\\\\}$`)\n if (!colRegex.test(entity.resourcePath)) {\n issues.push({\n code: createCode('EXPOSURE', 'INVALID_RESOURCE_PATH_FORMAT'),\n message: 'The single item route should match exactly your collection path plus one identifier variable.',\n suggestion: `Make sure the item path is formatted exactly like \"${entity.collectionPath}/{id}\".`,\n severity: 'error',\n context: { ...context, property: 'resourcePath' },\n })\n }\n }\n } else {\n if (!entity.resourcePath) {\n issues.push({\n code: createCode('EXPOSURE', 'MISSING_RESOURCE_PATH'),\n message: 'Endpoints representing a single item must declare their URL route.',\n suggestion: 'Set the URL path (such as \"/profile\").',\n severity: 'error',\n context: { ...context, property: 'resourcePath' },\n })\n } else {\n const parts = entity.resourcePath.split('/').filter(Boolean)\n if (parts.length !== 1 || !entity.resourcePath.startsWith('/')) {\n issues.push({\n code: createCode('EXPOSURE', 'INVALID_RESOURCE_PATH_FORMAT'),\n message: 'The URL route must only contain one exact part or level.',\n suggestion: 'Simplify the endpoint URL to a single segment.',\n severity: 'error',\n context: { ...context, property: 'resourcePath' },\n })\n }\n }\n }\n\n // Path Collisions\n if (entity.isRoot) {\n if (entity.collectionPath) {\n const collectionCollision = apiModel.findCollectionPathCollision(entity.collectionPath, entity.key)\n if (collectionCollision) {\n issues.push({\n code: createCode('EXPOSURE', 'ROOT_COLLECTION_COLLISION'),\n message: `The route \"${entity.collectionPath}\" is already used by another view.`,\n suggestion: 'Give this resource a different path to avoid conflicts.',\n severity: 'error',\n context: { ...context, property: 'collectionPath' },\n })\n }\n }\n\n if (entity.resourcePath) {\n const resourceCollision = apiModel.findResourcePathCollision(entity.resourcePath, entity.key)\n if (resourceCollision) {\n issues.push({\n code: createCode('EXPOSURE', 'ROOT_RESOURCE_COLLISION'),\n message: `The route \"${entity.resourcePath}\" is already used by another view.`,\n suggestion: 'Give this single-item resource a different path to avoid conflicts.',\n severity: 'error',\n context: { ...context, property: 'resourcePath' },\n })\n }\n }\n }\n\n // Minimum Actions\n if (!entity.actions || entity.actions.length === 0) {\n issues.push({\n code: createCode('EXPOSURE', 'MISSING_ACTIONS'),\n message: 'This exposed view does not let users do anything.',\n suggestion: 'Enable at least one operation like Create, Read, or Update.',\n severity: 'error',\n context: { ...context, property: 'actions' },\n })\n } else {\n for (const action of entity.actions) {\n issues.push(...validateAction(action, entity, apiModel.key))\n\n // Check inheritance of access rules\n // For a rule to exist, it might be on the action, the exposure, any parent, or the apiModel.\n let hasAuth = false\n if (action.accessRule && action.accessRule.length > 0) hasAuth = true\n if (!hasAuth && entity.accessRule && entity.accessRule.length > 0) hasAuth = true\n\n let curr = entity.parent?.key\n while (curr && !hasAuth) {\n const p = apiModel.exposes.get(curr)\n if (p && p.accessRule && p.accessRule.length > 0) {\n hasAuth = true\n break\n }\n curr = p?.parent?.key\n }\n\n if (!hasAuth && apiModel.accessRule && apiModel.accessRule.length > 0) hasAuth = true\n\n if (!hasAuth) {\n issues.push({\n code: createCode('ACTION', 'MISSING_ACCESS_RULES'),\n message: `The ${action.kind} action has no security rules attached, making it entirely inaccessible or open.`,\n suggestion: 'Allow specific user roles to access this operation.',\n severity: 'error',\n // using action.kind as the key context equivalent\n context: { ...context, kind: 'Action', key: action.kind, parentExposedEntityKey: entity.key },\n })\n }\n }\n }\n\n return issues\n}\n"]}
|
|
1
|
+
{"version":3,"file":"api_model_rules.js","sourceRoot":"","sources":["../../../../src/modeling/validation/api_model_rules.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,EAAE,YAAY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CAAC,CAAA;oBACJ,CAAC;gBACH,CAAC;gBACD,IAAI,SAAS,EAAE,CAAC;oBACd,gDAAgD;oBAChD,MAAM,GAAG,GAAa,EAAE,CAAA;oBACxB,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;wBAC7C,GAAG,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAA;oBACxC,CAAC;oBACD,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;wBAC7C,GAAG,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAA;oBACxC,CAAC;oBACD,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;wBAChB,MAAM,CAAC,IAAI,CAAC;4BACV,IAAI,EAAE,UAAU,CAAC,UAAU,EAAE,uBAAuB,CAAC;4BACrD,OAAO,EAAE,sDAAsD;4BAC/D,UAAU,EAAE,uEAAuE;4BACnF,QAAQ,EAAE,SAAS;4BACnB,OAAO;yBACR,CAAC,CAAA;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC","sourcesContent":["import type { ApiModel } from '../ApiModel.js'\nimport type { ExposedEntity } from '../ExposedEntity.js'\nimport type { Action } from '../actions/Action.js'\nimport { ListAction } from '../actions/ListAction.js'\nimport { DeleteAction } from '../actions/DeleteAction.js'\nimport { UpdateAction } from '../actions/UpdateAction.js'\nimport { SearchAction } from '../actions/SearchAction.js'\nimport type { RolesBasedAccessControl, UsernamePasswordConfiguration } from '../types.js'\nimport type { ApiModelValidationItem, ApiModelValidationContext } from '../types.js'\nimport { ApiModelKind, ExposedEntityKind } from '../../models/kinds.js'\nimport { SemanticType } from '../Semantics.js'\n\n/**\n * Creates a unique validation code.\n * @param entity The entity type (e.g., 'API', 'EXPOSURE', 'ACTION')\n * @param issue The issue identifier (e.g., 'MISSING_NAME')\n */\nfunction createCode(entity: string, issue: string): string {\n return `${entity}_${issue}`\n}\n\n/**\n * Validates the core properties and metadata of an ApiModel.\n */\nexport function validateApiModelInfo(model: ApiModel): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey: model.key,\n kind: ApiModelKind,\n key: model.key,\n }\n\n if (model.kind !== ApiModelKind) {\n issues.push({\n code: createCode('API', 'INVALID_KIND'),\n message: 'The API model type is incorrect.',\n suggestion: 'Set the model type to \"ApiModel\".',\n severity: 'error',\n context: { ...context, property: 'kind' },\n })\n }\n\n if (!model.key || typeof model.key !== 'string' || model.key.trim() === '') {\n issues.push({\n code: createCode('API', 'MISSING_KEY'),\n message: 'The API model is missing a unique identifier.',\n suggestion: 'Provide a valid name to use as a unique identifier.',\n severity: 'error',\n context: { ...context, property: 'key' },\n })\n }\n\n if (!model.info || !model.info.name || model.info.name.trim() === '') {\n issues.push({\n code: createCode('API', 'MISSING_NAME'),\n message: 'The API model has no defined name.',\n suggestion: 'Provide a descriptive name for your API.',\n severity: 'error',\n context: { ...context, property: 'info.name' },\n })\n }\n\n if (!model.info || !model.info.description || model.info.description.trim() === '') {\n issues.push({\n code: createCode('API', 'MISSING_DESCRIPTION'),\n message: 'Adding a description helps others understand your API.',\n suggestion: 'Add a description to clarify the purpose of this API.',\n severity: 'warning',\n context: { ...context, property: 'info.description' },\n })\n }\n\n return issues\n}\n\nexport function validateApiModelDependency(model: ApiModel): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey: model.key,\n kind: ApiModelKind,\n key: model.key,\n }\n\n const domain = model.domain\n if (!domain) {\n issues.push({\n code: createCode('API', 'MISSING_DOMAIN'),\n message: 'No Data Domain is attached to the API.',\n suggestion: 'Select a Data Domain from the settings to power your API.',\n severity: 'error',\n context,\n })\n return issues // Can't validate version if it doesn't exist\n }\n\n if (!domain.info || !domain.info.version) {\n issues.push({\n code: createCode('API', 'MISSING_DOMAIN_VERSION'),\n message: 'The selected Data Domain is missing a version number.',\n suggestion: 'Specify a version for the attached Data Domain.',\n severity: 'error',\n context,\n })\n }\n\n return issues\n}\n\nexport function validateApiModelSecurity(model: ApiModel): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey: model.key,\n kind: ApiModelKind,\n key: model.key,\n }\n\n // Resolve User target\n const userEntity = model.domain && model.user ? model.domain.findEntity(model.user.key, model.user.domain) : undefined\n\n // Authentication\n if (!model.authentication) {\n issues.push({\n code: createCode('API', 'MISSING_AUTHENTICATION'),\n message: 'The API is missing authentication settings.',\n suggestion: 'Go to the security settings and configure how users authenticate.',\n severity: 'error',\n context: { ...context, property: 'authentication' },\n })\n } else if (model.authentication.strategy === 'UsernamePassword') {\n const auth = model.authentication as UsernamePasswordConfiguration\n if (!auth.passwordKey) {\n issues.push({\n code: createCode('API', 'MISSING_PASSWORD_KEY'),\n message: 'Username & Password authentication requires a specific field for the password.',\n suggestion:\n 'Select which field in your user profile should store the password. ' +\n 'The data domain model should have a password data semantic on that property.',\n severity: 'error',\n context: { ...context, property: 'authentication.passwordKey' },\n })\n } else if (userEntity) {\n const passwordProp = Array.from(userEntity.properties).find((p) => p.key === auth.passwordKey)\n if (passwordProp && !passwordProp.hasSemantic(SemanticType.Password)) {\n issues.push({\n code: createCode('API', 'MISSING_PASSWORD_SEMANTIC'),\n message: 'The selected password field is missing the Password data semantic.',\n suggestion: 'Go to the Data Modeler and add the \"Password\" semantic to this property.',\n severity: 'error',\n context: { ...context, property: 'authentication.passwordKey' },\n })\n }\n }\n\n if (userEntity) {\n const hasUsernameSemantic = Array.from(userEntity.properties).some(\n (p) => typeof p.hasSemantic === 'function' && p.hasSemantic(SemanticType.Username)\n )\n if (!hasUsernameSemantic) {\n issues.push({\n code: createCode('API', 'MISSING_USERNAME_SEMANTIC'),\n message: 'Username & Password authentication requires a field with the Username data semantic.',\n suggestion: 'Go to the Data Modeler and add the \"Username\" semantic to the property used for login.',\n severity: 'error',\n context: { ...context, property: 'user' },\n })\n }\n }\n }\n\n // Authorization\n if (!model.authorization) {\n issues.push({\n code: createCode('API', 'MISSING_AUTHORIZATION'),\n message: 'The API is missing authorization settings.',\n suggestion: 'Go to the security settings and configure how to handle user permissions.',\n severity: 'error',\n context: { ...context, property: 'authorization' },\n })\n } else if (model.authorization.strategy === 'RBAC') {\n const rbac = model.authorization as RolesBasedAccessControl\n if (!rbac.roleKey) {\n issues.push({\n code: createCode('API', 'MISSING_ROLE_KEY'),\n message: 'Role-based access control is selected but no role field has been defined.',\n suggestion: \"Select which field in your user profile determines the user's role.\",\n severity: 'error',\n context: { ...context, property: 'authorization.roleKey' },\n })\n } else if (userEntity) {\n const roleProp = Array.from(userEntity.properties).find((p) => p.key === rbac.roleKey)\n if (roleProp && !roleProp.hasSemantic(SemanticType.UserRole)) {\n issues.push({\n code: createCode('API', 'MISSING_ROLE_SEMANTIC'),\n message: 'The selected role field is missing the User Role data semantic.',\n suggestion: 'Go to the Data Modeler and add the \"User Role\" semantic to this property.',\n severity: 'error',\n context: { ...context, property: 'authorization.roleKey' },\n })\n }\n }\n }\n\n // Session\n if (!model.session) {\n issues.push({\n code: createCode('API', 'MISSING_SESSION'),\n message: 'The API is missing session configuration.',\n suggestion: 'Configure how user sessions will be handled.',\n severity: 'error',\n context: { ...context, property: 'session' },\n })\n } else {\n if (!model.session.secret) {\n issues.push({\n code: createCode('API', 'MISSING_SESSION_SECRET'),\n message: 'A secure encryption key is required for sessions.',\n suggestion: 'Provide a strong security key in the session settings.',\n severity: 'error',\n context: { ...context, property: 'session.secret' },\n })\n }\n\n if (!model.session.properties || model.session.properties.length === 0) {\n issues.push({\n code: createCode('API', 'MISSING_SESSION_PROPERTIES'),\n message: 'The session token needs to include at least one piece of user information, like an ID.',\n suggestion: 'Select fields that should be stored securely inside the session payload.',\n severity: 'error',\n context: { ...context, property: 'session.properties' },\n })\n } else if (model.authorization && model.authorization.strategy === 'RBAC') {\n const rbac = model.authorization as RolesBasedAccessControl\n if (rbac.roleKey && !model.session.properties.includes(rbac.roleKey)) {\n issues.push({\n code: createCode('API', 'MISSING_RBAC_SESSION_PROPERTY'),\n message: 'The user role must be included in the session data for permissions to work.',\n suggestion: 'Make sure your selected role field is checked in the session settings.',\n severity: 'error',\n context: { ...context, property: 'session.properties' },\n })\n }\n }\n\n const { cookie, jwt } = model.session\n if ((!cookie || !cookie.enabled) && (!jwt || !jwt.enabled)) {\n issues.push({\n code: createCode('API', 'MISSING_SESSION_TRANSPORT'),\n message: 'No delivery method for sessions (like cookies or tokens) is enabled.',\n suggestion: 'Enable at least one session delivery mechanism in the security settings.',\n severity: 'error',\n context: { ...context, property: 'session' },\n })\n }\n }\n\n // User Target\n if (!model.user) {\n issues.push({\n code: createCode('API', 'MISSING_USER_ENTITY'),\n message: 'You need to specify what kind of object represents your users.',\n suggestion: 'Select a model from your domain that stores your user accounts.',\n severity: 'error',\n context: { ...context, property: 'user' },\n })\n } else if (model.domain && !model.domain.findEntity(model.user.key, model.user.domain)) {\n issues.push({\n code: createCode('API', 'INVALID_USER_ENTITY'),\n message: 'The selected user model no longer exists in your data domain.',\n suggestion: 'Please navigate to security settings and select a valid user model.',\n severity: 'error',\n context: { ...context, property: 'user' },\n })\n }\n\n return issues\n}\n\nexport function validateApiModelMetadata(model: ApiModel): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey: model.key,\n kind: ApiModelKind,\n key: model.key,\n }\n\n const urlRegex = /^https?:\\/\\//i\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\n\n if (model.contact) {\n if (model.contact.email && !emailRegex.test(model.contact.email)) {\n issues.push({\n code: createCode('API', 'INVALID_CONTACT_EMAIL'),\n message: 'The contact email address looks invalid.',\n suggestion: 'Please double check the email address formatting.',\n severity: 'error',\n context: { ...context, property: 'contact.email' },\n })\n }\n if (model.contact.url && !urlRegex.test(model.contact.url)) {\n issues.push({\n code: createCode('API', 'INVALID_CONTACT_URL'),\n message: 'The contact link looks invalid.',\n suggestion: 'Provide a working link, starting with http:// or https://.',\n severity: 'error',\n context: { ...context, property: 'contact.url' },\n })\n }\n } else {\n issues.push({\n code: createCode('API', 'MISSING_CONTACT'),\n message: 'A contact email or link is highly recommended for API consumers.',\n suggestion: 'Add an email or help desk link in the metadata tab.',\n severity: 'info',\n context: { ...context, property: 'contact' },\n })\n }\n\n if (model.license) {\n if (model.license.url && !urlRegex.test(model.license.url)) {\n issues.push({\n code: createCode('API', 'INVALID_LICENSE_URL'),\n message: 'The license link looks invalid.',\n suggestion: 'Provide a working link, starting with http:// or https://.',\n severity: 'error',\n context: { ...context, property: 'license.url' },\n })\n }\n } else {\n issues.push({\n code: createCode('API', 'MISSING_LICENSE'),\n message: 'Adding a license to your API helps users understand its usage rights.',\n suggestion: 'Add the name and a link to your API license terms.',\n severity: 'info',\n context: { ...context, property: 'license' },\n })\n }\n\n if (!model.termsOfService) {\n issues.push({\n code: createCode('API', 'MISSING_TOS'),\n message: 'Terms of Service help legal compliance.',\n suggestion: 'Add a link to the terms of your API service.',\n severity: 'info',\n context: { ...context, property: 'termsOfService' },\n })\n }\n\n return issues\n}\n\nexport function validateApiPagination(model: ApiModel): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey: model.key,\n kind: ApiModelKind,\n key: model.key,\n }\n // We only need pagination when the API contains at least one List or Search action\n let validate = false\n for (const exposure of model.exposes.values()) {\n if (exposure.actions.some((action) => ListAction.isListAction(action) || SearchAction.isSearchAction(action))) {\n validate = true\n break\n }\n }\n if (!validate) {\n return issues\n }\n if (!model.pagination || !model.pagination.kind) {\n issues.push({\n code: createCode('API', 'MISSING_PAGINATION'),\n message: 'The API must have a defined pagination strategy when it exposes List or Search actions.',\n suggestion: 'Configure how results are loaded (e.g. by page or by a continuous cursor).',\n severity: 'error',\n context: { ...context, property: 'pagination' },\n })\n } else {\n if (model.pagination.defaultLimit === undefined) {\n issues.push({\n code: createCode('API', 'MISSING_PAGINATION_DEFAULT_LIMIT'),\n message: \"The API doesn't have a defined default page limit when it exposes List or Search actions.\",\n suggestion: 'Set a default page limit for the pagination otherwise the API will use its default limit.',\n severity: 'info',\n context: { ...context, property: 'pagination.defaultLimit' },\n })\n }\n if (model.pagination.maxLimit === undefined) {\n issues.push({\n code: createCode('API', 'MISSING_PAGINATION_MAX_LIMIT'),\n message: \"The API doesn't have a defined page size max limit when it exposes List or Search actions.\",\n suggestion: 'Set a max page size limit for the pagination otherwise the API will use its default max limit.',\n severity: 'info',\n context: { ...context, property: 'pagination.maxLimit' },\n })\n }\n }\n return issues\n}\n\nexport function validateAction(action: Action, parent: ExposedEntity, apiModelKey: string): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey,\n kind: 'Action',\n key: action.kind, // Actions lack nanoids, kind represents its type\n parentExposedEntityKey: parent.key,\n }\n\n if (DeleteAction.isDeleteAction(action)) {\n if (!action.strategy) {\n issues.push({\n code: createCode('ACTION', 'DELETE_MISSING_STRATEGY'),\n message: 'A Delete action must know if you want to completely erase the record, or just hide it.',\n suggestion: 'Configure the deletion type (permanent or soft).',\n severity: 'error',\n context: { ...context, property: 'strategy' },\n })\n } else if (action.strategy === 'hard') {\n issues.push({\n code: createCode('ACTION', 'DELETE_HARD_WARNING'),\n message: 'Permanent delete is active. There will be no way to restore deleted data.',\n suggestion: 'Consider switching to \"soft delete\" if users might need to undo mistakes.',\n severity: 'info',\n context: { ...context, property: 'strategy' },\n })\n }\n }\n\n if (UpdateAction.isUpdateAction(action)) {\n if (!action.allowedMethods || action.allowedMethods.length === 0) {\n issues.push({\n code: createCode('ACTION', 'UPDATE_MISSING_METHODS'),\n message:\n 'An Update action must define how the data is sent (PUT replaces everything; PATCH applies partial changes).',\n suggestion: 'Select at least one allowed HTTP method.',\n severity: 'error',\n context: { ...context, property: 'allowedMethods' },\n })\n }\n }\n\n const allRateLimiters = action.getAllRateLimiters()\n const oneHasRules = allRateLimiters.some((i) => i.rules.length)\n if (!oneHasRules) {\n issues.push({\n code: createCode('ACTION', 'MISSING_RATE_LIMITS'),\n message: 'It is best practice to configure a rate limit so your API is not overwhelmed.',\n suggestion: 'Set a reasonable maximum request speed for this operation.',\n severity: 'warning',\n context,\n })\n }\n\n return issues\n}\n\nexport function validateExposedEntity(entity: ExposedEntity, apiModel: ApiModel): ApiModelValidationItem[] {\n const issues: ApiModelValidationItem[] = []\n const context: ApiModelValidationContext = {\n apiModelKey: apiModel.key,\n kind: ExposedEntityKind,\n key: entity.key,\n }\n\n // Valid Entity Reference\n if (!entity.entity || !entity.entity.key) {\n issues.push({\n code: createCode('EXPOSURE', 'MISSING_ENTITY_REF'),\n message: 'This exposed endpoint does not point to a specific data model.',\n suggestion: 'Select which database entity this endpoint should serve.',\n severity: 'error',\n context: { ...context, property: 'entity' },\n })\n } else if (apiModel.domain && !apiModel.domain.findEntity(entity.entity.key, entity.entity.domain)) {\n issues.push({\n code: createCode('EXPOSURE', 'INVALID_ENTITY_REF'),\n message: 'This endpoint points to a data model that no longer exists.',\n suggestion: 'Select a new valid database model or delete this endpoint.',\n severity: 'error',\n context: { ...context, property: 'entity' },\n })\n }\n\n // Path Integrity\n if (entity.hasCollection) {\n if (!entity.collectionPath) {\n issues.push({\n code: createCode('EXPOSURE', 'MISSING_COLLECTION_PATH'),\n message: 'When an endpoint exposes a collection, it must define what its base URL path is.',\n suggestion: 'Add a path (e.g., \"/items\").',\n severity: 'error',\n context: { ...context, property: 'collectionPath' },\n })\n } else {\n const parts = entity.collectionPath.split('/').filter(Boolean)\n if (parts.length !== 1 || !entity.collectionPath.startsWith('/')) {\n issues.push({\n code: createCode('EXPOSURE', 'INVALID_COLLECTION_PATH'),\n message: 'The collection URL should start with \"/\" and have no extra slashes.',\n suggestion: `Ensure the path looks like exactly \"/${parts[0] || 'subresource'}\".`,\n severity: 'error',\n context: { ...context, property: 'collectionPath' },\n })\n }\n }\n\n if (!entity.resourcePath) {\n issues.push({\n code: createCode('EXPOSURE', 'MISSING_RESOURCE_PATH'),\n message: 'You need an identifier to locate single items.',\n suggestion: 'Specify the identification parameter format, like \"{id}\".',\n severity: 'error',\n context: { ...context, property: 'resourcePath' },\n })\n } else if (entity.collectionPath) {\n const colRegex = new RegExp(`^${entity.collectionPath}/\\\\{[a-zA-Z0-9_]+\\\\}$`)\n if (!colRegex.test(entity.resourcePath)) {\n issues.push({\n code: createCode('EXPOSURE', 'INVALID_RESOURCE_PATH_FORMAT'),\n message: 'The single item route should match exactly your collection path plus one identifier variable.',\n suggestion: `Make sure the item path is formatted exactly like \"${entity.collectionPath}/{id}\".`,\n severity: 'error',\n context: { ...context, property: 'resourcePath' },\n })\n }\n }\n } else {\n if (!entity.resourcePath) {\n issues.push({\n code: createCode('EXPOSURE', 'MISSING_RESOURCE_PATH'),\n message: 'Endpoints representing a single item must declare their URL route.',\n suggestion: 'Set the URL path (such as \"/profile\").',\n severity: 'error',\n context: { ...context, property: 'resourcePath' },\n })\n } else {\n const parts = entity.resourcePath.split('/').filter(Boolean)\n if (parts.length !== 1 || !entity.resourcePath.startsWith('/')) {\n issues.push({\n code: createCode('EXPOSURE', 'INVALID_RESOURCE_PATH_FORMAT'),\n message: 'The URL route must only contain one exact part or level.',\n suggestion: 'Simplify the endpoint URL to a single segment.',\n severity: 'error',\n context: { ...context, property: 'resourcePath' },\n })\n }\n }\n }\n\n // Path Collisions\n if (entity.isRoot) {\n if (entity.collectionPath) {\n const collectionCollision = apiModel.findCollectionPathCollision(entity.collectionPath, entity.key)\n if (collectionCollision) {\n issues.push({\n code: createCode('EXPOSURE', 'ROOT_COLLECTION_COLLISION'),\n message: `The route \"${entity.collectionPath}\" is already used by another view.`,\n suggestion: 'Give this resource a different path to avoid conflicts.',\n severity: 'error',\n context: { ...context, property: 'collectionPath' },\n })\n }\n }\n\n if (entity.resourcePath) {\n const resourceCollision = apiModel.findResourcePathCollision(entity.resourcePath, entity.key)\n if (resourceCollision) {\n issues.push({\n code: createCode('EXPOSURE', 'ROOT_RESOURCE_COLLISION'),\n message: `The route \"${entity.resourcePath}\" is already used by another view.`,\n suggestion: 'Give this single-item resource a different path to avoid conflicts.',\n severity: 'error',\n context: { ...context, property: 'resourcePath' },\n })\n }\n }\n }\n\n // Minimum Actions\n if (!entity.actions || entity.actions.length === 0) {\n issues.push({\n code: createCode('EXPOSURE', 'MISSING_ACTIONS'),\n message: 'This exposed view does not let users do anything.',\n suggestion: 'Enable at least one operation like Create, Read, or Update.',\n severity: 'error',\n context: { ...context, property: 'actions' },\n })\n } else {\n let hasSearch = false\n let hasList = false\n for (const action of entity.actions) {\n issues.push(...validateAction(action, entity, apiModel.key))\n\n if (SearchAction.isSearchAction(action)) hasSearch = true\n if (ListAction.isListAction(action)) hasList = true\n\n // Check inheritance of access rules\n // For a rule to exist, it might be on the action, the exposure, any parent, or the apiModel.\n let hasAuth = false\n if (action.accessRule && action.accessRule.length > 0) hasAuth = true\n if (!hasAuth && entity.accessRule && entity.accessRule.length > 0) hasAuth = true\n\n let curr = entity.parent?.key\n while (curr && !hasAuth) {\n const p = apiModel.exposes.get(curr)\n if (p && p.accessRule && p.accessRule.length > 0) {\n hasAuth = true\n break\n }\n curr = p?.parent?.key\n }\n\n if (!hasAuth && apiModel.accessRule && apiModel.accessRule.length > 0) hasAuth = true\n\n if (!hasAuth) {\n issues.push({\n code: createCode('ACTION', 'MISSING_ACCESS_RULES'),\n message: `The ${action.kind} action has no security rules attached, making it entirely inaccessible or open.`,\n suggestion: 'Allow specific user roles to access this operation.',\n severity: 'error',\n // using action.kind as the key context equivalent\n context: { ...context, kind: 'Action', key: action.kind, parentExposedEntityKey: entity.key },\n })\n }\n }\n\n if (hasList || hasSearch) {\n const contract = entity.paginationContract\n if (!contract) {\n issues.push({\n code: createCode('EXPOSURE', 'MISSING_PAGINATION_CONTRACT'),\n message: 'The List or Search action needs a pagination contract.',\n suggestion: 'Add a pagination contract to the exposed entity.',\n severity: 'error',\n context,\n })\n } else {\n if (hasList) {\n if (!contract.filterableFields || contract.filterableFields.length === 0) {\n issues.push({\n code: createCode('EXPOSURE', 'LIST_MISSING_FILTERS'),\n message: 'Listing all elements without filters could be overwhelming for large tables.',\n suggestion: 'Select a few important fields to allow filtering.',\n severity: 'warning',\n context,\n })\n }\n if (!contract.sortableFields || contract.sortableFields.length === 0) {\n issues.push({\n code: createCode('EXPOSURE', 'LIST_MISSING_SORTING'),\n message: 'Listing all elements without sorting could be overwhelming for large tables.',\n suggestion: 'Select a few important fields to allow sorting.',\n severity: 'warning',\n context,\n })\n }\n }\n if (hasSearch) {\n // Search and technically be used for filtering.\n const all: string[] = []\n if (Array.isArray(contract.searchableFields)) {\n all.push(...contract.searchableFields)\n }\n if (Array.isArray(contract.filterableFields)) {\n all.push(...contract.filterableFields)\n }\n if (!all.length) {\n issues.push({\n code: createCode('EXPOSURE', 'SEARCH_MISSING_FIELDS'),\n message: 'Search action needs to know which fields to look in.',\n suggestion: 'Select a few important fields to allow searching or full-text search.',\n severity: 'warning',\n context,\n })\n }\n }\n }\n }\n }\n\n return issues\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectRequest.d.ts","sourceRoot":"","sources":["../../../src/models/ProjectRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAA;AACtG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAE,YAAY,EAA2B,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,QAAQ,E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 +244,6 @@ export class ProjectRequest extends Request {
|
|
|
244
244
|
if (!environment) {
|
|
245
245
|
return undefined;
|
|
246
246
|
}
|
|
247
|
-
let parent = this.getParent();
|
|
248
|
-
if (parent === project) {
|
|
249
|
-
parent = undefined;
|
|
250
|
-
}
|
|
251
247
|
return project.findEnvironment(environment);
|
|
252
248
|
}
|
|
253
249
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectRequest.js","sourceRoot":"","sources":["../../../src/models/ProjectRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAGrC,OAAO,EAAgB,IAAI,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAExE,OAAO,EAAY,OAAO,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAA;AA+CzC;;;;;;GAMG;AACH,MAAM,OAAO,cAAe,SAAQ,OAAO;IAChC,IAAI,GAAG,IAAI,CAAA;IAEpB;;OAEG;IACH,GAAG,GAAG,EAAE,CAAA;IAER;;OAEG;IACH,OAAO,CAAa;IAEpB;;;;OAIG;IACH,WAAW,CAAS;IAEpB;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAc;QACpC,MAAM,KAAK,GAAG,KAAwB,CAAA;QACtC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YAClC,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAU,OAAO,CAAC,GAAW,EAAE,OAAqB;QACxD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MA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I,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,EAAE,CAAC;YACzE,OAAO,OAAO,CAAC,aAAa,CAAA;QAC9B,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED;;OAEG;IACO,6BAA6B;QACrC,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAA;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAC5F,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,OAAO,CAAC,aAAuC,CAAA;QACxD,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;CACF","sourcesContent":["import { nanoid } from '../nanoid.js'\nimport { ProjectDefinitionProperty, IProjectDefinitionProperty } from './ProjectDefinitionProperty.js'\nimport { ProjectFolder } from './ProjectFolder.js'\nimport { IHttpRequest, Kind as HttpRequestKind } from './HttpRequest.js'\nimport { HttpProject } from './HttpProject.js'\nimport { IRequest, Request } from './Request.js'\nimport { Environment } from './Environment.js'\nimport { Property } from './Property.js'\nimport { Server } from './Server.js'\nimport { UriTemplate } from '../lib/parsers/UriTemplate.js'\nimport { RequestAuthorization } from './RequestAuthorization.js'\nimport { Thing } from './Thing.js'\n\nexport const Kind = 'Core#ProjectRequest'\n\nexport interface RequestUrlReadOptions {\n /**\n * When set it won't apply variables to the URL.\n */\n noVariables?: boolean\n /**\n * When set is returns the only the base URL defined in the environment without\n * adding the `url` defined on the request object. *\n */\n baseUrl?: boolean\n /**\n * When set it uses these variables instead one the onces defined on the project.\n * When this is defined then `noVariables` has no effect.\n */\n variables?: Record<string, string>\n}\n\nexport interface IProjectRequest extends IProjectDefinitionProperty, IRequest {\n kind: typeof Kind\n /**\n * The identifier of the request.\n */\n key: string\n /**\n * The key of an environment defined on the project to apply to this request.\n * When not set it inherits environments from parents.\n * However, when this is set, it makes sure that server/variables from this environment are always applied.\n */\n environment?: string\n}\n\nexport interface IRequestCloneOptions {\n /**\n * By default it revalidates (re-creates) keys in the request.\n * Set this to true to not make any changes to the keys.\n */\n withoutRevalidate?: boolean\n /**\n * By default it attaches the request to the same parent as the original request.\n * Set this to `true` when moving a request between projects to prevent adding the request to the project.\n * Note, the request still have a reference to the original project. You need to update the `project` property.\n */\n withoutAttach?: boolean\n}\n\n/**\n * **Note about the payload.**\n *\n * The payload is **always** stored in the request object in its serialized form.\n * Use the `readPayload()` to read the correct data type and the `writePayload()` to\n * safely store the payload.\n */\nexport class ProjectRequest extends Request implements ProjectDefinitionProperty {\n override kind = Kind\n\n /**\n * The identifier of the request.\n */\n key = ''\n\n /**\n * A reference to the top level project object.\n */\n project: HttpProject\n\n /**\n * The key of an environment defined on the project to apply to this request.\n * When not set it inherits environments from parents.\n * However, when this is set, it makes sure that server/variables from this environment are always applied.\n */\n environment?: string\n\n /**\n * Checks whether the input is a definition of a project folder.\n */\n static isProjectRequest(input: unknown): boolean {\n const typed = input as IProjectRequest\n if (!input || typed.kind !== Kind) {\n return false\n }\n return true\n }\n\n /**\n * Creates a project request from an URL.\n * This does not manipulate the project.\n *\n * @param url The Request URL. This is required.\n * @param project The parent project.\n */\n static override fromUrl(url: string, project?: HttpProject): ProjectRequest {\n if (!project) {\n throw new Error(`The project is required.`)\n }\n const now: number = Date.now()\n const request = new ProjectRequest(project, {\n key: nanoid(),\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url,\n },\n info: Thing.fromName(url).toJSON(),\n })\n return request\n }\n\n /**\n * Creates a project request from a name.\n * This does not manipulate the project.\n *\n * @param name The Request name.\n * @param project The parent project.This is required.\n */\n static override fromName(name: string, project?: HttpProject): ProjectRequest {\n if (!project) {\n throw new Error(`The project is required.`)\n }\n const now: number = Date.now()\n const request = new ProjectRequest(project, {\n key: nanoid(),\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url: '',\n },\n info: Thing.fromName(name).toJSON(),\n })\n return request\n }\n\n /**\n * Creates a project request from an HttpRequest definition.\n * This does not manipulate the project.\n *\n * @param project The parent project This is required.\n * @param info The request data.\n */\n static override fromHttpRequest(info: IHttpRequest, project?: HttpProject): ProjectRequest {\n if (!project) {\n throw new Error(`The project is required.`)\n }\n const now: number = Date.now()\n const request = new ProjectRequest(project, {\n key: nanoid(),\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: info.method,\n url: info.url,\n headers: info.headers,\n payload: info.payload,\n },\n info: Thing.fromName(info.url).toJSON(),\n })\n return request\n }\n\n /**\n * Creates a project request for a schema of a Request.\n */\n static fromRequest(request: IRequest, project: HttpProject): ProjectRequest {\n const key = nanoid()\n const init: IProjectRequest = { ...request, key, kind: Kind }\n const result = new ProjectRequest(project, init)\n return result\n }\n\n constructor(project: HttpProject, input?: string | IProjectRequest) {\n super(input)\n this.project = project\n let init: IProjectRequest\n if (typeof input === 'string') {\n init = JSON.parse(input)\n } else if (typeof input === 'object') {\n init = input\n } else {\n const now: number = Date.now()\n init = {\n key: nanoid(),\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url: '',\n },\n info: Thing.fromName('').toJSON(),\n }\n }\n this.new(init)\n }\n\n override new(init: IProjectRequest): void {\n super.new(init)\n\n const { key, environment } = init as IProjectRequest\n this.key = key || nanoid()\n if (environment) {\n this.environment = environment\n }\n }\n\n override toJSON(): IProjectRequest {\n const request = super.toJSON()\n const result: IProjectRequest = { ...request, key: this.key, kind: Kind }\n if (this.environment) {\n result.environment = this.environment\n }\n return result\n }\n\n /**\n * The callback called when the object is attached to a parent.\n * This is called when the object is created and inserted to a project or a folder\n * and when the object is moved between folders.\n */\n attachedCallback(): void {\n // ...\n }\n\n /**\n * The callback called when the object is detached from its parent.\n * This callback is called when the item is deleted from a folder or a project,\n * or when the item is about to be moved to another folder.\n */\n detachedCallback(): void {\n // ...\n }\n\n /**\n * @returns The instance of the HttpProject or a ProjectFolder that is a closes parent of this instance.\n */\n getParent(): ProjectFolder | HttpProject | undefined {\n const { project, key } = this\n return project.findParent(key)\n }\n\n /**\n * @returns A reference to the parent folder or the top-level HTTP project.\n */\n getProject(): HttpProject {\n return this.project\n }\n\n /**\n * Removes this request from the project.\n */\n remove(): void {\n this.project.removeRequest(this.key)\n }\n\n /**\n * Makes a copy of this request.\n * By default it attaches the copied request to the same parent.\n * Use the options dictionary to control this behavior.\n */\n clone(opts: IRequestCloneOptions = {}): ProjectRequest {\n const copy = new ProjectRequest(this.project, this.toJSON())\n if (!opts.withoutRevalidate) {\n copy.key = nanoid()\n }\n if (!opts.withoutAttach) {\n // if the parent is the project then add the request to the project.\n const parent = this.getParent()\n if (parent) {\n parent.addRequest(copy)\n }\n }\n return copy\n }\n\n /**\n * The static version of the `clone()` method.\n *\n * @param request The request schema to clone.\n * @param project The project to add the request to.\n * @param opts Optional options.\n * @returns The copied request.\n */\n static clone(request: IProjectRequest, project: HttpProject, opts: IRequestCloneOptions = {}): ProjectRequest {\n const obj = new ProjectRequest(project, request)\n return obj.clone(opts)\n }\n\n /**\n * @returns The environment that should be applied to the request, if any.\n */\n getEnvironment(): Environment | undefined {\n const { environment, project } = this\n if (!environment) {\n return undefined\n }\n let parent = this.getParent()\n if (parent === project) {\n parent = undefined\n }\n return project.findEnvironment(environment)\n }\n\n /**\n * @returns All environments that can be applied to this request.\n */\n readEnvironments(): Environment[] {\n let parent = this.getParent()\n if (parent === this.project) {\n parent = undefined\n }\n return this.project.readEnvironments({ parent: parent?.key })\n }\n\n /**\n * It reads the URL from an environment defined for the request..\n * The environment servers and variables are applies for all environments defined on each folder down to this request.\n * This respects the `encapsulate` flag defined on an environment.\n *\n * By default it applies variables collected from the environments to the url. You can configure this behavior\n * by passing a configuration option.\n *\n * Note on performance.\n * This is a heave computing operation so use it sparingly. For best performance only compute the URL when\n * environments, environment selection or variables change.\n *\n * @param opts Read URL options\n * @returns the read URL or undefined when the URL/environments are not defined.\n */\n readUrl(opts: RequestUrlReadOptions = {}): string | undefined {\n const { environment } = this\n const expects = this.getExpects()\n // note, this list respects the `encapsulate` flag.\n const environments = this.readEnvironments()\n\n let requestUrl = opts.baseUrl ? undefined : expects.url\n if (!environments) {\n if (requestUrl && opts.variables) {\n return this.evaluateUri(requestUrl, opts.variables)\n }\n return requestUrl || undefined\n }\n\n // we assume that absolute URL has a scheme with a delimiter (://). However, the scheme value can be an URL.\n // When the request starts with `/` is obviously a relative (no domain) URL\n // The edge case is `{` because it may mean a variable with a domain or a path to be appended to the base URI\n // defined in an environment. However, we choose to use `/` as the indicator of being a \"relative\" URL.\n const isAbsolute = !!requestUrl && !requestUrl.startsWith('/') && requestUrl.includes('://')\n if (isAbsolute && opts.noVariables) {\n // we know the URL exists, it is absolute (server wouldn't be applied anyway), and we don't\n // want to apply variables. We return what we have so far.\n return requestUrl\n }\n\n const flatProperties: Property[] = []\n let effectiveServer: Server | undefined\n for (const env of environments) {\n if (env.server && env.server.uri) {\n effectiveServer = env.server\n }\n if (!opts.noVariables && !opts.variables && env.variables) {\n for (const prop of env.variables) {\n // environments are listed from the project's root down to the folder where the request\n // exists. When a folder has a variable that was already defined it is replaced.\n this.addProperty(prop, flatProperties)\n }\n }\n if (env.key === environment) {\n break\n }\n }\n\n if (!requestUrl) {\n // we return whatever we have in the server.\n if (effectiveServer) {\n // flatProperties is be empty if `noVariables` option is passed.\n const uri = effectiveServer.readUri()\n if (opts.variables) {\n return this.evaluateUri(uri, opts.variables)\n }\n return this.evaluateUri(uri, flatProperties)\n }\n return undefined\n }\n\n if (isAbsolute) {\n // ignore server reading and just apply variables to the request URL\n if (opts.variables) {\n return this.evaluateUri(requestUrl, opts.variables)\n }\n return this.evaluateUri(requestUrl, flatProperties)\n }\n\n let serverUrl = ''\n if (effectiveServer) {\n serverUrl = effectiveServer.readUri()\n }\n if (!serverUrl.endsWith('/')) {\n serverUrl += '/'\n }\n if (requestUrl.startsWith('/')) {\n requestUrl = requestUrl.substring(1)\n }\n const url = serverUrl + requestUrl\n if (opts.variables) {\n return this.evaluateUri(url, opts.variables)\n }\n return this.evaluateUri(url, flatProperties)\n }\n\n protected addProperty(item: Property, list: Property[]): void {\n const index = list.findIndex((i) => i.name === item.name)\n if (index >= 0) {\n list.splice(index, 1)\n }\n list.push(item)\n }\n\n /**\n * Evaluates the URI against variables.\n *\n * Note, this doesn't throw errors. When error occurs it returns the input string.\n *\n * @param uri The URI to process\n * @param variables The list of variables to use\n * @returns Expanded URI.\n */\n protected evaluateUri(uri: string, variables?: Property[] | Record<string, string>): string {\n if (!variables) {\n return uri\n }\n\n let vars: Record<string, string> | undefined\n if (Array.isArray(variables)) {\n if (variables.length) {\n vars = Property.toMap(variables) as Record<string, string>\n }\n } else {\n vars = variables\n }\n if (!vars) {\n return uri\n }\n let result = uri\n try {\n result = new UriTemplate(uri).expand(vars, { ignoreMissing: true })\n } catch {\n //\n }\n return result\n }\n\n /**\n * Reads the authorization that should be applied to the request.\n *\n * 1) First it returns the locally (on the request) defined authorization.\n * 2) Then it returns authorization defined on the selected environment.\n * 3) If has defined environment but no authorization on it, then it returns empty array.\n * 4) Only if the request has no selected environment then it reads first environment\n * that has authorization (from the request up to the project's root).\n */\n readAuthorization(): RequestAuthorization[] {\n if (Array.isArray(this.authorization) && this.authorization.length) {\n return this.authorization\n }\n const envAuth = this.readEnvironmentAuthorization()\n if (envAuth) {\n return envAuth\n }\n if (this.environment) {\n return []\n }\n const inherited = this.readEnvironmentsAuthorization()\n if (inherited) {\n return inherited\n }\n return []\n }\n\n /**\n * @returns Authorization defined on the selected environment or undefined.\n */\n protected readEnvironmentAuthorization(): RequestAuthorization[] | undefined {\n const selfEnv = this.getEnvironment()\n if (!selfEnv) {\n return undefined\n }\n if (Array.isArray(selfEnv.authorization) && selfEnv.authorization.length) {\n return selfEnv.authorization\n }\n return undefined\n }\n\n /**\n * @returns Authorization defined on any inherited environment or undefined.\n */\n protected readEnvironmentsAuthorization(): RequestAuthorization[] | undefined {\n const envs = this.readEnvironments()\n const authEnv = envs.find((i) => Array.isArray(i.authorization) && !!i.authorization.length)\n if (authEnv) {\n return authEnv.authorization as RequestAuthorization[]\n }\n return undefined\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ProjectRequest.js","sourceRoot":"","sources":["../../../src/models/ProjectRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAGrC,OAAO,EAAgB,IAAI,IAAI,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAExE,OAAO,EAAY,OAAO,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAElC,MAAM,CAAC,MAAM,IAAI,GAAG,qBAAqB,CAAA;AA+CzC;;;;;;GAMG;AACH,MAAM,OAAO,cAAe,SAAQ,OAAO;IAChC,IAAI,GAAG,IAAI,CAAA;IAEpB;;OAEG;IACH,GAAG,GAAG,EAAE,CAAA;IAER;;OAEG;IACH,OAAO,CAAa;IAEpB;;;;OAIG;IACH,WAAW,CAAS;IAEpB;;OAEG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAc;QACpC,MAAM,KAAK,GAAG,KAAwB,CAAA;QACtC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YAClC,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CAAU,OAAO,CAAC,GAAW,EAAE,OAAqB;QACxD,IAAI,CAAC,OAAO,EAAE,CAA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CAAA;QAC9B,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;IAED;;OAEG;IACO,6BAA6B;QACrC,MAAM,IAAI,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAA;QACpC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;QAC5F,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,OAAO,CAAC,aAAuC,CAAA;QACxD,CAAC;QACD,OAAO,SAAS,CAAA;IAClB,CAAC;CACF","sourcesContent":["import { nanoid } from '../nanoid.js'\nimport { ProjectDefinitionProperty, IProjectDefinitionProperty } from './ProjectDefinitionProperty.js'\nimport { ProjectFolder } from './ProjectFolder.js'\nimport { IHttpRequest, Kind as HttpRequestKind } from './HttpRequest.js'\nimport { HttpProject } from './HttpProject.js'\nimport { IRequest, Request } from './Request.js'\nimport { Environment } from './Environment.js'\nimport { Property } from './Property.js'\nimport { Server } from './Server.js'\nimport { UriTemplate } from '../lib/parsers/UriTemplate.js'\nimport { RequestAuthorization } from './RequestAuthorization.js'\nimport { Thing } from './Thing.js'\n\nexport const Kind = 'Core#ProjectRequest'\n\nexport interface RequestUrlReadOptions {\n /**\n * When set it won't apply variables to the URL.\n */\n noVariables?: boolean\n /**\n * When set is returns the only the base URL defined in the environment without\n * adding the `url` defined on the request object. *\n */\n baseUrl?: boolean\n /**\n * When set it uses these variables instead one the onces defined on the project.\n * When this is defined then `noVariables` has no effect.\n */\n variables?: Record<string, string>\n}\n\nexport interface IProjectRequest extends IProjectDefinitionProperty, IRequest {\n kind: typeof Kind\n /**\n * The identifier of the request.\n */\n key: string\n /**\n * The key of an environment defined on the project to apply to this request.\n * When not set it inherits environments from parents.\n * However, when this is set, it makes sure that server/variables from this environment are always applied.\n */\n environment?: string\n}\n\nexport interface IRequestCloneOptions {\n /**\n * By default it revalidates (re-creates) keys in the request.\n * Set this to true to not make any changes to the keys.\n */\n withoutRevalidate?: boolean\n /**\n * By default it attaches the request to the same parent as the original request.\n * Set this to `true` when moving a request between projects to prevent adding the request to the project.\n * Note, the request still have a reference to the original project. You need to update the `project` property.\n */\n withoutAttach?: boolean\n}\n\n/**\n * **Note about the payload.**\n *\n * The payload is **always** stored in the request object in its serialized form.\n * Use the `readPayload()` to read the correct data type and the `writePayload()` to\n * safely store the payload.\n */\nexport class ProjectRequest extends Request implements ProjectDefinitionProperty {\n override kind = Kind\n\n /**\n * The identifier of the request.\n */\n key = ''\n\n /**\n * A reference to the top level project object.\n */\n project: HttpProject\n\n /**\n * The key of an environment defined on the project to apply to this request.\n * When not set it inherits environments from parents.\n * However, when this is set, it makes sure that server/variables from this environment are always applied.\n */\n environment?: string\n\n /**\n * Checks whether the input is a definition of a project folder.\n */\n static isProjectRequest(input: unknown): boolean {\n const typed = input as IProjectRequest\n if (!input || typed.kind !== Kind) {\n return false\n }\n return true\n }\n\n /**\n * Creates a project request from an URL.\n * This does not manipulate the project.\n *\n * @param url The Request URL. This is required.\n * @param project The parent project.\n */\n static override fromUrl(url: string, project?: HttpProject): ProjectRequest {\n if (!project) {\n throw new Error(`The project is required.`)\n }\n const now: number = Date.now()\n const request = new ProjectRequest(project, {\n key: nanoid(),\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url,\n },\n info: Thing.fromName(url).toJSON(),\n })\n return request\n }\n\n /**\n * Creates a project request from a name.\n * This does not manipulate the project.\n *\n * @param name The Request name.\n * @param project The parent project.This is required.\n */\n static override fromName(name: string, project?: HttpProject): ProjectRequest {\n if (!project) {\n throw new Error(`The project is required.`)\n }\n const now: number = Date.now()\n const request = new ProjectRequest(project, {\n key: nanoid(),\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url: '',\n },\n info: Thing.fromName(name).toJSON(),\n })\n return request\n }\n\n /**\n * Creates a project request from an HttpRequest definition.\n * This does not manipulate the project.\n *\n * @param project The parent project This is required.\n * @param info The request data.\n */\n static override fromHttpRequest(info: IHttpRequest, project?: HttpProject): ProjectRequest {\n if (!project) {\n throw new Error(`The project is required.`)\n }\n const now: number = Date.now()\n const request = new ProjectRequest(project, {\n key: nanoid(),\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: info.method,\n url: info.url,\n headers: info.headers,\n payload: info.payload,\n },\n info: Thing.fromName(info.url).toJSON(),\n })\n return request\n }\n\n /**\n * Creates a project request for a schema of a Request.\n */\n static fromRequest(request: IRequest, project: HttpProject): ProjectRequest {\n const key = nanoid()\n const init: IProjectRequest = { ...request, key, kind: Kind }\n const result = new ProjectRequest(project, init)\n return result\n }\n\n constructor(project: HttpProject, input?: string | IProjectRequest) {\n super(input)\n this.project = project\n let init: IProjectRequest\n if (typeof input === 'string') {\n init = JSON.parse(input)\n } else if (typeof input === 'object') {\n init = input\n } else {\n const now: number = Date.now()\n init = {\n key: nanoid(),\n kind: Kind,\n created: now,\n updated: now,\n expects: {\n kind: HttpRequestKind,\n method: 'GET',\n url: '',\n },\n info: Thing.fromName('').toJSON(),\n }\n }\n this.new(init)\n }\n\n override new(init: IProjectRequest): void {\n super.new(init)\n\n const { key, environment } = init as IProjectRequest\n this.key = key || nanoid()\n if (environment) {\n this.environment = environment\n }\n }\n\n override toJSON(): IProjectRequest {\n const request = super.toJSON()\n const result: IProjectRequest = { ...request, key: this.key, kind: Kind }\n if (this.environment) {\n result.environment = this.environment\n }\n return result\n }\n\n /**\n * The callback called when the object is attached to a parent.\n * This is called when the object is created and inserted to a project or a folder\n * and when the object is moved between folders.\n */\n attachedCallback(): void {\n // ...\n }\n\n /**\n * The callback called when the object is detached from its parent.\n * This callback is called when the item is deleted from a folder or a project,\n * or when the item is about to be moved to another folder.\n */\n detachedCallback(): void {\n // ...\n }\n\n /**\n * @returns The instance of the HttpProject or a ProjectFolder that is a closes parent of this instance.\n */\n getParent(): ProjectFolder | HttpProject | undefined {\n const { project, key } = this\n return project.findParent(key)\n }\n\n /**\n * @returns A reference to the parent folder or the top-level HTTP project.\n */\n getProject(): HttpProject {\n return this.project\n }\n\n /**\n * Removes this request from the project.\n */\n remove(): void {\n this.project.removeRequest(this.key)\n }\n\n /**\n * Makes a copy of this request.\n * By default it attaches the copied request to the same parent.\n * Use the options dictionary to control this behavior.\n */\n clone(opts: IRequestCloneOptions = {}): ProjectRequest {\n const copy = new ProjectRequest(this.project, this.toJSON())\n if (!opts.withoutRevalidate) {\n copy.key = nanoid()\n }\n if (!opts.withoutAttach) {\n // if the parent is the project then add the request to the project.\n const parent = this.getParent()\n if (parent) {\n parent.addRequest(copy)\n }\n }\n return copy\n }\n\n /**\n * The static version of the `clone()` method.\n *\n * @param request The request schema to clone.\n * @param project The project to add the request to.\n * @param opts Optional options.\n * @returns The copied request.\n */\n static clone(request: IProjectRequest, project: HttpProject, opts: IRequestCloneOptions = {}): ProjectRequest {\n const obj = new ProjectRequest(project, request)\n return obj.clone(opts)\n }\n\n /**\n * @returns The environment that should be applied to the request, if any.\n */\n getEnvironment(): Environment | undefined {\n const { environment, project } = this\n if (!environment) {\n return undefined\n }\n return project.findEnvironment(environment)\n }\n\n /**\n * @returns All environments that can be applied to this request.\n */\n readEnvironments(): Environment[] {\n let parent = this.getParent()\n if (parent === this.project) {\n parent = undefined\n }\n return this.project.readEnvironments({ parent: parent?.key })\n }\n\n /**\n * It reads the URL from an environment defined for the request..\n * The environment servers and variables are applies for all environments defined on each folder down to this request.\n * This respects the `encapsulate` flag defined on an environment.\n *\n * By default it applies variables collected from the environments to the url. You can configure this behavior\n * by passing a configuration option.\n *\n * Note on performance.\n * This is a heave computing operation so use it sparingly. For best performance only compute the URL when\n * environments, environment selection or variables change.\n *\n * @param opts Read URL options\n * @returns the read URL or undefined when the URL/environments are not defined.\n */\n readUrl(opts: RequestUrlReadOptions = {}): string | undefined {\n const { environment } = this\n const expects = this.getExpects()\n // note, this list respects the `encapsulate` flag.\n const environments = this.readEnvironments()\n\n let requestUrl = opts.baseUrl ? undefined : expects.url\n if (!environments) {\n if (requestUrl && opts.variables) {\n return this.evaluateUri(requestUrl, opts.variables)\n }\n return requestUrl || undefined\n }\n\n // we assume that absolute URL has a scheme with a delimiter (://). However, the scheme value can be an URL.\n // When the request starts with `/` is obviously a relative (no domain) URL\n // The edge case is `{` because it may mean a variable with a domain or a path to be appended to the base URI\n // defined in an environment. However, we choose to use `/` as the indicator of being a \"relative\" URL.\n const isAbsolute = !!requestUrl && !requestUrl.startsWith('/') && requestUrl.includes('://')\n if (isAbsolute && opts.noVariables) {\n // we know the URL exists, it is absolute (server wouldn't be applied anyway), and we don't\n // want to apply variables. We return what we have so far.\n return requestUrl\n }\n\n const flatProperties: Property[] = []\n let effectiveServer: Server | undefined\n for (const env of environments) {\n if (env.server && env.server.uri) {\n effectiveServer = env.server\n }\n if (!opts.noVariables && !opts.variables && env.variables) {\n for (const prop of env.variables) {\n // environments are listed from the project's root down to the folder where the request\n // exists. When a folder has a variable that was already defined it is replaced.\n this.addProperty(prop, flatProperties)\n }\n }\n if (env.key === environment) {\n break\n }\n }\n\n if (!requestUrl) {\n // we return whatever we have in the server.\n if (effectiveServer) {\n // flatProperties is be empty if `noVariables` option is passed.\n const uri = effectiveServer.readUri()\n if (opts.variables) {\n return this.evaluateUri(uri, opts.variables)\n }\n return this.evaluateUri(uri, flatProperties)\n }\n return undefined\n }\n\n if (isAbsolute) {\n // ignore server reading and just apply variables to the request URL\n if (opts.variables) {\n return this.evaluateUri(requestUrl, opts.variables)\n }\n return this.evaluateUri(requestUrl, flatProperties)\n }\n\n let serverUrl = ''\n if (effectiveServer) {\n serverUrl = effectiveServer.readUri()\n }\n if (!serverUrl.endsWith('/')) {\n serverUrl += '/'\n }\n if (requestUrl.startsWith('/')) {\n requestUrl = requestUrl.substring(1)\n }\n const url = serverUrl + requestUrl\n if (opts.variables) {\n return this.evaluateUri(url, opts.variables)\n }\n return this.evaluateUri(url, flatProperties)\n }\n\n protected addProperty(item: Property, list: Property[]): void {\n const index = list.findIndex((i) => i.name === item.name)\n if (index >= 0) {\n list.splice(index, 1)\n }\n list.push(item)\n }\n\n /**\n * Evaluates the URI against variables.\n *\n * Note, this doesn't throw errors. When error occurs it returns the input string.\n *\n * @param uri The URI to process\n * @param variables The list of variables to use\n * @returns Expanded URI.\n */\n protected evaluateUri(uri: string, variables?: Property[] | Record<string, string>): string {\n if (!variables) {\n return uri\n }\n\n let vars: Record<string, string> | undefined\n if (Array.isArray(variables)) {\n if (variables.length) {\n vars = Property.toMap(variables) as Record<string, string>\n }\n } else {\n vars = variables\n }\n if (!vars) {\n return uri\n }\n let result = uri\n try {\n result = new UriTemplate(uri).expand(vars, { ignoreMissing: true })\n } catch {\n //\n }\n return result\n }\n\n /**\n * Reads the authorization that should be applied to the request.\n *\n * 1) First it returns the locally (on the request) defined authorization.\n * 2) Then it returns authorization defined on the selected environment.\n * 3) If has defined environment but no authorization on it, then it returns empty array.\n * 4) Only if the request has no selected environment then it reads first environment\n * that has authorization (from the request up to the project's root).\n */\n readAuthorization(): RequestAuthorization[] {\n if (Array.isArray(this.authorization) && this.authorization.length) {\n return this.authorization\n }\n const envAuth = this.readEnvironmentAuthorization()\n if (envAuth) {\n return envAuth\n }\n if (this.environment) {\n return []\n }\n const inherited = this.readEnvironmentsAuthorization()\n if (inherited) {\n return inherited\n }\n return []\n }\n\n /**\n * @returns Authorization defined on the selected environment or undefined.\n */\n protected readEnvironmentAuthorization(): RequestAuthorization[] | undefined {\n const selfEnv = this.getEnvironment()\n if (!selfEnv) {\n return undefined\n }\n if (Array.isArray(selfEnv.authorization) && selfEnv.authorization.length) {\n return selfEnv.authorization\n }\n return undefined\n }\n\n /**\n * @returns Authorization defined on any inherited environment or undefined.\n */\n protected readEnvironmentsAuthorization(): RequestAuthorization[] | undefined {\n const envs = this.readEnvironments()\n const authEnv = envs.find((i) => Array.isArray(i.authorization) && !!i.authorization.length)\n if (authEnv) {\n return authEnv.authorization as RequestAuthorization[]\n }\n return undefined\n }\n}\n"]}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import type { DeletionSchema } from './Deletion.js';
|
|
2
2
|
import { OrganizationKind } from '../kinds.js';
|
|
3
3
|
export type UserOrganizationGrantType = 'owner' | 'manager' | 'editor' | 'viewer';
|
|
4
|
+
/**
|
|
5
|
+
* The response of the organization slug validation.
|
|
6
|
+
*/
|
|
7
|
+
export interface OrganizationSlugValidateResponse {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the slug is valid.
|
|
10
|
+
*/
|
|
11
|
+
valid: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The reason why the slug is invalid.
|
|
14
|
+
*/
|
|
15
|
+
reason?: string;
|
|
16
|
+
}
|
|
4
17
|
/**
|
|
5
18
|
* In the system the user identity represents registration information associated with a specific identity provider.
|
|
6
19
|
* This association allows the user to use different identity providers that map to the same user, as long as the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Organization.d.ts","sourceRoot":"","sources":["../../../../src/models/store/Organization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAE9C,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEjF;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,OAAO,gBAAgB,CAAA;IAC7B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IACnB;;OAEG;IACH,OAAO,C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