Skip to content

Instantly share code, notes, and snippets.

@joyblanks
joyblanks / smartsheet.d.ts
Created October 22, 2021 18:29
Smartsheet declarations WIP
interface SmartsheetPaged {
pageNumber: number;
pageSize: number;
totalPages: number;
totalCount: number;
}
export interface SmartsheetClientOptions {
accessToken?: string;
logLevel?: string;
@joyblanks
joyblanks / proxy.conf.js
Created August 19, 2019 05:20
Angular Proxy Config, when API's dont support CORS
// README: check the cookie from request headers in browser and replace this.
const cookie = "<Copy a cookie from a request that happens in your API when deployed>";
const target = "https://<tenant>.sharepoint.com";
const PROXY_CONFIG = {
"/test/_layouts/*": {
"target": target,
"secure": false,
"changeOrigin": true,
"bypass": function (req, res, proxyOptions) {
req.headers["origin"] = target;
@joyblanks
joyblanks / ng-sharepoint-service.ts
Created August 19, 2019 03:33
Sharepoint Service for Angular
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable, of } from 'rxjs';
import { map, switchMap, tap } from 'rxjs/operators';
const SP_SITE = 'https:[<tenant>].sharepoint.com'
const CRLF = '\r\n';
const MAX_RECORDS = 1000;
const PEOPLE_SOURCE_ID = 'B09A7990-05EA-4AF9-81EF-EDFAB16C4E31';
const DIGEST_INTERVAL = 6e5; // 10 minutes
const CONTEXT_INFO = `${SP_SITE}/_api/contextinfo`;