Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/actions/setup-for-scripts/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24'
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10
with:
run_install: |
- args: [--filter, ., --filter, '{./scripts}...']
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
with:
node-version: '24'

- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10

- id: matrix
run: |
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
printf "Aborting: symlinks found:\n%s" "$symlinks"; exit 1
fi

- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10

- name: Get pnpm cache info
id: pnpm-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pnpm-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '24'
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10

- name: Get pnpm cache info
id: pnpm-cache
Expand Down
30 changes: 30 additions & 0 deletions types/dom-webcodecs/test/dom-webcodecs-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,36 @@ new AudioData({
sampleRate: 48000,
});

// AudioDataInit.data is a plain BufferSource, as in the spec and in lib.dom.d.ts, so any
// ArrayBuffer-backed view is accepted alongside the ArrayBuffer itself.
// $ExpectType AudioData
new AudioData({
data: new Uint8Array(1024),
timestamp: 100,
format: "f32",
numberOfChannels: 2,
numberOfFrames: 1,
sampleRate: 48000,
});

// $ExpectType AudioData
new AudioData({
data: new DataView(audioBuffer),
timestamp: 100,
format: "f32",
numberOfChannels: 2,
numberOfFrames: 1,
sampleRate: 48000,
});

// copyTo, unlike AudioDataInit.data, is AllowShared in both the spec and lib.dom.d.ts, so a
// SharedArrayBuffer-backed destination is accepted here. Keeping the two apart is what stops
// this file from colliding with the lib.dom.d.ts declarations it merges into.
declare const sharedDestination: Uint8Array<SharedArrayBuffer>;

// $ExpectType void
audioFrame.copyTo(sharedDestination, { planeIndex: 0 });

// $ExpectType AudioData
audioFrame.clone();

Expand Down
1 change: 1 addition & 0 deletions types/dom-webcodecs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"module": "node16",
"lib": [
"es6",
"es2017.sharedmemory",
"dom"
],
"noImplicitAny": true,
Expand Down
5 changes: 4 additions & 1 deletion types/dom-webcodecs/webcodecs.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ interface AudioDataCopyToOptions {
}

interface AudioDataInit {
data: AllowSharedBufferSource;
// The WebCodecs spec declares this as a plain `BufferSource`, and so does lib.dom.d.ts.
// Chromium's IDL marks it `[AllowShared]`, but declaring it as `AllowSharedBufferSource`
// here conflicts with the lib.dom.d.ts declaration once SharedArrayBuffer is in scope.
data: BufferSource;
format: AudioSampleFormat;
numberOfChannels: number;
numberOfFrames: number;
Expand Down
7 changes: 1 addition & 6 deletions types/fancade-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,5 @@
"devDependencies": {
"@types/fancade-editor": "workspace:."
},
"owners": [
{
"name": "Bricked",
"githubUsername": "brckd"
}
]
"owners": []
}
8 changes: 1 addition & 7 deletions types/forge-viewer/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ declare namespace Autodesk {
successCallback: (doc: Document) => void,
errorCallback: (errorCode: ErrorCodes, errorMsg: string, messages: any[]) => void,
accessControlProperties?: any,
options?: object,
): void;

downloadAecModelData(onFinished?: (data: any) => void): Promise<any>;
Expand All @@ -599,13 +600,6 @@ declare namespace Autodesk {
getViewableItems(document: Document): void;
getViewablePath(item: object, outLoadOptions?: object): string;
getViewGeometry(item: object): object;
load(
documentId: string,
onSuccessCallback: () => void,
onErrorCallback: () => void,
accessControlProperties?: object,
options?: object,
): void;
requestThumbnailWithSecurity(data: string, onComplete: (err: Error, response: any) => void): void;
}

