@boostercloud/framework-provider-azure 0.24.2 → 0.26.1-pr1023.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.
@@ -1,11 +1,11 @@
1
1
  export declare const eventsStoreAttributes: {
2
- readonly partitionKey: "entityTypeName_entityID_kind";
3
- readonly sortKey: "createdAt";
4
- };
2
+ readonly partitionKey: 'entityTypeName_entityID_kind'
3
+ readonly sortKey: 'createdAt'
4
+ }
5
5
  export declare const environmentVarNames: {
6
- readonly restAPIURL: "BOOSTER_REST_API_URL";
7
- readonly websocketAPIURL: "BOOSTER_WEBSOCKET_API_URL";
8
- readonly cosmosDbConnectionString: "COSMOSDB_CONNECTION_STRING";
9
- };
10
- export declare const AZURE_CONFLICT_ERROR_CODE = 409;
11
- export declare const AZURE_PRECONDITION_FAILED_ERROR = 412;
6
+ readonly restAPIURL: 'BOOSTER_REST_API_URL'
7
+ readonly websocketAPIURL: 'BOOSTER_WEBSOCKET_API_URL'
8
+ readonly cosmosDbConnectionString: 'COSMOSDB_CONNECTION_STRING'
9
+ }
10
+ export declare const AZURE_CONFLICT_ERROR_CODE = 409
11
+ export declare const AZURE_PRECONDITION_FAILED_ERROR = 412
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { HasInfrastructure, ProviderLibrary, RocketDescriptor } from '@boostercloud/framework-types';
2
- export declare function loadInfrastructurePackage(packageName: string): HasInfrastructure;
3
- export declare const Provider: (rockets?: RocketDescriptor[] | undefined) => ProviderLibrary;
4
- export * from './constants';
1
+ import { HasInfrastructure, ProviderLibrary, RocketDescriptor } from '@boostercloud/framework-types'
2
+ export declare function loadInfrastructurePackage(packageName: string): HasInfrastructure
3
+ export declare const Provider: (rockets?: RocketDescriptor[] | undefined) => ProviderLibrary
4
+ export * from './constants'
package/dist/index.js CHANGED
@@ -83,4 +83,4 @@ const Provider = (rockets) => ({
83
83
  });
84
84
  exports.Provider = Provider;
85
85
  function notImplemented() { }
86
- tslib_1.__exportStar(require("./constants"), exports);
86
+ (0, tslib_1.__exportStar)(require("./constants"), exports);
@@ -1,13 +1,13 @@
1
- import { Cookie } from '@azure/functions';
1
+ import { Cookie } from '@azure/functions'
2
2
  /**
3
3
  * See https://docs.microsoft.com/es-es/azure/azure-functions/functions-reference-node#response-object
4
4
  */
5
5
  export interface ContextResponse {
6
- body: string;
7
- headers: object;
8
- isRaw?: boolean;
9
- status: number;
10
- cookies?: Cookie[];
6
+ body: string
7
+ headers: object
8
+ isRaw?: boolean
9
+ status: number
10
+ cookies?: Cookie[]
11
11
  }
12
- export declare function requestSucceeded(body?: any): Promise<ContextResponse>;
13
- export declare function requestFailed(error: Error): Promise<ContextResponse>;
12
+ export declare function requestSucceeded(body?: any): Promise<ContextResponse>
13
+ export declare function requestFailed(error: Error): Promise<ContextResponse>
@@ -15,7 +15,7 @@ async function requestSucceeded(body) {
15
15
  }
16
16
  exports.requestSucceeded = requestSucceeded;
