@camunda/ccma-api 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,107 @@
1
+ import type { ApprovalJobDto, ApprovalJobStatus, ApprovalUseCaseDto } from '@camunda/ccma-shared-types';
2
+ import type { RequestBaseParams } from '../../types/general.types.js';
3
+ export interface ApprovalPageDto {
4
+ approvals: ApprovalJobDto[];
5
+ page: {
6
+ limit: number;
7
+ offset: number;
8
+ /** True when the next page holds more. Never read the length instead. */
9
+ hasMore: boolean;
10
+ };
11
+ }
12
+ export interface ListApprovalsRequest extends RequestBaseParams {
13
+ params?: {
14
+ type?: string;
15
+ status?: ApprovalJobStatus;
16
+ limit?: number;
17
+ offset?: number;
18
+ };
19
+ }
20
+ export interface ApprovalIdRequest extends RequestBaseParams {
21
+ params: {
22
+ id: string;
23
+ };
24
+ }
25
+ export interface RejectApprovalRequest extends RequestBaseParams {
26
+ params: {
27
+ id: string;
28
+ reason: string;
29
+ };
30
+ }
31
+ /** The envelope that every create route of every use case shares. */
32
+ export interface CreateApprovalRequest<TPayload> extends RequestBaseParams {
33
+ params: {
34
+ payload: TPayload;
35
+ reason?: string;
36
+ /** More approvals than the floor of the use case. Never fewer. */
37
+ requiredAcks?: number;
38
+ };
39
+ }
40
+ export interface SendToExpiredTrialPayloadDto {
41
+ orgId: string;
42
+ orgName?: string;
43
+ }
44
+ export interface ExtendTrialPayloadDto {
45
+ orgId: string;
46
+ orgName?: string;
47
+ /**
48
+ * Days of trial counted from the moment the action RUNS.
49
+ *
50
+ * Never a date. Accounts holds the new expiry inside a window that it
51
+ * measures when the call arrives, and under approvals that is days after the
52
+ * person chose the value. See `use-cases/extend-trial.ts` in
53
+ * control-backend.
54
+ */
55
+ days: number;
56
+ }
57
+ export declare class ControlApprovalsService {
58
+ /**
59
+ * The registered privileged actions, with the rules that guard each one.
60
+ *
61
+ * A frontend reads this to run the same policy as the service, so it never
62
+ * holds a copy of the registry. A new use case then needs no frontend
63
+ * deploy.
64
+ */
65
+ static listUseCases(params: RequestBaseParams): Promise<ApprovalUseCaseDto[]>;
66
+ /**
67
+ * One page of the requests that the caller can read.
68
+ *
69
+ * It is not the whole table: control-backend hides a request whose use case
70
+ * the caller cannot act on, unless the caller opened it.
71
+ */
72
+ static list(params: ListApprovalsRequest): Promise<ApprovalPageDto>;
73
+ static get(params: ApprovalIdRequest): Promise<ApprovalJobDto>;
74
+ /** Adds the approval of the caller. The last one can run the action. */
75
+ static acknowledge(params: ApprovalIdRequest): Promise<ApprovalJobDto>;
76
+ /** Closes a request without running the action. The reason is necessary. */
77
+ static reject(params: RejectApprovalRequest): Promise<ApprovalJobDto>;
78
+ /** Takes back a request. Only the person who opened it can. */
79
+ static withdraw(params: ApprovalIdRequest): Promise<ApprovalJobDto>;
80
+ /**
81
+ * Runs a request that holds its approvals.
82
+ *
83
+ * Only a use case in the explicit mode needs this. An action that throws
84
+ * leaves the request `failed`, and this call still answers 200 with it, so
85
+ * read `status` and `executionError` of the answer.
86
+ */
87
+ static execute(params: ApprovalIdRequest): Promise<ApprovalJobDto>;
88
+ /** Opens a send-to-expired-trial request. Any signed-in Camundi can. */
89
+ static createSendToExpiredTrial(params: CreateApprovalRequest<SendToExpiredTrialPayloadDto>): Promise<ApprovalJobDto>;
90
+ /**
91
+ * Opens an extend-trial request.
92
+ *
93
+ * Opening one needs `accounts:admin:extendTrial`, the same permission that
94
+ * approving needs, and the reason is necessary.
95
+ */
96
+ static createExtendTrial(params: CreateApprovalRequest<ExtendTrialPayloadDto>): Promise<ApprovalJobDto>;
97
+ /**
98
+ * The shared half of every call that answers one request.
99
+ *
100
+ * Six routes answer `{ approval }` and differ only in the verb and the path.
101
+ * One private helper keeps the metrics context, the status check and the
102
+ * unwrapping in one place.
103
+ */
104
+ private static readOne;
105
+ /** The shared half of every create route. See `approvalRequestBody`. */
106
+ private static create;
107
+ }
@@ -0,0 +1,228 @@
1
+ import { request } from "../../utils/api.js";
2
+ import { HttpError } from "../../utils/errors.js";
3
+ const BASE = { id: "control" };
4
+ function contextFor(name, url, normalizedUrl, type, source) {
5
+ return {
6
+ method: {
7
+ name: `ControlApprovalsService.${name}`,
8
+ url,
9
+ normalizedUrl,
10
+ type
11
+ },
12
+ source,
13
+ target: { name: "control", type: "internal" }
14
+ };
15
+ }
16
+ class ControlApprovalsService {
17
+ /**
18
+ * The registered privileged actions, with the rules that guard each one.
19
+ *
20
+ * A frontend reads this to run the same policy as the service, so it never
21
+ * holds a copy of the registry. A new use case then needs no frontend
22
+ * deploy.
23
+ */
24
+ static async listUseCases(params) {
25
+ const serviceContext = contextFor(
26
+ "listUseCases",
27
+ "api/approvals/use-cases",
28
+ "api/approvals/use-cases",
29
+ "get",
30
+ params.config.metrics?.source || "unset"
31
+ );
32
+ const response = await request({
33
+ config: params.config,
34
+ base: BASE,
35
+ url: serviceContext.method.url,
36
+ method: "get",
37
+ metricsDetails: serviceContext
38
+ });
39
+ if (!response.ok) {
40
+ throw new HttpError(
41
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
42
+ response.status,
43
+ response.statusText
44
+ );
45
+ }
46
+ return response.body.useCases;
47
+ }
48
+ /**
49
+ * One page of the requests that the caller can read.
50
+ *
51
+ * It is not the whole table: control-backend hides a request whose use case
52
+ * the caller cannot act on, unless the caller opened it.
53
+ */
54
+ static async list(params) {
55
+ const query = new URLSearchParams();
56
+ for (const [key, value] of Object.entries(params.params ?? {})) {
57
+ if (value !== void 0) {
58
+ query.set(key, String(value));
59
+ }
60
+ }
61
+ const suffix = query.size > 0 ? `?${query.toString()}` : "";
62
+ const serviceContext = contextFor(
63
+ "list",
64
+ `api/approvals${suffix}`,
65
+ "api/approvals",
66
+ "get",
67
+ params.config.metrics?.source || "unset"
68
+ );
69
+ const response = await request({
70
+ config: params.config,
71
+ base: BASE,
72
+ url: serviceContext.method.url,
73
+ method: "get",
74
+ metricsDetails: serviceContext
75
+ });
76
+ if (!response.ok) {
77
+ throw new HttpError(
78
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
79
+ response.status,
80
+ response.statusText
81
+ );
82
+ }
83
+ return response.body;
84
+ }
85
+ static async get(params) {
86
+ return ControlApprovalsService.readOne(
87
+ params,
88
+ "get",
89
+ `api/approvals/${params.params.id}`,
90
+ "api/approvals/:id",
91
+ "get"
92
+ );
93
+ }
94
+ /** Adds the approval of the caller. The last one can run the action. */
95
+ static async acknowledge(params) {
96
+ return ControlApprovalsService.readOne(
97
+ params,
98
+ "acknowledge",
99
+ `api/approvals/${params.params.id}/ack`,
100
+ "api/approvals/:id/ack",
101
+ "post"
102
+ );
103
+ }
104
+ /** Closes a request without running the action. The reason is necessary. */
105
+ static async reject(params) {
106
+ return ControlApprovalsService.readOne(
107
+ params,
108
+ "reject",
109
+ `api/approvals/${params.params.id}/reject`,
110
+ "api/approvals/:id/reject",
111
+ "post",
112
+ { reason: params.params.reason }
113
+ );
114
+ }
115
+ /** Takes back a request. Only the person who opened it can. */
116
+ static async withdraw(params) {
117
+ return ControlApprovalsService.readOne(
118
+ params,
119
+ "withdraw",
120
+ `api/approvals/${params.params.id}/withdraw`,
121
+ "api/approvals/:id/withdraw",
122
+ "post"
123
+ );
124
+ }
125
+ /**
126
+ * Runs a request that holds its approvals.
127
+ *
128
+ * Only a use case in the explicit mode needs this. An action that throws
129
+ * leaves the request `failed`, and this call still answers 200 with it, so
130
+ * read `status` and `executionError` of the answer.
131
+ */
132
+ static async execute(params) {
133
+ return ControlApprovalsService.readOne(
134
+ params,
135
+ "execute",
136
+ `api/approvals/${params.params.id}/execute`,
137
+ "api/approvals/:id/execute",
138
+ "post"
139
+ );
140
+ }
141
+ /** Opens a send-to-expired-trial request. Any signed-in Camundi can. */
142
+ static async createSendToExpiredTrial(params) {
143
+ return ControlApprovalsService.create(
144
+ params,
145
+ "createSendToExpiredTrial",
146
+ "api/approvals/send-to-expired-trial"
147
+ );
148
+ }
149
+ /**
150
+ * Opens an extend-trial request.
151
+ *
152
+ * Opening one needs `accounts:admin:extendTrial`, the same permission that
153
+ * approving needs, and the reason is necessary.
154
+ */
155
+ static async createExtendTrial(params) {
156
+ return ControlApprovalsService.create(
157
+ params,
158
+ "createExtendTrial",
159
+ "api/approvals/extend-trial"
160
+ );
161
+ }
162
+ /**
163
+ * The shared half of every call that answers one request.
164
+ *
165
+ * Six routes answer `{ approval }` and differ only in the verb and the path.
166
+ * One private helper keeps the metrics context, the status check and the
167
+ * unwrapping in one place.
168
+ */
169
+ static async readOne(params, name, url, normalizedUrl, method, body) {
170
+ const serviceContext = contextFor(
171
+ name,
172
+ url,
173
+ normalizedUrl,
174
+ method,
175
+ params.config.metrics?.source || "unset"
176
+ );
177
+ const response = await request({
178
+ config: params.config,
179
+ base: BASE,
180
+ url,
181
+ method,
182
+ metricsDetails: serviceContext,
183
+ body
184
+ });
185
+ if (!response.ok) {
186
+ throw new HttpError(
187
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
188
+ response.status,
189
+ response.statusText
190
+ );
191
+ }
192
+ return response.body.approval;
193
+ }
194
+ /** The shared half of every create route. See `approvalRequestBody`. */
195
+ static async create(params, name, url) {
196
+ const serviceContext = contextFor(
197
+ name,
198
+ url,
199
+ url,
200
+ "post",
201
+ params.config.metrics?.source || "unset"
202
+ );
203
+ const response = await request({
204
+ config: params.config,
205
+ base: BASE,
206
+ url,
207
+ method: "post",
208
+ metricsDetails: serviceContext,
209
+ body: {
210
+ payload: params.params.payload,
211
+ reason: params.params.reason,
212
+ requiredAcks: params.params.requiredAcks
213
+ }
214
+ });
215
+ if (!response.ok) {
216
+ throw new HttpError(
217
+ `${serviceContext.method.name}: ${response.status} ${response.statusText}`,
218
+ response.status,
219
+ response.statusText
220
+ );
221
+ }
222
+ return response.body.approval;
223
+ }
224
+ }
225
+ export {
226
+ ControlApprovalsService
227
+ };
228
+ //# sourceMappingURL=control.approvals.service.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/services/control/control.approvals.service.ts"],
4
+ "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type {\n ApprovalJobDto,\n ApprovalJobStatus,\n ApprovalUseCaseDto,\n} from '@camunda/ccma-shared-types'\nimport type {\n RequestBaseParams,\n RequestBaseServiceContext,\n} from '../../types/general.types.js'\nimport { request } from '../../utils/api.js'\nimport { HttpError } from '../../utils/errors.js'\n\n/**\n * The four-eyes approval surface of control-backend.\n *\n * One service for the whole mechanism, and not one for each use case. The\n * generic routes (list, read, approve, reject, withdraw, run) carry no\n * knowledge of a use case, which is what lets one view in control-frontend\n * show every privileged action. Only the create calls are per use case,\n * because a payload can be validated only for the use case it belongs to.\n *\n * Every route answers 404 while the feature flag `control.approvals` is off on\n * the stage, and while the service reaches no stage at all.\n */\n\nconst BASE = { id: 'control' } as const\n\nexport interface ApprovalPageDto {\n approvals: ApprovalJobDto[]\n page: {\n limit: number\n offset: number\n /** True when the next page holds more. Never read the length instead. */\n hasMore: boolean\n }\n}\n\nexport interface ListApprovalsRequest extends RequestBaseParams {\n params?: {\n type?: string\n status?: ApprovalJobStatus\n limit?: number\n offset?: number\n }\n}\n\nexport interface ApprovalIdRequest extends RequestBaseParams {\n params: { id: string }\n}\n\nexport interface RejectApprovalRequest extends RequestBaseParams {\n params: { id: string; reason: string }\n}\n\n/** The envelope that every create route of every use case shares. */\nexport interface CreateApprovalRequest<TPayload> extends RequestBaseParams {\n params: {\n payload: TPayload\n reason?: string\n /** More approvals than the floor of the use case. Never fewer. */\n requiredAcks?: number\n }\n}\n\nexport interface SendToExpiredTrialPayloadDto {\n orgId: string\n orgName?: string\n}\n\nexport interface ExtendTrialPayloadDto {\n orgId: string\n orgName?: string\n /**\n * Days of trial counted from the moment the action RUNS.\n *\n * Never a date. Accounts holds the new expiry inside a window that it\n * measures when the call arrives, and under approvals that is days after the\n * person chose the value. See `use-cases/extend-trial.ts` in\n * control-backend.\n */\n days: number\n}\n\nfunction contextFor(\n name: string,\n url: string,\n normalizedUrl: string,\n type: 'get' | 'post',\n source: string,\n): RequestBaseServiceContext {\n return {\n method: {\n name: `ControlApprovalsService.${name}`,\n url,\n normalizedUrl,\n type,\n },\n source,\n target: { name: 'control', type: 'internal' },\n }\n}\n\nexport class ControlApprovalsService {\n /**\n * The registered privileged actions, with the rules that guard each one.\n *\n * A frontend reads this to run the same policy as the service, so it never\n * holds a copy of the registry. A new use case then needs no frontend\n * deploy.\n */\n public static async listUseCases(\n params: RequestBaseParams,\n ): Promise<ApprovalUseCaseDto[]> {\n const serviceContext = contextFor(\n 'listUseCases',\n 'api/approvals/use-cases',\n 'api/approvals/use-cases',\n 'get',\n params.config.metrics?.source || 'unset',\n )\n const response = await request<{ useCases: ApprovalUseCaseDto[] }>({\n config: params.config,\n base: BASE,\n url: serviceContext.method.url,\n method: 'get',\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body!.useCases\n }\n\n /**\n * One page of the requests that the caller can read.\n *\n * It is not the whole table: control-backend hides a request whose use case\n * the caller cannot act on, unless the caller opened it.\n */\n public static async list(\n params: ListApprovalsRequest,\n ): Promise<ApprovalPageDto> {\n const query = new URLSearchParams()\n for (const [key, value] of Object.entries(params.params ?? {})) {\n if (value !== undefined) {\n query.set(key, String(value))\n }\n }\n const suffix = query.size > 0 ? `?${query.toString()}` : ''\n const serviceContext = contextFor(\n 'list',\n `api/approvals${suffix}`,\n 'api/approvals',\n 'get',\n params.config.metrics?.source || 'unset',\n )\n const response = await request<ApprovalPageDto>({\n config: params.config,\n base: BASE,\n url: serviceContext.method.url,\n method: 'get',\n metricsDetails: serviceContext,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body!\n }\n\n public static async get(params: ApprovalIdRequest): Promise<ApprovalJobDto> {\n return ControlApprovalsService.readOne(\n params,\n 'get',\n `api/approvals/${params.params.id}`,\n 'api/approvals/:id',\n 'get',\n )\n }\n\n /** Adds the approval of the caller. The last one can run the action. */\n public static async acknowledge(\n params: ApprovalIdRequest,\n ): Promise<ApprovalJobDto> {\n return ControlApprovalsService.readOne(\n params,\n 'acknowledge',\n `api/approvals/${params.params.id}/ack`,\n 'api/approvals/:id/ack',\n 'post',\n )\n }\n\n /** Closes a request without running the action. The reason is necessary. */\n public static async reject(\n params: RejectApprovalRequest,\n ): Promise<ApprovalJobDto> {\n return ControlApprovalsService.readOne(\n params,\n 'reject',\n `api/approvals/${params.params.id}/reject`,\n 'api/approvals/:id/reject',\n 'post',\n { reason: params.params.reason },\n )\n }\n\n /** Takes back a request. Only the person who opened it can. */\n public static async withdraw(\n params: ApprovalIdRequest,\n ): Promise<ApprovalJobDto> {\n return ControlApprovalsService.readOne(\n params,\n 'withdraw',\n `api/approvals/${params.params.id}/withdraw`,\n 'api/approvals/:id/withdraw',\n 'post',\n )\n }\n\n /**\n * Runs a request that holds its approvals.\n *\n * Only a use case in the explicit mode needs this. An action that throws\n * leaves the request `failed`, and this call still answers 200 with it, so\n * read `status` and `executionError` of the answer.\n */\n public static async execute(\n params: ApprovalIdRequest,\n ): Promise<ApprovalJobDto> {\n return ControlApprovalsService.readOne(\n params,\n 'execute',\n `api/approvals/${params.params.id}/execute`,\n 'api/approvals/:id/execute',\n 'post',\n )\n }\n\n /** Opens a send-to-expired-trial request. Any signed-in Camundi can. */\n public static async createSendToExpiredTrial(\n params: CreateApprovalRequest<SendToExpiredTrialPayloadDto>,\n ): Promise<ApprovalJobDto> {\n return ControlApprovalsService.create(\n params,\n 'createSendToExpiredTrial',\n 'api/approvals/send-to-expired-trial',\n )\n }\n\n /**\n * Opens an extend-trial request.\n *\n * Opening one needs `accounts:admin:extendTrial`, the same permission that\n * approving needs, and the reason is necessary.\n */\n public static async createExtendTrial(\n params: CreateApprovalRequest<ExtendTrialPayloadDto>,\n ): Promise<ApprovalJobDto> {\n return ControlApprovalsService.create(\n params,\n 'createExtendTrial',\n 'api/approvals/extend-trial',\n )\n }\n\n /**\n * The shared half of every call that answers one request.\n *\n * Six routes answer `{ approval }` and differ only in the verb and the path.\n * One private helper keeps the metrics context, the status check and the\n * unwrapping in one place.\n */\n private static async readOne(\n params: RequestBaseParams,\n name: string,\n url: string,\n normalizedUrl: string,\n method: 'get' | 'post',\n body?: Record<string, unknown>,\n ): Promise<ApprovalJobDto> {\n const serviceContext = contextFor(\n name,\n url,\n normalizedUrl,\n method,\n params.config.metrics?.source || 'unset',\n )\n const response = await request<{ approval: ApprovalJobDto }>({\n config: params.config,\n base: BASE,\n url,\n method,\n metricsDetails: serviceContext,\n body,\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body!.approval\n }\n\n /** The shared half of every create route. See `approvalRequestBody`. */\n private static async create<TPayload>(\n params: CreateApprovalRequest<TPayload>,\n name: string,\n url: string,\n ): Promise<ApprovalJobDto> {\n const serviceContext = contextFor(\n name,\n url,\n url,\n 'post',\n params.config.metrics?.source || 'unset',\n )\n const response = await request<{ approval: ApprovalJobDto }>({\n config: params.config,\n base: BASE,\n url,\n method: 'post',\n metricsDetails: serviceContext,\n body: {\n payload: params.params.payload,\n reason: params.params.reason,\n requiredAcks: params.params.requiredAcks,\n },\n })\n if (!response.ok) {\n throw new HttpError(\n `${serviceContext.method.name}: ${response.status} ${response.statusText}`,\n response.status,\n response.statusText,\n )\n }\n return response.body!.approval\n }\n}\n"],
5
+ "mappings": "AAeA,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAe1B,MAAM,OAAO,EAAE,IAAI,UAAU;AA0D7B,SAAS,WACP,MACA,KACA,eACA,MACA,QAC2B;AAC3B,SAAO;AAAA,IACL,QAAQ;AAAA,MACN,MAAM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SAAS,IAAI;AAChB,YAAM,IAAI;AAAA,QACR,GAAG,eAAe,OAAO,IAAI,KAAK,SAAS,MAAM,IAAI,SAAS,UAAU;AAAA,QACxE,SAAS;AAAA,QACT,SAAS;AAAA,MACX;AAAA,IACF;AACA,WAAO,SAAS,KAAM;AAAA,EACxB;AACF;",
6
+ "names": []
7
+ }
@@ -1,5 +1,5 @@
1
1
  import type { RequestBaseParamsConfig } from '../types/general.types.js';