Expand Down
1 change: 1 addition & 0 deletions types/pg/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface ClientConfig {
stream?: () => stream.Duplex | undefined;
statement_timeout?: false | number | undefined;
ssl?: boolean | ConnectionOptions | undefined;
enableChannelBinding?: boolean | undefined;
sslnegotiation?: "postgres" | "direct" | undefined;
query_timeout?: number | undefined;
lock_timeout?: number | undefined;
Expand Down
2 changes: 2 additions & 0 deletions types/pg/pg-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const client = new Client({
password: "secretpassword!!",
application_name: "DefinitelyTyped",
keepAlive: true,
enableChannelBinding: true,
ssl: true,
sslnegotiation: "direct",
pipeline: true,
Expand Down Expand Up @@ -270,6 +271,7 @@ const pool = new Pool({
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 2000,
keepAlive: false,
enableChannelBinding: true,
lock_timeout: 5000,
log: (...args) => {
console.log.apply(console, args);
Expand Down
139 changes: 136 additions & 3 deletions types/sharetribe-flex-integration-sdk/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ export interface TransactionRelationships {
messages?: {
data: ResourceReference[];
};
protectedFileAttachments?: {
data: ResourceReference[];
};
}

/**
Expand Down Expand Up @@ -144,6 +147,9 @@ export interface UserRelationships {
stripeAccount?: {
data?: ResourceReference;
};
privateFileAttachments?: {
data: ResourceReference[];
};
}

/**
Expand Down Expand Up @@ -198,6 +204,9 @@ export interface ListingRelationships {
images?: {
data: ResourceReference[];
};
protectedFileAttachments?: {
data: ResourceReference[];
};
}

/**
Expand All @@ -216,6 +225,7 @@ export interface Listing {
export interface MessageAttributes {
content: string;
createdAt: string;
deleted?: boolean;
}

/**
Expand All @@ -228,6 +238,9 @@ export interface MessageRelationships {
sender: {
data: ResourceReference;
};
publicFileAttachments?: {
data: ResourceReference[];
};
}

/**
Expand Down Expand Up @@ -290,7 +303,8 @@ export interface File {
}

/**
* File attachment relationships. The `message` relationship is only present when the file is attached to a message.
* File attachment relationships. Exactly one of `message`, `listing` or `transaction` is present,
* naming the resource the file is attached to.
*/
export interface FileAttachmentRelationships {
file: {
Expand All @@ -299,21 +313,79 @@ export interface FileAttachmentRelationships {
message?: {
data: ResourceReference;
};
listing?: {
data: ResourceReference;
};
transaction?: {
data: ResourceReference;
};
}

/**
* File attachment resource (links a file to a transaction message)
* Visibility of a file attachment. `protected` and `private` files are readable only by the
* resource owner and marketplace operators; `protected` ones can additionally be revealed to
* transaction parties by a transaction process action.
*/
export type FileAttachmentScope = "public" | "protected" | "private";

/**
* File attachment resource (links a file to a message, listing or transaction)
*/
export interface FileAttachment {
id: UUID;
type: "fileAttachment";
attributes: {
scope: "public";
scope: FileAttachmentScope;
deleted: boolean;
};
relationships: FileAttachmentRelationships;
}

/**
* A file to attach, as accepted by the `protectedFileAttachments` and `privateFileAttachments`
* body parameters
*/
export interface FileAttachmentParam {
fileId: UUID | string;
}

/**
* A presigned upload target returned by `integrationSdk.fileUploads.create()`
*/
export interface FileUpload {
id: UUID;
type: "fileUpload";
attributes: {
fileId: UUID;
url: string;
method: string;
headers: Record<string, string>;
expiresAt: string;
};
}

/**
* A short-lived download URL returned by `integrationSdk.fileDownloads.create()`
*/
export interface FileDownload {
id: UUID;
type: "fileDownload";
attributes: {
fileId: UUID;
url: string;
expiresAt: string;
};
}

/**
* File metadata extracted by `file.metadata()`, suitable for `integrationSdk.files.create()`
*/
export interface FileMetadata {
name: string;
mimeType: string;
size: number;
}

/**
* Event attributes
*/
Expand Down Expand Up @@ -581,6 +653,7 @@ export interface IntegrationSdk {
protectedData?: Record<string, unknown>;
privateData?: Record<string, unknown>;
profileImageId?: UUID;
privateFileAttachments?: FileAttachmentParam[];
},
options?: PerRequestOptions,
) => Promise<MutationResponse<User>>;
Expand Down Expand Up @@ -645,6 +718,7 @@ export interface IntegrationSdk {
privateData?: Record<string, unknown>;
metadata?: Record<string, unknown>;
images?: Array<UUID | string>;
protectedFileAttachments?: FileAttachmentParam[];
},
options?: PerRequestOptions & { include?: string[] },
) => Promise<MutationResponse<Listing>>;
Expand All @@ -664,6 +738,7 @@ export interface IntegrationSdk {
privateData?: Record<string, unknown>;
metadata?: Record<string, unknown>;
images?: Array<UUID | string>;
protectedFileAttachments?: FileAttachmentParam[];
},
options?: PerRequestOptions,
) => Promise<MutationResponse<Listing>>;
Expand Down Expand Up @@ -854,6 +929,19 @@ export interface IntegrationSdk {
& PaginationParams
& BaseQueryParams,
) => Promise<QueryResponse<File>>;
/**
* Register a file with the Integration API (first step of the upload flow). The created
* file starts in the `pendingUpload` state.
*/
create: (
params: {
ownerId: UUID | string;
name: string;
mimeType: string;
size: number;
},
options?: PerRequestOptions,
) => Promise<MutationResponse<File>>;
};

fileAttachments: {
Expand All @@ -866,12 +954,34 @@ export interface IntegrationSdk {
ids?: Array<UUID | string>;
fileIds?: Array<UUID | string>;
messageId?: UUID | string;
listingId?: UUID | string;
transactionId?: UUID | string;
}
& PaginationParams
& BaseQueryParams,
) => Promise<QueryResponse<FileAttachment>>;
};

fileUploads: {
/**
* Request a presigned upload URL for a file in the `pendingUpload` state
*/
create: (
params: { fileId: UUID | string },
options?: PerRequestOptions,
) => Promise<MutationResponse<FileUpload>>;
};

fileDownloads: {
/**
* Request a short-lived download URL for a file
*/
create: (
params: { fileId: UUID | string },
options?: PerRequestOptions,
) => Promise<MutationResponse<FileDownload>>;
};

/**
* Revoke authentication token
*/
Expand Down Expand Up @@ -928,3 +1038,26 @@ export namespace util {
*/
const prodCommandLimiterConfig: unknown;
}

/**
* Helpers for the file upload flow
*/
export namespace file {
/**
* Extract the metadata needed for `integrationSdk.files.create()` from a `File` object.
* @param file - A `File` object, e.g. from an `<input type="file">` element
*/
function metadata(file: unknown): FileMetadata;
/**
* Upload a file directly to cloud storage using a presigned URL obtained from
* `integrationSdk.fileUploads.create()`. This bypasses the SDK interceptor pipeline.
* @returns A promise that resolves when the upload is complete
*/
function upload(params: {
url: string;
file: unknown;
method?: string;
headers?: Record<string, string>;
onUploadProgress?: (progressEvent: unknown) => void;
}): Promise<unknown>;
}
Loading