{"id":19297419,"url":"https://github.com/roitinnovation/roit-queues","last_synced_at":"2025-04-22T09:31:06.554Z","repository":{"id":52624763,"uuid":"327125160","full_name":"roitinnovation/roit-queues","owner":"roitinnovation","description":"Queue manager for Typescript, as well as Nestjs.","archived":false,"fork":false,"pushed_at":"2023-03-23T19:01:40.000Z","size":48,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-30T06:59:46.523Z","etag":null,"topics":["cloudtasks","nestjs","nodejs","pubsub","queue","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roitinnovation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-05T21:34:56.000Z","updated_at":"2022-01-04T22:46:05.000Z","dependencies_parsed_at":"2024-10-30T05:26:57.302Z","dependency_job_id":null,"html_url":"https://github.com/roitinnovation/roit-queues","commit_stats":{"total_commits":68,"total_committers":7,"mean_commits":9.714285714285714,"dds":0.5441176470588236,"last_synced_commit":"f44d697d72ab2e6c53edc658084acfb7cc236ed1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roitinnovation%2Froit-queues","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roitinnovation%2Froit-queues/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roitinnovation%2Froit-queues/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roitinnovation%2Froit-queues/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roitinnovation","download_url":"https://codeload.github.com/roitinnovation/roit-queues/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223860122,"owners_count":17215633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudtasks","nestjs","nodejs","pubsub","queue","typescript"],"created_at":"2024-11-09T23:04:51.199Z","updated_at":"2024-11-09T23:04:51.767Z","avatar_url":"https://github.com/roitinnovation.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ROIT Queues\n\n### Usage for Pub/Sub\n\nIn the `env.yaml` file add the `pubSubCredential{}` and `projectId` attributes, with the number of folders inside the {}:\n\n```yaml\ndev:\n    pubSubCredential{5}: my-credential.json\n    firestore:\n        projectId: my-project-id\n```\n\nNote: if you use `glcloud auth application-default login`, you don't need to set `pubSubCredential` at env file!\n\nInject in your desired class:\n```typescript\nimport { PubSubHandler } from '@roit/roit-queues'\n\nconstructor( \n    private readonly pubSubHandler: PubSubHandler\n) {}\n```\n\nUse the `publish` method:\n```typescript\nconst myObject = {\n    // properties\n}\n\nconst attributes = {\n    // properties\n}\n\nconst messageId = await this.pubSubHandler.publish(myObject, 'myTopic', attributes)\nconsole.log(messageId) // outputs 234786275\n```\n\n### Usage for Cloud Tasks\n\nIn the `env.yaml` file add the `cloudTaskCredencial{}` and `projectId` attributes, with the number of folders inside the {}:\n\n```yaml\ndev:\n    cloudTaskCredential{5}: my-credential.json\n    firestore:\n        projectId: my-project-id\n```\n\nInject in your desired class:\n```typescript\nimport { CloudTaskProvider } from '@roit/roit-queues'\n\nconstructor( \n    private readonly cloudTaskProvider: CloudTaskProvider\n) {}\n```\n\nSchedule Time params:\n```typescript\nscheduleTime: {\n    seconds?: number\n    nanos?: number\n    dateExecute?: string // Use moment formats: https://www.npmjs.com/package/moment\n    executeAt?: string // Use ms formats: https://www.npmjs.com/package/ms\n}\n```\n\n\nUse the `createTask` method:\n```typescript\nimport { TaskConfiguration } from '@roit/roit-queues'\n\nconst myTask: TaskConfiguration = {\n    url: 'https://endpoint.com',\n    httpMethod: 'POST',\n    region: 'us-central1',\n    queue: 'my-queue',\n    scheduleTime: {\n        seconds: 3600   \n    },\n    headers: MyHeadersObject,\n    body: MyPayloadObject\n}\n\nconst taskResponse = await this.cloudTaskProvider.createTask(myTask)\nconsole.log(taskResponse)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froitinnovation%2Froit-queues","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froitinnovation%2Froit-queues","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froitinnovation%2Froit-queues/lists"}