@forge/usage 0.1.0-next.0 → 0.1.0-next.2
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.
- package/CHANGELOG.md +13 -0
- package/out/index.d.ts +3 -3
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @forge/usage
|
|
2
2
|
|
|
3
|
+
## 0.1.0-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [b984c40]
|
|
8
|
+
- @forge/api@8.4.0-next.4
|
|
9
|
+
|
|
10
|
+
## 0.1.0-next.1
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 255a038: `reportUsageCount` now returns the raw API response instead of throwing when the response is not ok.
|
|
15
|
+
|
|
3
16
|
## 0.1.0-next.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/out/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FetchMethod } from '@forge/api';
|
|
1
|
+
import type { APIResponse, FetchMethod } from '@forge/api';
|
|
2
2
|
export declare const USAGE_EVENTS_PATH = "/marketplace/metering/v1/usage-events";
|
|
3
3
|
export declare const BILLABLE_ACTION = "api-call";
|
|
4
4
|
export declare const DEFAULT_ACTOR = "ari:cloud:identity::user/atlassian-internal-system";
|
|
@@ -7,6 +7,6 @@ export type ReportUsageCountParams = {
|
|
|
7
7
|
usageTimestamp: number | Date;
|
|
8
8
|
user?: string;
|
|
9
9
|
};
|
|
10
|
-
export declare const createReportUsageCount: (requestAtlassian: FetchMethod) => (params: ReportUsageCountParams) => Promise<
|
|
11
|
-
export declare const reportUsageCount: (params: ReportUsageCountParams) => Promise<
|
|
10
|
+
export declare const createReportUsageCount: (requestAtlassian: FetchMethod) => (params: ReportUsageCountParams) => Promise<APIResponse>;
|
|
11
|
+
export declare const reportUsageCount: (params: ReportUsageCountParams) => Promise<APIResponse>;
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE3D,eAAO,MAAM,iBAAiB,0CAA0C,CAAC;AACzE,eAAO,MAAM,eAAe,aAAa,CAAC;AAC1C,eAAO,MAAM,aAAa,uDAAuD,CAAC;AAKlF,MAAM,MAAM,sBAAsB,GAAG;IAEnC,UAAU,EAAE,MAAM,CAAC;IAEnB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AA4CF,eAAO,MAAM,sBAAsB,GAAI,kBAAkB,WAAW,MAC3B,QAAQ,sBAAsB,KAAG,OAAO,CAAC,WAAW,CA0B5F,CAAC;AAKF,eAAO,MAAM,gBAAgB,WA/BoB,sBAAsB,KAAG,OAAO,CAAC,WAAW,CA+Bd,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -49,14 +49,11 @@ const createReportUsageCount = (requestAtlassian) => {
|
|
|
49
49
|
applicableExemptionId: null,
|
|
50
50
|
dimensions
|
|
51
51
|
};
|
|
52
|
-
|
|
52
|
+
return await requestAtlassian(exports.USAGE_EVENTS_PATH, {
|
|
53
53
|
method: 'POST',
|
|
54
54
|
headers: { 'content-type': 'application/json' },
|
|
55
55
|
body: JSON.stringify(payload)
|
|
56
56
|
});
|
|
57
|
-
if (!response.ok) {
|
|
58
|
-
throw new Error(`Failed to report usage: ${response.status} ${response.statusText}.`);
|
|
59
|
-
}
|
|
60
57
|
};
|
|
61
58
|
};
|
|
62
59
|
exports.createReportUsageCount = createReportUsageCount;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/usage",
|
|
3
|
-
"version": "0.1.0-next.
|
|
3
|
+
"version": "0.1.0-next.2",
|
|
4
4
|
"description": "Forge Usage SDK",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"types": "out/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"compile": "tsc -b -v"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@forge/api": "^8.
|
|
13
|
+
"@forge/api": "^8.4.0-next.4"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/node": "20.19.1",
|