Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ coverage
helm
reports
.release-please-manifest.json
HANDOFF.md
200 changes: 164 additions & 36 deletions openapi3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,71 +7,136 @@ info:
name: MIT
url: https://opensource.org/licenses/MIT
paths:
/anotherResource:
get:
operationId: getAnotherResource
/record:
post:
operationId: createRecord
tags:
- anotherResource
summary: gets the resource
- record
summary: Start an ingestion process flow
description: Validates the request (light & fast) and creates a Jobnik ingestion job.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ingestionPayload'
responses:
201:
description: Ingestion job created
content:
application/json:
schema:
$ref: '#/components/schemas/jobResponse'
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/error'
/record/{id}:
delete:
operationId: deleteRecord
tags:
- record
summary: Start a delete process flow
description: Validates the record can be deleted and creates a Jobnik delete job.
parameters:
- $ref: '#/components/parameters/recordId'
responses:
200:
description: OK
description: Delete job created
content:
application/json:
schema:
$ref: '#/components/schemas/anotherResource'
$ref: '#/components/schemas/jobResponse'
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/error'
/resourceName:
get:
operationId: getResourceName
404:
description: Record not found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
patch:
operationId: updateRecord
tags:
- resourceName
summary: gets the resource
- record
summary: Update metadata for a record
parameters:
- $ref: '#/components/parameters/recordId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/updatePayload'
responses:
200:
description: OK
description: Metadata updated
content:
application/json:
schema:
$ref: '#/components/schemas/resource'
$ref: '#/components/schemas/ackResponse'
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/error'
post:
operationId: createResource
404:
description: Record not found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
/record/status/{id}:
patch:
operationId: updateRecordStatus
tags:
- resourceName
summary: creates a new record of type resource
- record
summary: Update the publish/unpublish status of a record
parameters:
- $ref: '#/components/parameters/recordId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/resource'
$ref: '#/components/schemas/statusPayload'
responses:
201:
description: created
200:
description: Status updated
content:
application/json:
schema:
$ref: '#/components/schemas/resource'
$ref: '#/components/schemas/ackResponse'
400:
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/error'
404:
description: Record not found
content:
application/json:
schema:
$ref: '#/components/schemas/error'
security:
- {}
components:
parameters:
recordId:
name: id
in: path
required: true
description: The record identifier
schema:
type: string
schemas:
error:
type: object
Expand All @@ -80,27 +145,90 @@ components:
properties:
message:
type: string
resource:
ingestionPayload:
Comment thread
asafmas-rnd marked this conversation as resolved.
Resolved
type: object
required:
- id
- name
- description
- modelPath
- productShapefilePath
- metadataShapefilePath
- productName
- productId
- productType
- classification
- region
properties:
id:
type: number
format: int64
name:
modelPath:
type: string
description: Path to the model inside the data/ folder - a tileset.json (3D Tiles) or a .3tz file
example: /shared/models/afula/data/tileset.json
productShapefilePath:
type: string
description: Path to the footprint shapefile (shape/Product.shp)
example: /shared/models/afula/shape/Product.shp
metadataShapefilePath:
type: string
description: Path to the parts metadata shapefile (shape/ShapeMetadata.shp)
example: /shared/models/afula/shape/ShapeMetadata.shp
productName:
type: string
maxLength: 120
description: Pre-filled from the prodName shapefile attribute, user editable
productId:
type: string
description: Deterministic id derived from the prodID attribute and the storage id
productType:
type: string
enum:
- 3DPhotoRealistic
- 3DPhotoRealisticBest
- 3DSemantic
- 3DSemanticMesh
- QuantizedMeshDTMBest
- QuantizedMeshDSMBest
- 3DPointCloud
productSubType:
type: string
description:
type: string
anotherResource:
region:
type: array
minItems: 1
items:
type: string
classification:
type: string
pattern: '^[a-zA-Z0-9]+$'
keywords:
type: string
additionalProperties: false
updatePayload:
type: object
description: Partial metadata fields to update
additionalProperties: true
statusPayload:
type: object
required:
- status
properties:
status:
type: string
enum:
- PUBLISHED
- UNPUBLISHED
jobResponse:
type: object
required:
- kind
- isAlive
- jobId
- status
properties:
kind:
jobId:
type: string
status:
type: string
ackResponse:
type: object
required:
- message
properties:
message:
type: string
isAlive:
type: boolean
29 changes: 0 additions & 29 deletions src/anotherResource/controllers/anotherResourceController.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/anotherResource/models/anotherResourceManager.ts

This file was deleted.

16 changes: 0 additions & 16 deletions src/anotherResource/routes/anotherResourceRouter.ts

This file was deleted.

6 changes: 6 additions & 0 deletions src/common/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ export interface IConfig {
get: <T>(setting: string) => T;
has: (setting: string) => boolean;
}

export interface LogContext {
fileName: string;
class: string;
function?: string;
}
6 changes: 2 additions & 4 deletions src/containerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { jsLogger } from '@map-colonies/js-logger';
import { type InjectionObject, registerDependencies } from '@common/dependencyRegistration';
import { SERVICES, SERVICE_NAME } from '@common/constants';
import { getTracing } from '@common/tracing';
import { resourceNameRouterFactory, RESOURCE_NAME_ROUTER_SYMBOL } from './resourceName/routes/resourceNameRouter';
import { anotherResourceRouterFactory, ANOTHER_RESOURCE_ROUTER_SYMBOL } from './anotherResource/routes/anotherResourceRouter';
import { recordRouterFactory, RECORD_ROUTER_SYMBOL } from './record/routes/recordRouter';
import { getConfig } from './common/config';

export interface RegisterOptions {
Expand All @@ -31,8 +30,7 @@ export const registerExternalValues = async (options?: RegisterOptions): Promise
{ token: SERVICES.LOGGER, provider: { useValue: logger } },
{ token: SERVICES.TRACER, provider: { useValue: tracer } },
{ token: SERVICES.METRICS, provider: { useValue: metricsRegistry } },
{ token: RESOURCE_NAME_ROUTER_SYMBOL, provider: { useFactory: resourceNameRouterFactory } },
{ token: ANOTHER_RESOURCE_ROUTER_SYMBOL, provider: { useFactory: anotherResourceRouterFactory } },
{ token: RECORD_ROUTER_SYMBOL, provider: { useFactory: recordRouterFactory } },
{
token: 'onSignal',
provider: {
Expand Down
Loading
Loading