Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: bump @globus/types from 0.0.7 to 0.0.8 #448

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
},
"license": "Apache-2.0",
"devDependencies": {
"@globus/types": "^0.0.7",
"@globus/types": "^0.0.8",
"@playwright/test": "^1.46.1",
"@tsconfig/recommended": "^1.0.7",
"@types/jest": "29.5.14",
Expand Down Expand Up @@ -121,7 +121,7 @@
"jwt-decode": "^4.0.0"
},
"peerDependencies": {
"@globus/types": "^0.0.7"
"@globus/types": "^0.0.8"
},
"peerDependenciesMeta": {
"@globus/types": {
Expand Down
2 changes: 1 addition & 1 deletion src/__mocks__/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const handlers = [

/**
* When `msw` is used in a test, the `mirror` method can be used
* on the Response of a `fetch` to provide prope type information.
* on the Response of a `fetch` to provide proper type information.
*
* @param response The `Response` object from a `fetch` call that `msw` intercepted.
*/
Expand Down
55 changes: 33 additions & 22 deletions src/__tests__/sdk-options.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { timer } from '../index';
import type { MirroredRequest } from '../__mocks__/handlers';
import { mirror } from '../__mocks__/handlers';

describe('sdk-options', () => {
test('environment', async () => {
Expand All @@ -8,44 +8,55 @@ describe('sdk-options', () => {
schedule: {
type: 'once' as const,
},
resource_server: 'transfer.api.globus.org' as const,
timer_type: 'transfer' as const,
body: {
source_endpoint: 'endpoint-1',
destination_endpoint: 'endpoint-2',
delete_destination_extra: false,
encrypt_data: false,
fail_on_quota_errors: false,
notify_on_failed: false,
notify_on_inactive: false,
notify_on_succeeded: false,
preserve_timestamp: false,
skip_source_errors: false,
store_base_path_info: false,
verify_checksum: false,
DATA_TYPE: 'transfer' as const,
DATA: [],
},
},
};

const withEnvironment = await timer.create(
{
headers: {
Authorization: 'Bearer example',
},
payload,
},
{
environment: 'sandbox',
},
);

const {
req: { headers: withEnvironmentHeaders },
} = (await withEnvironment.json()) as MirroredRequest;
} = await mirror(
await timer.create(
{
headers: {
Authorization: 'Bearer example',
},
payload,
},
{
environment: 'sandbox',
},
),
);

expect(withEnvironmentHeaders['host']).toEqual('sandbox.timer.automate.globus.org');

const withoutEnvironment = await timer.create({
headers: {
Authorization: 'Bearer example',
},
payload,
});

const {
req: { headers: withoutEnvironmentHeaders },
} = (await withoutEnvironment.json()) as MirroredRequest;
} = await mirror(
await timer.create({
headers: {
Authorization: 'Bearer example',
},
payload,
}),
);

expect(withoutEnvironmentHeaders['host']).toEqual('timer.automate.globus.org');
});
Expand Down
169 changes: 90 additions & 79 deletions src/services/globus-connect-server/__tests__/endpoint.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { endpoint } from '..';

import type { MirroredRequest } from '../../../__mocks__/handlers';
import { mirror } from '../../../__mocks__/handlers';

const GCS_HOST = 'https://fa5e.bd7c.data.globus.org';

describe('gcs – endpoint', () => {
test('get', async () => {
const result = await endpoint.get({
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
});
const {
req: { url, method, headers },
} = (await result.json()) as unknown as MirroredRequest;
} = await mirror(
await endpoint.get({
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
}),
);
expect({
url,
method,
Expand All @@ -33,21 +34,24 @@ describe('gcs – endpoint', () => {
});

test('update', async () => {
const result = await endpoint.update(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{
payload: {
DATA_TYPE: 'endpoint#1.0.0',
display_name: 'My First Endpoint',
},
},
);
const {
req: { url, method, headers, json },
} = (await result.json()) as unknown as MirroredRequest;
} = await mirror(
await endpoint.update(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{
payload: {
DATA_TYPE: 'endpoint#1.0.0',
display_name: 'My First Endpoint',
network_use: 'normal',
public: true,
},
},
),
);
expect({
url,
method,
Expand All @@ -59,14 +63,16 @@ describe('gcs – endpoint', () => {
"accept": "*/*",
"accept-encoding": "gzip,deflate",
"connection": "close",
"content-length": "65",
"content-length": "102",
"content-type": "application/json",
"host": "fa5e.bd7c.data.globus.org",
"user-agent": "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)",
},
"json": {
"DATA_TYPE": "endpoint#1.0.0",
"display_name": "My First Endpoint",
"network_use": "normal",
"public": true,
},
"method": "PUT",
"url": "https://fa5e.bd7c.data.globus.org/api/endpoint",
Expand All @@ -75,20 +81,21 @@ describe('gcs – endpoint', () => {
});

test('patch', async () => {
const result = await endpoint.patch(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{
payload: {
public: true,
},
},
);
const {
req: { url, method, headers, json },
} = (await result.json()) as unknown as MirroredRequest;
} = await mirror(
await endpoint.patch(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{
payload: {
public: true,
},
},
),
);
expect({
url,
method,
Expand All @@ -115,21 +122,22 @@ describe('gcs – endpoint', () => {
});

test('updateSubscriptionId', async () => {
const result = await endpoint.updateSubscriptionId(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{
payload: {
DATA_TYPE: 'endpoint_subscription#1.0.0',
subscription_id: 'example-subscription-id',
},
},
);
const {
req: { url, method, headers, json },
} = (await result.json()) as unknown as MirroredRequest;
} = await mirror(
await endpoint.updateSubscriptionId(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{
payload: {
DATA_TYPE: 'endpoint_subscription#1.0.0',
subscription_id: 'example-subscription-id',
},
},
),
);
expect({
url,
method,
Expand Down Expand Up @@ -157,21 +165,22 @@ describe('gcs – endpoint', () => {
});

test('updateOwnerString', async () => {
const result = await endpoint.updateOwnerString(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{
payload: {
DATA_TYPE: 'owner_string#1.0.0',
identity_id: 'example-identity-id',
},
},
);
const {
req: { url, method, headers, json },
} = (await result.json()) as unknown as MirroredRequest;
} = await mirror(
await endpoint.updateOwnerString(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{
payload: {
DATA_TYPE: 'owner_string#1.0.0',
identity_id: 'example-identity-id',
},
},
),
);
expect({
url,
method,
Expand Down Expand Up @@ -199,21 +208,22 @@ describe('gcs – endpoint', () => {
});

test('updateOwner', async () => {
const result = await endpoint.updateOwner(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{
payload: {
DATA_TYPE: 'endpoint_owner#1.0.0',
identity_id: 'example-identity-id',
},
},
);
const {
req: { url, method, headers, json },
} = (await result.json()) as unknown as MirroredRequest;
} = await mirror(
await endpoint.updateOwner(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{
payload: {
DATA_TYPE: 'endpoint_owner#1.0.0',
identity_id: 'example-identity-id',
},
},
),
);
expect({
url,
method,
Expand Down Expand Up @@ -241,16 +251,17 @@ describe('gcs – endpoint', () => {
});

test('resetOwnerString', async () => {
const result = await endpoint.resetOwnerString(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{},
);
const {
req: { url, method, headers },
} = (await result.json()) as unknown as MirroredRequest;
} = await mirror(
await endpoint.resetOwnerString(
{
host: GCS_HOST,
endpoint_id: 'ac9cb54b-fc48-4824-b801-1388baf0a909',
},
{},
),
);
expect({
url,
method,
Expand Down
Loading
Loading