@origincloud/billing 0.0.0-stage → 0.12.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,93 @@
1
+ import { type CallOptions, type Client, type Service } from "@origincloud/core";
2
+ /**
3
+ * Calls PriceListService.
4
+ *
5
+ * The public price list: the list price of every billable product, for
6
+ * anyone to read, websites included. It needs no access token.
7
+ *
8
+ * Unlike the rest of this API, its path has been `/v1/pricing` since before
9
+ * the API was published, and its fields are written in snake case, as
10
+ * websites read them.
11
+ */
12
+ export declare class PriceListClient {
13
+ /**
14
+ * The endpoint the client sends its calls to, which also serves the
15
+ * operations its methods answer with.
16
+ */
17
+ readonly service: Service;
18
+ /** A client of PriceListService that sends its calls through `client`. */
19
+ constructor(client: Client);
20
+ /**
21
+ * Returns the prices in effect now. The answer carries an `ETag`; a
22
+ * request that sends it back in `If-None-Match` is answered
23
+ * `304 Not Modified`, without a body, while the list is unchanged.
24
+ */
25
+ getPriceList(request: GetPriceListRequest, options?: CallOptions): Promise<PriceList>;
26
+ }
27
+ /**
28
+ * The price list. Every amount is in EUR, before VAT, which depends on the
29
+ * customer's country and is added on the invoice.
30
+ */
31
+ export interface PriceList {
32
+ /** Always `EUR`. */
33
+ currency?: string;
34
+ /** Always true: every amount is net, before VAT. */
35
+ amounts_exclude_vat?: boolean;
36
+ /**
37
+ * When a list price was last set, changed, took effect or ended: what a
38
+ * "prices last updated" line shows. Unset only while nothing is priced.
39
+ */
40
+ last_changed?: string;
41
+ /**
42
+ * One entry per product family with a price in effect, in the platform's
43
+ * catalog order: `compute_instance`, `network_floating_ip`,
44
+ * `network_nat_gateway`, `network_vpc_egress`, `network_vpc_ingress`,
45
+ * `network_vpc_internal`, `storage_volume`, `storage_snapshot`,
46
+ * `observability_custom_metric`, `observability_api_request`,
47
+ * `observability_ingested_sample`.
48
+ */
49
+ families?: PriceFamily[];
50
+ }
51
+ /** One product family's prices. */
52
+ export interface PriceFamily {
53
+ /** The family, such as `compute_instance`. */
54
+ family?: string;
55
+ /**
56
+ * The family's prices in effect, by product key, numbers compared as
57
+ * numbers: a class's instance types run from smallest to largest.
58
+ */
59
+ prices?: Price[];
60
+ }
61
+ /** The list price of one product. */
62
+ export interface Price {
63
+ /**
64
+ * The product the price bills, as usage and cost reports name it, such
65
+ * as `compute.gp1.core.2`, `storage.gp1` or `network.vpc_egress`.
66
+ */
67
+ product_key?: string;
68
+ /**
69
+ * The parts of the product key, split out: `instanceType` for an instance,
70
+ * `storageClass` for a volume. Empty for a product that has none.
71
+ */
72
+ dimensions?: Record<string, string>;
73
+ /**
74
+ * What is counted: `seconds`, `gib_hours`, `gb` (decimal, 10^9 bytes),
75
+ * `metric_months`, `requests` or `samples`.
76
+ */
77
+ unit_type?: string;
78
+ /**
79
+ * How many of the unit the amount pays for: `3600` seconds is an
80
+ * hourly rate, `1000` requests a rate per thousand.
81
+ */
82
+ unit_count?: number;
83
+ /** The price of that many units, as a decimal string. */
84
+ amount?: string;
85
+ /** When the price took effect. */
86
+ valid_from?: string;
87
+ /** When the price is to end; unset while no end is scheduled. */
88
+ valid_until?: string;
89
+ }
90
+ /** The request for GetPriceList, which takes nothing. */
91
+ export interface GetPriceListRequest {
92
+ }
93
+ //# sourceMappingURL=price_list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"price_list.d.ts","sourceRoot":"","sources":["../../src/v1beta1/price_list.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAS,MAAM,mBAAmB,CAAC;AAEvF;;;;;;;;;GASG;AACH,qBAAa,eAAe;IAC1B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,0EAA0E;gBAC9D,MAAM,EAAE,MAAM;IAI1B;;;;OAIG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC;CAW5F;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oDAAoD;IACpD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED,mCAAmC;AACnC,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC;CAClB;AAED,qCAAqC;AACrC,MAAM,WAAW,KAAK;IACpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;CAAG"}
@@ -0,0 +1,38 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ // source: origincloud/billing/v1beta1/price_list.proto
3
+ import { query } from "@origincloud/core";
4
+ /**
5
+ * Calls PriceListService.
6
+ *
7
+ * The public price list: the list price of every billable product, for
8
+ * anyone to read, websites included. It needs no access token.
9
+ *
10
+ * Unlike the rest of this API, its path has been `/v1/pricing` since before
11
+ * the API was published, and its fields are written in snake case, as
12
+ * websites read them.
13
+ */
14
+ export class PriceListClient {
15
+ /**
16
+ * The endpoint the client sends its calls to, which also serves the
17
+ * operations its methods answer with.
18
+ */
19
+ service;
20
+ /** A client of PriceListService that sends its calls through `client`. */
21
+ constructor(client) {
22
+ this.service = client.service("billing", false);
23
+ }
24
+ /**
25
+ * Returns the prices in effect now. The answer carries an `ETag`; a
26
+ * request that sends it back in `If-None-Match` is answered
27
+ * `304 Not Modified`, without a body, while the list is unchanged.
28
+ */
29
+ async getPriceList(request, options) {
30
+ return this.service.call({
31
+ method: "GET",
32
+ path: `/v1/pricing`,
33
+ query: query(request, []),
34
+ idempotent: true,
35
+ }, options);
36
+ }
37
+ }
38
+ //# sourceMappingURL=price_list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"price_list.js","sourceRoot":"","sources":["../../src/v1beta1/price_list.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,uDAAuD;AAEvD,OAAO,EAA+C,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEvF;;;;;;;;;GASG;AACH,MAAM,OAAO,eAAe;IAC1B;;;OAGG;IACM,OAAO,CAAU;IAE1B,0EAA0E;IAC1E,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,YAAY,CAAC,OAA4B,EAAE,OAAqB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,aAAa;YACnB,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YACzB,UAAU,EAAE,IAAI;SACjB,EACD,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,78 @@
1
+ import { type CallOptions, type Client, type Service } from "@origincloud/core";
2
+ /**
3
+ * Calls SpendLimitService.
4
+ *
5
+ * Spend limits: an amount per calendar month for a billing account, and the
6
+ * shares of it at which an alert is emailed. A spend limit only alerts: it
7
+ * never stops or refuses anything.
8
+ *
9
+ * Access to spend limits is granted apart from access to billing accounts:
10
+ * an organization's owner holds it by default.
11
+ */
12
+ export declare class SpendLimitClient {
13
+ /**
14
+ * The endpoint the client sends its calls to, which also serves the
15
+ * operations its methods answer with.
16
+ */
17
+ readonly service: Service;
18
+ /** A client of SpendLimitService that sends its calls through `client`. */
19
+ constructor(client: Client);
20
+ /**
21
+ * Returns a billing account's spend limit; one that has none has no
22
+ * `limit`. Needs `admin.spend_limit.get` on the organization.
23
+ */
24
+ getSpendLimit(request: GetSpendLimitRequest, options?: CallOptions): Promise<SpendLimit>;
25
+ /**
26
+ * Sets or removes a billing account's spend limit. The fields named in
27
+ * `updateMask` are replaced and the others kept. A spend limit left
28
+ * without a `limit` is removed, with its thresholds and recipients. Needs
29
+ * `admin.spend_limit.update` on the organization.
30
+ */
31
+ updateSpendLimit(request: UpdateSpendLimitRequest, options?: CallOptions): Promise<SpendLimit>;
32
+ }
33
+ /**
34
+ * A billing account's spend limit: the most it means to spend in a calendar
35
+ * month, and when to be told. Each threshold alerts once a month, the first
36
+ * time the month's spend crosses it.
37
+ */
38
+ export interface SpendLimit {
39
+ /**
40
+ * The spend limit's resource name,
41
+ * `organizations/{organization}/billingAccounts/{billing_account}/spendLimit`.
42
+ */
43
+ name?: string;
44
+ /**
45
+ * The amount per calendar month in EUR, before VAT, as a decimal string
46
+ * such as `500.00`; more than zero. Unset means no spend limit.
47
+ */
48
+ limit?: string;
49
+ /**
50
+ * The percentages of `limit` whose crossing emails an alert, such as `80`
51
+ * and `100`; each from 1 to 32767, so a threshold can lie beyond the
52
+ * limit. Empty while there is no `limit`.
53
+ */
54
+ alertThresholdsPercent?: number[];
55
+ /**
56
+ * Where alerts are sent. Empty while there is no `limit`, and an alert
57
+ * with no recipient is sent to nobody.
58
+ */
59
+ notificationEmails?: string[];
60
+ /** When the spend limit was last set; unset while there is none. */
61
+ updateTime?: string;
62
+ }
63
+ /** The request for GetSpendLimit. */
64
+ export interface GetSpendLimitRequest {
65
+ /** The spend limit to return. */
66
+ name?: string;
67
+ }
68
+ /** The request for UpdateSpendLimit. */
69
+ export interface UpdateSpendLimitRequest {
70
+ /** The spend limit, by its name, with the fields to change. */
71
+ spendLimit?: SpendLimit;
72
+ /**
73
+ * The fields to change: `limit`, `alertThresholdsPercent` and
74
+ * `notificationEmails`. `*` is every one of them.
75
+ */
76
+ updateMask?: string;
77
+ }
78
+ //# sourceMappingURL=spend_limit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend_limit.d.ts","sourceRoot":"","sources":["../../src/v1beta1/spend_limit.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAoB,MAAM,mBAAmB,CAAC;AAElG;;;;;;;;;GASG;AACH,qBAAa,gBAAgB;IAC3B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,2EAA2E;gBAC/D,MAAM,EAAE,MAAM;IAI1B;;;OAGG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAa9F;;;;;OAKG;IACG,gBAAgB,CAAC,OAAO,EAAE,uBAAuB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;CAYrG;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qCAAqC;AACrC,MAAM,WAAW,oBAAoB;IACnC,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wCAAwC;AACxC,MAAM,WAAW,uBAAuB;IACtC,+DAA+D;IAC/D,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,53 @@
1
+ // Code generated by the SDK's generator (generator/). DO NOT EDIT.
2
+ // source: origincloud/billing/v1beta1/spend_limit.proto
3
+ import { pathValue, query } from "@origincloud/core";
4
+ /**
5
+ * Calls SpendLimitService.
6
+ *
7
+ * Spend limits: an amount per calendar month for a billing account, and the
8
+ * shares of it at which an alert is emailed. A spend limit only alerts: it
9
+ * never stops or refuses anything.
10
+ *
11
+ * Access to spend limits is granted apart from access to billing accounts:
12
+ * an organization's owner holds it by default.
13
+ */
14
+ export class SpendLimitClient {
15
+ /**
16
+ * The endpoint the client sends its calls to, which also serves the
17
+ * operations its methods answer with.
18
+ */
19
+ service;
20
+ /** A client of SpendLimitService that sends its calls through `client`. */
21
+ constructor(client) {
22
+ this.service = client.service("billing", false);
23
+ }
24
+ /**
25
+ * Returns a billing account's spend limit; one that has none has no
26
+ * `limit`. Needs `admin.spend_limit.get` on the organization.
27
+ */
28
+ async getSpendLimit(request, options) {
29
+ const p0 = pathValue("name", request.name, "organizations/*/billingAccounts/*/spendLimit");
30
+ return this.service.call({
31
+ method: "GET",
32
+ path: `/v1beta1/${p0}`,
33
+ query: query(request, ["name"]),
34
+ idempotent: true,
35
+ }, options);
36
+ }
37
+ /**
38
+ * Sets or removes a billing account's spend limit. The fields named in
39
+ * `updateMask` are replaced and the others kept. A spend limit left
40
+ * without a `limit` is removed, with its thresholds and recipients. Needs
41
+ * `admin.spend_limit.update` on the organization.
42
+ */
43
+ async updateSpendLimit(request, options) {
44
+ const p0 = pathValue("spendLimit.name", request.spendLimit?.name, "organizations/*/billingAccounts/*/spendLimit");
45
+ return this.service.call({
46
+ method: "PATCH",
47
+ path: `/v1beta1/${p0}`,
48
+ body: request.spendLimit,
49
+ query: query(request, ["spendLimit.name", "spendLimit"]),
50
+ }, options);
51
+ }
52
+ }
53
+ //# sourceMappingURL=spend_limit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spend_limit.js","sourceRoot":"","sources":["../../src/v1beta1/spend_limit.ts"],"names":[],"mappings":"AAAA,mEAAmE;AACnE,wDAAwD;AAExD,OAAO,EAA+C,SAAS,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAElG;;;;;;;;;GASG;AACH,MAAM,OAAO,gBAAgB;IAC3B;;;OAGG;IACM,OAAO,CAAU;IAE1B,2EAA2E;IAC3E,YAAY,MAAc;QACxB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,aAAa,CAAC,OAA6B,EAAE,OAAqB;QACtE,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,8CAA8C,CAAC,CAAC;QAC3F,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,YAAY,EAAE,EAAE;YACtB,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;YAC/B,UAAU,EAAE,IAAI;SACjB,EACD,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,gBAAgB,CAAC,OAAgC,EAAE,OAAqB;QAC5E,MAAM,EAAE,GAAG,SAAS,CAAC,iBAAiB,EAAE,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,8CAA8C,CAAC,CAAC;QAClH,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CACtB;YACE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,YAAY,EAAE,EAAE;YACtB,IAAI,EAAE,OAAO,CAAC,UAAU;YACxB,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;SACzD,EACD,OAAO,CACR,CAAC;IACJ,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,42 @@
1
1
  {
2
2
  "name": "@origincloud/billing",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.12.0",
4
+ "description": "Origin Cloud's billing service: billing accounts and the projects they pay for, payment methods, cost and usage, spend limits and the price list.",
5
+ "license": "Apache-2.0",
6
+ "homepage": "https://github.com/origincloudhq/sdk-typescript#readme",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/origincloudhq/sdk-typescript.git",
10
+ "directory": "packages/billing"
11
+ },
12
+ "bugs": "https://github.com/origincloudhq/sdk-typescript/issues",
13
+ "keywords": [
14
+ "origincloud",
15
+ "origin-cloud",
16
+ "sdk",
17
+ "billing"
18
+ ],
19
+ "type": "module",
20
+ "sideEffects": false,
21
+ "engines": {
22
+ "node": ">=20"
23
+ },
24
+ "exports": {
25
+ "./*": {
26
+ "types": "./dist/*/index.d.ts",
27
+ "default": "./dist/*/index.js"
28
+ },
29
+ "./package.json": "./package.json"
30
+ },
31
+ "files": [
32
+ "dist",
33
+ "src",
34
+ "!dist/**/*.tsbuildinfo"
35
+ ],
36
+ "peerDependencies": {
37
+ "@origincloud/core": "^0.12.0"
38
+ },
39
+ "devDependencies": {
40
+ "@origincloud/core": "^0.12.0"
41
+ }
42
+ }