@forge/storage 2.0.2 → 2.0.3-experimental-04cc2b9

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.
Files changed (51) hide show
  1. package/LICENSE.txt +1 -1
  2. package/package.json +11 -2
  3. package/README.md +0 -50
  4. package/out/__test__/errors.test.d.ts +0 -2
  5. package/out/__test__/errors.test.d.ts.map +0 -1
  6. package/out/__test__/errors.test.js +0 -34
  7. package/out/__test__/global-storage.test.d.ts +0 -2
  8. package/out/__test__/global-storage.test.d.ts.map +0 -1
  9. package/out/__test__/global-storage.test.js +0 -833
  10. package/out/__test__/list-api.test.d.ts +0 -2
  11. package/out/__test__/list-api.test.d.ts.map +0 -1
  12. package/out/__test__/list-api.test.js +0 -650
  13. package/out/conditions.d.ts +0 -3
  14. package/out/conditions.d.ts.map +0 -1
  15. package/out/conditions.js +0 -10
  16. package/out/eap/conditions.d.ts +0 -40
  17. package/out/eap/conditions.d.ts.map +0 -1
  18. package/out/eap/conditions.js +0 -112
  19. package/out/eap/index.d.ts +0 -2
  20. package/out/eap/index.d.ts.map +0 -1
  21. package/out/eap/index.js +0 -4
  22. package/out/entity-storage/index.d.ts +0 -2
  23. package/out/entity-storage/index.d.ts.map +0 -1
  24. package/out/entity-storage/index.js +0 -5
  25. package/out/entity-storage/query-api.d.ts +0 -48
  26. package/out/entity-storage/query-api.d.ts.map +0 -1
  27. package/out/entity-storage/query-api.js +0 -154
  28. package/out/entity-storage/storage-builder.d.ts +0 -20
  29. package/out/entity-storage/storage-builder.d.ts.map +0 -1
  30. package/out/entity-storage/storage-builder.js +0 -25
  31. package/out/errors.d.ts +0 -9
  32. package/out/errors.d.ts.map +0 -1
  33. package/out/errors.js +0 -41
  34. package/out/global-storage.d.ts +0 -50
  35. package/out/global-storage.d.ts.map +0 -1
  36. package/out/global-storage.js +0 -156
  37. package/out/gql-queries.d.ts +0 -81
  38. package/out/gql-queries.d.ts.map +0 -1
  39. package/out/gql-queries.js +0 -200
  40. package/out/index.d.ts +0 -49
  41. package/out/index.d.ts.map +0 -1
  42. package/out/index.js +0 -33
  43. package/out/query-api.d.ts +0 -14
  44. package/out/query-api.d.ts.map +0 -1
  45. package/out/query-api.js +0 -44
  46. package/out/query-interfaces.d.ts +0 -113
  47. package/out/query-interfaces.d.ts.map +0 -1
  48. package/out/query-interfaces.js +0 -8
  49. package/out/storage-adapter.d.ts +0 -42
  50. package/out/storage-adapter.d.ts.map +0 -1
  51. package/out/storage-adapter.js +0 -2
package/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2025 Atlassian
1
+ Copyright (c) 2026 Atlassian
2
2
  Permission is hereby granted to use this software in accordance with the terms
3
3
  and conditions outlined in the Atlassian Developer Terms, which can be found
4
4
  at the following URL:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/storage",
3
- "version": "2.0.2",
3
+ "version": "2.0.3-experimental-04cc2b9",
4
4
  "description": "Forge Storage methods",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -16,9 +16,18 @@
16
16
  },
17
17
  "devDependencies": {
18
18
  "@atlassian/metrics-interface": "4.0.0",
19
- "@types/node": "20.19.1"
19
+ "@types/node": "20.19.1",
20
+ "typescript": "5.9.2"
20
21
  },
