npm package diff
Package: @forge/storage
Versions: 1.6.0 - 1.7.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
@@ -24,30 +24,25 @@
assertNoErrors(responseBody.errors);
return responseBody.data;
}
class GlobalStorage {
- getAppContextAri;
apiClient;
getMetrics;
endpoint = '/forge/entities/graphql';
- constructor(getAppContextAri, apiClient, getMetrics) {
- this.getAppContextAri = getAppContextAri;
+ constructor(apiClient, getMetrics) {
this.apiClient = apiClient;
this.getMetrics = getMetrics;
}
- doGetAppContextAri() {
- return typeof this.getAppContextAri === 'function' ? this.getAppContextAri() : this.getAppContextAri;
- }
async get(key) {
return this.getInternal(key, false);
}
async getSecret(key) {
return this.getInternal(key, true);
}
async list(options) {
const requestBody = process.env.IS_CLEANUP_FUNCTION === 'true'
- ? gql_queries_1.UntypedQueries.listQueryForCleanup(this.doGetAppContextAri(), options)
- : gql_queries_1.UntypedQueries.listQuery(this.doGetAppContextAri(), options);
+ ? gql_queries_1.UntypedQueries.listQueryForCleanup(options)
+ : 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;
@@ -58,9 +53,9 @@
nextCursor
};
}
async listCustomEntities(options) {
- const requestBody = gql_queries_1.CustomEntityQueries.listQuery(this.doGetAppContextAri(), options);
+ const requestBody = gql_queries_1.CustomEntityQueries.listQuery(options);
const response = await this.wrapInMetric('typed', 'query', false, async () => await this.query(requestBody));
const edges = response.appStoredCustomEntities.edges;
const results = edges.map(({ node }) => node);
return {
@@ -68,41 +63,41 @@
nextCursor: response.appStoredCustomEntities.cursor || null
};
}
async set(key, value) {
- const requestBody = gql_queries_1.UntypedQueries.set(this.doGetAppContextAri(), key, value, false);
+ const requestBody = gql_queries_1.UntypedQueries.set(key, value, false);
await this.wrapInMetric('untyped', 'set', false, async () => await this.mutation(requestBody, 'appStorage', 'setAppStoredEntity'));
}
async setSecret(key, value) {
- const requestBody = gql_queries_1.UntypedQueries.set(this.doGetAppContextAri(), key, value, true);
+ const requestBody = gql_queries_1.UntypedQueries.set(key, value, true);
await this.wrapInMetric('untyped', 'set', true, async () => await this.mutation(requestBody, 'appStorage', 'setAppStoredEntity'));
}
async delete(key) {
- const requestBody = gql_queries_1.UntypedQueries.delete(this.doGetAppContextAri(), key, false);
+ const requestBody = gql_queries_1.UntypedQueries.delete(key, false);
await this.wrapInMetric('untyped', 'delete', false, async () => this.mutation(requestBody, 'appStorage', 'deleteAppStoredEntity'));
}
async deleteSecret(key) {
- const requestBody = gql_queries_1.UntypedQueries.delete(this.doGetAppContextAri(), key, true);
+ const requestBody = gql_queries_1.UntypedQueries.delete(key, true);
await this.wrapInMetric('untyped', 'delete', true, async () => this.mutation(requestBody, 'appStorage', 'deleteAppStoredEntity'));
}
async getEntity(entityName, entityKey) {
return this.getEntityInternal(entityName, entityKey);
}
async setEntity(entityName, entityKey, value) {
- const requestBody = gql_queries_1.CustomEntityQueries.set(this.doGetAppContextAri(), entityName, entityKey, value);
+ const requestBody = gql_queries_1.CustomEntityQueries.set(entityName, entityKey, value);
await this.wrapInMetric('typed', 'set', false, async () => this.mutation(requestBody, 'appStorageCustomEntity', 'setAppStoredCustomEntity'));
}
async deleteEntity(entityName, entityKey) {
- const requestBody = gql_queries_1.CustomEntityQueries.delete(this.doGetAppContextAri(), entityName, entityKey);
+ const requestBody = gql_queries_1.CustomEntityQueries.delete(entityName, entityKey);
await this.wrapInMetric('typed', 'delete', false, async () => await this.mutation(requestBody, 'appStorageCustomEntity', 'deleteAppStoredCustomEntity'));
}
async getInternal(key, encrypted) {
- const requestBody = gql_queries_1.UntypedQueries.get(this.doGetAppContextAri(), key, encrypted);
+ const requestBody = gql_queries_1.UntypedQueries.get(key, encrypted);
const { appStoredEntity: { value } } = await this.wrapInMetric('untyped', 'get', encrypted, async () => await this.query(requestBody));
return value ?? undefined;
}
async getEntityInternal(entityName, entityKey) {
- const requestBody = gql_queries_1.CustomEntityQueries.get(this.doGetAppContextAri(), entityName, entityKey);
+ const requestBody = gql_queries_1.CustomEntityQueries.get(entityName, entityKey);
const { appStoredCustomEntity: { value } } = await this.wrapInMetric('typed', 'get', false, async () => await this.query(requestBody));
return value ?? undefined;
}
buildRequest(requestBody) {
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
@@ -3,10 +3,9 @@
const errors_1 = require("../errors");
const global_storage_1 = require("../global-storage");
const gql_queries_1 = require("../gql-queries");
const mocks_1 = require("@atlassian/metrics-interface/dist/mocks");
-const contextAri = 'app-ari';
-const getStorage = (apiClientMock, metrics) => new global_storage_1.GlobalStorage(() => contextAri, apiClientMock, () => metrics);
+const getStorage = (apiClientMock, metrics) => new global_storage_1.GlobalStorage(apiClientMock, () => metrics);
const getApiClientMock = (response, statusCode = 200) => {
return jest.fn().mockReturnValue({
ok: statusCode === 200,
status: statusCode,
@@ -71,13 +70,8 @@
const [, { body }] = apiClientMock.mock.calls[0];
const expectedBody = query ? { query, variables } : { variables };
expect(JSON.parse(body)).toEqual(expect.objectContaining(expectedBody));
}
- beforeEach(() => {
- global.api = {
- __getAppAri: jest.fn().mockReturnValue(contextAri)
- };
- });
describe('get', () => {
it('should call the storage API, passing the provided key and returning the stored value', async () => {
const apiClientMock = getApiClientMock({
data: {
@@ -89,9 +83,8 @@
const metricMocks = getMetricMock();
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
const returnedValue = await globalStorage.get('testKey');
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
key: 'testKey',
encrypted: false
});
expect(returnedValue).toEqual('testValue');
@@ -110,9 +103,8 @@
const metricMocks = getMetricMock();
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
const returnedValue = await globalStorage.get('testKey');
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
key: 'testKey',
encrypted: false
});
expect(returnedValue).toEqual(undefined);
@@ -131,9 +123,8 @@
const metricMocks = getMetricMock();
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
const returnedValue = await globalStorage.get('testKey');
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
key: 'testKey',
encrypted: false
});
expect(returnedValue).toEqual(0);
@@ -152,9 +143,8 @@
const metricMocks = getMetricMock();
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
const returnedValue = await globalStorage.get('testKey');
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
key: 'testKey',
encrypted: false
});
expect(returnedValue).toEqual('');
@@ -210,9 +200,8 @@
const metricMocks = getMetricMock();
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
const returnedValue = await globalStorage.getSecret('testKey');
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
key: 'testKey',
encrypted: true
});
expect(returnedValue).toEqual('testValue');
@@ -236,9 +225,8 @@
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
await globalStorage.set('testKey', 'testValue');
verifyApiClientCalledWith(apiClientMock, {
input: {
- contextAri,
key: 'testKey',
value: 'testValue',
encrypted: false
}
@@ -292,9 +280,8 @@
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
await expect(globalStorage.set('testKey', 'testValue')).rejects.toThrow(errors_1.APIError.forStatus(500));
verifyApiClientCalledWith(apiClientMock, {
input: {
- contextAri,
key: 'testKey',
value: 'testValue',
encrypted: false
}
@@ -319,9 +306,8 @@
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
await globalStorage.setSecret('testKey', 'testValue');
verifyApiClientCalledWith(apiClientMock, {
input: {
- contextAri,
key: 'testKey',
value: 'testValue',
encrypted: true
}
@@ -346,9 +332,8 @@
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
await globalStorage.delete('testKey');
verifyApiClientCalledWith(apiClientMock, {
input: {
- contextAri,
key: 'testKey',
encrypted: false
}
});
@@ -403,9 +388,8 @@
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
await globalStorage.deleteSecret('testKey');
verifyApiClientCalledWith(apiClientMock, {
input: {
- contextAri,
key: 'testKey',
encrypted: true
}
});
@@ -426,9 +410,8 @@
const metricMocks = getMetricMock();
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
const returnedValue = await globalStorage.getEntity('testEntityName', 'testEntityKey');
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
entityName: 'testEntityName',
key: 'testEntityKey'
});
expect(returnedValue).toEqual('testValue');
@@ -447,9 +430,8 @@
const metricMocks = getMetricMock();
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
const returnedValue = await globalStorage.getEntity('testEntityName', 'testEntityKey');
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
entityName: 'testEntityName',
key: 'testEntityKey'
});
expect(returnedValue).toEqual(undefined);
@@ -468,9 +450,8 @@
const metricMocks = getMetricMock();
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
const returnedValue = await globalStorage.getEntity('testEntityName', 'testEntityKey');
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
entityName: 'testEntityName',
key: 'testEntityKey'
});
expect(returnedValue).toEqual(0);
@@ -489,9 +470,8 @@
const metricMocks = getMetricMock();
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
const returnedValue = await globalStorage.getEntity('testEntityName', 'testEntityKey');
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
entityName: 'testEntityName',
key: 'testEntityKey'
});
expect(returnedValue).toEqual('');
@@ -550,9 +530,8 @@
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
await globalStorage.setEntity('testEntityName', 'testEntityKey', 'testValue');
verifyApiClientCalledWith(apiClientMock, {
input: {
- contextAri,
entityName: 'testEntityName',
key: 'testEntityKey',
value: 'testValue'
}
@@ -606,9 +585,8 @@
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
await expect(globalStorage.setEntity('testEntityName', 'testEntityKey', 'testValue')).rejects.toThrow(errors_1.APIError.forStatus(500));
verifyApiClientCalledWith(apiClientMock, {
input: {
- contextAri,
entityName: 'testEntityName',
key: 'testEntityKey',
value: 'testValue'
}
@@ -633,9 +611,8 @@
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
await globalStorage.deleteEntity('testEntityName', 'testEntityKey');
verifyApiClientCalledWith(apiClientMock, {
input: {
- contextAri,
entityName: 'testEntityName',
key: 'testEntityKey'
}
});
@@ -699,13 +676,12 @@
const cursor = 'cursor';
const limit = 10;
const response = await globalStorage.list({ where, cursor, limit });
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
where,
cursor,
limit
- }, gql_queries_1.UntypedQueries.listQuery(contextAri, {}).query);
+ }, gql_queries_1.UntypedQueries.listQuery({}).query);
expect(response).toEqual(expect.objectContaining({
results: [
{ key: 'key1', value: 'testValue' },
{ key: 'key2', value: 'testValue' }
@@ -740,13 +716,12 @@
const cursor = 'cursor';
const limit = 10;
const response = await globalStorage.list({ where, cursor, limit });
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
where,
cursor,
limit
- }, gql_queries_1.UntypedQueries.listQueryForCleanup(contextAri, {}).query);
+ }, gql_queries_1.UntypedQueries.listQueryForCleanup({}).query);
expect(response).toEqual(expect.objectContaining({
results: [
{ key: 'key1', value: 'testValue' },
{ key: 'key2', value: 'testValue' }
@@ -769,13 +744,12 @@
const metricMocks = getMetricMock();
const globalStorage = getStorage(apiClientMock, passMetrics ? metricMocks.mockMetrics : undefined);
await globalStorage.list({});
verifyApiClientCalledWith(apiClientMock, {
- contextAri,
where: null,
cursor: null,
limit: null
- }, gql_queries_1.UntypedQueries.listQuery(contextAri, {}).query);
+ }, gql_queries_1.UntypedQueries.listQuery({}).query);
passMetrics
? checkMetricsFired(metricMocks, { store: 'untyped', operation: 'query', encrypted: false }, true)
: expect(metricMocks.mockMetrics.counter).not.toHaveBeenCalled();
});
@@ -845,11 +819,9 @@
expect(response).toMatchObject({
results: [],
nextCursor: null
});
- verifyApiClientCalledWith(apiClientMock, {
- contextAri
- }, gql_queries_1.CustomEntityQueries.listQuery(contextAri, {}).query);
+ verifyApiClientCalledWith(apiClientMock, {}, gql_queries_1.CustomEntityQueries.listQuery({}).query);
passMetrics
? checkMetricsFired(metricMocks, { store: 'typed', operation: 'query', encrypted: false }, true)
: expect(metricMocks.mockMetrics.counter).not.toHaveBeenCalled();
});
@@ -868,11 +840,9 @@
expect(response).toMatchObject({
results: [],
nextCursor: 'DUMMY_CURSOR'
});
- verifyApiClientCalledWith(apiClientMock, {
- contextAri
- }, gql_queries_1.CustomEntityQueries.listQuery(contextAri, {}).query);
+ verifyApiClientCalledWith(apiClientMock, {}, gql_queries_1.CustomEntityQueries.listQuery({}).query);
passMetrics
? checkMetricsFired(metricMocks, { store: 'typed', operation: 'query', encrypted: false }, true)
: expect(metricMocks.mockMetrics.counter).not.toHaveBeenCalled();
});
Modified: package/out/gql-queries.js
Index: package/out/gql-queries.js
===================================================================
--- package/out/gql-queries.js
+++ package/out/gql-queries.js
@@ -1,24 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomEntityQueries = exports.UntypedQueries = void 0;
class UntypedQueries {
- static get = (contextAri, key, encrypted) => ({
+ static get = (key, encrypted) => ({
query: `
- query forge_app_getApplicationStorageEntity($contextAri: ID!, $key: ID!, $encrypted: Boolean!) {
- appStoredEntity(contextAri: $contextAri, key: $key, encrypted: $encrypted) {
+ query forge_app_getApplicationStorageEntity($key: ID!, $encrypted: Boolean!) {
+ appStoredEntity(key: $key, encrypted: $encrypted) {
key
value
}
}
`,
variables: {
- contextAri,
key,
encrypted
}
});
- static set = (contextAri, key, value, encrypted) => ({
+ static set = (key, value, encrypted) => ({
query: `
mutation forge_app_setApplicationStorageEntity($input: SetAppStoredEntityMutationInput!) {
appStorage{
setAppStoredEntity(input: $input) {
@@ -36,16 +35,15 @@
}
`,
variables: {
input: {
- contextAri,
key,
value,
encrypted
}
}
});
- static delete = (contextAri, key, encrypted) => ({
+ static delete = (key, encrypted) => ({
query: `
mutation forge_app_deleteApplicationStorageEntity($input: DeleteAppStoredEntityMutationInput!) {
appStorage {
deleteAppStoredEntity(input: $input) {
@@ -63,18 +61,17 @@
}
`,
variables: {
input: {
- contextAri,
key,
encrypted
}
}
});
- static listQuery = (contextAri, options) => ({
+ static listQuery = (options) => ({
query: `
- query forge_app_getApplicationStorageEntities($contextAri: ID!, $where: [AppStoredEntityFilter!], $cursor: String, $limit: Int) {
- appStoredEntities(contextAri: $contextAri, where: $where, after: $cursor, first: $limit) {
+ query forge_app_getApplicationStorageEntities($where: [AppStoredEntityFilter!], $cursor: String, $limit: Int) {
+ appStoredEntities(where: $where, after: $cursor, first: $limit) {
edges {
node {
value
key
@@ -85,18 +82,17 @@
}
}
`,
variables: {
- contextAri,
where: options.where ?? null,
cursor: options.cursor ?? null,
limit: options.limit ?? null
}
});
- static listQueryForCleanup = (contextAri, options) => ({
+ static listQueryForCleanup = (options) => ({
query: `
- query forge_app_getApplicationStorageEntitiesForCleanup($contextAri: ID!, $where: [AppStoredEntityFilter!], $cursor: String, $limit: Int) {
- appStoredEntitiesForCleanup(contextAri: $contextAri, where: $where, after: $cursor, first: $limit) {
+ query forge_app_getApplicationStorageEntitiesForCleanup($where: [AppStoredEntityFilter!], $cursor: String, $limit: Int) {
+ appStoredEntitiesForCleanup(where: $where, after: $cursor, first: $limit) {
edges {
node {
value
key
@@ -107,34 +103,32 @@
}
}
`,
variables: {
- contextAri,
where: options.where ?? null,
cursor: options.cursor ?? null,
limit: options.limit ?? null
}
});
}
exports.UntypedQueries = UntypedQueries;
class CustomEntityQueries {
- static get = (contextAri, entityName, key) => ({
+ static get = (entityName, key) => ({
query: `
- query forge_app_getApplicationStorageCustomEntity ($contextAri: ID!, $key: ID!, $entityName: String!) {
- appStoredCustomEntity(contextAri: $contextAri, key: $key, entityName: $entityName) {
+ query forge_app_getApplicationStorageCustomEntity ($key: ID!, $entityName: String!) {
+ appStoredCustomEntity(key: $key, entityName: $entityName) {
value
entityName
key
}
}
`,
variables: {
- contextAri,
entityName,
key
}
});
- static set = (contextAri, entityName, key, value) => ({
+ static set = (entityName, key, value) => ({
query: `
mutation forge_app_setApplicationStorageCustomEntity($input: SetAppStoredCustomEntityMutationInput!) {
appStorageCustomEntity{
setAppStoredCustomEntity(input: $input) {
@@ -152,16 +146,15 @@
}
`,
variables: {
input: {
- contextAri,
entityName,
key,
value
}
}
});
- static delete = (contextAri, entityName, key) => ({
+ static delete = (entityName, key) => ({
query: `
mutation forge_app_deleteApplicationStorageCustomEntity($input: DeleteAppStoredCustomEntityMutationInput!) {
appStorageCustomEntity {
deleteAppStoredCustomEntity(input: $input) {
@@ -179,19 +172,18 @@
}
`,
variables: {
input: {
- contextAri,
entityName,
key
}
}
});
- static listQuery = (contextAri, options) => {
+ static listQuery = (options) => {
return {
query: `
- query AppStorageCustomEntityQueries ($contextAri: ID!, $entityName: String!, $indexName: String!, $range: AppStoredCustomEntityRange, $filters: AppStoredCustomEntityFilters, $sort:SortOrder, $limit: Int, $cursor: String, $partition: [AppStoredCustomEntityFieldValue!]) {
- appStoredCustomEntities(contextAri: $contextAri, entityName: $entityName, indexName: $indexName, range: $range, filters: $filters, sort:$sort, limit: $limit, cursor: $cursor, partition: $partition) {
+ query AppStorageCustomEntityQueries ($entityName: String!, $indexName: String!, $range: AppStoredCustomEntityRange, $filters: AppStoredCustomEntityFilters, $sort:SortOrder, $limit: Int, $cursor: String, $partition: [AppStoredCustomEntityFieldValue!]) {
+ appStoredCustomEntities(entityName: $entityName, indexName: $indexName, range: $range, filters: $filters, sort:$sort, limit: $limit, cursor: $cursor, partition: $partition) {
edges {
node {
key
value
@@ -207,9 +199,8 @@
}
}
`,
variables: {
- contextAri,
entityName: options.entityName,
indexName: options.indexName,
range: options.range,
...(options.filters && options.filters.length
Modified: package/package.json
Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
{
"name": "@forge/storage",
- "version": "1.6.0",
+ "version": "1.7.0-next.0",
"description": "Forge Storage methods",
"author": "Atlassian",
"license": "UNLICENSED",
"main": "out/index.js",
@@ -17,8 +17,8 @@
"devDependencies": {
"@types/node": "14.18.63",
"@types/node-fetch": "^2.6.11",
"node-fetch": "2.7.0",
- "@forge/util": "1.4.4",
+ "@forge/util": "1.4.6",
"@atlassian/metrics-interface": "4.0.0"
}
}
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,SAAS,CAAC;AAInD,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AAEtE,UAAU,WAAW;IACnB,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,EAAE,CAAC;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAcD,oBAAY,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAC5C,oBAAY,aAAa,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AA+B/D,qBAAa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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-queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE1E,qBAAa,cAAc;IACzB,OAAc,GAAG,eAAgB,MAAM,OAAO,MAAM,aAAa,OAAO;;;;;;;MAcrE;IAEH,OAAc,GAAG,eAAgB,MAAM,OAAO,MAAM,SAAS,GAAG,aAAa,OAAO;;;;;;;;;;MA0BjF;IAEH,OAAc,MAAM,eAAgB,MAAM,OAAO,MAAM,aAAa,OAAO;;;;;;;;;MAyBxE;IAEH,OAAc,SAAS,eAAgB,MAAM,WAAW,WAAW;;;;;;;;MAuBhE;IAEH,OAAc,mBAAmB,eAAgB,MAAM,WAAW,WAAW;;;;;;;;MAuB1E;CACJ;AAED,qBAAa,mBAAmB;IAC9B,OAAc,GAAG,eAAgB,MAAM,cAAc,MAAM,OAAO,MAAM;;;;;;;MAerE;IAEH,OAAc,GAAG,eAAgB,MAAM,cAAc,MAAM,OAAO,MAAM,SAAS,GAAG;;;;;;;;;;MA0BjF;IAEH,OAAc,MAAM,eAAgB,MAAM,cAAc,MAAM,OAAO,MAAM;;;;;;;;;MAyBxE;IAEH,OAAc,SAAS,eAAgB,MAAM,WAAW,uBAAuB;;;;;;;;;;;;;;;MAuC7E;CACH"}
\ No newline at end of file
+{"version":3,"file":"gql-queries.d.ts","sourceRoot":"","sources":["../src/gql-queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE1E,qBAAa,cAAc;IACzB,OAAc,GAAG,QAAS,MAAM,aAAa,OAAO;;;;;;MAajD;IAEH,OAAc,GAAG,QAAS,MAAM,SAAS,GAAG,aAAa,OAAO;;;;;;;;;MAyB7D;IAEH,OAAc,MAAM,QAAS,MAAM,aAAa,OAAO;;;;;;;;MAwBpD;IAEH,OAAc,SAAS,YAAa,WAAW;;;;;;;MAqB5C;IAEH,OAAc,mBAAmB,YAAa,WAAW;;;;;;;MAqBtD;CACJ;AAED,qBAAa,mBAAmB;IAC9B,OAAc,GAAG,eAAgB,MAAM,OAAO,MAAM;;;;;;MAcjD;IAEH,OAAc,GAAG,eAAgB,MAAM,OAAO,MAAM,SAAS,GAAG;;;;;;;;;MAyB7D;IAEH,OAAc,MAAM,eAAgB,MAAM,OAAO,MAAM;;;;;;;;MAwBpD;IAEH,OAAc,SAAS,YAAa,uBAAuB;;;;;;;;;;;;;;MAsCzD;CACH"}
\ No newline at end of file
Modified: package/README.md
Index: package/README.md
===================================================================
--- package/README.md
+++ package/README.md
@@ -24,9 +24,8 @@
const extraHeaders = {
// See add-forge-user-agent.ts
'User-Agent': `H11n/${version} ${appAri}`,
- 'X-Forge-Context': appContextAri,
Authorization: `Bearer ${token}`
// Only required when accessing Storage service via the GraphQL gateway
Modified: package/out/global-storage.d.ts
Index: package/out/global-storage.d.ts
===================================================================
--- package/out/global-storage.d.ts
+++ package/out/global-storage.d.ts
@@ -11,14 +11,12 @@
}
export declare type StoreType = 'typed' | 'untyped';
export declare type OperationType = 'get' | 'set' | 'query' | 'delete';
export declare class GlobalStorage implements SharedStorageAdapter {
- private getAppContextAri;
private apiClient;
private readonly getMetrics;
private readonly endpoint;
- constructor(getAppContextAri: (() => string) | string, apiClient: FetchMethod, getMetrics: () => Metrics | undefined);
- private doGetAppContextAri;
+ constructor(apiClient: FetchMethod, getMetrics: () => Metrics | undefined);
get(key: string): Promise<any>;
getSecret(key: string): Promise<any>;
list(options: ListOptions): Promise<ListResults>;
listCustomEntities(options: CustomEntityListOptions): Promise<ListResults>;
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
@@ -1,85 +1,77 @@
import { CustomEntityListOptions, ListOptions } from './query-interfaces';
export declare class UntypedQueries {
- static get: (contextAri: string, key: string, encrypted: boolean) => {
+ static get: (key: string, encrypted: boolean) => {
query: string;
variables: {
- contextAri: string;
key: string;
encrypted: boolean;
};
};
- static set: (contextAri: string, key: string, value: any, encrypted: boolean) => {
+ static set: (key: string, value: any, encrypted: boolean) => {
query: string;
variables: {
input: {
- contextAri: string;
key: string;
value: any;
encrypted: boolean;
};
};
};
- static delete: (contextAri: string, key: string, encrypted: boolean) => {
+ static delete: (key: string, encrypted: boolean) => {
query: string;
variables: {
input: {
- contextAri: string;
key: string;
encrypted: boolean;
};
};
};
- static listQuery: (contextAri: string, options: ListOptions) => {
+ static listQuery: (options: ListOptions) => {
query: string;
variables: {
- contextAri: string;
where: import("./query-interfaces").WhereClause[] | null;
cursor: string | null;
limit: number | null;
};
};
- static listQueryForCleanup: (contextAri: string, options: ListOptions) => {
+ static listQueryForCleanup: (options: ListOptions) => {
query: string;
variables: {
- contextAri: string;
where: import("./query-interfaces").WhereClause[] | null;
cursor: string | null;
limit: number | null;
};
};
}
export declare class CustomEntityQueries {
- static get: (contextAri: string, entityName: string, key: string) => {
+ static get: (entityName: string, key: string) => {
query: string;
variables: {
- contextAri: string;
entityName: string;
key: string;
};
};
- static set: (contextAri: string, entityName: string, key: string, value: any) => {
+ static set: (entityName: string, key: string, value: any) => {
query: string;
variables: {
input: {
- contextAri: string;
entityName: string;
key: string;
value: any;
};
};
};
- static delete: (contextAri: string, entityName: string, key: string) => {
+ static delete: (entityName: string, key: string) => {
query: string;
variables: {
input: {
- contextAri: string;
entityName: string;
key: string;
};
};
};
- static listQuery: (contextAri: string, options: CustomEntityListOptions) => {
+ static listQuery: (options: CustomEntityListOptions) => {
query: string;
variables: {
limit?: number | undefined;
cursor?: string | undefined;
@@ -87,9 +79,8 @@
partition?: import("./query-interfaces").CustomEntityPartitionValue[] | undefined;
filters?: {
[x: string]: import("./query-interfaces").FilterClause[];
} | undefined;
- contextAri: string;
entityName: string | undefined;
indexName: string | undefined;
range: import("./query-interfaces").RangeClause | undefined;
};