17
17
  async function requestFailed(error) {
18
- const status = framework_types_1.httpStatusCodeFor(error);
18
+ const status = (0, framework_types_1.httpStatusCodeFor)(error);
19
19
  return {
20
20
  headers: {
21
21
  'Access-Control-Allow-Origin': '*',
@@ -24,7 +24,7 @@ async function requestFailed(error) {
24
24
  status,
25
25
  body: JSON.stringify({
26
26
  status,
27
- title: framework_types_1.toClassTitle(error),
27
+ title: (0, framework_types_1.toClassTitle)(error),
28
28
  reason: error.message,
29
29
  }),
30
30
  };
@@ -1,8 +1,26 @@
1
- import { EventEnvelope } from '@boostercloud/framework-types';
2
- import { CosmosClient } from '@azure/cosmos';
3
- import { BoosterConfig, Logger, UUID } from '@boostercloud/framework-types';
4
- import { Context } from '@azure/functions';
5
- export declare function rawEventsToEnvelopes(context: Context): Array<EventEnvelope>;
6
- export declare function readEntityEventsSince(cosmosDb: CosmosClient, config: BoosterConfig, logger: Logger, entityTypeName: string, entityID: UUID, since?: string): Promise<Array<EventEnvelope>>;
7
- export declare function readEntityLatestSnapshot(cosmosDb: CosmosClient, config: BoosterConfig, logger: Logger, entityTypeName: string, entityID: UUID): Promise<EventEnvelope | null>;
8
- export declare function storeEvents(cosmosDb: CosmosClient, eventEnvelopes: Array<EventEnvelope>, config: BoosterConfig, logger: Logger): Promise<void>;
1
+ import { EventEnvelope } from '@boostercloud/framework-types'
2
+ import { CosmosClient } from '@azure/cosmos'
3
+ import { BoosterConfig, Logger, UUID } from '@boostercloud/framework-types'
4
+ import { Context } from '@azure/functions'
5
+ export declare function rawEventsToEnvelopes(context: Context): Array<EventEnvelope>
6
+ export declare function readEntityEventsSince(
7
+ cosmosDb: CosmosClient,
8
+ config: BoosterConfig,
9
+ logger: Logger,
10
+ entityTypeName: string,
11
+ entityID: UUID,
12
+ since?: string
13
+ ): Promise<Array<EventEnvelope>>
14
+ export declare function readEntityLatestSnapshot(
15
+ cosmosDb: CosmosClient,
16
+ config: BoosterConfig,
17
+ logger: Logger,
18
+ entityTypeName: string,
19
+ entityID: UUID
20
+ ): Promise<EventEnvelope | null>
21
+ export declare function storeEvents(
22
+ cosmosDb: CosmosClient,
23
+ eventEnvelopes: Array<EventEnvelope>,
24
+ config: BoosterConfig,
25
+ logger: Logger
26
+ ): Promise<void>
@@ -17,7 +17,7 @@ async function readEntityEventsSince(cosmosDb, config, logger, entityTypeName, e
17
17
  parameters: [
18
18
  {
19
19
  name: '@partitionKey',
20
- value: partition_keys_1.partitionKeyForEvent(entityTypeName, entityID),
20
+ value: (0, partition_keys_1.partitionKeyForEvent)(entityTypeName, entityID),
21
21
  },
22
22
  {
23
23
  name: '@fromTime',
@@ -43,7 +43,7 @@ async function readEntityLatestSnapshot(cosmosDb, config, logger, entityTypeName
43
43
  parameters: [
44
44
  {
45
45
  name: '@partitionKey',
46
- value: partition_keys_1.partitionKeyForEvent(entityTypeName, entityID, 'snapshot'),
46
+ value: (0, partition_keys_1.partitionKeyForEvent)(entityTypeName, entityID, 'snapshot'),
47
47
  },
48
48
  ],
49
49
  })
@@ -67,7 +67,7 @@ async function storeEvents(cosmosDb, eventEnvelopes, config, logger) {
67
67
  .container(config.resourceNames.eventsStore)
68
68
  .items.create({
69
69
  ...eventEnvelope,
70
- [constants_1.eventsStoreAttributes.partitionKey]: partition_keys_1.partitionKeyForEvent(eventEnvelope.entityTypeName, eventEnvelope.entityID, eventEnvelope.kind),
70
+ [constants_1.eventsStoreAttributes.partitionKey]: (0, partition_keys_1.partitionKeyForEvent)(eventEnvelope.entityTypeName, eventEnvelope.entityID, eventEnvelope.kind),
71
71
  [constants_1.eventsStoreAttributes.sortKey]: new Date().toISOString(),
72
72
  });
73
73
  });
@@ -1,3 +1,6 @@
1
- import { GraphQLRequestEnvelope, Logger, GraphQLRequestEnvelopeError } from '@boostercloud/framework-types';
2
- import { Context } from '@azure/functions';
3
- export declare function rawGraphQLRequestToEnvelope(context: Context, logger: Logger): Promise<GraphQLRequestEnvelope | GraphQLRequestEnvelopeError>;
1
+ import { GraphQLRequestEnvelope, Logger, GraphQLRequestEnvelopeError } from '@boostercloud/framework-types'
2
+ import { Context } from '@azure/functions'
3
+ export declare function rawGraphQLRequestToEnvelope(
4
+ context: Context,
5
+ logger: Logger
6
+ ): Promise<GraphQLRequestEnvelope | GraphQLRequestEnvelopeError>
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.rawGraphQLRequestToEnvelope = void 0;
4
4
  async function rawGraphQLRequestToEnvelope(context, logger) {
5
- var _a, _b;
5
+ var _a, _b, _c, _d, _e, _f;
6
6
  logger.debug('Received GraphQL request: ', context.req);
7
7
  const requestID = context.executionContext.invocationId;
8
8
  const connectionID = undefined; // TODO: Add this when sockets are supported
@@ -17,6 +17,13 @@ async function rawGraphQLRequestToEnvelope(context, logger) {
17
17
  eventType,
18
18
  token: (_b = (_a = context.req) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.authorization,
19
19
  value: graphQLValue,
20
+ context: {
21
+ request: {
22
+ headers: (_c = context.req) === null || _c === void 0 ? void 0 : _c.headers,
23
+ body: (_d = context.req) === null || _d === void 0 ? void 0 : _d.body,
24
+ },
25
+ rawContext: context,
26
+ },
20
27
  };
21
28
  }
22
29
  catch (e) {
@@ -25,6 +32,13 @@ async function rawGraphQLRequestToEnvelope(context, logger) {
25
32
  requestID,
26
33
  connectionID,
27
34
  eventType,
35
+ context: {
36
+ request: {
37
+ headers: (_e = context.req) === null || _e === void 0 ? void 0 : _e.headers,
38
+ body: (_f = context.req) === null || _f === void 0 ? void 0 : _f.body,
39
+ },
40
+ rawContext: context,
41
+ },
28
42
  };
29
43
  }
30
44
  }
@@ -1,2 +1,6 @@
1
- import { EventEnvelope, UUID } from '@boostercloud/framework-types';
2
- export declare function partitionKeyForEvent(entityTypeName: string, entityID: UUID, kind?: EventEnvelope['kind']): string;
1
+ import { EventEnvelope, UUID } from '@boostercloud/framework-types'
2
+ export declare function partitionKeyForEvent(
3
+ entityTypeName: string,
4
+ entityID: UUID,
5
+ kind?: EventEnvelope['kind']
6
+ ): string
@@ -1,5 +1,23 @@
1
- import { CosmosClient } from '@azure/cosmos';
2
- import { BoosterConfig, Logger, ReadModelInterface, ReadOnlyNonEmptyArray, UUID } from '@boostercloud/framework-types';
3
- export declare function fetchReadModel(db: CosmosClient, config: BoosterConfig, logger: Logger, readModelName: string, readModelID: UUID): Promise<ReadOnlyNonEmptyArray<ReadModelInterface>>;
4
- export declare function storeReadModel(db: CosmosClient, config: BoosterConfig, logger: Logger, readModelName: string, readModel: ReadModelInterface): Promise<void>;
5
- export declare function deleteReadModel(db: CosmosClient, config: BoosterConfig, logger: Logger, readModelName: string, readModel: ReadModelInterface): Promise<void>;
1
+ import { CosmosClient } from '@azure/cosmos'
2
+ import { BoosterConfig, Logger, ReadModelInterface, ReadOnlyNonEmptyArray, UUID } from '@boostercloud/framework-types'
3
+ export declare function fetchReadModel(
4
+ db: CosmosClient,
5
+ config: BoosterConfig,
6
+ logger: Logger,
7
+ readModelName: string,
8
+ readModelID: UUID
9
+ ): Promise<ReadOnlyNonEmptyArray<ReadModelInterface>>
10
+ export declare function storeReadModel(
11
+ db: CosmosClient,
12
+ config: BoosterConfig,
13
+ logger: Logger,
14
+ readModelName: string,
15
+ readModel: ReadModelInterface
16
+ ): Promise<void>
17
+ export declare function deleteReadModel(
18
+ db: CosmosClient,
19
+ config: BoosterConfig,
20
+ logger: Logger,
21
+ readModelName: string,
22
+ readModel: ReadModelInterface
23
+ ): Promise<void>
@@ -1,8 +1,11 @@
1
- import { Logger, ScheduledCommandEnvelope } from '@boostercloud/framework-types';
1
+ import { Logger, ScheduledCommandEnvelope } from '@boostercloud/framework-types'
2
2
  interface AzureScheduledCommandEnvelope {
3
- bindings: {
4
- [name: string]: unknown;
5
- };
3
+ bindings: {
4
+ [name: string]: unknown
5
+ }
6
6
  }
7
- export declare function rawScheduledInputToEnvelope(input: Partial<AzureScheduledCommandEnvelope>, logger: Logger): Promise<ScheduledCommandEnvelope>;
8
- export {};
7
+ export declare function rawScheduledInputToEnvelope(
8
+ input: Partial<AzureScheduledCommandEnvelope>,
9
+ logger: Logger
10
+ ): Promise<ScheduledCommandEnvelope>
11
+ export {}
@@ -1,3 +1,12 @@
1
- import { CosmosClient } from '@azure/cosmos';
2
- import { BoosterConfig, Logger, FilterFor, ReadModelListResult } from '@boostercloud/framework-types';
3
- export declare function searchReadModel(cosmosDb: CosmosClient, config: BoosterConfig, logger: Logger, readModelName: string, filters: FilterFor<unknown>, limit?: number, afterCursor?: Record<string, string> | undefined, paginatedVersion?: boolean): Promise<Array<any> | ReadModelListResult<any>>;
1
+ import { CosmosClient } from '@azure/cosmos'
2
+ import { BoosterConfig, Logger, FilterFor, ReadModelListResult } from '@boostercloud/framework-types'
3
+ export declare function searchReadModel(
4
+ cosmosDb: CosmosClient,
5
+ config: BoosterConfig,
6
+ logger: Logger,
7
+ readModelName: string,
8
+ filters: FilterFor<unknown>,
9
+ limit?: number,
10
+ afterCursor?: Record<string, string> | undefined,
11
+ paginatedVersion?: boolean
12
+ ): Promise<Array<any> | ReadModelListResult<any>>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boostercloud/framework-provider-azure",
3
- "version": "0.24.2",
3
+ "version": "0.26.1-pr1023.2+6b59c26d",
4
4
  "description": "Handle Booster's integration with Azure",
5
5
  "keywords": [
6
6
  "framework-provider-azure"
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "@azure/cosmos": "3.7.3",
24
24
  "@azure/functions": "^1.2.2",
25
- "@boostercloud/framework-types": "^0.24.2",
25
+ "@boostercloud/framework-types": "0.26.1-pr1023.2+6b59c26d",
26
26
  "chai": "4.2.0",
27
27
  "chai-as-promised": "7.1.1",
28
28
  "mocha": "8.4.0",
@@ -41,5 +41,5 @@
41
41
  "bugs": {
42
42
  "url": "https://github.com/boostercloud/booster/issues"
43
43
  },
44
- "gitHead": "2cb24f409123cf14dd38670e5be2c0a8f7e4c769"
44
+ "gitHead": "6b59c26d35d38c5f5836161dd3ee91bed7e707ce"
45
45
  }