npm package diff
Package: @forge/storage
Versions: 1.7.3 - 1.8.0-next.0
Modified: package/out/global-storage.js
Index: package/out/global-storage.js
===================================================================
--- package/out/global-storage.js
+++ package/out/global-storage.js
@@ -38,15 +38,11 @@
async getSecret(key) {
return this.getInternal(key, true);
}
async list(options) {
- const requestBody = process.env.IS_CLEANUP_FUNCTION === 'true'
- ? gql_queries_1.UntypedQueries.listQueryForCleanup(options)
- : gql_queries_1.UntypedQueries.listQuery(options);
+ const requestBody = gql_queries_1.UntypedQueries.listQuery(options);
const response = await this.wrapInMetric('untyped', 'query', false, async () => await this.query(requestBody));
- const edges = process.env.IS_CLEANUP_FUNCTION === 'true'
- ? response.appStoredEntitiesForCleanup.edges
- : response.appStoredEntities.edges;
+ const edges = response.appStoredEntities.edges;
const nextCursor = edges.length > 0 ? edges[edges.length - 1].cursor : undefined;
const results = edges.map(({ node }) => node);
return {
results,
Modified: package/out/__test__/global-storage.test.js
Index: package/out/__test__/global-storage.test.js
===================================================================
--- package/out/__test__/global-storage.test.js
+++ package/out/__test__/global-storage.test.js
@@ -691,49 +691,8 @@
passMetrics
? checkMetricsFired(metricMocks, { store: 'untyped', operation: 'query', encrypted: false }, true)
: expect(metricMocks.mockMetrics.counter).not.toHaveBeenCalled();
});
- it('should query the appStoredEntitiesForCleanup endpoint given process.env.IS_CLEANUP_FUNCTION is set to true', async () => {
- process.env.IS_CLEANUP_FUNCTION = 'true';
- const apiClientMock = getApiClientMock({
- data: {
- appStoredEntitiesForCleanup: {
- edges: [
- { node: { key: 'key1', value: 'testValue' }, cursor: 'cursor1' },
- { node: { key: 'key2', value: 'testValue' }, cursor: 'cursor2' }
- ]
- }
- }
- });
- const metricMocks = getMetricMock();
- const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
- const where = [
- {
- field: 'key',
- condition: 'STARTS_WITH',
- value: 'test'
- }
- ];
- const cursor = 'cursor';
- const limit = 10;
- const response = await globalStorage.list({ where, cursor, limit });
- verifyApiClientCalledWith(apiClientMock, {
- where,
- cursor,
- limit
- }, gql_queries_1.UntypedQueries.listQueryForCleanup({}).query);
- expect(response).toEqual(expect.objectContaining({
- results: [
- { key: 'key1', value: 'testValue' },
- { key: 'key2', value: 'testValue' }
- ],
- nextCursor: 'cursor2'
- }));
- passMetrics
- ? checkMetricsFired(metricMocks, { store: 'untyped', operation: 'query', encrypted: false }, true)
- : expect(metricMocks.mockMetrics.counter).not.toHaveBeenCalled();
- process.env.IS_CLEANUP_FUNCTION = '';
- });
it('should use default values', async () => {
const apiClientMock = getApiClientMock({
data: {
appStoredEntities: {
Modified: package/out/gql-queries.js
Index: package/out/gql-queries.js
===================================================================
--- package/out/gql-queries.js
+++ package/out/gql-queries.js
@@ -87,29 +87,8 @@
cursor: options.cursor ?? null,
limit: options.limit ?? null
}
});
- static listQueryForCleanup = (options) => ({
- query: `
- query forge_app_getApplicationStorageEntitiesForCleanup($where: [AppStoredEntityFilter!], $cursor: String, $limit: Int) {
- appStoredEntitiesForCleanup(where: $where, after: $cursor, first: $limit) {
- edges {
- node {
- value
- key
- }
-
- cursor
- }
- }
- }
- `,
- variables: {
- where: options.where ?? null,
- cursor: options.cursor ?? null,
- limit: options.limit ?? null
- }
- });
}
exports.UntypedQueries = UntypedQueries;
class CustomEntityQueries {
static get = (entityName, key) => ({
Modified: package/package.json
Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
{
"name": "@forge/storage",
- "version": "1.7.3",
+ "version": "1.8.0-next.0",
"description": "Forge Storage methods",
"author": "Atlassian",
"license": "SEE LICENSE IN LICENSE.txt",
"main": "out/index.js",
Modified: package/out/global-storage.d.ts.map
Index: package/out/global-storage.d.ts.map
===================================================================
--- package/out/global-storage.d.ts.map
+++ package/out/global-storage.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"global-storage.d.ts","sourceRoot":"","sources":["../src/global-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,WAAW,EAAE,MAAM,SA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AU,EAAE,MAAM,OAAO,GAAG,SAAS;IAGlD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAI9B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAIpC,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAehD,kBAAkB,CAAC,OAAO,EAAE,uBAAuB,GAAG,OAAO,CAAC,WAAW,CAAC;IAc1E,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAU3C,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC;IAUjD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOlC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOxC,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAI/D,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5E,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAU1D,WAAW;YAUX,iBAAiB;IAU/B,OAAO,CAAC,YAAY;YAUN,KAAK;YAML,QAAQ;YAsBR,YAAY;CAyC3B"}
\ No newline at end of file
Modified: package/out/gql-queries.d.ts.map
Index: package/out/gql-queries.d.ts.map
===================================================================
--- package/out/gql-queries.d.ts.map
+++ package/out/gql-queries.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"gql-queries.d.ts","sourceRoot":"","sources":["../src/gql-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AAc,MAAM,eAAgB,MAAM,OAAO,MAAM;;;;;;;;MAwBpD;IAEH,OAAc,SAAS,YAAa,uBAAuB;;;;;;;;;;;;;;MAsCzD;CACH"}
\ No newline at end of file
Modified: package/out/gql-queries.d.ts
Index: package/out/gql-queries.d.ts
===================================================================
--- package/out/gql-queries.d.ts
+++ package/out/gql-queries.d.ts
@@ -33,16 +33,8 @@
cursor: string | null;
limit: number | null;
};
};
- static listQueryForCleanup: (options: ListOptions) => {
- query: string;
- variables: {
- where: import("./query-interfaces").WhereClause[] | null;
- cursor: string | null;
- limit: number | null;
- };
- };
}
export declare class CustomEntityQueries {
static get: (entityName: string, key: string) => {
query: string;