UNPKG

@webda/gcp

Version:

Webda GCP Services implementation

1,457 lines (1,456 loc) 54.7 kB
{ "beans": {}, "deployers": {}, "moddas": { "Webda/GoogleCloudFireStore": "lib/services/firestore:default", "Webda/GoogleCloudKMS": "lib/services/kms:GCPKMSService", "Webda/GoogleCloudPubSub": "lib/services/pubsub:default", "Webda/GoogleCloudQueue": "lib/services/queue:default", "Webda/GoogleCloudStorage": "lib/services/storage:default" }, "models": { "graph": {}, "tree": {}, "plurals": {}, "list": {}, "reflections": {} }, "schemas": { "Webda/BinaryFile": { "type": "object", "properties": { "hash": { "type": "string", "description": "Will be computed by the service\n\nhash of the content" }, "challenge": { "type": "string", "description": "Will be computed by the service\n\nhash of the content prefixed by 'WEBDA'" }, "size": { "type": "number", "description": "Size of the binary" }, "name": { "type": "string", "description": "Current name" }, "mimetype": { "type": "string", "description": "Mimetype of the binary" }, "metadata": { "description": "Metadatas stored along with the binary" }, "originalname": { "type": "string", "description": "Original name" } }, "required": [ "mimetype", "name", "size" ], "description": "Represent a file to store", "$schema": "http://json-schema.org/draft-07/schema#", "title": "BinaryFile" }, "Webda/GoogleCloudFireStore": { "type": "object", "properties": { "type": { "type": "string", "description": "Type of the service" }, "url": { "type": "string", "description": "URL on which to serve the content" }, "model": { "type": "string", "description": "Webda model to use within the Store", "default": "Webda/CoreModel" }, "additionalModels": { "type": "array", "items": { "type": "string" }, "description": "Additional models\n\nAllow this store to manage other models", "default": [] }, "asyncDelete": { "type": "boolean", "description": "async delete" }, "expose": { "$ref": "#/definitions/StoreExposeParameters", "description": "Expose the service to an urls", "deprecated": "will probably be removed in 4.0 in favor of Expose annotation" }, "strict": { "type": "boolean", "description": "Allow to load object that does not have the type data\n\nIf set to true, then the Store will only managed the defined _model and no model extending this one", "default": false }, "defaultModel": { "type": "boolean", "description": "When __type model not found, use the model If strict is setup this parameter is not used", "default": true }, "forceModel": { "type": "boolean", "description": "If set, Store will ignore the __type", "default": false }, "slowQueryThreshold": { "type": "number", "description": "Slow query threshold", "default": 30000 }, "modelAliases": { "type": "object", "additionalProperties": { "type": "string" }, "description": "Model Aliases to allow easier rename of Model" }, "noCache": { "type": "boolean", "description": "Disable default memory cache" }, "collection": { "type": "string", "description": "Collection to use" }, "compoundIndexes": { "type": "array", "items": { "$ref": "#/definitions/FireStoreIndex" }, "description": "To allow efficient query on several fields" }, "openapi": { "type": "object", "additionalProperties": true } }, "required": [ "asyncDelete", "collection", "compoundIndexes", "slowQueryThreshold", "type" ], "description": "Firebase parameters", "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "StoreExposeParameters": { "type": "object", "properties": { "url": { "type": "string", "description": "URL endpoint to use to expose REST Resources API", "default": "service.getName().toLowerCase()" }, "restrict": { "type": "object", "properties": { "create": { "type": "boolean", "description": "Do not expose the POST" }, "update": { "type": "boolean", "description": "Do not expose the PUT and PATCH" }, "get": { "type": "boolean", "description": "Do not expose the GET" }, "delete": { "type": "boolean", "description": "Do not expose the DELETE" }, "query": { "type": "boolean", "description": "Do not expose the query endpoint" } }, "description": "You can restrict any part of the CRUD", "default": {} }, "queryMethod": { "type": "string", "enum": [ "PUT", "GET" ], "description": "For confidentiality sometimes you might prefer to expose query through PUT To avoid GET logging", "default": "GET" } }, "deprecated": "Store should not be exposed directly anymore\nYou should use the DomainService instead" }, "FireStoreIndex": { "type": "object", "additionalProperties": { "type": "string", "enum": [ "asc", "desc" ] }, "description": "Definition of a FireStore index" } }, "title": "FireStore" }, "Webda/GoogleCloudKMS": { "type": "object", "properties": { "type": { "type": "string", "description": "Type of the service" }, "url": { "type": "string", "description": "URL on which to serve the content" }, "defaultKey": { "type": "string", "description": "Encryption key to use by default", "default": "WEBDA_GCP_KMS_KEY env variable" }, "openapi": { "type": "object", "additionalProperties": true } }, "required": [ "type" ], "description": "Parameters for the KMS Service", "$schema": "http://json-schema.org/draft-07/schema#", "title": "GCPKMSService" }, "Webda/GoogleCloudPubSub": { "type": "object", "properties": { "type": { "type": "string", "description": "Type of the service" }, "url": { "type": "string", "description": "URL on which to serve the content" }, "topic": { "type": "string", "description": "Topic to use on GCP" }, "subscriptionOptions": { "$ref": "#/definitions/CreateSubscriptionOptions", "description": "Subscription options to pass to GCP" }, "openapi": { "type": "object", "additionalProperties": true } }, "required": [ "topic", "type" ], "$schema": "http://json-schema.org/draft-07/schema#", "definitions": { "CreateSubscriptionOptions": { "type": "object", "properties": { "gaxOpts": { "type": "object", "properties": { "timeout": { "type": "number" }, "retry": { "anyOf": [ { "$ref": "#/definitions/Partial%3Cclass-657338214-822-3488-657338214-0-17392%3E" }, { "type": "null" } ] }, "autoPaginate": { "type": "boolean" }, "maxResults": { "type": "number" }, "maxRetries": { "type": "number" }, "otherArgs": { "type": "object" }, "bundleOptions": { "anyOf": [ { "type": "object", "properties": { "elementCountLimit": { "type": "number" }, "requestByteLimit": { "type": "number" }, "elementCountThreshold": { "type": "number" }, "requestByteThreshold": { "type": "number" }, "delayThreshold": { "type": "number" } } }, { "type": "null" } ] }, "isBundling": { "type": "boolean" }, "longrunning": { "type": "object", "properties": { "maxRetries": { "type": "number" }, "initialRetryDelayMillis": { "type": "number" }, "retryDelayMultiplier": { "type": "number" }, "maxRetryDelayMillis": { "type": "number" }, "initialRpcTimeoutMillis": { "type": [ "number", "null" ] }, "maxRpcTimeoutMillis": { "type": [ "number", "null" ] }, "totalTimeoutMillis": { "type": [ "number", "null" ] }, "rpcTimeoutMultiplier": { "type": [ "number", "null" ] } }, "required": [ "initialRetryDelayMillis", "retryDelayMultiplier", "maxRetryDelayMillis" ] }, "apiName": { "type": "string" }, "retryRequestOptions": { "type": "object", "properties": { "objectMode": { "type": "boolean" }, "request": {}, "retries": { "type": "number" }, "noResponseRetries": { "type": "number" }, "currentRetryAttempt": { "type": "number" }, "shouldRetryFn": {}, "maxRetryDelay": { "type": "number" }, "retryDelayMultiplier": { "type": "number" }, "totalTimeout": { "type": "number" } } } } }, "flowControl": { "type": "object", "properties": { "allowExcessMessages": { "type": "boolean" }, "maxBytes": { "type": "number" }, "maxMessages": { "type": "number" }, "maxExtensionMinutes": { "type": "number" }, "maxExtension": { "type": "number", "deprecated": "Use maxExtensionMinutes." } } }, "name": { "type": [ "string", "null" ], "description": "Subscription name" }, "topic": { "type": [ "string", "null" ], "description": "Subscription topic" }, "pushConfig": { "anyOf": [ { "type": "object", "properties": { "pushEndpoint": { "type": [ "string", "null" ], "description": "PushConfig pushEndpoint" }, "attributes": { "anyOf": [ { "type": "object", "additionalProperties": { "type": "string" } }, { "type": "null" } ], "description": "PushConfig attributes" }, "oidcToken": { "anyOf": [ { "type": "object", "properties": { "serviceAccountEmail": { "type": [ "string", "null" ], "description": "OidcToken serviceAccountEmail" }, "audience": { "type": [ "string", "null" ], "description": "OidcToken audience" } }, "description": "Properties of an OidcToken." }, { "type": "null" } ], "description": "PushConfig oidcToken" }, "pubsubWrapper": { "anyOf": [ { "type": "object", "description": "Properties of a PubsubWrapper." }, { "type": "null" } ], "description": "PushConfig pubsubWrapper" }, "noWrapper": { "anyOf": [ { "type": "object", "properties": { "writeMetadata": { "type": [ "boolean", "null" ], "description": "NoWrapper writeMetadata" } }, "description": "Properties of a NoWrapper." }, { "type": "null" } ], "description": "PushConfig noWrapper" } }, "description": "Properties of a PushConfig." }, { "type": "null" } ], "description": "Subscription pushConfig" }, "bigqueryConfig": { "anyOf": [ { "type": "object", "properties": { "table": { "type": [ "string", "null" ], "description": "BigQueryConfig table" }, "useTopicSchema": { "type": [ "boolean", "null" ], "description": "BigQueryConfig useTopicSchema" }, "writeMetadata": { "type": [ "boolean", "null" ], "description": "BigQueryConfig writeMetadata" }, "dropUnknownFields": { "type": [ "boolean", "null" ], "description": "BigQueryConfig dropUnknownFields" }, "state": { "anyOf": [ { "$ref": "#/definitions/google.pubsub.v1.BigQueryConfig.State" }, { "type": "string", "const": "STATE_UNSPECIFIED" }, { "type": "string", "const": "ACTIVE" }, { "type": "string", "const": "PERMISSION_DENIED" }, { "type": "string", "const": "NOT_FOUND" }, { "type": "string", "const": "SCHEMA_MISMATCH" }, { "type": "string", "const": "IN_TRANSIT_LOCATION_RESTRICTION" }, { "type": "null" } ], "description": "BigQueryConfig state" }, "useTableSchema": { "type": [ "boolean", "null" ], "description": "BigQueryConfig useTableSchema" }, "serviceAccountEmail": { "type": [ "string", "null" ], "description": "BigQueryConfig serviceAccountEmail" } }, "description": "Properties of a BigQueryConfig." }, { "type": "null" } ], "description": "Subscription bigqueryConfig" }, "cloudStorageConfig": { "anyOf": [ { "type": "object", "properties": { "bucket": { "type": [ "string", "null" ], "description": "CloudStorageConfig bucket" }, "filenamePrefix": { "type": [ "string", "null" ], "description": "CloudStorageConfig filenamePrefix" }, "filenameSuffix": { "type": [ "string", "null" ], "description": "CloudStorageConfig filenameSuffix" }, "filenameDatetimeFormat": { "type": [ "string", "null" ], "description": "CloudStorageConfig filenameDatetimeFormat" }, "textConfig": { "anyOf": [ { "type": "object", "description": "Properties of a TextConfig." }, { "type": "null" } ], "description": "CloudStorageConfig textConfig" }, "avroConfig": { "anyOf": [ { "type": "object", "properties": { "writeMetadata": { "type": [ "boolean", "null" ], "description": "AvroConfig writeMetadata" }, "useTopicSchema": { "type": [ "boolean", "null" ], "description": "AvroConfig useTopicSchema" } }, "description": "Properties of an AvroConfig." }, { "type": "null" } ], "description": "CloudStorageConfig avroConfig" }, "maxDuration": { "anyOf": [ { "type": "object", "properties": { "seconds": { "anyOf": [ { "type": "number" }, { "type": "object", "properties": { "high": { "type": "number", "description": "The high 32 bits as a signed value." }, "low": { "type": "number", "description": "The low 32 bits as a signed value." }, "unsigned": { "type": "boolean", "description": "Whether unsigned or not." } }, "required": [ "high", "low", "unsigned" ] }, { "type": "string" }, { "type": "null" } ], "description": "Duration seconds" }, "nanos": { "type": [ "number", "null" ], "description": "Duration nanos" } }, "description": "Properties of a Duration." }, { "type": "null" } ], "description": "CloudStorageConfig maxDuration" }, "maxBytes": { "anyOf": [ { "type": "number" }, { "type": "object", "properties": { "high": { "type": "number", "description": "The high 32 bits as a signed value." }, "low": { "type": "number", "description": "The low 32 bits as a signed value." }, "unsigned": { "type": "boolean", "description": "Whether unsigned or not." } }, "required": [ "high", "low", "unsigned" ] }, { "type": "string" }, { "type": "null" } ], "description": "CloudStorageConfig maxBytes" }, "maxMessages": { "anyOf": [ { "type": "number" }, { "type": "object", "properties": { "high": { "type": "number", "description": "The high 32 bits as a signed value." }, "low": { "type": "number", "description": "The low 32 bits as a signed value." }, "unsigned": { "type": "boolean", "description": "Whether unsigned or not." } }, "required": [ "high", "low", "unsigned" ] }, { "type": "string" }, { "type": "null" } ], "description": "CloudStorageConfig maxMessages" }, "state": { "anyOf": [ { "$ref": "#/definitions/google.pubsub.v1.CloudStorageConfig.State" }, { "type": "string", "const": "STATE_UNSPECIFIED" }, { "type": "string", "const": "ACTIVE" }, { "type": "string", "const": "PERMISSION_DENIED" }, { "type": "string", "const": "NOT_FOUND" }, { "type": "string", "const": "IN_TRANSIT_LOCATION_RESTRICTION" }, { "type": "string", "const": "SCHEMA_MISMATCH" }, { "type": "null" } ], "description": "CloudStorageConfig state" }, "serviceAccountEmail": { "type": [ "string", "null" ], "description": "CloudStorageConfig serviceAccountEmail" } }, "description": "Properties of a CloudStorageConfig." }, { "type": "null" } ], "description": "Subscription cloudStorageConfig" }, "ackDeadlineSeconds": { "type": [ "number", "null" ], "description": "Subscription ackDeadlineSeconds" }, "retainAckedMessages": { "type": [ "boolean", "null" ], "description": "Subscription retainAckedMessages" }, "labels": { "anyOf": [ { "type": "object", "additionalProperties": { "type": "string" } }, { "type": "null" } ], "description": "Subscription labels" }, "enableMessageOrdering": { "type": [ "boolean", "null" ], "description": "Subscription enableMessageOrdering" }, "expirationPolicy": { "anyOf": [ { "type": "object", "properties": { "ttl": { "anyOf": [ { "type": "object", "properties": { "seconds": { "anyOf": [ { "type": "number" }, { "type": "object", "properties": { "high": { "type": "number", "description": "The high 32 bits as a signed value." }, "low": { "type": "number", "description": "The low 32 bits as a signed value." }, "unsigned": { "type": "boolean", "description": "Whether unsigned or not." } }, "required": [ "high", "low", "unsigned" ] }, { "type": "string" }, { "type": "null" } ], "description": "Duration seconds" }, "nanos": { "type": [ "number", "null" ], "description": "Duration nanos" } }, "description": "Properties of a Duration." }, { "type": "null" } ], "description": "ExpirationPolicy ttl" } }, "description": "Properties of an ExpirationPolicy." }, { "type": "null" } ], "description": "Subscription expirationPolicy" }, "filter": { "type": [ "string", "null" ], "description": "Subscription filter" }, "deadLetterPolicy": { "anyOf": [ { "type": "object", "properties": { "deadLetterTopic": { "type": [ "string", "null" ], "description": "DeadLetterPolicy deadLetterTopic" }, "maxDeliveryAttempts": { "type": [ "number", "null" ], "description": "DeadLetterPolicy maxDeliveryAttempts" } }, "description": "Properties of a DeadLetterPolicy." }, { "type": "null" } ], "description": "Subscription deadLetterPolicy" }, "retryPolicy": { "anyOf": [ { "type": "object", "properties": { "minimumBackoff": { "anyOf": [ { "type": "object", "properties": { "seconds": { "anyOf": [ { "type": "number" }, { "type": "object", "properties": { "high": { "type": "number", "description": "The high 32 bits as a signed value." }, "low": { "type": "number", "description": "The low 32 bits as a signed value." }, "unsigned": { "type": "boolean", "description": "Whether unsigned or not." } }, "required": [ "high", "low", "unsigned" ] }, { "type": "string" }, { "type": "null" } ], "description": "Duration seconds" }, "nanos": { "type": [ "number", "null" ], "description": "Duration nanos" } }, "description": "Properties of a Duration." }, { "type": "null" } ], "description": "RetryPolicy minimumBackoff" }, "maximumBackoff": { "anyOf": [ { "type": "object", "properties": { "seconds": { "anyOf": [ { "type": "number" }, { "type": "object", "properties": { "high": { "type": "number", "description": "The high 32 bits as a signed value." }, "low": { "type": "number", "description": "The low 32 bits as a signed value." }, "unsigned": { "type": "boolean", "description": "Whether unsigned or not." } }, "required": [ "high", "low", "unsigned" ] }, { "type": "string" }, { "type": "null" } ], "description": "Duration seconds" }, "nanos": { "type": [ "number", "null" ], "description": "Duration nanos" } }, "description": "Properties of a Duration." }, { "type": "null" } ], "description": "RetryPolicy maximumBackoff" } }, "description": "Properties of a RetryPolicy." }, { "type": "null" } ], "description": "Subscription retryPolicy" }, "detached": { "type": [ "boolean", "null" ], "description": "Subscription detached" }, "enableExactlyOnceDelivery": { "type": [ "boolean", "null" ], "description": "Subscription enableExactlyOnceDelivery" }, "topicMessageRetentionDuration": { "anyOf": [ { "type": "object", "properties": { "seconds": { "anyOf": [ { "type": "number" }, { "type": "object", "properties": { "high": { "type": "number", "description": "The high 32 bits as a signed value." }, "low": { "type": "number", "description": "The low 32 bits as a signed value." }, "unsigned": { "type": "boolean", "description": "Whether unsigned or not." } }, "required": [ "high", "low", "unsigned" ] }, { "type": "string" }, { "type": "null" } ], "description": "Duration seconds" }, "nanos": { "type": [ "number", "null" ], "description": "Duration nanos" } }, "description": "Properties of a Duration." }, { "type": "null" } ], "description": "Subscription topicMessageRetentionDuration" }, "state": { "anyOf": [ { "$ref": "#/definitions/google.pubsub.v1.Subscription.State" }, { "type": "string", "const": "STATE_UNSPECIFIED" }, { "type": "string", "const": "ACTIVE" }, { "type": "string", "const": "RESOURCE_ERROR" }, { "type": "null" } ], "description": "Subscription state" }, "analyticsHubSubscriptionInfo": { "anyOf": [ { "type": "object", "properties": { "listing": { "type": [ "string", "null" ], "description": "AnalyticsHubSubscriptionInfo listing" }, "subscription": { "type": [ "string", "null" ], "description": "AnalyticsHubSubscriptionInfo subscription" } }, "description": "Properties of an AnalyticsHubSubscriptionInfo." }, { "type": "null" } ], "description": "Subscription analyticsHubSubscriptionInfo" }, "messageRetentionDuration": { "anyOf": [ { "type": "object", "properties": { "seconds": { "anyOf": [ { "type": "number" }, { "type": "object", "properties": { "high": { "type": "number", "description": "The high 32 bits as a signed value." }, "low": { "type": "number", "description": "The low 32 bits as a signed value." }, "unsigned": { "type": "boolean", "description": "Whether unsigned or not." } }, "required": [ "high", "low", "unsigned" ] }, { "type": "string" }, { "type": "null" } ], "description": "Duration seconds" }, "nanos": { "type": [ "number", "null" ], "description": "Duration nanos" } }, "description": "Properties of a Duration." }, { "type": "number" } ] }, "pushEndpoint": { "type": "string" }, "oidcToken": { "$ref": "#/definitions/OidcToken" } } }, "Partial<class-657338214-822-3488-657338214-0-17392>": { "type": "object", "properties": { "retryCodes": { "type": "array", "items": { "type": "number" } }, "backoffSettings": { "type": "object", "properties": { "maxRetries": { "type": "number" }, "initialRetryDelayMillis": { "type": "number" }, "retryDelayMultiplier": { "type": "number" }, "maxRetryDelayMillis": { "type": "number" }, "initialRpcTimeoutMillis": { "type": [ "number", "null" ] }, "maxRpcTimeoutMillis": { "type": [ "number", "null" ] }, "totalTimeoutMillis": { "type": [ "number", "null" ] }, "rpcTimeoutMultiplier": { "type": [ "number", "null" ] } }, "required": [ "initialRetryDelayMillis", "retryDelayMultiplier", "maxRetryDelayMillis" ] }, "shouldRetryFn": {}, "getResumptionRequestFn": {} } }, "google.pubsub.v1.BigQueryConfig.State": { "type": "number", "enum": [ 0, 1, 2, 3, 4, 5 ], "description": "State enum." }, "google.pubsub.v1.CloudStorageConfig.State": { "type": "number", "enum": [ 0, 1, 2, 3, 4, 5 ], "description": "State enum." }, "google.pubsub.v1.Subscription.State": { "type": "number", "enum": [ 0, 1, 2 ], "description": "State enum." }, "OidcToken": { "type": "object", "properties": { "serviceAccountEmail": { "type": [ "string", "null" ], "description": "OidcToken serviceAccountEmail" }, "audience": { "type": [ "string", "null" ], "description": "OidcToken audience" } }, "description": "Properties of an OidcToken." } }, "title": "GCPPubSubService" }, "Webda/GoogleCloudQueue": { "type": "object", "properties": { "type": {