21
22
  "publishConfig": {
22
23
  "registry": "https://packages.atlassian.com/api/npm/npm-public/"
24
+ },
25
+ "peerDependencies": {
26
+ "typescript": ">=5.0.0"
27
+ },
28
+ "peerDependenciesMeta": {
29
+ "typescript": {
30
+ "optional": true
31
+ }
23
32
  }
24
33
  }
package/README.md DELETED
@@ -1,50 +0,0 @@
1
- Common library for both Forge environment and Harmonised Connect app environment.
2
-
3
- Usage example:
4
-
5
- ```javascript
6
- import fetch, { RequestInit } from 'node-fetch';
7
-
8
- import { GlobalStorage } from './global-storage';
9
- import { APIResponse, getStorageInstanceWithQuery } from './index';
10
- import { getMetrics } from './runtime/fetch-and-storage';
11
-
12
- const API_BASE = 'https://api.atlassian.com';
13
-
14
- // For user agent header
15
- const version = '0.0.1';
16
- const appAri = 'ari:cloud:ecosystem::app/...';
17
-
18
- // For Storage service auth
19
- const appContextAri = 'ari:cloud:jira::site/...';
20
- const token = '...';
21
-
22
- async function apiClient(path: string, init: RequestInit): Promise<APIResponse> {
23
- const url = API_BASE + path;
24
-
25
- const extraHeaders = {
26
- // See add-forge-user-agent.ts
27
- 'User-Agent': `H11n/${version} ${appAri}`,
28
-
29
- Authorization: `Bearer ${token}`
30
-
31
- // Only required when accessing Storage service via the GraphQL gateway
32
- // https://api.atlassian.com/graphql
33
- // 'X-ExperimentalApi': 'AppEntityStorage'
34
- };
35
-
36
- init.headers = Object.assign(init.headers!, extraHeaders);
37
- return fetch(url, init);
38
- }
39
-
40
- const adapter = new GlobalStorage(() => appContextAri, apiClient, getMetrics);
41
- const storage = getStorageInstanceWithQuery(adapter);
42
-
43
- async function demo() {
44
- await storage.set('key', 'value');
45
- console.log(await storage.get('key'));
46
- await storage.delete('key');
47
- }
48
-
49
- demo();
50
- ```
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=errors.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.test.d.ts","sourceRoot":"","sources":["../../src/__test__/errors.test.ts"],"names":[],"mappings":""}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const errors_1 = require("../errors");
4
- describe('APIError', () => {
5
- describe('forStatus', () => {
6
- it.each([
7
- [400, 'Bad request'],
8
- [413, 'Bad request'],
9
- [401, 'Authentication error'],
10
- [403, 'Permissions error or key does not exist'],
11
- [404, 'Permissions error or key does not exist'],
12
- [409, 'Conflicting update occurred'],
13
- [500, 'Internal server error']
14
- ])('should contain the correct error message for a code of %s', (status, message) => {
15
- expect(errors_1.APIError.forStatus(status).message).toEqual(message);
16
- });
17
- it('should return a generic error message for unexpected status codes', () => {
18
- expect(errors_1.APIError.forStatus(100).message).toEqual("Unknown error. Received status code '100'");
19
- });
20
- });
21
- describe('forErrorCode', () => {
22
- it('should return contain the provided message if the error code is in the allow list', () => {
23
- expect(errors_1.APIError.forErrorCode('INVALID_CURSOR', 'this is an error message').message).toEqual('this is an error message');
24
- });
25
- it('should return the error code if no message was provided', () => {
26
- expect(errors_1.APIError.forErrorCode('INVALID_CURSOR', null).message).toEqual('INVALID_CURSOR');
27
- });
28
- });
29
- describe('forUnexpected', () => {
30
- it('should return an APIError with a message provided', () => {
31
- expect(errors_1.APIError.forUnexpected('test').message).toEqual('test');
32
- });
33
- });
34
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=global-storage.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"global-storage.test.d.ts","sourceRoot":"","sources":["../../src/__test__/global-storage.test.ts"],"names":[],"mappings":""}