@squarecloud/api
Version:
A NodeJS wrapper for Square Cloud API
1 lines • 1.5 kB
Source Map (JSON)
{"version":3,"sources":["../../src/structures/deploy.ts"],"sourcesContent":["import type { APIDeployment, DeploymentState } from \"@squarecloud/api-types/v2\";\n\nimport type { BaseApplication } from \"./application/base\";\n\n/**\n * Represents an application deployment\n */\nexport class Deployment {\n\t/** The ID of the deploy. */\n\tpublic readonly id: `git-${string}`;\n\n\t/** The current state of the deploy. */\n\tpublic state: DeploymentState;\n\n\t/** The date the deploy was created. */\n\tpublic createdAt: Date;\n\n\t/** The date the deploy was created in millisseconds. */\n\tpublic createdTimestamp: number;\n\n\t/**\n\t * Represents an application deployment\n\t *\n\t * @constructor\n\t * @param application - The application from which you fetched the deployment\n\t * @param data - The data from this deployment\n\t */\n\tconstructor(\n\t\tpublic readonly application: BaseApplication,\n\t\tdata: APIDeployment,\n\t) {\n\t\tconst { id, state, date } = data;\n\n\t\tthis.id = id;\n\t\tthis.state = state;\n\t\tthis.createdAt = new Date(date);\n\t\tthis.createdTimestamp = this.createdAt.getTime();\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,IAAM,aAAN,MAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBvB,YACiB,aAChB,MACC;AAFe;AAnBjB;AAAA,wBAAgB;AAGhB;AAAA,wBAAO;AAGP;AAAA,wBAAO;AAGP;AAAA,wBAAO;AAaN,UAAM,EAAE,IAAI,OAAO,KAAK,IAAI;AAE5B,SAAK,KAAK;AACV,SAAK,QAAQ;AACb,SAAK,YAAY,IAAI,KAAK,IAAI;AAC9B,SAAK,mBAAmB,KAAK,UAAU,QAAQ;AAAA,EAChD;AACD;","names":[]}