From 1a2428d08a42673750abdbf779d248ac2ae39349 Mon Sep 17 00:00:00 2001 From: Jakub Vacek Date: Fri, 8 Oct 2021 07:43:29 +0200 Subject: [PATCH 1/3] feat: add basic maps --- .../maps/azure-cognitive-services.suma | 112 +++++++++ .../maps/google-vision-api.suma | 229 ++++++++++++++++++ .../identity/face-detection/maps/mock.suma | 114 +++++++++ .../identity/face-detection/maps/mock.test.ts | 46 ++++ .../identity/face-detection/profile.supr | 87 +++++++ providers/azure-cognitive-services.json | 18 ++ providers/google-vision-api.json | 18 ++ superface/sdk.d.ts | 72 +++--- superface/sdk.js | 19 +- superface/super.json | 37 +++ superface/types/identity/face-detection.d.ts | 50 ++++ superface/types/identity/face-detection.js | 11 + yarn.lock | 1 - 13 files changed, 770 insertions(+), 44 deletions(-) create mode 100644 capabilities/identity/face-detection/maps/azure-cognitive-services.suma create mode 100644 capabilities/identity/face-detection/maps/google-vision-api.suma create mode 100644 capabilities/identity/face-detection/maps/mock.suma create mode 100644 capabilities/identity/face-detection/maps/mock.test.ts create mode 100644 capabilities/identity/face-detection/profile.supr create mode 100644 providers/azure-cognitive-services.json create mode 100644 providers/google-vision-api.json create mode 100644 superface/types/identity/face-detection.d.ts create mode 100644 superface/types/identity/face-detection.js diff --git a/capabilities/identity/face-detection/maps/azure-cognitive-services.suma b/capabilities/identity/face-detection/maps/azure-cognitive-services.suma new file mode 100644 index 000000000..7a0b236be --- /dev/null +++ b/capabilities/identity/face-detection/maps/azure-cognitive-services.suma @@ -0,0 +1,112 @@ +profile = "identity/face-detection@1.0" +provider = "azure-cognitive-services" + +""" +FaceDetection map +""" +map FaceDetection { + instance = input.instance + imageUrl = input.imageUrl + + http POST "/face/v1.0/detect" { + security "azure-subscription-key" + + request { + query { + 'detectionModel' = "detection_01" + 'returnFaceLandmarks' = true + 'returnFaceAttributes'='emotion' + } + headers { + "Content-Type" = "application/json" + } + body { + url = imageUrl + } + } + + response { + return map error if (statusCode !== 200) { + code = body.error.code + message = body.error.message + } + + faces = body.map((r) => { + const resolveLikelihood = (value) => { + if(value >= 0 && value <= 0.2) { + return 'veryUnlikely' + } + + if(value > 0.2 && value <= 0.4) { + return 'unlikely' + } + + if(value > 0.4 && value <= 0.6) { + return 'possible' + } + + if(value > 0.6 && value <= 0.8) { + return 'likely' + } + + if(value > 0.8 && value <= 1) { + return 'verylikely' + } + + return 'unknown' + } + + return { + faceRectangle: { + topLeft: { + x: r.faceRectangle.left, + y: r.faceRectangle.top, + }, + topRight: { + x: r.faceRectangle.left + r.faceRectangle.width, + y: r.faceRectangle.top, + }, + bottomLeft: { + x: r.faceRectangle.left, + y: r.faceRectangle.top + r.faceRectangle.height + }, + bottomRight: { + x: r.faceRectangle.left + r.faceRectangle.width, + y: r.faceRectangle.top + r.faceRectangle.height + } + }, + landmarks: [ + {kind: 'leftPupil', x: r.faceLandmarks.pupilLeft.x, y: r.faceLandmarks.pupilLeft.y }, + {kind: 'rightPupil', x: r.faceLandmarks.pupilRight.x, y: r.faceLandmarks.pupilRight.y }, + {kind: 'noseTip', x: r.faceLandmarks.noseTip.x, y: r.faceLandmarks.noseTip.y }, + {kind: 'mouthLeft', x: r.faceLandmarks.mouthLeft.x, y: r.faceLandmarks.mouthLeft.y }, + {kind: 'mouthRight', x: r.faceLandmarks.mouthRight.x, y: r.faceLandmarks.mouthRight.y }, + {kind: 'eyebrowLeftOuter', x: r.faceLandmarks.eyebrowLeftOuter.x, y: r.faceLandmarks.eyebrowLeftOuter.y }, + {kind: 'eyebrowLeftInner', x: r.faceLandmarks.eyebrowLeftInner.x, y: r.faceLandmarks.eyebrowLeftInner.y }, + {kind: 'eyeLeftOuter', x: r.faceLandmarks.eyeLeftOuter.x, y: r.faceLandmarks.eyeLeftOuter.y }, + {kind: 'eyeLeftTop', x: r.faceLandmarks.eyeLeftTop.x, y: r.faceLandmarks.eyeLeftTop.y }, + {kind: 'eyeLeftBottom', x: r.faceLandmarks.eyeLeftBottom.x, y: r.faceLandmarks.eyeLeftBottom.y }, + {kind: 'eyeLeftInner', x: r.faceLandmarks.eyeLeftInner.x, y: r.faceLandmarks.eyeLeftInner.y }, + {kind: 'eyebrowRightInner', x: r.faceLandmarks.eyebrowRightInner.x, y: r.faceLandmarks.eyebrowRightInner.y }, + {kind: 'eyebrowRightOuter', x: r.faceLandmarks.eyebrowRightOuter.x, y: r.faceLandmarks.eyebrowRightOuter.y }, + {kind: 'eyeRightInner', x: r.faceLandmarks.eyeRightInner.x, y: r.faceLandmarks.eyeRightInner.y }, + {kind: 'eyeRightTop', x: r.faceLandmarks.eyeRightTop.x, y: r.faceLandmarks.eyeRightTop.y }, + {kind: 'eyeRightBottom', x: r.faceLandmarks.eyeRightBottom.x, y: r.faceLandmarks.eyeRightBottom.y }, + {kind: 'eyeRightOuter', x: r.faceLandmarks.eyeRightOuter.x, y: r.faceLandmarks.eyeRightOuter.y }, + {kind: 'noseRootLeft', x: r.faceLandmarks.noseRootLeft.x, y: r.faceLandmarks.noseRootLeft.y }, + {kind: 'noseRootRight', x: r.faceLandmarks.noseRootRight.x, y: r.faceLandmarks.noseRootRight.y }, + ], + emotions: { + happiness: resolveLikelihood(r.faceAttributes.emotion.happiness), + anger: resolveLikelihood(r.faceAttributes.emotion.anger), + sadness: resolveLikelihood(r.faceAttributes.emotion.sadness), + surprise: resolveLikelihood(r.faceAttributes.emotion.surprise) + } + } + }) + return map result [{ faces: faces }] + } + } +} + + diff --git a/capabilities/identity/face-detection/maps/google-vision-api.suma b/capabilities/identity/face-detection/maps/google-vision-api.suma new file mode 100644 index 000000000..1b3849e5b --- /dev/null +++ b/capabilities/identity/face-detection/maps/google-vision-api.suma @@ -0,0 +1,229 @@ +profile = "identity/face-detection@1.0" +provider = "google-vision-api" + +""" +FaceDetection map +""" +map FaceDetection { + imageUrl = input.imageUrl + + + http POST "/v1/images:annotate" { + security "google-api-key" + + request { + headers { + "Content-Type" = "application/json" + } + body { + requests = [{ + features: [ + { + maxResults: 1, + type: "FACE_DETECTION" + } + ], + image: { + source: { + imageUri: imageUrl + } + } + }] + } + } + + response { + return map error if (statusCode !== 200) { + code = body.error.code + message = body.error.message + } + + map result body.responses.map((res) => { + return { + faces: res.faceAnnotations.map((faceAnnotation) => { + const resolveLikelihood = (value) => { + if(value === 'VERY_UNLIKELY') { + return 'veryUnlikely' + } + + if(value === 'UNLIKELY') { + return 'unlikely' + } + + if(value === 'POSSIBLE') { + return 'possible' + } + + if(value === 'LIKELY') { + return 'likely' + } + + if(value === 'VERY_LIKELY') { + return 'verylikely' + } + + return 'unknown' + } + + return { + faceRectangle: { + bottomLeft: {x: faceAnnotation.boundingPoly.vertices[0].x, y: faceAnnotation.boundingPoly.vertices[0].y}, + bottomRight: {x: faceAnnotation.boundingPoly.vertices[1].x, y: faceAnnotation.boundingPoly.vertices[1].y}, + topRight: {x: faceAnnotation.boundingPoly.vertices[2].x, y: faceAnnotation.boundingPoly.vertices[2].y}, + topLeft: {x: faceAnnotation.boundingPoly.vertices[3].x, y: faceAnnotation.boundingPoly.vertices[3].y}, + }, + landmarks: faceAnnotation.landmarks.map((landmark) => { + //Left eyebrow + if(landmark.type === 'LEFT_OF_LEFT_EYEBROW') { + return { + kind: 'eyebrowLeftOuter', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'RIGHT_OF_LEFT_EYEBROW') { + return { + kind: 'eyebrowLeftInner', + x: landmark.position.x, + y: landmark.position.y + } + } + //Right eyebrow + if(landmark.type === 'RIGHT_OF_RIGHT_EYEBROW') { + return { + kind: 'eyebrowRightOuter', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'LEFT_OF_RIGHTT_EYEBROW') { + return { + kind: 'eyebrowRightInner', + x: landmark.position.x, + y: landmark.position.y + } + } + //Mouth + if(landmark.type === 'MOUTH_LEFT') { + return { + kind: 'mouthLeft', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'MOUTH_RIGHT') { + return { + kind: 'mouthRight', + x: landmark.position.x, + y: landmark.position.y + } + } + //Nose + if(landmark.type === 'NOSE_BOTTOM_LEFT') { + return { + kind: 'noseRootLeft', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'NOSE_BOTTOM_RIGHT') { + return { + kind: 'noseRootRight', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'NOSE_TIP') { + return { + kind: 'noseTip', + x: landmark.position.x, + y: landmark.position.y + } + } + //Left eye + if(landmark.type === 'LEFT_EYE') { + return { + kind: 'leftPupil', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'LEFT_EYE_TOP_BOUNDARY') { + return { + kind: 'eyeLeftTop', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'LEFT_EYE_RIGHT_CORNER') { + return { + kind: 'eyeLeftInner', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'LEFT_EYE_LEFT_CORNER') { + return { + kind: 'eyeLeftOuter', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'LEFT_EYE_BOTTOM_BOUNDARY') { + return { + kind: 'eyeLeftBottom', + x: landmark.position.x, + y: landmark.position.y + } + } + //Right eye + if(landmark.type === 'RIGHT_EYE') { + return { + kind: 'rightPupil', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'RIGHT_EYE_TOP_BOUNDARY') { + return { + kind: 'eyeRightTop', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'RIGHT_EYE_LEFT_CORNER') { + return { + kind: 'eyeRightInner', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'RIGHT_EYE_RIGHT_CORNER') { + return { + kind: 'eyeRightOuter', + x: landmark.position.x, + y: landmark.position.y + } + } + if(landmark.type === 'RIGHT_EYE_BOTTOM_BOUNDARY') { + return { + kind: 'eyeRightBottom', + x: landmark.position.x, + y: landmark.position.y + } + } + }).filter((landmark) => landmark !== undefined), + + emotions: { + happiness: resolveLikelihood(faceAnnotation.joyLikelihood), + anger: resolveLikelihood(faceAnnotation.angerLikelihood), + sadness: resolveLikelihood(faceAnnotation.sorrowLikelihood), + surprise: resolveLikelihood(faceAnnotation.surpriseLikelihood) + } + } + }) + } + }) + } + } +} diff --git a/capabilities/identity/face-detection/maps/mock.suma b/capabilities/identity/face-detection/maps/mock.suma new file mode 100644 index 000000000..46a4cac34 --- /dev/null +++ b/capabilities/identity/face-detection/maps/mock.suma @@ -0,0 +1,114 @@ +profile = "identity/face-detection@1.0" +provider = "mock" + +""" +FaceDetection map +""" +map FaceDetection { + map result [{ + faces: [{ + faceRectangle:{ + topLeft: { + x: 1, + y: 1 + }, + topRight: { + x: 2, + y: 1 + }, + bottomLeft: { + x: 1, + y: 2 + }, + bottomRight: { + x: 2, + y: 2 + } + }, + landmarks: [ + { + kind: 'eyebrowLeftOuter', + x: 1, + y: 2 + },{ + kind: 'eyebrowLeftInner', + x: 1, + y: 2 + },{ + kind: 'eyebrowRightOuter', + x: 1, + y: 2 + },{ + kind: 'eyebrowRightInner', + x: 1, + y: 2 + },{ + kind: 'mouthLeft', + x: 1, + y: 2 + },{ + kind: 'mouthRight', + x: 1, + y: 2 + },{ + kind: 'noseRootLeft', + x: 1, + y: 2 + }, { + kind: 'noseRootRight', + x: 1, + y: 2 + }, { + kind: 'noseTip', + x: 1, + y: 2 + },{ + kind: 'leftPupil', + x: 1, + y: 2 + },{ + kind: 'eyeLeftTop', + x: 1, + y: 2 + },{ + kind: 'eyeLeftInner', + x: 1, + y: 2 + }, { + kind: 'eyeLeftOuter', + x: 1, + y: 2 + }, { + kind: 'eyeLeftBottom', + x: 1, + y: 2 + }, { + kind: 'rightPupil', + x: 1, + y: 2 + }, { + kind: 'eyeRightTop', + x: 1, + y: 2 + }, { + kind: 'eyeRightInner', + x: 1, + y: 2 + },{ + kind: 'eyeRightOuter', + x: 1, + y: 2 + },{ + kind: 'eyeRightBottom', + x: 1, + y: 2 + }], + emotions: { + happiness: 'possible', + anger: 'possible', + sadness: 'possible', + surprise: 'possible', + } + }] + }] +} diff --git a/capabilities/identity/face-detection/maps/mock.test.ts b/capabilities/identity/face-detection/maps/mock.test.ts new file mode 100644 index 000000000..bbbd33f68 --- /dev/null +++ b/capabilities/identity/face-detection/maps/mock.test.ts @@ -0,0 +1,46 @@ +import { SuperfaceClient } from '../../../../superface/sdk'; + +describe('identity/face-detection/mock', () => { + it('should return mock data', async () => { + const client = new SuperfaceClient(); + const profile = await client.getProfile('identity/face-detection'); + const provider = await client.getProvider('mock'); + const usecase = profile.useCases.FaceDetection; + + expect(provider).not.toBeUndefined(); + expect(usecase).not.toBeUndefined(); + + const result = await usecase.perform( + { + imageUrl: 'mock', + instance: 'mock', + }, + { provider: 'mock' } + ); + + result.unwrap(); + expect(result.isOk()).toBeTruthy(); + + const faceAnnotations = result.unwrap(); + expect(faceAnnotations[0]).toHaveProperty('faces'); + expect(faceAnnotations[0].faces?.[0]).toHaveProperty('emotions'); + expect(faceAnnotations[0].faces?.[0].emotions).toHaveProperty('sadness'); + expect(faceAnnotations[0].faces?.[0].emotions).toHaveProperty('surprise'); + expect(faceAnnotations[0].faces?.[0].emotions).toHaveProperty('happiness'); + expect(faceAnnotations[0].faces?.[0].emotions).toHaveProperty('anger'); + expect(faceAnnotations[0].faces?.[0]).toHaveProperty('landmarks'); + expect(faceAnnotations[0].faces?.[0]).toHaveProperty('faceRectangle'); + expect(faceAnnotations[0].faces?.[0].faceRectangle).toHaveProperty( + 'topLeft' + ); + expect(faceAnnotations[0].faces?.[0].faceRectangle).toHaveProperty( + 'topRight' + ); + expect(faceAnnotations[0].faces?.[0].faceRectangle).toHaveProperty( + 'bottomLeft' + ); + expect(faceAnnotations[0].faces?.[0].faceRectangle).toHaveProperty( + 'bottomRight' + ); + }); +}); diff --git a/capabilities/identity/face-detection/profile.supr b/capabilities/identity/face-detection/profile.supr new file mode 100644 index 000000000..6927252db --- /dev/null +++ b/capabilities/identity/face-detection/profile.supr @@ -0,0 +1,87 @@ +name = "identity/face-detection" +version = "1.0.0" + +""" +FaceDetection usecase +""" +usecase FaceDetection { + input { + imageUrl! string! + //Azure specific instance - should be resolved as integration parameters + instance string! + } + + result [{ + faces [{ + faceRectangle! faceRectangle! + landmarks! [landmark]! + emotions! emotions! + }] + }] + + error { + message! string! + code! string! + } +} +model emotions { + happiness! likelihood! + anger! likelihood! + sadness! likelihood! + surprise! likelihood! +} + +model faceRectangle { + topLeft! point! + topRight! point! + bottomLeft! point! + bottomRight! point! +}! + +model likelihood enum { + unknown + veryUnlikely + unlikely + possible + likely + veryLikely +} + +model landmark { + kind! landmarkKind! + x! number! + y! number! +} + +model landmarkKind enum { + //Left eye + leftPupil + eyeLeftOuter + eyeLeftTop + eyeLeftBottom + eyeLeftInner + //Right eye + rightPupil + eyeRightOuter + eyeRightTop + eyeRightBottom + eyeRightInner + //Left eyebrow + eyebrowLeftOuter + eyebrowLeftInner + //Right eyebrow + eyebrowRightInner + eyebrowRightOuter + //Nose + noseTip + noseRootLeft + noseRootRight + //Mouth + mouthLeft + mouthRight +} + +model point { + x! number! + y! number! +} diff --git a/providers/azure-cognitive-services.json b/providers/azure-cognitive-services.json new file mode 100644 index 000000000..e40768011 --- /dev/null +++ b/providers/azure-cognitive-services.json @@ -0,0 +1,18 @@ +{ + "name": "azure-cognitive-services", + "services": [ + { + "id": "default", + "baseUrl": "https://{instance}.cognitiveservices.azure.com" + } + ], + "securitySchemes": [ + { + "id": "azure-subscription-key", + "type": "apiKey", + "in": "header", + "name": "Ocp-Apim-Subscription-Key" + } + ], + "defaultService": "default" +} diff --git a/providers/google-vision-api.json b/providers/google-vision-api.json new file mode 100644 index 000000000..7732ea4b8 --- /dev/null +++ b/providers/google-vision-api.json @@ -0,0 +1,18 @@ +{ + "name": "google-vision-api", + "services": [ + { + "id": "default", + "baseUrl": "https://vision.googleapis.com" + } + ], + "securitySchemes": [ + { + "id": "google-api-key", + "type": "apiKey", + "in": "query", + "name": "key" + } + ], + "defaultService": "default" +} diff --git a/superface/sdk.d.ts b/superface/sdk.d.ts index 4625d018f..8ca125a52 100644 --- a/superface/sdk.d.ts +++ b/superface/sdk.d.ts @@ -1,29 +1,40 @@ +export { CommunicationSendSmsProfile } from "./types/communication/send-sms"; +export { VcsUserReposProfile } from "./types/vcs/user-repos"; +export { VcsPullRequestsProfile } from "./types/vcs/pull-requests"; +export { VcsSingleFileContentProfile } from "./types/vcs/single-file-content"; export { AddressCleanAddressProfile } from "./types/address/clean-address"; -export { AddressGeocodingProfile } from "./types/address/geocoding"; -export { CommunicationEmailTemplatesProfile } from "./types/communication/email-templates"; export { CommunicationSendEmailProfile } from "./types/communication/send-email"; -export { CommunicationSendMessageProfile } from "./types/communication/send-message"; -export { CommunicationSendSmsProfile } from "./types/communication/send-sms"; export { CommunicationSendTemplatedEmailProfile } from "./types/communication/send-templated-email"; -export { DeliveryTrackingShipmentInfoProfile } from "./types/delivery-tracking/shipment-info"; export { StarwarsCharacterInformationProfile } from "./types/starwars/character-information"; export { VcsPullRequestProfile } from "./types/vcs/pull-request"; -export { VcsPullRequestsProfile } from "./types/vcs/pull-requests"; -export { VcsSingleFileContentProfile } from "./types/vcs/single-file-content"; -export { VcsUserReposProfile } from "./types/vcs/user-repos"; +export { AddressGeocodingProfile } from "./types/address/geocoding"; +export { DeliveryTrackingShipmentInfoProfile } from "./types/delivery-tracking/shipment-info"; +export { CommunicationEmailTemplatesProfile } from "./types/communication/email-templates"; +export { CommunicationSendMessageProfile } from "./types/communication/send-message"; export { WeatherCurrentCityProfile } from "./types/weather/current-city"; +export { IdentityFaceDetectionProfile } from "./types/identity/face-detection"; export declare const SuperfaceClient: new () => import("@superfaceai/one-sdk/dist/client/client").TypedSuperfaceClient<{ + "identity/face-detection": { + FaceDetection: [import("./types/identity/face-detection").IdentityFaceDetectionFaceDetectionInput, import("./types/identity/face-detection").IdentityFaceDetectionFaceDetectionResult]; + }; "weather/current-city": { GetCurrentWeatherInCity: [import("./types/weather/current-city").WeatherCurrentCityGetCurrentWeatherInCityInput, import("./types/weather/current-city").WeatherCurrentCityGetCurrentWeatherInCityResult]; }; - "vcs/user-repos": { - UserRepos: [import("./types/vcs/user-repos").VcsUserReposUserReposInput, import("./types/vcs/user-repos").VcsUserReposUserReposResult]; + "communication/send-message": { + SendMessage: [import("./types/communication/send-message").CommunicationSendMessageSendMessageInput, import("./types/communication/send-message").CommunicationSendMessageSendMessageResult]; }; - "vcs/single-file-content": { - SingleFileContent: [import("./types/vcs/single-file-content").VcsSingleFileContentSingleFileContentInput, import("./types/vcs/single-file-content").VcsSingleFileContentSingleFileContentResult]; + "communication/email-templates": { + ListTemplates: [any, import("./types/communication/email-templates").CommunicationEmailTemplatesListTemplatesResult]; + GetTemplateContent: [import("./types/communication/email-templates").CommunicationEmailTemplatesGetTemplateContentInput, import("./types/communication/email-templates").CommunicationEmailTemplatesGetTemplateContentResult]; + CreateTemplate: [import("./types/communication/email-templates").CommunicationEmailTemplatesCreateTemplateInput, import("./types/communication/email-templates").CommunicationEmailTemplatesCreateTemplateResult]; + UpdateTemplate: [import("./types/communication/email-templates").CommunicationEmailTemplatesUpdateTemplateInput, import("./types/communication/email-templates").CommunicationEmailTemplatesUpdateTemplateResult]; }; - "vcs/pull-requests": { - PullRequests: [import("./types/vcs/pull-requests").VcsPullRequestsPullRequestsInput, import("./types/vcs/pull-requests").VcsPullRequestsPullRequestsResult]; + "delivery-tracking/shipment-info": { + ShipmentInfo: [import("./types/delivery-tracking/shipment-info").DeliveryTrackingShipmentInfoShipmentInfoInput, import("./types/delivery-tracking/shipment-info").DeliveryTrackingShipmentInfoShipmentInfoResult]; + }; + "address/geocoding": { + Geocode: [import("./types/address/geocoding").AddressGeocodingGeocodeInput, import("./types/address/geocoding").AddressGeocodingGeocodeResult]; + ReverseGeocode: [import("./types/address/geocoding").AddressGeocodingReverseGeocodeInput, import("./types/address/geocoding").AddressGeocodingReverseGeocodeResult]; }; "vcs/pull-request": { PullRequest: [import("./types/vcs/pull-request").VcsPullRequestPullRequestInput, import("./types/vcs/pull-request").VcsPullRequestPullRequestResult]; @@ -31,34 +42,27 @@ export declare const SuperfaceClient: new () => import("@superfaceai/one-sdk/dis "starwars/character-information": { RetrieveCharacterInformation: [import("./types/starwars/character-information").StarwarsCharacterInformationRetrieveCharacterInformationInput, import("./types/starwars/character-information").StarwarsCharacterInformationRetrieveCharacterInformationResult]; }; - "delivery-tracking/shipment-info": { - ShipmentInfo: [import("./types/delivery-tracking/shipment-info").DeliveryTrackingShipmentInfoShipmentInfoInput, import("./types/delivery-tracking/shipment-info").DeliveryTrackingShipmentInfoShipmentInfoResult]; - }; "communication/send-templated-email": { SendTemplatedEmail: [import("./types/communication/send-templated-email").CommunicationSendTemplatedEmailSendTemplatedEmailInput, import("./types/communication/send-templated-email").CommunicationSendTemplatedEmailSendTemplatedEmailResult]; }; - "communication/send-sms": { - SendMessage: [import("./types/communication/send-sms").CommunicationSendSmsSendMessageInput, import("./types/communication/send-sms").CommunicationSendSmsSendMessageResult]; - RetrieveMessageStatus: [import("./types/communication/send-sms").CommunicationSendSmsRetrieveMessageStatusInput, import("./types/communication/send-sms").CommunicationSendSmsRetrieveMessageStatusResult]; - }; - "communication/send-message": { - SendMessage: [import("./types/communication/send-message").CommunicationSendMessageSendMessageInput, import("./types/communication/send-message").CommunicationSendMessageSendMessageResult]; - }; "communication/send-email": { SendEmail: [import("./types/communication/send-email").CommunicationSendEmailSendEmailInput, import("./types/communication/send-email").CommunicationSendEmailSendEmailResult]; }; - "communication/email-templates": { - ListTemplates: [any, import("./types/communication/email-templates").CommunicationEmailTemplatesListTemplatesResult]; - GetTemplateContent: [import("./types/communication/email-templates").CommunicationEmailTemplatesGetTemplateContentInput, import("./types/communication/email-templates").CommunicationEmailTemplatesGetTemplateContentResult]; - CreateTemplate: [import("./types/communication/email-templates").CommunicationEmailTemplatesCreateTemplateInput, import("./types/communication/email-templates").CommunicationEmailTemplatesCreateTemplateResult]; - UpdateTemplate: [import("./types/communication/email-templates").CommunicationEmailTemplatesUpdateTemplateInput, import("./types/communication/email-templates").CommunicationEmailTemplatesUpdateTemplateResult]; - }; - "address/geocoding": { - Geocode: [import("./types/address/geocoding").AddressGeocodingGeocodeInput, import("./types/address/geocoding").AddressGeocodingGeocodeResult]; - ReverseGeocode: [import("./types/address/geocoding").AddressGeocodingReverseGeocodeInput, import("./types/address/geocoding").AddressGeocodingReverseGeocodeResult]; - }; "address/clean-address": { CleanAddress: [import("./types/address/clean-address").AddressCleanAddressCleanAddressInput, import("./types/address/clean-address").AddressCleanAddressCleanAddressResult]; }; + "vcs/single-file-content": { + SingleFileContent: [import("./types/vcs/single-file-content").VcsSingleFileContentSingleFileContentInput, import("./types/vcs/single-file-content").VcsSingleFileContentSingleFileContentResult]; + }; + "vcs/pull-requests": { + PullRequests: [import("./types/vcs/pull-requests").VcsPullRequestsPullRequestsInput, import("./types/vcs/pull-requests").VcsPullRequestsPullRequestsResult]; + }; + "vcs/user-repos": { + UserRepos: [import("./types/vcs/user-repos").VcsUserReposUserReposInput, import("./types/vcs/user-repos").VcsUserReposUserReposResult]; + }; + "communication/send-sms": { + SendMessage: [import("./types/communication/send-sms").CommunicationSendSmsSendMessageInput, import("./types/communication/send-sms").CommunicationSendSmsSendMessageResult]; + RetrieveMessageStatus: [import("./types/communication/send-sms").CommunicationSendSmsRetrieveMessageStatusInput, import("./types/communication/send-sms").CommunicationSendSmsRetrieveMessageStatusResult]; + }; }>; export declare type SuperfaceClient = InstanceType; diff --git a/superface/sdk.js b/superface/sdk.js index 43fc2972a..f7517e9c3 100644 --- a/superface/sdk.js +++ b/superface/sdk.js @@ -13,19 +13,20 @@ var __assign = (this && this.__assign) || function () { Object.defineProperty(exports, "__esModule", { value: true }); exports.SuperfaceClient = void 0; var one_sdk_1 = require("@superfaceai/one-sdk"); +var send_sms_1 = require("./types/communication/send-sms"); +var user_repos_1 = require("./types/vcs/user-repos"); +var pull_requests_1 = require("./types/vcs/pull-requests"); +var single_file_content_1 = require("./types/vcs/single-file-content"); var clean_address_1 = require("./types/address/clean-address"); -var geocoding_1 = require("./types/address/geocoding"); -var email_templates_1 = require("./types/communication/email-templates"); var send_email_1 = require("./types/communication/send-email"); -var send_message_1 = require("./types/communication/send-message"); -var send_sms_1 = require("./types/communication/send-sms"); var send_templated_email_1 = require("./types/communication/send-templated-email"); -var shipment_info_1 = require("./types/delivery-tracking/shipment-info"); var character_information_1 = require("./types/starwars/character-information"); var pull_request_1 = require("./types/vcs/pull-request"); -var pull_requests_1 = require("./types/vcs/pull-requests"); -var single_file_content_1 = require("./types/vcs/single-file-content"); -var user_repos_1 = require("./types/vcs/user-repos"); +var geocoding_1 = require("./types/address/geocoding"); +var shipment_info_1 = require("./types/delivery-tracking/shipment-info"); +var email_templates_1 = require("./types/communication/email-templates"); +var send_message_1 = require("./types/communication/send-message"); var current_city_1 = require("./types/weather/current-city"); -var typeDefinitions = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, clean_address_1.addressCleanAddress), geocoding_1.addressGeocoding), email_templates_1.communicationEmailTemplates), send_email_1.communicationSendEmail), send_message_1.communicationSendMessage), send_sms_1.communicationSendSms), send_templated_email_1.communicationSendTemplatedEmail), shipment_info_1.deliveryTrackingShipmentInfo), character_information_1.starwarsCharacterInformation), pull_request_1.vcsPullRequest), pull_requests_1.vcsPullRequests), single_file_content_1.vcsSingleFileContent), user_repos_1.vcsUserRepos), current_city_1.weatherCurrentCity); +var face_detection_1 = require("./types/identity/face-detection"); +var typeDefinitions = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, send_sms_1.communicationSendSms), user_repos_1.vcsUserRepos), pull_requests_1.vcsPullRequests), single_file_content_1.vcsSingleFileContent), clean_address_1.addressCleanAddress), send_email_1.communicationSendEmail), send_templated_email_1.communicationSendTemplatedEmail), character_information_1.starwarsCharacterInformation), pull_request_1.vcsPullRequest), geocoding_1.addressGeocoding), shipment_info_1.deliveryTrackingShipmentInfo), email_templates_1.communicationEmailTemplates), send_message_1.communicationSendMessage), current_city_1.weatherCurrentCity), face_detection_1.identityFaceDetection); exports.SuperfaceClient = one_sdk_1.createTypedClient(typeDefinitions); diff --git a/superface/super.json b/superface/super.json index 530fc71b2..638a01117 100644 --- a/superface/super.json +++ b/superface/super.json @@ -292,6 +292,25 @@ "file": "../capabilities/weather/current-city/maps/wttr-in.suma" } } + }, + "identity/face-detection": { + "file": "../capabilities/identity/face-detection/profile.supr", + "providers": { + "azure-cognitive-services": { + "file": "../capabilities/identity/face-detection/maps/azure-cognitive-services.suma" + }, + "google-vision-api": { + "file": "../capabilities/identity/face-detection/maps/google-vision-api.suma" + }, + "mock": { + "file": "../capabilities/identity/face-detection/maps/mock.suma" + } + }, + "priority": [ + "azure-cognitive-services", + "google-vision-api", + "mock" + ] } }, "providers": { @@ -443,6 +462,24 @@ "wttr-in": { "file": "../providers/wttr-in.json", "security": [] + }, + "google-vision-api": { + "file": "../providers/google-vision-api.json", + "security": [ + { + "id": "google-api-key", + "apikey": "$GOOGLE_API_KEY" + } + ] + }, + "azure-cognitive-services": { + "file": "../providers/azure-cognitive-services.json", + "security": [ + { + "id": "azure-subscription-key", + "apikey": "$AZURE_SUBSCRIPTION_KEY" + } + ] } } } diff --git a/superface/types/identity/face-detection.d.ts b/superface/types/identity/face-detection.d.ts new file mode 100644 index 000000000..a68cd52d6 --- /dev/null +++ b/superface/types/identity/face-detection.d.ts @@ -0,0 +1,50 @@ +import { TypedProfile } from '@superfaceai/one-sdk'; +export declare type IdentityFaceDetectionFaceDetectionInput = { + imageUrl: string; + instance?: string; +}; +export declare type IdentityFaceDetectionFaceDetectionResult = { + faces?: { + faceRectangle: { + topLeft: { + x: number; + y: number; + }; + topRight: { + x: number; + y: number; + }; + bottomLeft: { + x: number; + y: number; + }; + bottomRight: { + x: number; + y: number; + }; + }; + landmarks: { + kind: 'leftPupil' | 'eyeLeftOuter' | 'eyeLeftTop' | 'eyeLeftBottom' | 'eyeLeftInner' | 'rightPupil' | 'eyeRightOuter' | 'eyeRightTop' | 'eyeRightBottom' | 'eyeRightInner' | 'eyebrowLeftOuter' | 'eyebrowLeftInner' | 'eyebrowRightInner' | 'eyebrowRightOuter' | 'noseTip' | 'noseRootLeft' | 'noseRootRight' | 'mouthLeft' | 'mouthRight'; + x: number; + y: number; + }[]; + emotions: { + happiness: 'unknown' | 'veryUnlikely' | 'unlikely' | 'possible' | 'likely' | 'veryLikely'; + anger: 'unknown' | 'veryUnlikely' | 'unlikely' | 'possible' | 'likely' | 'veryLikely'; + sadness: 'unknown' | 'veryUnlikely' | 'unlikely' | 'possible' | 'likely' | 'veryLikely'; + surprise: 'unknown' | 'veryUnlikely' | 'unlikely' | 'possible' | 'likely' | 'veryLikely'; + }; + }[]; +}[]; +declare const profile: { + /** FaceDetection usecase **/ + FaceDetection: [IdentityFaceDetectionFaceDetectionInput, IdentityFaceDetectionFaceDetectionResult]; +}; +export declare type IdentityFaceDetectionProfile = TypedProfile; +export declare const identityFaceDetection: { + "identity/face-detection": { + /** FaceDetection usecase **/ + FaceDetection: [IdentityFaceDetectionFaceDetectionInput, IdentityFaceDetectionFaceDetectionResult]; + }; +}; +export {}; diff --git a/superface/types/identity/face-detection.js b/superface/types/identity/face-detection.js new file mode 100644 index 000000000..cb35d28c7 --- /dev/null +++ b/superface/types/identity/face-detection.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.identityFaceDetection = void 0; +var one_sdk_1 = require("@superfaceai/one-sdk"); +var profile = { + /** FaceDetection usecase **/ + "FaceDetection": one_sdk_1.typeHelper() +}; +exports.identityFaceDetection = { + "identity/face-detection": profile +}; diff --git a/yarn.lock b/yarn.lock index 488cb486f..2b0b113dd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5013,7 +5013,6 @@ typescript-is@^0.18.3: integrity sha512-kBgZIJt3AKrtye1H2GYf9bWu1YS0Z9AZZl4OZG4z2Ps2jPMZuycilP9RkxPLP+tPxCUjXfmaJti9TNGoz5schA== dependencies: nested-error-stacks "^2" - reflect-metadata ">=0.1.12" tsutils "^3.17.1" optionalDependencies: reflect-metadata ">=0.1.12" From 3cf3b18f203e7c6cfb4c0281803f06d357796f92 Mon Sep 17 00:00:00 2001 From: Jakub Vacek Date: Tue, 12 Oct 2021 15:41:02 +0200 Subject: [PATCH 2/3] fix: lint --- .../identity/face-detection/maps/mock.suma | 46 +++++++++---------- .../identity/face-detection/profile.supr | 20 ++++---- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/capabilities/identity/face-detection/maps/mock.suma b/capabilities/identity/face-detection/maps/mock.suma index 46a4cac34..dea4ff9a3 100644 --- a/capabilities/identity/face-detection/maps/mock.suma +++ b/capabilities/identity/face-detection/maps/mock.suma @@ -27,87 +27,87 @@ map FaceDetection { }, landmarks: [ { - kind: 'eyebrowLeftOuter', + kind: `eyebrowLeftOuter`, x: 1, y: 2 },{ - kind: 'eyebrowLeftInner', + kind: `eyebrowLeftInner`, x: 1, y: 2 },{ - kind: 'eyebrowRightOuter', + kind: `eyebrowRightOuter`, x: 1, y: 2 },{ - kind: 'eyebrowRightInner', + kind: `eyebrowRightInner`, x: 1, y: 2 },{ - kind: 'mouthLeft', + kind: `mouthLeft`, x: 1, y: 2 },{ - kind: 'mouthRight', + kind: `mouthRight`, x: 1, y: 2 },{ - kind: 'noseRootLeft', + kind: `noseRootLeft`, x: 1, y: 2 }, { - kind: 'noseRootRight', + kind: `noseRootRight`, x: 1, y: 2 }, { - kind: 'noseTip', + kind: `noseTip`, x: 1, y: 2 },{ - kind: 'leftPupil', + kind: `leftPupil`, x: 1, y: 2 },{ - kind: 'eyeLeftTop', + kind: `eyeLeftTop`, x: 1, y: 2 },{ - kind: 'eyeLeftInner', + kind: `eyeLeftInner`, x: 1, y: 2 }, { - kind: 'eyeLeftOuter', + kind: `eyeLeftOuter`, x: 1, y: 2 }, { - kind: 'eyeLeftBottom', + kind: `eyeLeftBottom`, x: 1, y: 2 }, { - kind: 'rightPupil', + kind: `rightPupil`, x: 1, y: 2 }, { - kind: 'eyeRightTop', + kind: `eyeRightTop`, x: 1, y: 2 }, { - kind: 'eyeRightInner', + kind: `eyeRightInner`, x: 1, y: 2 },{ - kind: 'eyeRightOuter', + kind: `eyeRightOuter`, x: 1, y: 2 },{ - kind: 'eyeRightBottom', + kind: `eyeRightBottom`, x: 1, y: 2 }], emotions: { - happiness: 'possible', - anger: 'possible', - sadness: 'possible', - surprise: 'possible', + happiness: `possible`, + anger: `possible`, + sadness: `possible`, + surprise: `possible`, } }] }] diff --git a/capabilities/identity/face-detection/profile.supr b/capabilities/identity/face-detection/profile.supr index 6927252db..6a8161b35 100644 --- a/capabilities/identity/face-detection/profile.supr +++ b/capabilities/identity/face-detection/profile.supr @@ -12,12 +12,12 @@ usecase FaceDetection { } result [{ - faces [{ + faces! [{ faceRectangle! faceRectangle! landmarks! [landmark]! emotions! emotions! - }] - }] + }]! + }]! error { message! string! @@ -32,11 +32,11 @@ model emotions { } model faceRectangle { - topLeft! point! - topRight! point! - bottomLeft! point! - bottomRight! point! -}! + topLeft! point! + topRight! point! + bottomLeft! point! + bottomRight! point! +} model likelihood enum { unknown @@ -82,6 +82,6 @@ model landmarkKind enum { } model point { - x! number! - y! number! + x number + y number } From d88c51d68b72baf55123eb4d6a6ce0a90af9397f Mon Sep 17 00:00:00 2001 From: Jakub Vacek Date: Thu, 21 Oct 2021 08:50:45 +0200 Subject: [PATCH 3/3] chore: prepare for integration parameters --- .../maps/azure-cognitive-services.suma | 1 - .../maps/google-vision-api.suma | 229 ------------------ .../identity/face-detection/profile.supr | 1 - providers/azure-cognitive-services.json | 8 +- providers/google-vision-api.json | 18 -- superface/super.json | 18 +- 6 files changed, 11 insertions(+), 264 deletions(-) delete mode 100644 capabilities/identity/face-detection/maps/google-vision-api.suma delete mode 100644 providers/google-vision-api.json diff --git a/capabilities/identity/face-detection/maps/azure-cognitive-services.suma b/capabilities/identity/face-detection/maps/azure-cognitive-services.suma index 7a0b236be..83a12b64a 100644 --- a/capabilities/identity/face-detection/maps/azure-cognitive-services.suma +++ b/capabilities/identity/face-detection/maps/azure-cognitive-services.suma @@ -5,7 +5,6 @@ provider = "azure-cognitive-services" FaceDetection map """ map FaceDetection { - instance = input.instance imageUrl = input.imageUrl http POST "/face/v1.0/detect" { diff --git a/capabilities/identity/face-detection/maps/google-vision-api.suma b/capabilities/identity/face-detection/maps/google-vision-api.suma deleted file mode 100644 index 1b3849e5b..000000000 --- a/capabilities/identity/face-detection/maps/google-vision-api.suma +++ /dev/null @@ -1,229 +0,0 @@ -profile = "identity/face-detection@1.0" -provider = "google-vision-api" - -""" -FaceDetection map -""" -map FaceDetection { - imageUrl = input.imageUrl - - - http POST "/v1/images:annotate" { - security "google-api-key" - - request { - headers { - "Content-Type" = "application/json" - } - body { - requests = [{ - features: [ - { - maxResults: 1, - type: "FACE_DETECTION" - } - ], - image: { - source: { - imageUri: imageUrl - } - } - }] - } - } - - response { - return map error if (statusCode !== 200) { - code = body.error.code - message = body.error.message - } - - map result body.responses.map((res) => { - return { - faces: res.faceAnnotations.map((faceAnnotation) => { - const resolveLikelihood = (value) => { - if(value === 'VERY_UNLIKELY') { - return 'veryUnlikely' - } - - if(value === 'UNLIKELY') { - return 'unlikely' - } - - if(value === 'POSSIBLE') { - return 'possible' - } - - if(value === 'LIKELY') { - return 'likely' - } - - if(value === 'VERY_LIKELY') { - return 'verylikely' - } - - return 'unknown' - } - - return { - faceRectangle: { - bottomLeft: {x: faceAnnotation.boundingPoly.vertices[0].x, y: faceAnnotation.boundingPoly.vertices[0].y}, - bottomRight: {x: faceAnnotation.boundingPoly.vertices[1].x, y: faceAnnotation.boundingPoly.vertices[1].y}, - topRight: {x: faceAnnotation.boundingPoly.vertices[2].x, y: faceAnnotation.boundingPoly.vertices[2].y}, - topLeft: {x: faceAnnotation.boundingPoly.vertices[3].x, y: faceAnnotation.boundingPoly.vertices[3].y}, - }, - landmarks: faceAnnotation.landmarks.map((landmark) => { - //Left eyebrow - if(landmark.type === 'LEFT_OF_LEFT_EYEBROW') { - return { - kind: 'eyebrowLeftOuter', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'RIGHT_OF_LEFT_EYEBROW') { - return { - kind: 'eyebrowLeftInner', - x: landmark.position.x, - y: landmark.position.y - } - } - //Right eyebrow - if(landmark.type === 'RIGHT_OF_RIGHT_EYEBROW') { - return { - kind: 'eyebrowRightOuter', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'LEFT_OF_RIGHTT_EYEBROW') { - return { - kind: 'eyebrowRightInner', - x: landmark.position.x, - y: landmark.position.y - } - } - //Mouth - if(landmark.type === 'MOUTH_LEFT') { - return { - kind: 'mouthLeft', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'MOUTH_RIGHT') { - return { - kind: 'mouthRight', - x: landmark.position.x, - y: landmark.position.y - } - } - //Nose - if(landmark.type === 'NOSE_BOTTOM_LEFT') { - return { - kind: 'noseRootLeft', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'NOSE_BOTTOM_RIGHT') { - return { - kind: 'noseRootRight', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'NOSE_TIP') { - return { - kind: 'noseTip', - x: landmark.position.x, - y: landmark.position.y - } - } - //Left eye - if(landmark.type === 'LEFT_EYE') { - return { - kind: 'leftPupil', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'LEFT_EYE_TOP_BOUNDARY') { - return { - kind: 'eyeLeftTop', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'LEFT_EYE_RIGHT_CORNER') { - return { - kind: 'eyeLeftInner', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'LEFT_EYE_LEFT_CORNER') { - return { - kind: 'eyeLeftOuter', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'LEFT_EYE_BOTTOM_BOUNDARY') { - return { - kind: 'eyeLeftBottom', - x: landmark.position.x, - y: landmark.position.y - } - } - //Right eye - if(landmark.type === 'RIGHT_EYE') { - return { - kind: 'rightPupil', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'RIGHT_EYE_TOP_BOUNDARY') { - return { - kind: 'eyeRightTop', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'RIGHT_EYE_LEFT_CORNER') { - return { - kind: 'eyeRightInner', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'RIGHT_EYE_RIGHT_CORNER') { - return { - kind: 'eyeRightOuter', - x: landmark.position.x, - y: landmark.position.y - } - } - if(landmark.type === 'RIGHT_EYE_BOTTOM_BOUNDARY') { - return { - kind: 'eyeRightBottom', - x: landmark.position.x, - y: landmark.position.y - } - } - }).filter((landmark) => landmark !== undefined), - - emotions: { - happiness: resolveLikelihood(faceAnnotation.joyLikelihood), - anger: resolveLikelihood(faceAnnotation.angerLikelihood), - sadness: resolveLikelihood(faceAnnotation.sorrowLikelihood), - surprise: resolveLikelihood(faceAnnotation.surpriseLikelihood) - } - } - }) - } - }) - } - } -} diff --git a/capabilities/identity/face-detection/profile.supr b/capabilities/identity/face-detection/profile.supr index 6a8161b35..aa23bb473 100644 --- a/capabilities/identity/face-detection/profile.supr +++ b/capabilities/identity/face-detection/profile.supr @@ -8,7 +8,6 @@ usecase FaceDetection { input { imageUrl! string! //Azure specific instance - should be resolved as integration parameters - instance string! } result [{ diff --git a/providers/azure-cognitive-services.json b/providers/azure-cognitive-services.json index e40768011..8cec0b62c 100644 --- a/providers/azure-cognitive-services.json +++ b/providers/azure-cognitive-services.json @@ -14,5 +14,11 @@ "name": "Ocp-Apim-Subscription-Key" } ], - "defaultService": "default" + "defaultService": "default", + "parameters": [ + { + "name": "instance", + "description": "Instance identifier of your azure instance" + } + ] } diff --git a/providers/google-vision-api.json b/providers/google-vision-api.json deleted file mode 100644 index 7732ea4b8..000000000 --- a/providers/google-vision-api.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "google-vision-api", - "services": [ - { - "id": "default", - "baseUrl": "https://vision.googleapis.com" - } - ], - "securitySchemes": [ - { - "id": "google-api-key", - "type": "apiKey", - "in": "query", - "name": "key" - } - ], - "defaultService": "default" -} diff --git a/superface/super.json b/superface/super.json index 40d8e1756..cc8ef15bf 100644 --- a/superface/super.json +++ b/superface/super.json @@ -303,16 +303,12 @@ "azure-cognitive-services": { "file": "../capabilities/identity/face-detection/maps/azure-cognitive-services.suma" }, - "google-vision-api": { - "file": "../capabilities/identity/face-detection/maps/google-vision-api.suma" - }, "mock": { "file": "../capabilities/identity/face-detection/maps/mock.suma" } }, "priority": [ "azure-cognitive-services", - "google-vision-api", "mock" ] }, @@ -508,15 +504,6 @@ "file": "../providers/wttr-in.json", "security": [] }, - "google-vision-api": { - "file": "../providers/google-vision-api.json", - "security": [ - { - "id": "google-api-key", - "apikey": "$GOOGLE_API_KEY" - } - ] - }, "azure-cognitive-services": { "file": "../providers/azure-cognitive-services.json", "security": [ @@ -524,7 +511,10 @@ "id": "azure-subscription-key", "apikey": "$AZURE_SUBSCRIPTION_KEY" } - ] + ], + "parameters": { + "instance": "jakubface" + } }, "openweathermap": { "file": "../providers/openweathermap.json",