Skip to content
Open
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
163 changes: 126 additions & 37 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,51 @@ components:
properties:
message:
type: string
resource:
ingestionPayload:
type: object
required:
- id
- name
- description
- modelPath
- tilesetFilename
- metadata
properties:
id:
type: number
format: int64
name:
modelPath:
type: string
description:
description: Path on the shared storage to the 3DTiles folder or 3TZ archive
tilesetFilename:
type: string
anotherResource:
description: The tileset entry name (e.g. tileset.json)
metadata:
type: object
description: 3D record metadata (business validation applied downstream)
additionalProperties: true
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:
- jobId
- status
properties:
jobId:
type: string
status:
type: string
ackResponse:
type: object
required:
- kind
- isAlive
- message
properties:
kind:
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