2
- export type ServiceName = 'accounts' | 'console' | 'audit-logger' | 'notifications' | 'login' | 'login-internal' | 'comm-bridge' | 'telemetry' | 'mixpanel' | 'alert-distributor' | 'analytic-bridge' | 'wordpress-helpcenter';
2
+ export type ServiceName = 'accounts' | 'console' | 'control' | 'audit-logger' | 'notifications' | 'login' | 'login-internal' | 'comm-bridge' | 'telemetry' | 'mixpanel' | 'alert-distributor' | 'analytic-bridge' | 'wordpress-helpcenter';
3
3
  export type ServiceAudience = 'camunda-cloud-audience' | 'comm-bridge-audience' | 'notification-audience' | 'analytics-audience';
4
4
  export interface EnvironmentParam {
5
5
  id: ServiceName | ServiceAudience;
@@ -20,6 +20,17 @@ const ENV_PARAMS = [
20
20
  int: "https://accounts.cloud.ultrawombat.com",
21
21
  prod: "https://accounts.cloud.camunda.io"
22
22
  },
23
+ {
24
+ // control-backend, the four-eyes approval service. It reaches dev today
25
+ // and nothing else: `saas-argocd-apps` holds an ApplicationSet for dev
26
+ // only. The int and prod names follow the pattern of every other service
27
+ // of the fleet, so they are right on the day the ApplicationSet lands.
28
+ id: "control",
29
+ dev: "https://control.cloud.dev.ultrawombat.com",
30
+ devAws: "https://control.cloud.dev.ultrawombat.com",
31
+ int: "https://control.cloud.ultrawombat.com",
32
+ prod: "https://control.cloud.camunda.io"
33
+ },
23
34
  {
24
35
  id: "audit-logger",
25
36
  dev: "https://audit.cloud.dev.ultrawombat.com",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils/environments.ts"],
4
- "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type { RequestBaseParamsConfig } from '../types/general.types.js'\n\nexport type ServiceName =\n | 'accounts'\n | 'console'\n | 'audit-logger'\n | 'notifications'\n | 'login'\n | 'login-internal'\n | 'comm-bridge'\n | 'telemetry'\n | 'mixpanel'\n | 'alert-distributor'\n | 'analytic-bridge'\n | 'wordpress-helpcenter'\n\nexport type ServiceAudience =\n | 'camunda-cloud-audience'\n | 'comm-bridge-audience'\n | 'notification-audience'\n | 'analytics-audience'\n\nexport interface EnvironmentParam {\n id: ServiceName | ServiceAudience\n dev: string\n devAws: string\n int: string\n prod: string\n}\n\nconst ENV_PARAMS: EnvironmentParam[] = [\n {\n id: 'notifications',\n dev: 'https://notifications.cloud.dev.ultrawombat.com',\n devAws: 'https://notifications.cloud.dev.ultrawombat.com',\n int: 'https://notifications.cloud.ultrawombat.com',\n prod: 'https://notifications.cloud.camunda.io',\n },\n {\n id: 'console',\n dev: 'https://console.cloud.dev.ultrawombat.com',\n devAws: 'https://console-aws.cloud.dev.ultrawombat.com',\n int: 'https://console.cloud.ultrawombat.com',\n prod: 'https://console.cloud.camunda.io',\n },\n {\n id: 'accounts',\n dev: 'https://accounts.cloud.dev.ultrawombat.com',\n devAws: 'https://accounts-aws.cloud.dev.ultrawombat.com',\n int: 'https://accounts.cloud.ultrawombat.com',\n prod: 'https://accounts.cloud.camunda.io',\n },\n {\n id: 'audit-logger',\n dev: 'https://audit.cloud.dev.ultrawombat.com',\n devAws: 'https://audit-logger.cloud.dev.ultrawombat.com',\n int: 'https://audit.cloud.ultrawombat.com',\n prod: 'https://audit.cloud.camunda.io',\n },\n {\n id: 'analytic-bridge',\n dev: 'https://analytics.cloud.dev.ultrawombat.com',\n devAws: 'https://analytics-bridge.cloud.dev.ultrawombat.com',\n int: 'https://analytics.cloud.ultrawombat.com',\n prod: 'https://analytics.cloud.camunda.io',\n },\n {\n id: 'login',\n dev: 'https://login.cloud.dev.ultrawombat.com',\n devAws: 'https://login.cloud.dev.ultrawombat.com',\n int: 'https://login.cloud.ultrawombat.com',\n prod: 'https://login.cloud.camunda.io',\n },\n {\n id: 'login-internal',\n dev: 'http://token-issuer.token-issuer.svc.cluster.local:8080',\n devAws: 'http://token-issuer.token-issuer.svc.cluster.local:8080',\n int: 'http://token-issuer.token-issuer.svc.cluster.local:8080',\n prod: 'http://token-issuer.token-issuer.svc.cluster.local:8080',\n },\n {\n id: 'comm-bridge',\n dev: 'https://comm.cloud.dev.ultrawombat.com',\n devAws: 'https://comm.cloud.dev.ultrawombat.com',\n int: 'https://comm.cloud.ultrawombat.com',\n prod: 'https://comm.cloud.camunda.io',\n },\n {\n id: 'telemetry',\n dev: 'https://telemetry.cloud.dev.ultrawombat.com',\n devAws: 'https://telemetry.cloud.dev.ultrawombat.com',\n int: 'https://telemetry.cloud.ultrawombat.com',\n prod: 'https://telemetry.cloud.camunda.io',\n },\n {\n id: 'mixpanel',\n dev: 'https://api.mixpanel.com',\n devAws: 'https://api.mixpanel.com',\n int: 'https://api.mixpanel.com',\n prod: 'https://api.mixpanel.com',\n },\n {\n id: 'alert-distributor',\n dev: 'https://alert-distributor.cloud.dev.ultrawombat.com',\n devAws: 'https://alert-distributor.cloud.dev.ultrawombat.com',\n int: 'https://alert-distributor.cloud.ultrawombat.com',\n prod: 'https://alert-distributor.cloud.camunda.io',\n },\n {\n id: 'wordpress-helpcenter',\n dev: 'https://camunda-help-stg.mystagingwebsite.com',\n devAws: 'https://camunda-help-stg.mystagingwebsite.com',\n int: 'https://camunda-help-stg.mystagingwebsite.com',\n prod: 'https://camunda-helpcenter.mystagingwebsite.com',\n },\n // AUDIENCES\n {\n id: 'camunda-cloud-audience',\n dev: 'cloud.dev.ultrawombat.com',\n devAws: 'cloud.dev.ultrawombat.com',\n int: 'cloud.ultrawombat.com',\n prod: 'cloud.camunda.io',\n },\n {\n id: 'comm-bridge-audience',\n dev: 'comm.dev.ultrawombat.com',\n devAws: 'comm.dev.ultrawombat.com',\n int: 'comm.ultrawombat.com',\n prod: 'comm.camunda.io',\n },\n {\n id: 'notification-audience',\n dev: 'notifications.dev.ultrawombat.com',\n devAws: 'notifications.dev.ultrawombat.com',\n int: 'notifications.ultrawombat.com',\n prod: 'notifications.camunda.io',\n },\n {\n id: 'analytics-audience',\n dev: 'analytics.dev.ultrawombat.com',\n devAws: 'analytics.dev.ultrawombat.com',\n int: 'analytics.ultrawombat.com',\n prod: 'analytics.camunda.io',\n },\n]\n\nexport function getEnvParam(\n id: ServiceName | ServiceAudience,\n config: RequestBaseParamsConfig,\n) {\n if (config.envOverride?.[id] && config.envOverride[id].length > 0) {\n return config.envOverride[id]\n }\n\n if (\n (id === 'console' && config.stage === 'localconsole') ||\n (id === 'accounts' && config.stage === 'localaccounts')\n ) {\n // special handling if running console/accounts frontend and backend locally\n return `http://localhost:8080`\n }\n\n const envParam = ENV_PARAMS.find(\n (environmentParam) => environmentParam.id === id,\n )\n if (!envParam) {\n throw new Error(`Unknown id: ${id}`)\n }\n switch (config.stage) {\n case 'local':\n case 'localconsole':\n case 'localaccounts':\n case 'dev':\n return envParam.dev\n case 'devAws':\n return envParam.devAws\n case 'int':\n return envParam.int\n case 'prod':\n return envParam.prod\n default:\n throw new Error(`Unknown stage: ${config.stage}`)\n }\n}\n"],
5
- "mappings": "AAoCA,MAAM,aAAiC;AAAA,EACrC;AAAA,IACE,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,E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AAK;AAAA,IACL,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AACF;AAEO,SAAS,YACd,IACA,QACA;AACA,MAAI,OAAO,cAAc,EAAE,KAAK,OAAO,YAAY,EAAE,EAAE,SAAS,GAAG;AACjE,WAAO,OAAO,YAAY,EAAE;AAAA,EAC9B;AAEA,MACG,OAAO,aAAa,OAAO,UAAU,kBACrC,OAAO,cAAc,OAAO,UAAU,iBACvC;AAEA,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,WAAW;AAAA,IAC1B,CAAC,qBAAqB,iBAAiB,OAAO;AAAA,EAChD;AACA,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,eAAe,EAAE,EAAE;AAAA,EACrC;AACA,UAAQ,OAAO,OAAO;AAAA,IACpB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO,SAAS;AAAA,IAClB,KAAK;AACH,aAAO,SAAS;AAAA,IAClB,KAAK;AACH,aAAO,SAAS;AAAA,IAClB,KAAK;AACH,aAAO,SAAS;AAAA,IAClB;AACE,YAAM,IAAI,MAAM,kBAAkB,OAAO,KAAK,EAAE;AAAA,EACpD;AACF;",
4
+ "sourcesContent": ["/*\n * Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH\n * under one or more contributor license agreements. Licensed under a commercial license.\n * You may not use this file except in compliance with the commercial license.\n */\n\nimport type { RequestBaseParamsConfig } from '../types/general.types.js'\n\nexport type ServiceName =\n | 'accounts'\n | 'console'\n | 'control'\n | 'audit-logger'\n | 'notifications'\n | 'login'\n | 'login-internal'\n | 'comm-bridge'\n | 'telemetry'\n | 'mixpanel'\n | 'alert-distributor'\n | 'analytic-bridge'\n | 'wordpress-helpcenter'\n\nexport type ServiceAudience =\n | 'camunda-cloud-audience'\n | 'comm-bridge-audience'\n | 'notification-audience'\n | 'analytics-audience'\n\nexport interface EnvironmentParam {\n id: ServiceName | ServiceAudience\n dev: string\n devAws: string\n int: string\n prod: string\n}\n\nconst ENV_PARAMS: EnvironmentParam[] = [\n {\n id: 'notifications',\n dev: 'https://notifications.cloud.dev.ultrawombat.com',\n devAws: 'https://notifications.cloud.dev.ultrawombat.com',\n int: 'https://notifications.cloud.ultrawombat.com',\n prod: 'https://notifications.cloud.camunda.io',\n },\n {\n id: 'console',\n dev: 'https://console.cloud.dev.ultrawombat.com',\n devAws: 'https://console-aws.cloud.dev.ultrawombat.com',\n int: 'https://console.cloud.ultrawombat.com',\n prod: 'https://console.cloud.camunda.io',\n },\n {\n id: 'accounts',\n dev: 'https://accounts.cloud.dev.ultrawombat.com',\n devAws: 'https://accounts-aws.cloud.dev.ultrawombat.com',\n int: 'https://accounts.cloud.ultrawombat.com',\n prod: 'https://accounts.cloud.camunda.io',\n },\n {\n // control-backend, the four-eyes approval service. It reaches dev today\n // and nothing else: `saas-argocd-apps` holds an ApplicationSet for dev\n // only. The int and prod names follow the pattern of every other service\n // of the fleet, so they are right on the day the ApplicationSet lands.\n id: 'control',\n dev: 'https://control.cloud.dev.ultrawombat.com',\n devAws: 'https://control.cloud.dev.ultrawombat.com',\n int: 'https://control.cloud.ultrawombat.com',\n prod: 'https://control.cloud.camunda.io',\n },\n {\n id: 'audit-logger',\n dev: 'https://audit.cloud.dev.ultrawombat.com',\n devAws: 'https://audit-logger.cloud.dev.ultrawombat.com',\n int: 'https://audit.cloud.ultrawombat.com',\n prod: 'https://audit.cloud.camunda.io',\n },\n {\n id: 'analytic-bridge',\n dev: 'https://analytics.cloud.dev.ultrawombat.com',\n devAws: 'https://analytics-bridge.cloud.dev.ultrawombat.com',\n int: 'https://analytics.cloud.ultrawombat.com',\n prod: 'https://analytics.cloud.camunda.io',\n },\n {\n id: 'login',\n dev: 'https://login.cloud.dev.ultrawombat.com',\n devAws: 'https://login.cloud.dev.ultrawombat.com',\n int: 'https://login.cloud.ultrawombat.com',\n prod: 'https://login.cloud.camunda.io',\n },\n {\n id: 'login-internal',\n dev: 'http://token-issuer.token-issuer.svc.cluster.local:8080',\n devAws: 'http://token-issuer.token-issuer.svc.cluster.local:8080',\n int: 'http://token-issuer.token-issuer.svc.cluster.local:8080',\n prod: 'http://token-issuer.token-issuer.svc.cluster.local:8080',\n },\n {\n id: 'comm-bridge',\n dev: 'https://comm.cloud.dev.ultrawombat.com',\n devAws: 'https://comm.cloud.dev.ultrawombat.com',\n int: 'https://comm.cloud.ultrawombat.com',\n prod: 'https://comm.cloud.camunda.io',\n },\n {\n id: 'telemetry',\n dev: 'https://telemetry.cloud.dev.ultrawombat.com',\n devAws: 'https://telemetry.cloud.dev.ultrawombat.com',\n int: 'https://telemetry.cloud.ultrawombat.com',\n prod: 'https://telemetry.cloud.camunda.io',\n },\n {\n id: 'mixpanel',\n dev: 'https://api.mixpanel.com',\n devAws: 'https://api.mixpanel.com',\n int: 'https://api.mixpanel.com',\n prod: 'https://api.mixpanel.com',\n },\n {\n id: 'alert-distributor',\n dev: 'https://alert-distributor.cloud.dev.ultrawombat.com',\n devAws: 'https://alert-distributor.cloud.dev.ultrawombat.com',\n int: 'https://alert-distributor.cloud.ultrawombat.com',\n prod: 'https://alert-distributor.cloud.camunda.io',\n },\n {\n id: 'wordpress-helpcenter',\n dev: 'https://camunda-help-stg.mystagingwebsite.com',\n devAws: 'https://camunda-help-stg.mystagingwebsite.com',\n int: 'https://camunda-help-stg.mystagingwebsite.com',\n prod: 'https://camunda-helpcenter.mystagingwebsite.com',\n },\n // AUDIENCES\n {\n id: 'camunda-cloud-audience',\n dev: 'cloud.dev.ultrawombat.com',\n devAws: 'cloud.dev.ultrawombat.com',\n int: 'cloud.ultrawombat.com',\n prod: 'cloud.camunda.io',\n },\n {\n id: 'comm-bridge-audience',\n dev: 'comm.dev.ultrawombat.com',\n devAws: 'comm.dev.ultrawombat.com',\n int: 'comm.ultrawombat.com',\n prod: 'comm.camunda.io',\n },\n {\n id: 'notification-audience',\n dev: 'notifications.dev.ultrawombat.com',\n devAws: 'notifications.dev.ultrawombat.com',\n int: 'notifications.ultrawombat.com',\n prod: 'notifications.camunda.io',\n },\n {\n id: 'analytics-audience',\n dev: 'analytics.dev.ultrawombat.com',\n devAws: 'analytics.dev.ultrawombat.com',\n int: 'analytics.ultrawombat.com',\n prod: 'analytics.camunda.io',\n },\n]\n\nexport function getEnvParam(\n id: ServiceName | ServiceAudience,\n config: RequestBaseParamsConfig,\n) {\n if (config.envOverride?.[id] && config.envOverride[id].length > 0) {\n return config.envOverride[id]\n }\n\n if (\n (id === 'console' && config.stage === 'localconsole') ||\n (id === 'accounts' && config.stage === 'localaccounts')\n ) {\n // special handling if running console/accounts frontend and backend locally\n return `http://localhost:8080`\n }\n\n const envParam = ENV_PARAMS.find(\n (environmentParam) => environmentParam.id === id,\n )\n if (!envParam) {\n throw new Error(`Unknown id: ${id}`)\n }\n switch (config.stage) {\n case 'local':\n case 'localconsole':\n case 'localaccounts':\n case 'dev':\n return envParam.dev\n case 'devAws':\n return envParam.devAws\n case 'int':\n return envParam.int\n case 'prod':\n return envParam.prod\n default:\n throw new Error(`Unknown stage: ${config.stage}`)\n }\n}\n"],
5
+ "mappings": "AAqCA,MAAM,aAAiC;AAAA,EACrC;AAAA,IACE,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAKE,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;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AAAA,EACR;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AACF;AAEO,SAAS,YACd,IACA,QACA;AACA,MAAI,OAAO,cAAc,EAAE,KAAK,OAAO,YAAY,EAAE,EAAE,SAAS,GAAG;AACjE,WAAO,OAAO,YAAY,EAAE;AAAA,EAC9B;AAEA,MACG,OAAO,aAAa,OAAO,UAAU,kBACrC,OAAO,cAAc,OAAO,UAAU,iBACvC;AAEA,WAAO;AAAA,EACT;AAEA,QAAM,WAAW,WAAW;AAAA,IAC1B,CAAC,qBAAqB,iBAAiB,OAAO;AAAA,EAChD;AACA,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,MAAM,eAAe,EAAE,EAAE;AAAA,EACrC;AACA,UAAQ,OAAO,OAAO;AAAA,IACpB,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO,SAAS;AAAA,IAClB,KAAK;AACH,aAAO,SAAS;AAAA,IAClB,KAAK;AACH,aAAO,SAAS;AAAA,IAClB,KAAK;AACH,aAAO,SAAS;AAAA,IAClB;AACE,YAAM,IAAI,MAAM,kBAAkB,OAAO,KAAK,EAAE;AAAA,EACpD;AACF;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/ccma-api",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Centralized API service layer for Camunda Cloud Management Apps",
5
5
  "bugs": {
6
6
  "url": "https://github.com/camunda/camunda-cloud-management-apps/issues"
@@ -41,7 +41,7 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@camunda/ccma-shared-types": "2.0.0"
44
+ "@camunda/ccma-shared-types": "3.0.0"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "node esbuild.mjs && tsc --emitDeclarationOnly --outDir dist",